WIP: other path update approach

Use jellyfin db to determine parent path id
This commit is contained in:
GrégoireDruant 2023-05-05 13:18:37 +02:00
parent fcda2ec043
commit 5b0fecf50c
3 changed files with 47 additions and 0 deletions

View file

@ -166,3 +166,26 @@ WHERE jellyfin_parent_id = ?
delete_version = """
DELETE FROM version
"""
get_season_kodi_parent_path_id = """
SELECT sh.kodi_pathid
FROM jellyfin s
JOIN jellyfin sh
ON s.parent_id = sh.kodi_id
WHERE s.media_type = ?
AND sh.media_type = ?
AND s.id = ?
"""
get_season_kodi_parent_path_id_obj = ["season", "tvshow", "{SeasonId}"]
get_episode_kodi_parent_path_id = """
SELECT sh.kodi_pathid
FROM jellyfin e
JOIN jellyfin s
ON e.parent_id = s.kodi_id
JOIN jellyfin sh
ON s.parent_id = sh.kodi_id
WHERE e.media_type = "episode"
AND s.media_type = "season"
AND sh.media_type = "tvshow"
AND e.kodi_fileid = 698;
"""
get_episode_kodi_parent_path_id = ["episode", "season", "tvshow", "{EpisodeId}"]