Commit Graph

54 Commits

Author SHA1 Message Date
Jan Solanti
98c4e957d2 cdrdao: make version regex work with 1.2.6
Signed-off-by: Jan Solanti <jhs@psonet.com>
2025-12-03 04:16:22 +02:00
JoeLametta
824ab995ab Add logger statement about output directory in cdrdao
Fixes #393.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2021-05-14 18:01:33 +00:00
JoeLametta
302bc22a66 Merge pull request #506 from whipper-team/ux/issue-495-cdparanoia-warnings
Add checks and warnings for (known) cdparanoia's upstream bugs
2020-09-23 19:51:16 +02:00
JoeLametta
1661e4291e Emit warning when the subcode's pre-emphasis flag of a track differs from the ToC's one
In the future I'd like to make sure this information is included in the logfile too (maybe also in the cue sheet).

Related to issue #296.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2020-09-18 11:58:18 +00:00
JoeLametta
07bd0348f3 Add checks and warnings for (known) cdparanoia's upstream bugs
Fixes #495.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2020-09-17 18:07:28 +00:00
JoeLametta
e56c636fd3 Improve docstrings
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2020-02-22 15:11:22 +00:00
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
d7f6d6888f Merge pull request #274 from mtdcr/accuraterip-module
accuraterip-checksum: convert to python C extension
2019-10-26 11:32:27 +02:00
JoeLametta
87a477a5d6 Fix wrong logger call
Introduced in 048a31e348.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-26 08:00:00 +00:00
JoeLametta
8b6b2d34fe Merge pull request #418 from mtdcr/fix-less-than-ten
Fix ripping discs with less than ten tracks
2019-10-21 17:40:18 +02: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
fe13affac2 Merge pull request #409 from whipper-team/bugfix/issue-361-drive-analysis-fails
Fix erroneous result message for whipper drive analyze
2019-10-21 16:30:03 +02:00
Andreas Oberritter
abf9a971e7 Fix ripping discs with less than ten tracks
Output lines of cdrdao for single digit track numbers start with a
whitespace character.

Broken since #345 was merged.

Signed-off-by: Andreas Oberritter <obi@saftware.de>
2019-10-20 15:41:33 +02:00
Andreas Oberritter
ab95715efc accuraterip-checksum: convert to python C extension
* calculate v1 and v2 checksums at once
* let libsndfile handle both WAV and FLAC

Signed-off-by: Andreas Oberritter <obi@saftware.de>
2019-09-09 20:37:50 +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
e5961ae04c Report eject's failures as logger warnings
If the eject command exits with an error, the output is logged as a WARNING. I don't think it's a good idea to mask those errors.

Closes #354.

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
1ae6240e63 Remove useless "stopgap morituri-insanity compatibility layer"
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-03-29 13:34:39 +01: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
JTL
3e79032b63 WIP: Refactor cdrdao toc/table functions into Task and provide progress output (#345)
* 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
2019-02-02 18:36:03 +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
c2af4459ef Preserve ToC file generated by cdrdao
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.
2018-11-19 12:56:58 +01: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
JoeLametta
00bf17082e Test HTOA peak value against 0 (integer comparison)
Now whipper uses the absolute value of SoX's peak level as internal peak value.

Fixes #143.
2018-02-01 15:14:42 +01: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
Samantha Baldwin
83729ef7f3 deflake, remove morituri hack, more error handling 2017-09-04 21:55:05 -04:00
Samantha Baldwin
bfa0308880 AccurateRip V2 support
- output path no longer has fallbacks
- refactor accuraterip cache
- use requests to download accuraterip entries
- add tests for accuraterip functionality
- remove gobject support from accuraterip-checksum calculation
- default track template now includes extension
- begin to remove support for continuing rip
- begin to use print instead of sys.stdout.write() throughout
2017-09-04 21:26:34 -04: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
gorgobacka
4b3d462b16 Detect and handle CD-R discs (#154)
* Use cdrdao to detect CD-Rs and continue ripping only if the argument --cdr is passed.

* Get and display disc format from MusicBrainz.

* Add info about CD-R detection to logger

* Remove Musicbrainz medium format info

* add cdrdao command to logger

* Fix for PEP8

* Fix line break
2017-06-06 11:12:00 +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
6be899632d Fix flake8 whitespace warnings.
Guided by the output of `flake8 --select=W`.
2017-04-28 13:47:11 +02:00