Fix add-on mode.

Hacky, to be tested
This commit is contained in:
GrégoireDruant 2023-05-07 20:18:20 +02:00
parent a7e2060c5c
commit a8f2935790
2 changed files with 14 additions and 1 deletions

View file

@ -358,6 +358,7 @@ WHERE idPath = ?
""" """
update_path_movie_obj = ["{Path}", "movies", "metadata.local", 1, "{PathId}"] update_path_movie_obj = ["{Path}", "movies", "metadata.local", 1, "{PathId}"]
update_path_toptvshow_obj = ["{TopLevel}", "tvshows", "metadata.local", 1, "{TopPathId}"] update_path_toptvshow_obj = ["{TopLevel}", "tvshows", "metadata.local", 1, "{TopPathId}"]
update_path_toptvshow_addon_obj = ["{TopLevel}", None, None, 1, "{TopPathId}"]
update_path_tvshow_obj = ["{Path}", None, None, 1, "{PathId}"] update_path_tvshow_obj = ["{Path}", None, None, 1, "{PathId}"]
update_path_episode_obj = ["{Path}", None, None, 1, "{PathId}"] update_path_episode_obj = ["{Path}", None, None, 1, "{PathId}"]
update_path_mvideo_obj = ["{Path}", "musicvideos", "metadata.local", 1, "{PathId}"] update_path_mvideo_obj = ["{Path}", "musicvideos", "metadata.local", 1, "{PathId}"]

View file

@ -169,7 +169,19 @@ class TVShows(KodiDb):
self.add_unique_id(*values(obj, QU.add_unique_id_tvshow_obj)) self.add_unique_id(*values(obj, QU.add_unique_id_tvshow_obj))
obj['TopPathId'] = self.add_path(obj['TopLevel']) obj['TopPathId'] = self.add_path(obj['TopLevel'])
if self.direct_path:
# Normal way, we use the actual top path
self.update_path(*values(obj, QU.update_path_toptvshow_obj)) self.update_path(*values(obj, QU.update_path_toptvshow_obj))
else:
# Hack to allow cast information in add-on mode
# We create a path on top of all others that holds mediaType and scrapper
self.update_path(*values(obj, QU.update_path_toptvshow_addon_obj))
temp_obj = dict()
temp_obj['TopLevel'] = 'plugin://plugin.video.jellyfin/'
temp_obj['TopPathId'] = self.add_path(temp_obj['TopLevel'])
self.update_path(*values(temp_obj, QU.update_path_toptvshow_obj))
self.update_path_parent_id(obj['TopPathId'], temp_obj['TopPathId'])
obj['PathId'] = self.add_path(*values(obj, QU.get_path_obj)) obj['PathId'] = self.add_path(*values(obj, QU.get_path_obj))