Fix AttributeErrors
This commit is contained in:
parent
1780b3948b
commit
4e16756829
1 changed files with 8 additions and 8 deletions
|
@ -93,17 +93,17 @@ def create_kodi_playlist(plex_id=None):
|
||||||
LOG.info('Creating new Kodi playlist from Plex playlist %s: %s',
|
LOG.info('Creating new Kodi playlist from Plex playlist %s: %s',
|
||||||
playlist.id, playlist.plex_name)
|
playlist.id, playlist.plex_name)
|
||||||
name = utils.valid_filename(playlist.plex_name)
|
name = utils.valid_filename(playlist.plex_name)
|
||||||
path = os.join(v.PLAYLIST_PATH, playlist.type, '%s.m3u8' % name)
|
path = os.path.join(v.PLAYLIST_PATH, playlist.type, '%s.m3u8' % name)
|
||||||
while exists(path) or playlist_object_from_db(path=path):
|
while exists(path) or playlist_object_from_db(path=path):
|
||||||
# In case the Plex playlist names are not unique
|
# In case the Plex playlist names are not unique
|
||||||
occurance = utils.REGEX_FILE_NUMBERING.search(path)
|
occurance = utils.REGEX_FILE_NUMBERING.search(path)
|
||||||
if not occurance:
|
if not occurance:
|
||||||
path = os.join(v.PLAYLIST_PATH,
|
path = os.path.join(v.PLAYLIST_PATH,
|
||||||
playlist.type,
|
playlist.type,
|
||||||
'%s_01.m3u8' % name[:min(len(name), 247)])
|
'%s_01.m3u8' % name[:min(len(name), 247)])
|
||||||
else:
|
else:
|
||||||
occurance = int(occurance.group(1)) + 1
|
occurance = int(occurance.group(1)) + 1
|
||||||
path = os.join(v.PLAYLIST_PATH,
|
path = os.path.join(v.PLAYLIST_PATH,
|
||||||
playlist.type,
|
playlist.type,
|
||||||
'%s_%02d.m3u8' % (name[:min(len(name), 247)],
|
'%s_%02d.m3u8' % (name[:min(len(name), 247)],
|
||||||
occurance))
|
occurance))
|
||||||
|
|
Loading…
Reference in a new issue