Rename method
This commit is contained in:
parent
ab718bae2a
commit
0255bd3584
3 changed files with 15 additions and 16 deletions
|
@ -68,9 +68,9 @@ 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:
|
||||||
# Set plugin path and media flags using real filename
|
# Set plugin path and media flags using real filename
|
||||||
filename = api.file_name(force_first_media=True)
|
filename = api.file_name(force_first_media=True)
|
||||||
|
|
|
@ -143,10 +143,9 @@ 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:
|
||||||
# Set plugin path
|
# Set plugin path
|
||||||
toplevelpath = "plugin://%s.tvshows/" % v.ADDON_ID
|
toplevelpath = "plugin://%s.tvshows/" % v.ADDON_ID
|
||||||
|
@ -154,9 +153,9 @@ 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 #####
|
||||||
if update_item:
|
if update_item:
|
||||||
LOG.info("UPDATE tvshow plex_id: %s - %s", plex_id, api.title())
|
LOG.info("UPDATE tvshow plex_id: %s - %s", plex_id, api.title())
|
||||||
|
@ -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())
|
||||||
|
|
|
@ -87,8 +87,8 @@ 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
|
||||||
[unicode] does not yet exist (using date_added [kodi date type],
|
[unicode] does not yet exist (using date_added [kodi date type],
|
||||||
|
|
Loading…
Reference in a new issue