mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-10 04:12:10 +01:00
Merge pull request #6262 from MrTimscampi/scanner-prefer-original-date
This commit is contained in:
@@ -63,7 +63,8 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
public static DateTime? GetDictionaryDateTime(IReadOnlyDictionary<string, string> tags, string key)
|
||||
{
|
||||
if (tags.TryGetValue(key, out var val)
|
||||
&& DateTime.TryParse(val, DateTimeFormatInfo.CurrentInfo, DateTimeStyles.AssumeUniversal, out var dateTime))
|
||||
&& (DateTime.TryParse(val, DateTimeFormatInfo.CurrentInfo, DateTimeStyles.AssumeUniversal, out var dateTime)
|
||||
|| DateTime.TryParseExact(val, "yyyy", DateTimeFormatInfo.CurrentInfo, DateTimeStyles.AssumeUniversal, out dateTime)))
|
||||
{
|
||||
return dateTime.ToUniversalTime();
|
||||
}
|
||||
|
||||
@@ -121,6 +121,7 @@ namespace MediaBrowser.MediaEncoding.Probing
|
||||
|
||||
// Several different forms of retail/premiere date
|
||||
info.PremiereDate =
|
||||
FFProbeHelpers.GetDictionaryDateTime(tags, "originaldate") ??
|
||||
FFProbeHelpers.GetDictionaryDateTime(tags, "retaildate") ??
|
||||
FFProbeHelpers.GetDictionaryDateTime(tags, "retail date") ??
|
||||
FFProbeHelpers.GetDictionaryDateTime(tags, "retail_date") ??
|
||||
|
||||
Reference in New Issue
Block a user