diff --git a/.gitignore b/.gitignore
index 2c29832..d6733a6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,5 +1,7 @@
!bcao.py
!requirements.txt
!.gitignore
-mypy.ini
+!mypy.ini
+!.run/
+!.idea/
*
\ No newline at end of file
diff --git a/.idea/.gitignore b/.idea/.gitignore
new file mode 100644
index 0000000..73f69e0
--- /dev/null
+++ b/.idea/.gitignore
@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/
diff --git a/.idea/bcao.iml b/.idea/bcao.iml
new file mode 100644
index 0000000..9493f03
--- /dev/null
+++ b/.idea/bcao.iml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 0000000..a55e7a1
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dictionaries/lynne.xml b/.idea/dictionaries/lynne.xml
new file mode 100644
index 0000000..78a5302
--- /dev/null
+++ b/.idea/dictionaries/lynne.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/discord.xml b/.idea/discord.xml
new file mode 100644
index 0000000..cd711a0
--- /dev/null
+++ b/.idea/discord.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 0000000..dd4c951
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..dcbfa5c
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..e5feef4
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..04aa77e
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,315 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1602831263913
+
+
+ 1602831263913
+
+
+
+
+
+
+
+ 1602927759343
+
+
+
+ 1602927759343
+
+
+ 1602942890966
+
+
+
+ 1602942890966
+
+
+ 1603715728224
+
+
+
+ 1603715728224
+
+
+ 1603716061845
+
+
+
+ 1603716061845
+
+
+ 1603716273616
+
+
+
+ 1603716273616
+
+
+ 1603717518466
+
+
+
+ 1603717518466
+
+
+ 1603719245013
+
+
+
+ 1603719245013
+
+
+ 1603719576507
+
+
+
+ 1603719576507
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/bcao (ceres).run.xml b/.run/bcao (ceres).run.xml
new file mode 100644
index 0000000..d9df8aa
--- /dev/null
+++ b/.run/bcao (ceres).run.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/bcao.run.xml b/.run/bcao.run.xml
new file mode 100644
index 0000000..be7d6a2
--- /dev/null
+++ b/.run/bcao.run.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.run/mypy.run.xml b/.run/mypy.run.xml
new file mode 100644
index 0000000..44157fa
--- /dev/null
+++ b/.run/mypy.run.xml
@@ -0,0 +1,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/bcao.py b/bcao.py
index 8b6d818..44bac6c 100755
--- a/bcao.py
+++ b/bcao.py
@@ -16,7 +16,7 @@ from os import path
from base64 import b64encode
from zipfile import ZipFile
from pathlib import Path
-from typing import Optional, Union, List, Dict, Any
+from typing import Optional, Union, List, Dict
# pycharm tells me some of these classes shouldn't be imported because they're not declared in __all__.
# however, the mutagen docs show example code where someone creates a mutagen.flac.Picture by referring to it as
@@ -33,7 +33,7 @@ from mutagen.id3 import APIC, PictureType, Frame, TRCK, TPE1, TIT2, TALB, TPE2
from PIL import Image
-fully_supported: List[str] = ["ogg", "flac", "mp3", "m4a", "wav"]
+fully_supported: List[str] = ["ogg", "flac", "mp3", "m4a", "wav", "aiff"]
MutagenFile = Union[MP3, FLAC, OggVorbis, mutagen.FileType]
MutagenTags = Union[mutagen.id3.ID3Tags, mutagen.mp4.Tags, mutagen.oggvorbis.OggVCommentDict]
args: argparse.Namespace
@@ -53,7 +53,8 @@ class SongInfo:
"m4a": "m4a",
"ogg": "vorbis",
"flac": "vorbis",
- "wav": "id3"
+ "wav": "id3",
+ "aiff": "id3"
}
def __init__(self, file_name: Path):
@@ -155,7 +156,7 @@ class SongInfo:
if self.format == "flac":
return len(self.m_file.pictures) != 0
- if self.format == "mp3" or self.format == "wav":
+ if self.format in ["mp3", "wav", "aiff"]:
apics: List[APIC] = self.m_tags.getall("APIC")
for apic in apics:
if apic.type == PictureType.COVER_FRONT:
@@ -174,7 +175,7 @@ class SongInfo:
elif self.format == "flac":
self.m_file.clear_pictures()
self.m_file.add_picture(to_embed)
- elif self.format in ["mp3", "wav"]:
+ elif self.format in ["mp3", "wav", "aiff"]:
self.m_tags.add(to_embed)
elif self.format == "m4a":
self.m_tags['covr'] = [to_embed]
@@ -315,7 +316,7 @@ def main() -> None:
embed_cover.height = image.size[1]
embed_cover.depth = image.bits
- elif song_format in ["mp3", "wav"]:
+ elif song_format in ["mp3", "wav", "aiff"]:
# apparently APIC files get compressed on save if they are "large":
# https://mutagen.readthedocs.io/en/latest/api/id3_frames.html#mutagen.id3.APIC
# i don't know what that means (lossless text compression? automatic JPEG conversion?) and i don't know if or how