move podcast playlist detection to cover pls and m3u handling

This commit is contained in:
Arno Hautala 2021-09-02 12:30:00 -04:00
parent 3d7189c36e
commit aa740c22dc

View file

@ -553,8 +553,6 @@ class Playlist(Record):
# Folders containing no music and only a single Album # Folders containing no music and only a single Album
# would generate duplicated playlists. That is intended and "wont fix". # would generate duplicated playlists. That is intended and "wont fix".
# Empty folders (inside the music path) will generate an error -> "wont fix". # Empty folders (inside the music path) will generate an error -> "wont fix".
if "/iPod_Control/Podcasts/" in playlistpath:
self.listtype = PlaylistType.PODCAST
listtracks = [] listtracks = []
for (dirpath, dirnames, filenames) in os.walk(playlistpath): for (dirpath, dirnames, filenames) in os.walk(playlistpath):
dirnames.sort() dirnames.sort()
@ -584,6 +582,8 @@ class Playlist(Record):
text = obj[0] text = obj[0]
else: else:
filename = obj filename = obj
if "/iPod_Control/Podcasts/" in filename:
self.listtype = PlaylistType.PODCAST
if os.path.isdir(filename): if os.path.isdir(filename):
self.listtracks = self.populate_directory(filename) self.listtracks = self.populate_directory(filename)
text = os.path.splitext(os.path.basename(filename))[0] text = os.path.splitext(os.path.basename(filename))[0]