Commit Graph

93 Commits

Author SHA1 Message Date
JoeLametta
7b8a20b22b Merge pull request #450 from ABCbum/develop
Use https and http appropriately when connecting to MusicBrainz
2020-01-29 10:00:35 +01:00
JoeLametta
7f438d1b75 Improve help string consistency
Reported by user "ABCbum" in comment (https://github.com/whipper-team/whipper/pull/436#discussion_r370068256).

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2020-01-28 17:05:31 +00:00
JoeLametta
1206552bd2 Use https and http appropriately when connecting to MusicBrainz
Fixed some bugs:
- MusicBrainz submit URL always has https as protocol: hardcoded, even when
inappropriate. It's just a graphical issue.
- Whipper appears to always communicate with MusicBrainz using musicbrainzngs
over http. The musicbrainzngs.set_hostname(server).
- `musicbrainzngs.set_hostname(server)` always defaults to http. Since musicbrainzngs
version 0.7 the method `set_hostname` takes an optional argument named `use_https`
(defaults to False) which whipper never passes.

Changed behaviour of `server` option (`musicbrainz` section of whipper's configuration file).
Now it expects an URL with a valid scheme (scheme must be `http` or `http`, empty scheme isn't allowed anymore).
Only the scheme and netloc parts of the URL are taken into account.

Fixes #437.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2020-01-17 15:12:40 +00:00
JoeLametta
caa2c8b27d Bug: whipper shouldn't abort if track rip succeeds on last allowed retry attempt
Fixes #449.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2020-01-14 17:50:04 +00:00
ABCbum
e2942b07e3 Add test case to check getCoverArt's functionality
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>
2020-01-14 15:57:34 +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
JoeLametta
fb9fb34b83 Move comment to the right place
The blank line after the comment was added in commit 644e67f105.

Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2020-01-04 12:21:08 +00:00
ABCbum
b914b31119 Enable mblookup to take release id as argument
To make mblookup able to look up data based on release id,
RegExp is used to detect whether the input is release id
or disc id and behaves differently according to that.
The input is now also tripped before being passed down.

Signed-off-by: ABCbum <kimlong221002@gmail.com>
2019-12-19 08:55:13 +00:00
JoeLametta
c13f541e61 Push whipper release v0.9.0
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-12-04 13:26:33 +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
993dd6cc33 Handle missing self.options for whipper cd info
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>
2019-10-26 11:24:30 +02:00
JoeLametta
d9b49df0aa Whitespace fixes
Signed-off-by: JoeLametta <JoeLametta@users.noreply.github.com>
2019-10-26 08:05:00 +00:00
Andreas Oberritter
252a2e8141 Use ittoc only for CDDB and MusicBrainz lookups
The data from itable may be more accurate, because ittoc comes from
getFastToc().

Signed-off-by: Andreas Oberritter <obi@saftware.de>
2019-10-20 15:25:17 +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
Volker Mische
9cf890a6e2 Fix offset find command
The refactoring of `ReadTOCTask` in commit 3e79032b63
broke the `offset find` command. This commit fixes it again.

Signed-off-by: Volker Mische <volker.mische@gmail.com>
2019-07-05 00:06:02 +02:00
JoeLametta
ccfe724e2e Merge pull request #392 from gorgobacka/default_success
Set default for eject to: success
2019-05-03 12:28:28 +02:00
JoeLametta
78b3c0d56a Merge pull request #391 from gorgobacka/perform_eject
Use eject value of the class again
2019-05-03 12:28:00 +02:00
gorgobacka
eff5fee3f4 use self.eject
Signed-off-by: gorgobacka <tho.b.j@gmx.de>
2019-05-03 12:25:48 +02:00
Frederik “Freso” S. Olesen
f74455c9f0 mblookup: Cast None to unicode before encoding
Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
2019-05-03 02:43:31 +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
gorgobacka
a977f9b7f6 set success as default
Signed-off-by: gorgobacka <tho.b.j@gmx.de>
2019-03-27 23:16:21 +01:00
Frederik “Freso” S. Olesen
135cc9ce05 Include MusicBrainz Release URL in log output (#382)
* 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>
2019-03-18 11:15:27 +00:00
Frederik “Freso” S. Olesen
239fc3e6ae Lowercase description of "%R" template variable
All other descriptions are lowercased, except for this one.

Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
2019-02-13 23:13:45 +01:00
JoeLametta
8266368c7d Merge pull request #364 from whipper-team/task/cleanup-musicbrainz-nomenclature
Clean up MusicBrainz nomenclature
2019-02-13 15:29:33 +01:00
Frederik “Freso” S. Olesen
75c5646d1e Fix MusicBrainz nomenclature: album → release
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>
2019-02-13 14:55:45 +01:00
Frederik “Freso” S. Olesen
e91fe2720b command.mblookup: Fix misaligned output.
Only three spaces before "Barcode" instead of four.

Signed-off-by: Frederik “Freso” S. Olesen <freso.dk@gmail.com>
2019-02-13 14:35:34 +01:00
JoeLametta
f79fb32340 Remove broken assertion 2019-02-02 19:19:50 +01:00
JoeLametta
cf923cc9cc Review existing comments and add new ones
Also clarified a statement
2019-02-02 19:19:50 +01:00
JoeLametta
ad66af900f Remove erroneous extra format argument 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
16b0d8dc29 Make methods static 2019-02-02 19:19:49 +01:00
JoeLametta
fef7973113 Modernize code for easier Python 3 port
- Replace print statement with function call
- Replace except ..., ...: syntax with except ... as ...:
- Simplify obsolete try ... except ... code block
- Replace some unicode calls with u-prefixed strings
- Do not use `len(SEQUENCE)` to determine if a sequence is empty
- Replace dictionary creation
- Drop support for GObject static bindings
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
3a569484e3 Discover plugins in system directories too
Fixes #135.
2018-12-14 22:16:13 +01:00
JoeLametta
c803a59d87 Fix whipper cd rip menu bug (loggers list) 2018-12-14 21:52:12 +01:00
JoeLametta
92cbb88f1f Avoid double showing the same error message 2018-12-14 14:21:56 +00: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
c377417108 Replace sys.std{out,err} statements with logger/print calls (#331)
* Change global default log level to 'INFO'

We're going to increase our usage of logger statements instead of print instructions (where deemed opportune).

* Replace sys.std{out,err} statements with logger/print calls

Fixes #303.
2018-12-13 20:21:26 +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
09c3e4771d Prevent exception in offset find
Whipper offset find needs a (remote) matching AccurateRip entry to perform its task and confirm the drive offset: if none is found, return early to prevent exception.

Fixes #208.
2018-11-09 21:36:50 +01:00
JoeLametta
d7fd3fb507 Convert print statement to logger warning
Clarify the description of the error.
2018-11-09 08:00:00 +00:00
JoeLametta
4f5b684ec7 Fix template validation error
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).
2018-11-04 12:17:44 +01:00
JoeLametta
f0fcae872d Write musicbrainz_discid tag when disc is unknown
Fixes #280.
2018-11-02 18:47:52 +01:00
Joe
241f44eff6 Merge branch 'master' into python3 2018-06-08 14:32:27 +00:00
Joe
a320f6a0a5 Remove whipper's image retag feature (#269)
Fixes #262.
2018-05-24 17:19:14 +02:00
Andreas Oberritter
145403705d Switch to PyGObject by default (#271)
* 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
2018-05-24 17:11:37 +02:00
JoeLametta
f6d9f398b0 Exception.message removed in Python 3 2018-05-08 18:39:08 +02:00
JoeLametta
0f67bc4a96 Remove unneeded brackets in print statements 2018-05-08 18:39:08 +02:00