diff --git a/arts/Aperture Science Psychoacoustics Laboratories_Portal_.png b/arts/Aperture Science Psychoacoustics Laboratories_Portal_.png new file mode 100755 index 0000000..d8ba77d Binary files /dev/null and b/arts/Aperture Science Psychoacoustics Laboratories_Portal_.png differ diff --git a/mobject.py b/mobject.py index 733e514..ba1d004 100644 --- a/mobject.py +++ b/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") @@ -77,6 +83,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") @@ -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") diff --git a/musick.py b/musick.py index 9b9ba01..d4d9e43 100644 --- a/musick.py +++ b/musick.py @@ -151,6 +151,7 @@ def process_file(f: str, odir: str): f" Title: \"{mobj.get_title()}\" -> \"{title}\"") mobj.set_artist(artist) + mobj.set_album_artist(artist) mobj.set_album(album) mobj.set_title(title)