1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-24 04:05:39 +01:00

Barnkanal have started missing season number for some shows, now defaults to "01" if episode number exist.

This commit is contained in:
Harald Gustafsson 2018-10-21 08:36:38 +02:00 committed by Johan Andersson
parent 171bd25084
commit c86c111931

View File

@ -259,14 +259,19 @@ class Svtplay(Service, MetadataThumbMixin):
self.output["episodename"] = other self.output["episodename"] = other
def seasoninfo(self, data): def seasoninfo(self, data):
season, episode = None, None
if "season" in data and data["season"]: if "season" in data and data["season"]:
season = "{:02d}".format(data["season"]) season = "{:02d}".format(data["season"])
if int(season) == 0:
season = None
if "episodeNumber" in data and data["episodeNumber"]:
episode = "{:02d}".format(data["episodeNumber"]) episode = "{:02d}".format(data["episodeNumber"])
if int(season) == 0 and int(episode) == 0: if int(episode) == 0:
return None, None episode = None
if episode is not None and season is None:
# Missing season, happens for some barnkanalen shows assume first and only
season = "01"
return season, episode return season, episode
else:
return None, None
def extrametadata(self, data): def extrametadata(self, data):
self.output["tvshow"] = (self.output["season"] is not None and self.output["tvshow"] = (self.output["season"] is not None and