Commit Graph

32 Commits

Author SHA1 Message Date
JoeLametta
b39345e1f0 Use shutil.move() instead of os.replace/rename
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2020-01-28 21:50:27 +00:00
ABCbum
f61214a238 Support fetching cover art images from the Cover Art Archive
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>
2020-01-14 15:57:34 +00:00
Merlijn Wajer
29ee670b7f program/cdparanoia: fix failed() task of AnalyzeTask
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-12-15 15:48:30 +00:00
JoeLametta
35201d5290 Address errors, improvements, formatting
- 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>
2019-11-26 18:46:12 +00:00
Drew DeVault
64dd9d843a Initial pass on python 3 port
Given the imminent end-of-life for Python 2, I didn't bother making the
codebase compatible with both.

Signed-off-by: Drew DeVault <sir@cmpwn.com>
2019-11-26 18:46:10 +00:00
JoeLametta
1be5adda65 Merge pull request #407 from whipper-team/bugfix/issue-284-flac-file-permissions
Set FLAC files permissions to 0644
2019-10-21 16:32:13 +02:00
JoeLametta
1c6fe42202 Set FLAC files permissions to 0644
Fixes #284.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-07-07 12:00:00 +00:00
JoeLametta
048a31e348 Fix erroneous result message for whipper drive analyze
If cdparanoia fails to analyze the drive, the drive is now marked as unable to defeat the cache.

Fixes #361.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-07-07 10:00:00 +00:00
JoeLametta
69f8f39c49 Change documentation from epydoc to reStructuredText
Thanks to Freso for all the useful comments!

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-05-03 20:06:13 +02:00
JoeLametta
cf923cc9cc Review existing comments and add new ones
Also clarified a statement
2019-02-02 19:19:50 +01:00
JoeLametta
6bb585e1a5 Replace if ... else ... with simpler statement 2019-02-02 19:19:49 +01:00
JoeLametta
e7bfc34c0e Rename 'throwaway' variables to single underscore
Also removed unused ones
2019-02-02 19:19:49 +01:00
JoeLametta
5311727572 Avoid shadowing built-ins/variables 2019-02-02 19:19:49 +01:00
JoeLametta
0e17b32740 Various stylistic fixes
- 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
2019-02-02 19:19:46 +01:00
JoeLametta
a4f654a3f3 Fix logger statements having multiple arguments
Some of the instructions have been rendered invalid during the conversion to logger statements...

Also performed various stylistic fixes
2018-12-14 14:21:56 +00:00
JoeLametta
c0637b1b92 Raise exception when cdparanoia can't read any frames
This commit effectively reverts #159. Whipper now raises an exception again but with a clearer textual description.

Closes #202.
2018-11-09 21:47:56 +01:00
JoeLametta
02fd962094 Limit length of filenames (#311)
* Limit length of filenames

If whipper generated filenames are longer thant the maximum value supported by the filesystem, the I/O operations are going to fail.
With this commit filenames which may be too long are truncated to the maximum allowable length.

Fixes #197.
2018-10-22 20:51:14 +02:00
JoeLametta
2b4140d300 Make Python code more idiomatic 2018-05-08 18:39:08 +02:00
JoeLametta
a484815106 Fix dictionary iteration methods 2018-05-08 18:39:08 +02:00
JoeLametta
4280dbfafc Convert except X, T to except X as T 2018-05-08 18:39:08 +02:00
JoeLametta
44ece38740 In Python 3 print is a function 2018-05-08 18:39:08 +02:00
Samantha Baldwin
09de58852e Revert "Convert docstrings to reStructuredText"
This reverts commit 3b1bd242d0.
2018-03-02 16:47:12 -05:00
Merlijn Wajer
5dbb197681 Switch to libcdio-cdparanoia (from cdparanoia) (#213)
* Switch to libcdio-cdparanoia (from cdparanoia)

Next commits will add a choice to fall back to the old one, or pick a
different name. But let's get this ready for testing now.

* Add libcdio-utils to .travis.yml

* Parse libcdio-paranoia version instead of cdparanoia

* Remove useless digit checking test
2018-01-26 09:01:01 +01:00
JoeLametta
3b1bd242d0 Convert docstrings to reStructuredText
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.
2018-01-12 11:42:24 +01:00
JoeLametta
3f248bfc00 Merge pull request #159 from sqozz/devision_zero
Fix division by zero
2017-08-02 10:26:20 +02:00
Sqozz
e84361b653 Fix division by zero 2017-07-28 18:27:42 +02:00
JoeLametta
b6fb7e8a86 Solve all flake8 warnings (#163)
Whipper is now fully PEP8 compliant.
Revised version which includes all the changes suggested by Freso.
2017-05-31 23:09:36 +02:00
Frederik “Freso” S. Olesen
b4539d1f80 Change "THOMAS" print statement to logger.debug() call
I left the "THOMAS" part in for now, but this seems more like a debug
message than a user facing message to me—but it was also obviously
something @thomasvs left in for himself, so maybe the whole if clause
has no reason to still be there and should just get removed.
2017-05-19 19:07:16 +02:00
Frederik “Freso” S. Olesen
52731e97c0 Remove old, commented out code
Some of this seems to be debug code which has been left in, some of it
seems to just be old code that was commented out and never put back in
and probably just forgotten about. Either way, we use git for a reason,
so there's no need for these code snippets to stick around. The code
history can be inspected and old code retrieved that way.
2017-05-19 19:05:11 +02:00
Frederik “Freso” S. Olesen
a20c25258d Remove "Morituri - for those about to RIP" lines. 2017-04-26 23:08:50 +02:00
Frederik “Freso” S. Olesen
c719d9c077 Update filenames.
Note that the (internal) file names of
"whipper/test/cache/result/fe105a11.pickle" did not get updated, since
that breaks the tests for some reason.
2017-04-26 23:08:50 +02:00
Frederik “Freso” S. Olesen
ff309e468c Rename "morituri" module to "whipper".
Fixes https://github.com/JoeLametta/whipper/issues/100
2017-04-26 23:08:28 +02:00