Commit graph

9323 commits

Author SHA1 Message Date
Guilherme Danno
63594386c2
Add the changelog 2019-07-30 17:09:00 -03:00
Guilherme Danno
4908028985
Use the 'resource_url' from discogs_client 2019-07-30 16:46:59 -03:00
Adrian Sampson
32b33922cb
Merge pull request #3336 from samuelnilsson/replaygain
ffmpeg replaygain backend: Only calculate replaygain for audio stream
2019-07-29 08:12:03 -04:00
Samuel Nilsson
60c174101f ffmpeg replaygain backend: Only calculate replaygain for audio stream. Fixed documentation for backend option. 2019-07-29 10:32:19 +02:00
Adrian Sampson
ddede4e39e
Merge pull request #3065 from zsinskri/r128-targetlevel-config
replaygain: target level refactor
2019-07-25 19:28:28 -04:00
Zsin Skri
e3645dfd59
Merge branch 'master' into r128-targetlevel-config 2019-07-25 23:22:32 +02:00
Zsin Skri
a9f70f8151 apply suggested improvements
Apply improvements suggested in GitHub PullRequest #3065:
- be idiomatic
  - 0 is falsy
  - check enum equality, not identity
  - mutate list by constructing a new one
- improve documentation
  - fix a typo
  - do not mention deprecation of a config option
2019-07-26 01:02:03 +02:00
Adrian Sampson
9392256993 Spelling & changelog for #3334 2019-07-24 22:13:53 -04:00
Adrian Sampson
84032e56e2 Merge pull request #3334 from MartyLake/martylake_add_forward_slash_option
Add option to force forward slashes in paths
2019-07-24 22:11:59 -04:00
MartyLake
fb96660171 Review: simpler implementation and test
Because **all** the path are bytestrings
2019-07-24 18:09:54 +02:00
MartyLake
819f03f0e0 Add special case for string 2019-07-24 10:11:32 +02:00
MartyLake
7ee11b0f1a Review: add missing lines 2019-07-24 10:08:40 +02:00
MartyLake
c52973e1c0 Review: Adds missing point to finish sentences 2019-07-24 09:53:54 +02:00
Adrian Sampson
897100cb3b
Merge pull request #3335 from malcops/feature/pm/acousticbrainz-extra-fields
Feature/pm/acousticbrainz extra fields
2019-07-23 23:04:11 -04:00
Paul Malcolm
aa17625551 changelog entry: additional acousticbrainz fields 2019-07-23 20:25:26 -04:00
Paul Malcolm
5f9a394ca9 Issue #2860 Fetch more acousticbrainz fields 2019-07-23 20:25:26 -04:00
MartyLake
076a82daa6 Review: Rename method 2019-07-24 00:09:52 +02:00
MartyLake
68ccfe0e6c Review: Add missing blank line 2019-07-23 23:54:54 +02:00
MartyLake
ee7f939336 Review: Remove stray blank line 2019-07-23 23:53:50 +02:00
MartyLake
aa1da3166f Review: Remove unnecessary parens 2019-07-23 23:53:17 +02:00
MartyLake
3a5ea58f7a Review: format docstring on the following line 2019-07-23 23:52:26 +02:00
MartyLake
dd9de05968 Review: Remove unnecessary split of concat 2019-07-23 23:50:20 +02:00
MartyLake
da864402d5 Review: Remove unnecessary get 2019-07-23 23:49:17 +02:00
MartyLake
1a4699d0ee Add documentation 2019-07-23 23:46:31 +02:00
MartyLake
d1ba309f36 Add a new method that copied pathlib.path.as_posix 2019-07-23 17:17:40 +02:00
Zsin Skri
da602d779c changelog: new r128_targetlevel option
Add changelog entries for the introduction of the `r128_targetlevel`
configuration option, superseding the `method` option.
2019-07-22 13:42:26 +02:00
Zsin Skri
fbc8cc484d update replaygain target level documentation
- document `r128_targetlevel`
- explain difference between `targetlevel` and `r128_targetlevel`
- deprecate `method` option: use `targetlevel` instead.
2019-07-22 13:42:26 +02:00
Zsin Skri
88ab5474c5 replaygain: add R128_* tag test
Assert that the replaygain plugin does not write REPLAYGAIN_* tags but R128_*
tags, when instructed to do so.

