use scandir to read dir content on file explorer (#64)

This commit is contained in:
Mungai Geoffrey
2022-06-07 11:26:55 +03:00
committed by GitHub
parent 892a090ed5
commit 824d3c6a86
9 changed files with 150 additions and 71 deletions
+6 -6
View File
@@ -46,7 +46,7 @@ class Track:
self.length = tags["length"]
self.genre = tags["genre"]
self.bitrate = tags["bitrate"]
try:
self.image = tags["image"]
except KeyError:
@@ -102,11 +102,9 @@ class Album:
def get_p_track(ptrack):
for track in api.TRACKS:
if (
track.title == ptrack["title"]
and track.artists == ptrack["artists"]
and ptrack["album"] == track.album
):
if (track.title == ptrack["title"]
and track.artists == ptrack["artists"]
and ptrack["album"] == track.album):
return track
@@ -191,9 +189,11 @@ class Folder:
name: str
path: str
trackcount: int
is_sym: bool = False
"""The number of tracks in the folder"""
def __init__(self, data) -> None:
self.name = data["name"]
self.path = data["path"]
self.is_sym = data["is_sym"]
self.trackcount = data["trackcount"]