1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-05 02:22:31 +01:00

Properly store AirDate from source timezone

This commit is contained in:
Mark McDowall 2013-07-30 01:52:54 +02:00
parent 4fe127aca6
commit 17d5895957

View File

@ -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;
}
}
}