mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-13 00:26:37 +08:00
Fix cloud media metadata repair and merging
This commit is contained in:
@@ -25,6 +25,7 @@ type LocalMetadata struct {
|
||||
PosterURL string
|
||||
BackdropURL string
|
||||
TMDbID int
|
||||
BangumiID int
|
||||
DoubanID string
|
||||
TheTVDBID string
|
||||
SeasonNum int
|
||||
@@ -35,6 +36,7 @@ type LocalMetadata struct {
|
||||
NSFW bool
|
||||
HasNFO bool
|
||||
HasArtwork bool
|
||||
PathHint bool
|
||||
}
|
||||
|
||||
type nfoUniqueID struct {
|
||||
@@ -299,6 +301,7 @@ func metadataFromDoc(doc *nfoDocument, baseDir string, seriesLike bool) *LocalMe
|
||||
PosterURL: firstRemoteURL(baseDir, nfoPosterValues(doc)...),
|
||||
BackdropURL: firstRemoteURL(baseDir, nfoBackdropValues(doc)...),
|
||||
TMDbID: int(doc.TMDbID),
|
||||
BangumiID: mustAtoi(externalIDFromUniqueIDs(doc.UniqueIDs, "bangumi", "bgm")),
|
||||
DoubanID: externalIDFromUniqueIDs(doc.UniqueIDs, "douban"),
|
||||
TheTVDBID: externalIDFromUniqueIDs(doc.UniqueIDs, "thetvdb", "tvdb"),
|
||||
SeasonNum: int(doc.Season),
|
||||
@@ -435,6 +438,9 @@ func mergeEpisodeMetadata(dst, episode *LocalMetadata, doc *nfoDocument) {
|
||||
if episode.TMDbID > 0 {
|
||||
dst.TMDbID = episode.TMDbID
|
||||
}
|
||||
if episode.BangumiID > 0 {
|
||||
dst.BangumiID = episode.BangumiID
|
||||
}
|
||||
if episode.DoubanID != "" {
|
||||
dst.DoubanID = episode.DoubanID
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user