diff --git a/resources/lib/playlists.py b/resources/lib/playlists.py index 0d71e442..6f71b14c 100644 --- a/resources/lib/playlists.py +++ b/resources/lib/playlists.py @@ -113,12 +113,12 @@ def create_kodi_playlist(plex_id=None, updated_at=None): if not occurance: path = os.path.join(v.PLAYLIST_PATH, playlist.type, - '%s_01.m3u' % name[:min(len(name), 247)]) + '%s_01.m3u' % name[:min(len(name), 248)]) else: occurance = int(occurance.group(1)) + 1 path = os.path.join(v.PLAYLIST_PATH, playlist.type, - '%s_%02d.m3u' % (name[:min(len(name), 247)], + '%s_%02d.m3u' % (name[:min(len(name), 248)], occurance)) LOG.debug('Kodi playlist path: %s', path) playlist.kodi_path = path diff --git a/resources/lib/utils.py b/resources/lib/utils.py index 1a89a9ae..6e35c429 100644 --- a/resources/lib/utils.py +++ b/resources/lib/utils.py @@ -317,9 +317,9 @@ def valid_filename(text): text = unicodedata.normalize('NFKD', text) text = text.encode('ascii', 'ignore') text = text.decode('ascii') - # Ensure that filename length is at most 255 chars (including 4 chars for + # Ensure that filename length is at most 255 chars (including 3 chars for # filename extension and 1 dot to separate the extension) - text = text[:min(len(text), 250)] + text = text[:min(len(text), 251)] return text