When metadata is absent,
the %S template variable does not have a default value set in the dictionary,
which can cause a "KeyError: 'S'" error.
While %A defaults to 'Unknown Artist' and %S might conventionally default to 'Artist, Unknown',
defaulting %S to that is unnecessary,
because manual tagging typically follows to assign the correct name.
Therefore, I default %S to 'Unknown Artist', just like %A.
Signed-off-by: sinofp <sinofp@tuta.io>
Replaced useless 'os.path.relpath(os.getcwd())' statement with 'os.curdir' (which is equal to '.').
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
- Trasparent change: now it makes more sense.
- Updated tests to reflect 'title', 'releaseTitle' meaning swap.
- Improved documentation.
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
Added conditional to `program.write_m3u()` to
ignore skipped tracks.
Added skipped_tracks support to the `Program` and
`image.ImageVerifyTask` classes to avoid crashing
when a file for a skipped track doesn't exist.
Added conditional to `accurip.calculate_checksums`
to check if a path exists before trying to calculate
checksums, this prevents `accuraterip-checksum.c` from
emitting an error message (`sf_open failed!`) when a
path doesn't exist (as when a track is skipped).
Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
Whipper's caching implementation causes a few issues (#196, #230, [#321 (comment)](https://github.com/whipper-team/whipper/pull/321#issuecomment-437588821)) and complicates the code: it's better to drop this feature.
The rip resume feature doesn't work anymore: if possible it will be restored in the future.
* Remove caching item from TODO
* Delete unneeded files related to caching
* Update 'common/directory.py' & 'test/test_common_directory.py' (caching removal)
* Update 'common/accurip.py' & 'test/test_common_accurip.py' (caching removal)
* Update 'common/program.py' (caching removal)
* Update 'command/cd.py' (caching removal)
This fixes#335, fixes#196 and fixes#230.
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
Added filter options:
- dot (replace leading dot with _)
- posix (replace illegal chars in *nix OSes with _)
- vfat (replace illegal chars in VFAT filesystems with _)
- whitespace (replace all whitespace chars with _)
- printable (replace all non printable ASCII chars with _)
Removed filter options:
- fat (replaced with vfat)
- special
Fixes#313.
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
This simplifies choosing the correct release when there are multiple matches.
If a certain release has multiple countries associated, all will be shown.
Thanks to the user "the-confessor" for testing this new feature.
Fixes#451.
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
If the directory used by tempfile.NamedTemporaryFile is on a different
filesystem (e.g. /tmp on tmpfs), `whipper cd rip --cover-art` will fail
with an error such as:
Traceback (most recent call last):
File "/usr/bin/whipper", line 11, in <module>
load_entry_point('whipper==0.9.0', 'console_scripts', 'whipper')()
File "/home/kevin/tmp/whipper/whipper/command/main.py", line 43, in main
ret = cmd.do()
File "/home/kevin/tmp/whipper/whipper/command/basecommand.py", line 139, in do
return self.cmd.do()
File "/home/kevin/tmp/whipper/whipper/command/basecommand.py", line 139, in do
return self.cmd.do()
File "/home/kevin/tmp/whipper/whipper/command/cd.py", line 191, in do
self.doCommand()
File "/home/kevin/tmp/whipper/whipper/command/cd.py", line 363, in doCommand
self.program.metadata.mbid)
File "/home/kevin/tmp/whipper/whipper/common/program.py", line 498, in getCoverArt
os.replace(f.name, cover_art_path)
OSError: [Errno 18] Invalid cross-device link: '/tmp/tmprmx4d9c9.cover.jpg' -> './Boston/Greatest Hits/cover.jpg'
due to calling os.replace with paths on different filesystems.
Instead of os.replace, use shutil.move, which falls back to shutil.copy2
if os.replace doesn't work.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Add PERFORMER & COMPOSER metadata tags to audio tracks (if available).
Composer(s) and performer(s) will be extracted from MusicBrainz
recording metadata by new _getComposers and _getPerformers
functions then there will be new properties added to each track
metadata. If those data are present it will be tagged as new tags
PERFORMER and COMPOSER.
Signed-off-by: ABCbum <kimlong221002@gmail.com>
Co-authored-by: JoeLametta <JoeLametta@users.noreply.github.com>
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
Add option `--cover-art` to `whipper cd rip` command which accepts three values:
- `file`: save the downloaded cover image as standalone file in the rip folder (named `cover.jpg`)
- `embed`: embed the download cover image into all the ripped audio tracks (no standalone file will be kept)
- `complete`: save standalone cover image as standalone file and embed it into all the ripped audio tracks (`file` + `embed`)
Every cover art is fetched from the Cover Art Archive as JPEG thumbnail with a maximum dimension of 500px.
Other supported values for the thumbnails are 250, 500 and 1200 (currently only some images have a corresponding 1200px sized thumbnail).
This feature introduces an optional dependency on the `Pillow` module which is required for the decoding of the cover file (required by the `embed` and `complete` option values).
Problem:
- EmbedPicTureTask shouldn't be a task.
Signed-off-by: ABCbum <kimlong221002@gmail.com>
Co-authored-by: JoeLametta <JoeLametta@users.noreply.github.com>
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
- Removed unused code not portable due to buffer() use
- raw_input() does not exist in Python 3
- Fixed octal constant syntax for Python 3
- Fixed TypeError
- Replace if not exists: makedirs(path) with single call: using makedirs(path, exist_ok=True)
- Class inherits from object, can be safely removed from bases in python3: pylint's useless-object-inheritance (W0235) check
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>