9db3aa9 introduced the -r/--max-retries option, but passed `'r'` to
`argparse.ArgumentParser.add_argument` instead of `'-r'` which causes:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".../whipper/command/main.py", line 48, in main
cmd = Whipper(sys.argv[1:], os.path.basename(sys.argv[0]), None)
File ".../whipper/command/basecommand.py", line 117, in __init__
self.options
File ".../whipper/command/basecommand.py", line 117, in __init__
self.options
File ".../whipper/command/basecommand.py", line 60, in __init__
self.add_arguments()
File ".../whipper/command/cd.py", line 308, in add_arguments
default=DEFAULT_MAX_RETRIES)
File "/usr/lib/python3.7/argparse.py", line 1354, in add_argument
kwargs = self._get_optional_kwargs(*args, **kwargs)
File "/usr/lib/python3.7/argparse.py", line 1485, in _get_optional_kwargs
raise ValueError(msg % args)
ValueError: invalid option string 'r': must start with a character '-'
for any arguments passed to `whipper cd rip`.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Ripping an unknown album when cover art fetching is enabled (e.g.
`whipper cd rip --unknown --cover-art complete`) causes whipper to crash
with an error similar to the following:
```python
Traceback (most recent call last):
File "<string>", line 1, in <module>
File ".../whipper/whipper/command/main.py", line 43, in main
ret = cmd.do()
File ".../whipper/whipper/command/basecommand.py", line 139, in do
return self.cmd.do()
File ".../whipper/whipper/command/basecommand.py", line 139, in do
return self.cmd.do()
File ".../whipper/whipper/command/cd.py", line 191, in do
self.doCommand()
File ".../whipper/whipper/command/cd.py", line 363, in doCommand
self.program.metadata.mbid)
AttributeError: 'NoneType' object has no attribute 'mbid'
```
due to accessing `self.program.metadata.mbid` when
`self.program.metadata` is `None`. To avoid this, only attempt to get
cover art when `self.program.metadata` is available.
Also print a warning when the cover art can't be fetched to inform the
user that it isn't being downloaded.
Signed-off-by: Kevin Locke <kevin@kevinlocke.name>
Add new `--max-retries` argument to allow users to specify maximum number
of attempts to try before giving up ripping a track. This value defaults to `5` while `0` means infinity.
Possible errors (negative number, string, etc) are also handled.
Co-authored-by: JoeLametta <JoeLametta@users.noreply.github.com>
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
Signed-off-by: ABCbum <kimlong221002@gmail.com>
Mock two functions `getCoverArt`, `get_image_front` and use
a locally available cover art to check if the created cover
art exists.
Problems:
- How to check image's quality.
- Not sure if only this check is enough (do we need to check the
embedding part?).
Signed-off-by: ABCbum <kimlong221002@gmail.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>
The attributes working_directory, disc_template, output_directory and offset are not defined during whipper cd info and they are only needed for ripping. self.program.getTable doesn't need output_path to gather the tocfile.
Therefore, this part is excluded, if the attributes don't exist and an offset of 0 is used.
Fixes issue #375.
Co-authored-by: gorgobacka <tho.b.j@gmx.de>
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
Signed-off-by: gorgobacka <tho.b.j@gmx.de>
* Include MusicBrainz Release URL in log output
This also passes *all* metadata to the `result` object, giving loggers a
lot more (release) metadata to work with, in case custom, “3rd party”
loggers (or even ourselves in the future!) want to do something more
fancy or expansive with the metadata in the log file.
Fixes https://github.com/whipper-team/whipper/issues/381
Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
* Uppercase "url" in output: "URL"
Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
In general, "albums" in everyday usage is what on MusicBrainz would be
considered a release group[1] while as far as I can tell, every single
instance of it being used in whipper is referring to a single "edition"
of an album, which is what would be called a "release" in
MusicBrainz terminology[2].
[1] https://musicbrainz.org/doc/Release_Group
[2] https://musicbrainz.org/doc/Release
Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
- Fix PEP8's line too long warning
- Remove useless parentheses
- Use triple quotes for docstring
- Address pylint's 'inconsistent-return-statements'
- Specify string format arguments as logging function parameters
- Comment out already disabled block of code
- Remove useless else (after return)
- Remove useless statement
- Do not import already imported module
* Begin work on moving cdrdao to a task
* Add code to start cdrdao task
* Allow cdrdao output to be asynchronously parsable
* Provide progress of cdrdao read toc/table to console
* Flake8 fixes, Freso's advices
Whipper uses cdrdao during its ripping process. With this commit it will now store cdrdao's generated tocfile in the ripping path.
Preserving the tocfile allows users to easily burn ripped discs having a non-compliant cue sheet.
Fixes#214.
Commit 9c72ebccd3 introduced a bug: all template strings are validated against the disc template RegEx (which, for example, is wrong if we're testing the track template).
* cd/offset: remove unused call to gobject.thread_init()
There are no threads involved.
* task: switch to PyGObject
Python-gobject-2 is deprecated.
* travis: update dependencies for PyGObject and GLib-2.0
* README: Add GObject Introspection
This commit also includes:
- whitespace / code formatting fixes
- slight syntax related changes: except <exception_name>, e -> except <exception_name> as e
- 3 pointless instructions instances have been rewritten [sorted] (spotted by semi-automatic check)
The unrelated changes shouldn't have any real impact on whipper's behaviour.