diff options
| author | Bond-009 <bond.009@outlook.com> | 2021-04-04 17:16:17 +0200 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2021-04-11 14:13:44 -0400 |
| commit | 9e459090edad3f860eba4de4507ad61b7a5ecfc6 (patch) | |
| tree | 9a40b5ffd33bdbb569f383b5a1846c56126f784c | |
| parent | 95a4fc0f18d93a370347ae5aca05a177a173c32f (diff) | |
Merge pull request #5693 from Maxr1998/probe-result-tweaks
(cherry picked from commit 7978f30ff78dcf7ba5b7b27b3201f81eb851f2b3)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
| -rw-r--r-- | MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs | 13 | ||||
| -rw-r--r-- | MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs | 1 |
2 files changed, 9 insertions, 5 deletions
diff --git a/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs b/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs index b2d4db894..da37687e8 100644 --- a/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs +++ b/MediaBrowser.MediaEncoding/Probing/FFProbeHelpers.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Globalization; namespace MediaBrowser.MediaEncoding.Probing { @@ -85,12 +86,14 @@ namespace MediaBrowser.MediaEncoding.Probing { var val = GetDictionaryValue(tags, key); - if (!string.IsNullOrEmpty(val)) + if (string.IsNullOrEmpty(val)) { - if (DateTime.TryParse(val, out var i)) - { - return i.ToUniversalTime(); - } + return null; + } + + if (DateTime.TryParse(val, DateTimeFormatInfo.CurrentInfo, DateTimeStyles.AssumeUniversal, out var i)) + { + return i.ToUniversalTime(); } return null; diff --git a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs index bd026bce1..8b060071b 100644 --- a/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs +++ b/MediaBrowser.MediaEncoding/Probing/ProbeResultNormalizer.cs @@ -131,6 +131,7 @@ namespace MediaBrowser.MediaEncoding.Probing info.PremiereDate = FFProbeHelpers.GetDictionaryDateTime(tags, "retaildate") ?? FFProbeHelpers.GetDictionaryDateTime(tags, "retail date") ?? FFProbeHelpers.GetDictionaryDateTime(tags, "retail_date") ?? + FFProbeHelpers.GetDictionaryDateTime(tags, "date_released") ?? FFProbeHelpers.GetDictionaryDateTime(tags, "date"); if (isAudio) |
