Commit 51f8fec1 authored by Hermann Krumrey's avatar Hermann Krumrey

Add curl to CI script, fix type errors

parent 62c9ec69
......@@ -15,6 +15,7 @@ default:
- python setup.py install
- cd ..
- rm -rf puffotter
- apt install curl
github_mirror:
stage: mirror
......
......@@ -209,12 +209,12 @@ class TvSeriesChecker(Checker):
if not season.is_spinoff():
continue
tvdb_data = self.tvdb[int(season.ids.get(IdType.TVDB)[0])][1]
tvdb_data = self.tvdb[int(season.ids.get(IdType.TVDB, [])[0])][1]
# Check Length
should = len(episode_files[season.ids.get(IdType.TVDB)[0]][1])
should = len(episode_files[season.ids.get(IdType.TVDB, [])[0]][1])
season_tvdb_id = season.ids.get(IdType.TVDB)[0]
season_tvdb_id = season.ids.get(IdType.TVDB, [])[0]
if not len(tvdb_data) == len(episode_files[season_tvdb_id][1]):
msg = "Mismatch in spinoff {}; Should:{}; Is:{}".format(
season.name, should, len(tvdb_data)
......
......@@ -69,7 +69,7 @@ class TvSeasonWidget(QWidget, Ui_TvSeasonWidget):
self.name.setText(self.metadata.name)
self.season_name.setText(self.season.name)
self.tvdb_id_edit.setText(str(self.season.ids.get(IdType.TVDB)[0]))
self.tvdb_id_edit.setText(str(self.season.ids.get(IdType.TVDB, [])[0]))
self.set_icon_image()
self.load_episode_files()
Thread(target=self.load_tvdb_info).start()
......
......@@ -62,7 +62,8 @@ class TvSeriesWidget(QWidget, Ui_TvSeriesWidget):
self.metadata = metadata
self.name.setText(metadata.name)
self.tags_edit.setText(", ".join(metadata.tags))
self.tvdb_id_edit.setText(str(metadata.tvdb_id))
tvdb_id = metadata.ids.get(IdType.TVDB, [])[0]
self.tvdb_id_edit.setText(str(tvdb_id))
self.set_icon_image()
Thread(target=self.load_tvdb_info).start()
......
......@@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License
along with toktokkie. If not, see <http://www.gnu.org/licenses/>.
LICENSE"""
from typing import List
from typing import List, Optional
from toktokkie.metadata.Metadata import Metadata
from toktokkie.metadata.MediaType import MediaType
from toktokkie.metadata.types.components.MusicAlbum import MusicAlbum
......@@ -52,9 +52,7 @@ class MusicArtist(Metadata):
"""
:return: All theme songs for this music artist
"""
album_map = {}
for album in self.albums:
album_map[album.name] = album
album_map = {x.name: x for x in self.albums}
theme_songs = []
for theme_song in self.json.get("theme_songs", []):
......
......@@ -251,7 +251,7 @@ class TvSeries(Metadata):
"No Metadata found for {}".format(season_name)
)
continue
tvdb_id = season_metadata.ids.get(IdType.TVDB)[0]
tvdb_id = season_metadata.ids.get(IdType.TVDB, [])[0]
if tvdb_id not in content_info:
content_info[tvdb_id] = {}
......
......@@ -40,7 +40,7 @@ class MusicThemeSong(Component):
self.logger.warning("Theme song {} does not match album {}"
.format(self.name, self.album.name))
ids = objectify_ids(json_data.get("series_ids"))
ids = objectify_ids(json_data.get("series_ids")) # type: ignore
self.series_ids = fill_ids(ids, theme_song_ids)
@property
......
......@@ -34,15 +34,15 @@ class TvSeason(Component):
self,
parent_path: str,
parent_ids: Dict[IdType, List[str]],
json_data: Dict[str, Union[Dict[str, List[str]], str]]
json_data: Dict[str, Union[str, Dict[str, List[str]]]]
):
self.parent_path = parent_path
self.parent_ids = parent_ids
self.name = json_data["name"]
self.name = str(json_data["name"])
self.path = os.path.join(parent_path, self.name)
ids = objectify_ids(json_data.get("ids", {}))
ids = objectify_ids(json_data.get("ids", {})) # type: ignore
self.ids = fill_ids(ids, [], parent_ids)
@property
......
......@@ -367,7 +367,8 @@ class Renamer:
content_info = tv_series_metadata.get_episode_files()
for tvdb_id, season_data in content_info.items():
is_spinoff = tv_series_metadata.ids.get(IdType.TVDB)[0] != tvdb_id
tvdb_ids = tv_series_metadata.ids.get(IdType.TVDB, [])
is_spinoff = tvdb_ids[0] != tvdb_id
if is_spinoff:
sample_episode = season_data[list(season_data)[0]][0]
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment