pull/1551/head
Jamie.Rees 7 years ago
parent 6cc2afc92f
commit f827dd5e06

@ -99,7 +99,7 @@ namespace Ombi.Core.Helpers
new EpisodeRequests new EpisodeRequests
{ {
EpisodeNumber = ep.number, EpisodeNumber = ep.number,
AirDate = DateTime.Parse(ep.airdate), AirDate = FormatDate(ep.airdate),
Title = ep.name, Title = ep.name,
Url = ep.url Url = ep.url
} }
@ -112,7 +112,7 @@ namespace Ombi.Core.Helpers
season.Episodes.Add(new EpisodeRequests season.Episodes.Add(new EpisodeRequests
{ {
EpisodeNumber = ep.number, EpisodeNumber = ep.number,
AirDate = DateTime.Parse(ep.airdate), AirDate = FormatDate(ep.airdate),
Title = ep.name, Title = ep.name,
Url = ep.url Url = ep.url
}); });
@ -132,7 +132,7 @@ namespace Ombi.Core.Helpers
episodesRequests.Add(new EpisodeRequests episodesRequests.Add(new EpisodeRequests
{ {
EpisodeNumber = ep.number, EpisodeNumber = ep.number,
AirDate = DateTime.Parse(ep.airdate), AirDate = FormatDate(ep.airdate),
Title = ep.name, Title = ep.name,
Url = ep.url Url = ep.url
}); });
@ -156,7 +156,7 @@ namespace Ombi.Core.Helpers
episodesRequests.Add(new EpisodeRequests episodesRequests.Add(new EpisodeRequests
{ {
EpisodeNumber = ep.number, EpisodeNumber = ep.number,
AirDate = DateTime.Parse(ep.airdate), AirDate = FormatDate(ep.airdate),
Title = ep.name, Title = ep.name,
Url = ep.url Url = ep.url
}); });
@ -196,5 +196,10 @@ namespace Ombi.Core.Helpers
return this; return this;
} }
private DateTime FormatDate(string date)
{
return string.IsNullOrEmpty(date) ? DateTime.MinValue : DateTime.Parse(date);
}
} }
} }
Loading…
Cancel
Save