This test is skipped for the `command` backend as it does not support OPUS.
2019-07-22 13:42:26 +02:00
Zsin Skri
5a8bdb67f7 replaygain: add target_level test
Assert that analysing the same track with different target levels yields
different gain adjustments.
2019-07-22 13:42:26 +02:00
Zsin Skri
e7e2c424e7 replaygain: targetlevel and peak_method depends on tag format
Allow to configure the target level for R128_* tags separately from REPLAYGAIN_*
tags and skip peak calculation for R128_* tags if possible.
2019-07-22 13:42:22 +02:00
Zsin Skri
0c8eead459 replaygain: pass target_level and peak to backends
Configure the replaygain analysis by passing arguments to the Backends. This
avoids the difference between ReplayGain and EBU r128 backends; every Backend
can now fulfil both tasks. Additionally it eases Backend development as the
difference between the two tag formats is now completely handled in the main
Plugin, not in the Backends.
2019-07-22 12:58:54 +02:00
Zsin Skri
b9063a0240 fix bs1770gain test
This test caused other tests to fail due to missing cleanup.
2019-07-22 12:49:50 +02:00
Adrian Sampson
bd6a5cfd8e
Merge pull request #3056 from zsinskri/replaygain-backend-ffmpeg
Replaygain backend ffmpeg
2019-07-20 21:40:43 -04:00
Zsin Skri
e5f2fe6fd3 avoid test failure
Use the POSIX character class instead of `\s` to match all whitespace in a
regular expression describing the language of valid inputs, in order to avoid a
test failure for the invalid escape sequence `\s` in Python strings.
2019-07-21 01:28:16 +02:00
Zsin Skri
f9ff56f496 improve wording in the ffmpeg replaygain backend
This commit mostly addresses feedback:
- remove some unused parenthesis
- fix a typo
- expand some docstrings
- document that ffmpeg is usually easy to install
2019-07-21 01:18:49 +02:00
Adrian Sampson
8b4d03095f parentwork tests: Remove unnecessary mocking
This mocking doesn't do anything because `command_output` is never
invoked by the code under test. See also #3332.
2019-07-20 16:23:03 -04:00
Zsin Skri
271a3c980c replaygain: ffmpeg: increase parser readability
Use keyword arguments to make the ffmpeg parser more readable.
2019-07-19 21:54:47 +02:00
Zsin Skri
b589521755 changelog entry: ffmpeg replaygain backend
Add changelog entry for the new ffmpeg replaygain backend.
2019-07-19 21:54:47 +02:00
Zsin Skri
c3af5b3763 replaygain: add ffmpeg backend
Add replaygain backend using ffmpeg's ebur128 filter.

The album gain is calculated as the mean of all BS.1770 gating block powers.
Besides differences in gating block offset, this should be equivalent to a
BS.1770 analysis of a proper concatenation of all tracks.

Just calculating the mean of all track gains (as implemented by the bs1770gain
backend) yields incorrect results as that would:
- completely ignore track lengths
  - just using length in seconds won't work either (e.g. BS.1770 ignores
    passages below a threshold)
- take the mean of track loudness, not power

When using the ffmpeg replaygain backend to create R128_*_GAIN tags, the
targetlevel will be set to -23 LUFS. GitHub PullRequest #3065 will make this
configurable.
It will also skip peak calculation, as there is no R128_*_PEAK tag.

It is checked if the libavfilter library supports replaygain calculation. Before
version 6.67.100 that did require the `--enable-libebur128` compile-time-option,
after that the ebur128 library is included in libavfilter itself. Thus we
require either a recent enough libavfilter version or the `--enable-libebur128`
option.
2019-07-19 21:54:47 +02:00
Zsin Skri
7a7314ee3f Allow other ReplayGain backends to support R128.
Previously using EBU R128 forced the use of the bs1770gain backend.
This change adds a whitelist of backends supporting R128. When the configured
backend is in that list it will also be used for R128 calculations. Otherwise
bs1770gain is still used as a default.

This should not change the overall behaviour of the program at all, but allow
for further R128-supporting backends to be added.
2019-07-19 21:54:47 +02:00
Adrian Sampson
5adb3ecad2
Merge pull request #3330 from zsinskri/bpd-sporadic-failure
fix "Sporadic test failures in BPD tests #3309"
2019-07-18 20:24:21 -04:00
Zsin Skri
5e5cb3cd43 changelog: fix "Sporadic test failures in BPD tests #3309" #3330
Add a changelog entry asking plugin developers to report any further occurrences
of this failure.
2019-07-17 19:26:45 +02:00
Zsin Skri
088af4d171 bpd tests: skip control_port in queue
When setting up bpd tests, two servers are startet: first a control server, then
bpd. Both send their assigned ports down a queue. The recipient only needs bpd's
port and thus skips the first queue entry.
2019-07-17 19:05:51 +02:00
Zsin Skri
8ba79117d9 bpd tests: use mp.Queue to communicate assigned port
Use a `multiprocessing.Queue` instead of a `multiprocessing.Value` to avoid the
manual polling/timeout handling.

TODO: Strangely Listener seems to be constructed twice. Only the second one is
used. Fix that and then remove the code working around it.
2019-07-17 16:19:17 +02:00
Zsin Skri
871f79c8f2 bpd tests: close only existing sockets
Close sockets in `finally`-clauses only after they have actually been created.
2019-07-17 13:38:57 +02:00
Zsin Skri
fb07a5112a bpd tests: terminate server upon connection failure 2019-07-17 13:21:25 +02:00
Zsin Skri
bbda292145 bpd test: make start_server a freestanding function
Under some circumstances (maybe under MS Windows?) local objects can't be
pickled. When `start_server` is a local this causes a crash:
https://ci.appveyor.com/project/beetbox/beets/builds/25996163/job/rbp3frnkwsvbuwx6#L541

Make `start_server` a freestanding function to mitigate this.
2019-07-15 22:25:48 +02:00
Zsin Skri
0ebab5edaa fix "Sporadic test failures in BPD tests #3309"
The bpd test bind a socket in order to test the protocol implementation. When
running concurrently this often resulted in an attempt to bind an already
occupied port.

By using the port number `0` we instead let the OS choose a free port. We then
have to extract it from the socket (which is handled by `bluelet`) via
`mock.patch`ing.
2019-07-15 21:25:39 +02:00
Adrian Sampson
f835cca235 Expand changelog for #3329 2019-07-15 09:51:18 -04:00
Adrian Sampson
cf3c1b9386 Merge pull request #3329 from zsinskri/command-output-stderr
util.command_output: return stderr, too
2019-07-15 09:47:53 -04:00