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>
Removed `return None` from the `Rip.doCommand` method
as suggested in review comments.
Changed logging strings to use logger arguments rather
than printf-string, as suggested in review comments.
Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
Added an exit status of 5 when tracks are skipped
during a rip attempt.
Fixed a TypeError caused by a syntax error in the
format string on line 537 in `whipper/command/cd.py`.
Changed f-string to printf-style format string
on line 493 in `whipper/command/cd.py`.
Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
Made changes to fix `KeyError` and implemented logging
of skipped tracks. For instance:
if any tracks are skipped, the log will show:
`Health status: Some tracks were not ripped (skipped)`.
the tracks that are skipped will show:
`Status: Track not ripped (skipped)`.
Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
Implemented the option (`-k`, `--keep-going`) to continue ripping
the CD even if one track fails to rip (as @xmixahlx suggested in #128).
Requested in #128
Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
Changed line-lengths/indentation of some code
Travis-CI was failing on account of lines being
under-indented or too long, this should correct it.
Signed-off-by: blueblots <63152708+blueblots@users.noreply.github.com>
It was introduced in commit acf942b5b6.
The error happens because 'self.itable.tracks' is a list of tracks
(zero-based numbering, HTOA excluded) so the first track can be accessed with
'self.itable.tracks[0]' but when 'number' has value 0, that matches the HTOA
(everything is shifted by one compared to 'self.itable.tracks').
It's unrelated to this bugfix but I've also moved some instructions outside
the try ... except clause.
Fixes#512.
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
The bare if evaluated to true for return codes > 0 and that's wrong (CDS_DISC_OK = 4).
Fixes#511.
Signed-off-by: JoeLametta <JoeLametta@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>
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