Rename method

This commit is contained in:
croneter 2018-11-09 09:48:04 +01:00
parent ab718bae2a
commit 0255bd3584
3 changed files with 15 additions and 16 deletions

View file

@ -68,7 +68,7 @@ class Movie(ItemBase):
# Network share # Network share
filename = playurl.rsplit("/", 1)[1] filename = playurl.rsplit("/", 1)[1]
path = playurl.replace(filename, "") path = playurl.replace(filename, "")
kodi_pathid = self.kodidb.add_video_path(path, kodi_pathid = self.kodidb.add_path(path,
content='movies', content='movies',
scraper='metadata.local') scraper='metadata.local')
if do_indirect: if do_indirect:

View file

@ -143,8 +143,7 @@ class Show(ItemBase, TvShowMixin):
if playurl is None: if playurl is None:
return return
path, toplevelpath = process_path(playurl) path, toplevelpath = process_path(playurl)
toppathid = self.kodidb.add_video_path( toppathid = self.kodidb.add_path(toplevelpath,
toplevelpath,
content='tvshows', content='tvshows',
scraper='metadata.local') scraper='metadata.local')
else: else:
@ -154,7 +153,7 @@ class Show(ItemBase, TvShowMixin):
# Do NOT set a parent id because addon-path cannot be "stacked" # Do NOT set a parent id because addon-path cannot be "stacked"
toppathid = None toppathid = None
kodi_pathid = self.kodidb.add_video_path(path, kodi_pathid = self.kodidb.add_path(path,
date_added=api.date_created(), date_added=api.date_created(),
id_parent_path=toppathid) id_parent_path=toppathid)
# UPDATE THE TVSHOW ##### # UPDATE THE TVSHOW #####
@ -394,8 +393,8 @@ class Episode(ItemBase, TvShowMixin):
filename = playurl.rsplit("/", 1)[1] filename = playurl.rsplit("/", 1)[1]
path = playurl.replace(filename, "") path = playurl.replace(filename, "")
parent_path_id = self.kodidb.parent_path_id(path) parent_path_id = self.kodidb.parent_path_id(path)
kodi_pathid = self.kodidb.add_video_path( kodi_pathid = self.kodidb.add_path(path,
path, id_parent_path=parent_path_id) id_parent_path=parent_path_id)
if do_indirect: if do_indirect:
# Set plugin path - do NOT use "intermediate" paths for the show # Set plugin path - do NOT use "intermediate" paths for the show
# as with direct paths! # as with direct paths!
@ -405,7 +404,7 @@ class Episode(ItemBase, TvShowMixin):
% (path, plex_id, v.PLEX_TYPE_EPISODE, filename)) % (path, plex_id, v.PLEX_TYPE_EPISODE, filename))
playurl = filename playurl = filename
# Root path tvshows/ already saved in Kodi DB # Root path tvshows/ already saved in Kodi DB
kodi_pathid = self.kodidb.add_video_path(path) kodi_pathid = self.kodidb.add_path(path)
# UPDATE THE EPISODE ##### # UPDATE THE EPISODE #####
if update_item: if update_item:
@ -522,7 +521,7 @@ class Episode(ItemBase, TvShowMixin):
filename = ('%s%s/?plex_id=%s&plex_type=%s&mode=play&filename=%s' filename = ('%s%s/?plex_id=%s&plex_type=%s&mode=play&filename=%s'
% (path, show_id, plex_id, v.PLEX_TYPE_EPISODE, % (path, show_id, plex_id, v.PLEX_TYPE_EPISODE,
filename)) filename))
kodi_pathid = self.kodidb.add_video_path(path) kodi_pathid = self.kodidb.add_path(path)
kodi_fileid = self.kodidb.add_file(filename, kodi_fileid = self.kodidb.add_file(filename,
kodi_pathid, kodi_pathid,
api.date_created()) api.date_created())

View file

@ -87,7 +87,7 @@ class KodiVideoDB(common.KodiDBBase):
(parent_id, pathid)) (parent_id, pathid))
return pathid return pathid
def add_video_path(self, path, date_added=None, id_parent_path=None, def add_path(self, path, date_added=None, id_parent_path=None,
content=None, scraper=None): content=None, scraper=None):
""" """
Returns the idPath from the path table. Creates a new entry if path Returns the idPath from the path table. Creates a new entry if path