mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-29 02:55:38 +00:00
Properly store AirDate from source timezone
This commit is contained in:
parent
4fe127aca6
commit
17d5895957
1 changed files with 6 additions and 4 deletions
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
using NzbDrone.Common;
|
||||
using NzbDrone.Core.MediaCover;
|
||||
using NzbDrone.Core.MetadataSource.Trakt;
|
||||
|
@ -110,12 +111,13 @@ private static SeriesStatusType GetSeriesStatus(string status)
|
|||
|
||||
private static string FromIsoToString(string iso)
|
||||
{
|
||||
DateTime result;
|
||||
if (String.IsNullOrWhiteSpace(iso)) return null;
|
||||
|
||||
if (!DateTime.TryParse(iso, out result))
|
||||
return null;
|
||||
var match = Regex.Match(iso, @"^\d{4}\W\d{2}\W\d{2}");
|
||||
|
||||
return result.ToString(Episode.AIR_DATE_FORMAT);
|
||||
if (!match.Success) return null;
|
||||
|
||||
return match.Captures[0].Value;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue