fix(organize): repair classification and forced rescrape

This commit is contained in:
ShukeBta
2026-08-10 19:16:12 +08:00
parent 60d2cfe2f1
commit 5c6fe91742
16 changed files with 416 additions and 34 deletions
+18 -4
View File
@@ -55,10 +55,12 @@ func (s *ScraperService) EnrichOneWithOptions(ctx context.Context, m *model.Medi
}
}
if match := s.matchFromMediaExternalIDs(ctx, m, lib); match != nil {
s.applyFanartArtwork(ctx, match)
mergeLocalMetadataIntoMatch(match, local)
return s.applyProviderMatchWithOptions(ctx, m, lib, match, options)
if !options.ForceRematch {
if match := s.matchFromMediaExternalIDs(ctx, m, lib); match != nil {
s.applyFanartArtwork(ctx, match)
mergeLocalMetadataIntoMatch(match, local)
return s.applyProviderMatchWithOptions(ctx, m, lib, match, options)
}
}
candidates := scrapeQueryCandidatesWithRecognition(ctx, s.repo, m, lib)
@@ -128,6 +130,18 @@ func (s *ScraperService) applyProviderMatchWithOptions(ctx context.Context, m *m
"year": match.Year,
"scrape_status": "matched",
}
if options.ForceRematch {
updates["original_name"] = strings.TrimSpace(match.OriginalName)
updates["release_date"] = strings.TrimSpace(match.ReleaseDate)
updates["tm_db_id"] = match.TMDbID
updates["bangumi_id"] = match.BangumiID
updates["douban_id"] = strings.TrimSpace(match.DoubanID)
updates["thetvdb_id"] = strings.TrimSpace(match.TheTVDBID)
updates["genres"] = strings.Join(match.Genres, ",")
updates["countries"] = strings.Join(match.Countries, ",")
updates["languages"] = strings.Join(match.Languages, ",")
updates["nsfw"] = match.NSFW
}
if match.ReleaseDate != "" {
updates["release_date"] = match.ReleaseDate
}