1
0
Fork 0
mirror of https://github.com/Jackett/Jackett synced 2024-12-25 01:07:38 +00:00

LostFilm: fix date parsing

This commit is contained in:
kaso17 2018-06-29 15:16:04 +02:00
parent 34fc2a0d15
commit b6692a7dab

View file

@ -389,7 +389,15 @@ namespace Jackett.Common.Indexers
var dateString = document.QuerySelector("div.title-block > div.details-pane > div.left-box").TextContent;
dateString = TrimString(dateString, "eng: ", " г."); // '... Дата выхода eng: 09 марта 2012 г. ...' -> '09 марта 2012'
var date = DateTime.Parse(dateString, new CultureInfo(Language)); // dd mmmm yyyy
DateTime date;
if (dateString.Length == 4) //dateString might be just a year, e.g. https://www.lostfilm.tv/series/Ghosted/season_1/episode_14/
{
date = DateTime.ParseExact(dateString, "yyyy", CultureInfo.InvariantCulture).ToLocalTime();
}
else
{
date = DateTime.Parse(dateString, new CultureInfo(Language)); // dd mmmm yyyy
}
var urlDetails = new TrackerUrlDetails(playButton);
var episodeReleases = await FetchTrackerReleases(urlDetails);