Added tracklist code to replace readmp3 routine

This commit is contained in:
Jan
2019-09-26 16:03:19 +02:00
parent 20f0eb71b9
commit 88dce016de
6 changed files with 27 additions and 41 deletions

View File

@@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
from pathlib import Path
@@ -6,7 +6,7 @@ EXTENSIONS=(".mp3",".ogg",".wav",".mpa",".m4a",".flac")
class ClockyTracklist:
"""read and monitor directory with audio files"""
def __init__(self,path=".",recursive=False,verbose=False):
def __init__(self,path=".",recursive=False,sort=False,verbose=False):
"""Read (current or supplied) path for all audio files. Add recursive=True to check all subdirectories too"""
self.recursive=recursive
self.path=path
@@ -18,6 +18,8 @@ class ClockyTracklist:
exit();
self.__ReadTrackList()
if sort:
self.tracklist.sort()
if(self.__verbose):
self.ShowTrackList()