Set full path in episode

This commit is contained in:
GrégoireDruant 2023-05-07 12:51:38 +02:00
parent ff95157315
commit e28a041287
2 changed files with 7 additions and 3 deletions

View file

@ -339,7 +339,7 @@ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
""" """
add_episode_obj = ["{EpisodeId}", "{FileId}", "{Title}", "{Plot}", "{RatingId}", "{Writers}", "{Premiere}", "{Runtime}", add_episode_obj = ["{EpisodeId}", "{FileId}", "{Title}", "{Plot}", "{RatingId}", "{Writers}", "{Premiere}", "{Runtime}",
"{Directors}", "{Season}", "{Index}", "{Title}", "{ShowId}", "{AirsBeforeSeason}", "{Directors}", "{Season}", "{Index}", "{Title}", "{ShowId}", "{AirsBeforeSeason}",
"{AirsBeforeEpisode}", "{SeasonId}", "{Filename}", "{PathId}", "{Unique}"] "{AirsBeforeEpisode}", "{SeasonId}", "{FullFilePath}", "{PathId}", "{Unique}"]
add_art = """ add_art = """
INSERT INTO art(media_id, media_type, type, url) INSERT INTO art(media_id, media_type, type, url)
VALUES (?, ?, ?, ?) VALUES (?, ?, ?, ?)
@ -474,12 +474,13 @@ WHERE idSeason = ?
update_episode = """ update_episode = """
UPDATE episode UPDATE episode
SET c00 = ?, c01 = ?, c03 = ?, c04 = ?, c05 = ?, c09 = ?, c10 = ?, SET c00 = ?, c01 = ?, c03 = ?, c04 = ?, c05 = ?, c09 = ?, c10 = ?,
c12 = ?, c13 = ?, c14 = ?, c15 = ?, c16 = ?, idSeason = ?, idShow = ? c12 = ?, c13 = ?, c14 = ?, c15 = ?, c16 = ?, idSeason = ?, idShow = ?,
c18 = ?, c19 = ?, c20 = ?
WHERE idEpisode = ? WHERE idEpisode = ?
""" """
update_episode_obj = ["{Title}", "{Plot}", "{RatingId}", "{Writers}", "{Premiere}", "{Runtime}", "{Directors}", update_episode_obj = ["{Title}", "{Plot}", "{RatingId}", "{Writers}", "{Premiere}", "{Runtime}", "{Directors}",
"{Season}", "{Index}", "{Title}", "{AirsBeforeSeason}", "{AirsBeforeEpisode}", "{SeasonId}", "{Season}", "{Index}", "{Title}", "{AirsBeforeSeason}", "{AirsBeforeEpisode}", "{SeasonId}",
"{ShowId}", "{EpisodeId}"] "{ShowId}", "{FullFilePath}", "{PathId}", "{Unique}", "{EpisodeId}"]
delete_path = """ delete_path = """

View file

@ -443,6 +443,8 @@ class TVShows(KodiDb):
obj['Filename'] = 'index.bdmv' obj['Filename'] = 'index.bdmv'
LOG.debug("Bluray directory %s", obj['Path']) LOG.debug("Bluray directory %s", obj['Path'])
obj['FullFilePath'] = obj['Path'] + obj['Filename']
else: else:
obj['Path'] = "plugin://plugin.video.jellyfin/%s/" % obj['SeriesId'] obj['Path'] = "plugin://plugin.video.jellyfin/%s/" % obj['SeriesId']
params = { params = {
@ -452,6 +454,7 @@ class TVShows(KodiDb):
'mode': "play" 'mode': "play"
} }
obj['Filename'] = "%s?%s" % (obj['Path'], urlencode(params)) obj['Filename'] = "%s?%s" % (obj['Path'], urlencode(params))
obj['FullFilePath'] = obj['Filename']
def get_show_id(self, obj): def get_show_id(self, obj):
obj['ShowId'] = self.jellyfin_db.get_item_by_id(*values(obj, QUEM.get_item_series_obj)) obj['ShowId'] = self.jellyfin_db.get_item_by_id(*values(obj, QUEM.get_item_series_obj))