All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog.
- In sorter.py:
- In
Sorter.sort()
:album_dir
was renamed to a more accurateparent_dir
. (The class methodSorter.move_track()
similarly had its argumentalbum
renamed toparent
.)- The initial assignment of
self.metadata
is now enclosed intry: except TypeError:
. I discovered that if all metadata is stripped from a track, its tag becomesNone
rather than an emptydict
and thus not subscriptable. The file is moved todest/no_tags
. See Issue #3. - Tracks that lack both artist and album tags are also moved to
dest/no_tags
. See Issue #3.
- In
- Issue #3: Tracks that are missing either all metadata or just both artist and album tags will be moved into a separate
- Issue #4: Total track count is kept during sorting and checked at the end to ensure it matches the pre-sort count.
- In sorter.py:
- The
label
argument forsanitize()
did not accurately appear to be optional (i.e. can beNone
); as a result and linted withmypy
,label
is now of typeOptional[str]
.- Because of this distinction of
label
being possibly empty, the argument order forsanitize()
is nowcategory: str, label: Optional[str]
.
- Because of this distinction of
- The
try: except AttributeError:
block might not be necessary now, sincemypy
encourages a literalNone
check at the beginning. - A new method-local variable
artist
is used in place ofself.metadata['artist']
inSorter.sort()
, with anotherNone
check to ensuremypy
doesn't complain about mismatching types.- This allowed me to keep
Sorter.is_artist_orchestra()
andSorter.substitute_suffixes
relatively unchanged.
- This allowed me to keep
- The
- The project has now been linted additionally by
mypy
on top ofFlake8
.
- In sorter.py:
- In
sanitize()
,label
was being incorrectly assignedconfig.CORR[category]
, when in factconfig.CORR[category][label]
is the desired element. Sorter.handle_orchestra()
is nowSorter.is_artist_orchestra()
and correctly returns abool
as per typing.
- In
- Issue #1:
- If a track lacks an album tag, it will correctly be placed in the next possible tag: the artist tag (group artists).
- Suffixes like
', Jr.'
can now coexist with a list of artists, as the comma is swapped with an underscore pre-split and swapped back post-split.
- Issue #2:
- Disc numbers will default to
1
if they are somehow missing or zeroed. Users will be alerted to this change. - Missing track numbers can't be fixed, but the user will still be alerted.
- Disc numbers will default to
- Forget the CSV functionality. It only hindered moving over tracks accurately. I thought they could be used as a sort of failsafe, but they actually increased complexity. Everything anyone needs to move files is already present within the ID3 metadata of each MP3 file. Some of the data is absent for some reason (including artists) but overall the effort is tremendously effective.
- Initial version