Added requirements.txt and loading of track metadata.

This commit is contained in:
The Wobbler 2024-12-29 13:50:19 +01:00
parent af2b7b6c8d
commit 8fbb40d2f9
4 changed files with 12 additions and 3 deletions

4
requirements.txt Normal file
View file

@ -0,0 +1,4 @@
PyQt6
pygame
tinytag
pydub

View file

@ -36,7 +36,9 @@ class Library:
for track in playlist.tracks:
track_item = QTreeWidgetItem(view)
track_item.setText(1, track.title)
track_item.setText(1, track.tags.title)
track_item.setText(2, track.tags.artist)
track_item.setText(3, track.tags.album)
return view

View file

@ -32,6 +32,8 @@ class Playlist:
file.close()
lines = m3u.split("\n") # m3u entries
lines = lines[:-1]
print(lines)
i = 0

View file

@ -3,6 +3,7 @@
from pydub import AudioSegment
from pydub.effects import normalize
from pygame.mixer import Sound
from tinytag import TinyTag
class Track:
@ -16,8 +17,8 @@ class Track:
self.property_string = property_string
self.cached = cache
# get filename (will be replaced by proper name getter in future)
self.title = path.split("/")[-1].split(".")[0]
self.tags = TinyTag.get(self.path)
self.audio = None
self.sound = None
self.duration = 0