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
1 changed files with 6 additions and 4 deletions

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 @@ namespace NzbDrone.Core.MetadataSource
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;
}
}
}