aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorShadowghost <Ghost_of_Stone@web.de>2026-07-21 20:27:04 +0200
committerShadowghost <Ghost_of_Stone@web.de>2026-07-21 20:27:04 +0200
commitca1f7af4458feffa7b9800d536b536e544fc4b7c (patch)
tree245698dd3361ba53eb0659de3e21a3c121759ac7 /MediaBrowser.Controller
parent65836cc844e6ef3d4b25b875668c4d32105a4dae (diff)
Fix incorrect year on local trailers
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs13
1 files changed, 13 insertions, 0 deletions
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 49a4ed4bf6..cc2a425a4d 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -1557,6 +1557,19 @@ namespace MediaBrowser.Controller.Entities
i.OwnerId = ownerId;
i.ParentId = Guid.Empty;
+
+ // Extras (e.g. trailers) frequently have no reliable date metadata of their own and
+ // would otherwise fall back to the file's container creation date. Inherit the owner's
+ // year/premiere date when the extra doesn't have one, so it stays consistent with the
+ // media it belongs to. Setting it before the refresh means the media info provider
+ // won't overwrite it from the file creation date.
+ if (!i.ProductionYear.HasValue && item.ProductionYear.HasValue)
+ {
+ i.ProductionYear = item.ProductionYear;
+ i.PremiereDate ??= item.PremiereDate;
+ subOptions.ForceSave = true;
+ }
+
return RefreshMetadataForOwnedItem(i, true, subOptions, cancellationToken);
});