mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-10 23:36:37 +08:00
fix: align scraped media naming and release sorting
This commit is contained in:
@@ -103,6 +103,9 @@ func addMediaTitleUpdates(updates map[string]any, existing, incoming model.Media
|
||||
if incoming.Year > 0 {
|
||||
setIfChanged(updates, "year", existing.Year, incoming.Year)
|
||||
}
|
||||
if incoming.ReleaseDate != "" {
|
||||
setIfChanged(updates, "release_date", existing.ReleaseDate, incoming.ReleaseDate)
|
||||
}
|
||||
if strings.TrimSpace(existing.ScrapeStatus) == "no_match" && incoming.ScrapeStatus != "matched" && (titleChanged || yearChanged) {
|
||||
updates["scrape_status"] = "pending"
|
||||
}
|
||||
@@ -119,6 +122,9 @@ func addMediaExternalIDUpdates(updates map[string]any, existing, incoming model.
|
||||
if incoming.Year > 0 && existing.Year <= 0 {
|
||||
updates["year"] = incoming.Year
|
||||
}
|
||||
if incoming.ReleaseDate != "" && existing.ReleaseDate == "" {
|
||||
updates["release_date"] = incoming.ReleaseDate
|
||||
}
|
||||
if changedExternalID && (status == "no_match" || status == "matched") && incoming.ScrapeStatus != "matched" {
|
||||
updates["scrape_status"] = "pending"
|
||||
}
|
||||
@@ -152,6 +158,9 @@ func addMatchedMediaDetailUpdates(updates map[string]any, existing, incoming mod
|
||||
if incoming.Year > 0 {
|
||||
setIfChanged(updates, "year", existing.Year, incoming.Year)
|
||||
}
|
||||
if incoming.ReleaseDate != "" {
|
||||
setIfChanged(updates, "release_date", existing.ReleaseDate, incoming.ReleaseDate)
|
||||
}
|
||||
if incoming.NSFW && !existing.NSFW {
|
||||
updates["nsfw"] = true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user