album artist
This commit is contained in:
parent
d258b93347
commit
0b1c8806a2
BIN
arts/Aperture Science Psychoacoustics Laboratories_Portal_.png
Executable file
BIN
arts/Aperture Science Psychoacoustics Laboratories_Portal_.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 146 KiB |
24
mobject.py
24
mobject.py
@ -1,4 +1,4 @@
|
||||
from mutagen.id3 import ID3, APIC, TIT2, TPE1, TALB, Encoding, PictureType
|
||||
from mutagen.id3 import ID3, APIC, TIT2, TPE1, TPE2, TALB, Encoding, PictureType
|
||||
from mutagen.flac import FLAC, Picture
|
||||
from pathlib import Path
|
||||
import io
|
||||
@ -21,6 +21,9 @@ class MObject:
|
||||
def get_album(self) -> list[str]:
|
||||
raise Exception("unimplemented")
|
||||
|
||||
def get_album_artist(self) -> list[str]:
|
||||
raise Exception("unimplemented")
|
||||
|
||||
def get_artist(self) -> list[str]:
|
||||
raise Exception("unimplemented")
|
||||
|
||||
@ -30,6 +33,9 @@ class MObject:
|
||||
def set_artist(self, val : list[str]) -> None:
|
||||
raise Exception("unimplemented")
|
||||
|
||||
def set_album_artist(self, val : list[str]) -> None:
|
||||
raise Exception("unimplemented")
|
||||
|
||||
def set_album(self, val : list[str]) -> None:
|
||||
raise Exception("unimplemented")
|
||||
|
||||
@ -78,6 +84,16 @@ class MMP3Object(MObject):
|
||||
self._file_io.seek(0)
|
||||
self._id3.save(self._file_io)
|
||||
|
||||
def get_album_artist(self) -> list[str]:
|
||||
return self._id3.get("TPE2")
|
||||
|
||||
def set_album_artist(self, val : list[str]) -> None:
|
||||
self._id3.delall("TPE2")
|
||||
self._id3.add(TPE2(text = val))
|
||||
|
||||
self._file_io.seek(0)
|
||||
self._id3.save(self._file_io)
|
||||
|
||||
def get_cover(self) -> bytes:
|
||||
cover = self._id3.getall("APIC")
|
||||
if (cover == None or len(cover) == 0):
|
||||
@ -118,6 +134,12 @@ class MFLACObject(MObject):
|
||||
self._file_io.seek(0)
|
||||
self._flac.save(self._file_io)
|
||||
|
||||
def get_album_artist(self) -> list[str]:
|
||||
return self.get_artist()
|
||||
|
||||
def set_album_artist(self, val : list[str]) -> None:
|
||||
return self.set_artist(val)
|
||||
|
||||
def get_artist(self) -> list[str]:
|
||||
return self._flac.get("ARTIST")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user