From b6692a7dab557dae20e045da0c0baeb72e7ec551 Mon Sep 17 00:00:00 2001 From: kaso17 Date: Fri, 29 Jun 2018 15:16:04 +0200 Subject: [PATCH] LostFilm: fix date parsing --- src/Jackett.Common/Indexers/LostFilm.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Jackett.Common/Indexers/LostFilm.cs b/src/Jackett.Common/Indexers/LostFilm.cs index 63f1facf4..0a09f671c 100644 --- a/src/Jackett.Common/Indexers/LostFilm.cs +++ b/src/Jackett.Common/Indexers/LostFilm.cs @@ -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);