Added display of track genres.

This commit is contained in:
The Wobbler 2025-03-07 19:24:41 +01:00
parent 9e20e21e6f
commit 209335b005
4 changed files with 18 additions and 9 deletions

View file

@ -13,6 +13,7 @@ class TrackMetadata:
title: str | None=None
artist: str | None=None
album: str | None=None
genre: str | None=None
images: TTImages | None=None # tinytag images
def add_missing(self):
@ -26,15 +27,19 @@ class TrackMetadata:
if self.album == "None":
self.album = ""
if self.genre == "None":
self.genre = ""
if self.path is None: # can't add missing information without a path
return
if self.title is None or self.artist is None or self.album is None:
if self.title is None or self.artist is None or self.album is None or self.genre is None:
tags = TinyTag.get(self.path, ignore_errors=True, duration=False)
self.title = tags.title
self.artist = tags.artist
self.album = tags.album
self.genre = tags.genre
class Track: