Commit graph

268 commits

Author SHA1 Message Date
Jack Wilsdon
f09088df43
replaygain: Handle invalid XML output from bs1770gain 2019-05-02 01:24:19 +01:00
Samuel Nilsson
93007bfdd5 ReplayGain: fixed error caused by per_disc option 2019-02-06 13:17:34 +01:00
Samuel Nilsson
24f02cb5cd ReplayGain refactoring 2019-02-06 10:12:06 +01:00
Samuel Nilsson
31326ebb20 Simplified album ReplayGain code 2019-02-06 10:06:48 +01:00
Samuel Nilsson
d910ed3ecf Merge branch 'master' of github.com:beetbox/beets into replaygain 2019-02-06 09:27:45 +01:00
Samuel Nilsson
3d842db8d8 Added per disc album_gain support 2019-02-06 09:27:24 +01:00
Jack Wilsdon
768770d561
Fix incorrect indentation 2019-01-31 00:15:42 +00:00
Martin Haaß
a3770686b4 to fix the peak calculation also delete the division 2018-08-20 23:39:34 +02:00
Martin Haaß
f58f03dbfd replaygain: albumpeak on large collections is calculated as average, not maximum (bug 3008) 2018-08-20 23:06:11 +02:00
Adrian Sampson
7d607b4c5d Merge pull request #2813 from autrimpo/issue2757
Use NullPaddedInt for R128 tags
2018-05-31 10:13:20 -04:00
Cédric Schieli
b9bac391a9
Really fix album replaygain calculation with gstreamer backend.
Fixes #2845
2018-03-19 21:09:35 +01:00
Michal Koutenský
8350ed6baf Unique debug messages for R128 functions 2018-02-18 20:09:58 +01:00
Adrian Sampson
b28e0b43ff Merge pull request #2778 from ylep/replaygain-options
Add --force, --write and --nowrite options to replaygain plugin
2018-01-02 14:50:27 -05:00
Yann Leprince
499cd378b7 fix the default write behaviour to the importer configuration 2018-01-02 12:11:47 +01:00
Yann Leprince
3ef4b70439 Fix coding style 2017-12-31 14:51:14 +01:00
Yann Leprince
1f6335581e Add --force, --write and --nowrite options to replaygain plugin 2017-12-31 12:00:02 +01:00
Yann Leprince
05775ccac6 Fix fragile parsing of bs1770gain output
bs1770gain is sorting the filenames internally, so in some corner cases it returns the results in a different order from the command-line arguments.

This patch uses the --xml option of bs1770gain (introduced in 0.4.6) in order to read the filenames reliably.
2017-12-31 11:27:42 +01:00
Heinz Wiesinger
bd6645d135 Fix album replaygain calculation with gstreamer backend.
Fixes #2636
2017-10-04 20:22:01 +02:00
Michal Koutenský
70a2ad354b fixes issue #2615 2017-07-04 15:53:02 +02:00
Michal Koutenský
2685f13315 replaygain: support r128 2017-05-17 21:48:01 +02:00
Adrian Sampson
998e6ac1c7 Remove unused import 2017-01-10 14:54:17 -05:00
Adrian Sampson
bc93a11141 Fix #2382: replaygain backend parsing on Python 3 2017-01-10 14:45:57 -05:00
Adrian Sampson
153b01e5a6 replaygain: Don't muck with logging level
This is now handled by the central logging infrastructure; no need to change
it here. I think this must be a leftover from the era when plugins had to
explicitly muck with their verbosity level, but even still it doesn't make
sense to do set the level to INFO unconditionally...
2017-01-10 14:24:18 -05:00
Johnny Robeson
3db656a685 use py3_path on gstreamer location prop setters
Location properties require strings, so we give them to them!
2016-09-24 01:16:56 -04:00
Johnny Robeson
7a2bdf502f s/utf8/utf-8/ in all encoding/decoding contexts
This matches up with the python documentation.
2016-09-06 23:10:24 -04:00
Johnny Robeson
6bedbd84df removebyte conversion/literals for command args
Paths are obviously untouched.

We definitely don't need these as they are entirely ascii.
2016-08-25 03:37:30 -04:00
Johnny Robeson
fb78830788 fix incorrect bytes() usages in replaygain
We encode the method and gain offset values to ascii.
2016-08-09 05:17:53 -04:00
Adrian Sampson
5e3bbf2aeb Remove remaining links to Google Code (fix #2145) 2016-07-27 13:32:41 -04:00
Johnny Robeson
c9c37a8f79 adding missing b' to command name checks in replaygain 2016-07-07 03:44:19 -04:00
Adrian Sampson
5efd5b21c5 Use new as_str method
Instead of `get(six.text_type)`, which was a surprisingly large portion of our
uses of six.
2016-06-25 19:16:14 -07:00
Johnny Robeson
e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04:00
Johnny Robeson
31cca684f2 replace itertools.izip with zip from six.moves 2016-06-23 04:40:18 -04:00
Adrian Sampson
351b6f8c9d Remove raw Unicode literals (fix #2069)
PEP 414 didn't add `ur"..."` literals to Python 3. So for hybrid 2/3
compatibility, these had to be replaced with ordinary Unicode string literals.
This was only painful for one string; the others were only raw strings by
convention. (All were regexes.)
2016-06-21 14:29:14 -07:00
Johnny Robeson
0f4b907ff5 wrap filter()s in a list() in replaygain plugin 2016-06-14 00:28:46 -04:00
pszxzsd
8dcd50b18f make bs1770gain calculate sample peak instead of true peak 2016-06-01 20:00:08 +02:00
Johnny Robeson
e6ab231f72 Revert "Remove bytes casting for non-path command args/opts"
This reverts commit 2a6e74bc27.
2016-05-30 22:00:42 -04:00
Johnny Robeson
2a6e74bc27 Remove bytes casting for non-path command args/opts 2016-05-30 21:42:44 -04:00
Adrian Sampson
eac7d64545 Merge branch 'master' into no_unicode_literals 2016-02-28 15:21:43 -08:00
Adrian Sampson
e54c7eec3d Standardize __future__ imports without parentheses
Since the list is short enough now, we don't need parentheses for the line
wrap. This is a little less ugly.
2016-02-28 15:03:51 -08:00
Adrian Sampson
d53019f9db Further whitespace fiddling
Most commonly, this sticks with:

    log.debug(
        'some long message here'
    )

instead of placing the closing ) at the end of the string literal.
2016-02-28 14:48:10 -08:00
Peter Kessen
456565b6f2 Removed import of unicode_literals from plugins
* play
* plexpudate
* random
* replaygain
2016-02-20 14:22:45 +01:00
Adrian Sampson
314521b6ae replaygain: Fix obvious typo (fix #1873, I hope) 2016-02-07 14:28:33 -08:00
Adrian Sampson
0aea7e398b replaygain: Handle missing GStreamer data (#1855) 2016-02-02 08:08:58 -08:00
Diego Moreda
76d7c65c1b replaygain: refine test by subclassing exception
* Subclass FatalReplayGainError into FatalGstreamerPluginReplayGainError
in order to handle gstreamer plugin errors more cleanly on
test_replaygain.
2016-01-26 22:20:42 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00:00
Adrian Sampson
b25b4db9e1 replaygain: Dodge possible encoding issues
In error reporting. May avoid the error in #1774, but it's hard to find out
exactly what the Python types of these arguments are from the GStreamer
documentation.
2015-12-26 22:40:13 -08:00
Peter Kessen
3eb8008b11 added encoding as comment in files
added line like
# -*- coding: utf-8 -*-
to all files with correct license in header
2015-11-19 18:41:01 +01:00
Adrian Sampson
9f7aa866bd Use ui.should_write everywhere
There sure are a lot of plugins that want to write metadata!
2015-11-07 13:20:09 -08:00
Adrian Sampson
16ad174d29 A debug message for ReplayGain 2015-10-29 17:43:31 -04:00
Adrian Sampson
225ba282cd Fix #1592 again: wrap title_gain in handler 2015-09-08 12:07:03 -07:00
Adrian Sampson
2140bb27a3 Fix #1592: unhandled exception in PyAudioTools 2015-09-07 14:15:46 -07:00
Adrian Sampson
493fbab1a5 replaygain: Fix #1518, GStreamer missing plugins 2015-07-06 16:23:04 -07:00
jmwatte
c834599b42 fix regex 2015-04-13 10:46:47 +02:00
Adrian Sampson
7372ad4831 replaygain: Log bs1770gain invocations
For clearer debugging in #1398.
2015-04-12 23:01:44 -07:00
Adrian Sampson
ab78eed02e replaygain: Avoid suppressing debug output (#1398)
This was suppressing debug output even with `beet -vv import`. This also avoid
registering an import hook when auto is disabled.
2015-04-12 22:59:48 -07:00
Adrian Sampson
9c7b8d22ca Catch empty output list in bs1770gain (fix #1398)
This should catch the original crash that brought this all up.
2015-04-10 09:01:13 -07:00
Adrian Sampson
6fcd88bc31 More precise comment for #1398 2015-04-10 08:53:54 -07:00
jmwatte
7128340385 fix no-PREFIX for long window-paths 2015-04-10 09:26:56 +02:00
Adrian Sampson
821c5bf3df Documentation pass for #1398 2015-04-09 17:06:35 -07:00
Adrian Sampson
ecb65a5a4a Idiomatic configuration defaults (#1398)
Paging @jmwatte: `config.add` is the standard way to specify defaults for
configuration options.
2015-04-09 16:55:18 -07:00
jmwatte
51cfde4e9d fix bs1770gain for windows and exceptionally big albums 2015-04-09 18:48:37 +02:00
jmwatte
7ac6ba53ff fix bs1770gain for windows and exceptionally big albums 2015-04-09 18:02:32 +02:00
jmwatte
f1f7094938 fix bs1770gain for windows and exceptionally big albums 2015-04-09 17:18:26 +02:00
Adrian Sampson
736eab412c Bytes arguments to bs1770gain command 2015-03-14 14:43:00 -07:00
Bruno Cauet
58b39f1000 Merge branch 'master' into subcommand-auto-format-path 2015-03-05 17:53:31 +01:00
Bruno Cauet
650305c9a1 All suitable plugins use CommonOptionsParser features 2015-03-05 17:03:02 +01:00
Bruno Cauet
9750351a1b beets.util.command_output() & related receives bytes
- May fail with unicode, esp. will non-ascii system path entry.
- Only send it bytes.
- Also applies to subprocess.Popen() & co.
2015-03-04 15:15:46 +01:00
Adrian Sampson
8113c7ba85 Roll back whitespace changes from #1343 2015-03-03 10:41:30 -08:00
jmwatte
5d7d402adb correct typing error 2015-03-03 13:11:25 +01:00
jean-marie winters
a3e32fd410 added fatalreplaygainerror 2015-03-03 11:23:45 +01:00
jean-marie winters
80c49ab360 removed line 288 2015-03-03 11:04:03 +01:00
jean-marie winters
0d49c830d8 just an updateMerge remote-tracking branch 'upstream/master' 2015-03-03 10:49:35 +01:00
jean-marie winters
5bc8ef7009 fix some formating 2015-03-02 22:11:33 +01:00
Adrian Sampson
8bd0633496 replaygain: Fix super call in AudioTools
Fix #1342.
2015-03-02 11:30:14 -08:00
jean-marie winters
1416846283 Merge branch 'bs1770gainsupport'
Conflicts:
	beetsplug/replaygain.py
2015-03-02 16:34:46 +01:00
jean-marie winters
72c5db8876 add doc, clean-up code 2015-03-02 15:38:33 +01:00
jean-marie winters
1385ce11ca Added support for bs1770gain, a loudness-scanner 2015-02-28 15:35:48 +01:00
Arturo R
60b1819db0 Stop applying mp3gain directly to files. Fixes #1316
Update docs to remove non-existent `apply` option.
2015-02-09 12:51:27 -08:00
Adrian Sampson
b8dab9cf9f Merge pull request #1247 from brunal/future
Use all __future__ imports in beets core

Conflicts:
	beetsplug/web/__init__.py
	test/test_embedart.py
2015-01-26 17:02:07 -08:00
Bruno Cauet
8165dec985 Delete manual formattings of album & item 2015-01-25 21:32:22 +01:00
Bruno Cauet
a5026100a3 All plugins use unicode_literals
Given that part of them has no test I may have broke them
2015-01-20 16:22:27 +01:00
Bruno Cauet
02d8e88ef1 Replace all mentions of 'str' with 'bytes' 2015-01-20 12:48:15 +01:00
Bruno Cauet
90b388b775 Use __future__ imports but unicode_literals everywhere
Include import of __future__ features division, absolute_imports and
print_function everywhere. Don't add unicode_literals yet for it is
harder to convert.

Goal is smoothing the transition to python 3.
2015-01-19 12:25:16 +01:00
Bruno Cauet
0c3675ada0 Fix replaygain: add 'log' to __init__ parameters 2015-01-14 16:17:20 +01:00
Adrian Sampson
24317fd4c7 Rename BeetsPlugin._import_stages to import_stages
For #1208. Restores backwards-compatibility and matches the development docs.
2015-01-11 14:27:59 -08:00
Bruno Cauet
b27c5304d1 Merge branch 'master' into logging
Conflicts:
	beetsplug/fetchart.py
	beetsplug/mpdstats.py
2015-01-09 15:15:27 +01:00
Frederik “Freso” S. Olesen
4b1f0cbf48 Happy 2015. ;)
See 7a410f636b

Command used:

    git grep -l 'Copyright 201'|xargs sed -i -E 's/Copyright 201./Copyright 2015/'`
2015-01-08 21:37:09 +01:00
Bruno Cauet
422a7f6063 replaygain: fix backend instanciation 2015-01-06 22:13:17 +01:00
Bruno Cauet
7d58a38428 Convert replaygain: pass logger to other classes
This time the logger is passed to the other classes of the module, not
to functions.
2015-01-06 21:42:02 +01:00
Bruno Cauet
427f7e7035 Automatic logger level changes on import
Breaking changes: plugins should set set _import_stages instead of
import_stages. From outside the latter is replaced by import_stages().
This is because it is now wrapped with log level-getting & -setting
statements.
2015-01-06 21:27:15 +01:00
Bruno Cauet
b8211a3c4c Every plugin uses its own logger
logging.getLogger(__name__) everywhere!
Several loggers prefixed every log message with [logername], which we
delete here.
2015-01-06 10:35:44 +01:00
Bruno Cauet
30f158a95e Move "from beets import logging" statements
Move the import next to other beets-related imports
2015-01-05 10:05:21 +01:00
Bruno Cauet
7df8bef8b7 Update logging imports: logging → beets.logging 2015-01-04 17:02:27 +01:00
Bruno Cauet
8cac47af2a Convert beets plugins to lazy logging 2015-01-04 17:02:27 +01:00
Adrian Sampson
0d529bae16 Docs tweaks for #1078 2014-11-11 11:57:08 -08:00
Francesco Rubino
2a9064ee21 Fixed format of comments and docstrings. 2014-11-11 18:44:09 +00:00
Francesco Rubino
df1503e2ca Added comments/docstrings to the AudioToolsBackend in the replaygain plugin 2014-11-11 18:11:22 +00:00
Adrian Sampson
05d5edcd0e Quiet down logging in #1070
This looks mostly helpful for debugging but redundant with the ordinary
logging.
2014-11-09 18:41:54 -08:00
Francesco Rubino
4bf17486eb Fixed line lengths, typo in documentation. 2014-11-09 10:29:46 +00:00
Francesco Rubino
8af5b0e6c3 Added backed audiotools to replaygain module and updated documentation 2014-11-07 18:14:56 +00:00
Adrian Sampson
c5293df963 replaygain: More descriptive backend errors
This avoids a bare `except:` to catch specific errors and give better messages
when they fail. Should provide more insight to this trouble:
https://groups.google.com/d/msg/beets-users/6d-TOg0SuPY/iL39tmo3rqUJ

Also related to #874.

Feedback from @yevgenybezman or others more familiar with the backend would be
welcome.
2014-10-09 12:26:53 -07:00
Adrian Sampson
84c0f909b6 replaygain: Check for bad mp3gain output (#961) 2014-09-15 10:25:57 -07:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
65de93941d flake8 cleanup
Cleanup after cleanup
2014-09-09 11:28:43 +10:00
e5e4eaeacd39c5cfba4d7c852c48277ae50331e6
66aee8094f Clean up of logging messages as described here
All logging now prefers the ' (single quote) over the " (double quote)

https://github.com/sampsyo/beets/wiki/Hacking
2014-09-09 11:28:43 +10:00
Yevgeny Bezman
2f9fe91121 replaygain: restore flake8 cleanliness 2014-06-27 20:02:11 +03:00
Yevgeny Bezman
b019e6a5c0 replaygain: silenced errors during import. Fixes #732 2014-06-27 19:50:41 +03:00
Adrian Sampson
32a3da5961 Clarify dependencies for RG GStreamer backend 2014-05-17 13:21:55 -07:00
Adrian Sampson
54445882d8 replaygain: Log when files are unsupported 2014-04-29 10:23:07 -07:00
Thomas Scholtes
e96753f96a Plugins use import_task.album 2014-04-25 13:52:03 +02:00
Yevgeny Bezman
e82147ce6d replaygain: added missing import 2014-04-17 21:32:12 +03:00
Yevgeny Bezman
bfac8cf84f replaygain: ignoring deprecation warning for threads_init in newer gi versions. Fixes #697 2014-04-17 20:06:03 +03:00
Thomas Scholtes
ea04344560 Test and fix unicode issues in logs. Fixes #699
The helper functions for creating test fixtures now include unicode characters.
2014-04-17 12:12:49 +02:00
Adrian Sampson
033cf9ec21 spell check 2014-04-15 21:17:23 -07:00
Adrian Sampson
9fd0e1d3fe fix #687: template indexes in logging statements 2014-04-14 10:35:20 -07:00
Fabrice Laporte
3ead936fe5 flake8 cleaning beetsplug/*
Remaining warnings are related to visual indentation.
2014-04-13 23:24:57 +02:00
Thomas Scholtes
c3ea1ded30 Add item.try_write() to log errors
Many commands and plugins use `item.write()` to update tags. Since the success
of the call is not critical to the functionality of most consumers we want to
catch any exceptions, log an error and continue with our task. The new method
encapsulates this logic.

This fixes #675.
2014-04-10 15:26:05 +02:00
Thomas Scholtes
1c598d4cee Add replaygain target level for gstreamer 2014-04-04 22:42:17 +02:00
Thomas Scholtes
81a2433e9d Use GLib.MainLoop instead of deprecated GObject 2014-04-04 19:46:43 +02:00
Thomas Scholtes
81f53fb0d2 Add basic cli tests for replaygain 2014-04-04 19:44:16 +02:00
Yevgeny Bezman
cf49d88156 replaygain: clarified the need to strange thread initialization| 2014-04-04 20:20:14 +03:00
Yevgeny Bezman
d8c37d6ca3 replaygain: Added a FatalReplayGainError class to signal the plugin that the backend failed completely 2014-04-04 19:17:41 +02:00
Thomas Scholtes
a5bdbdcf7f Move available backends to class level
See also https://github.com/sampsyo/beets/issues/650
2014-04-04 19:17:41 +02:00
Thomas Scholtes
439fc1938f Remove debug print statements 2014-04-04 19:17:41 +02:00
Thomas Scholtes
89680d835a Refine docstrings and fix style issues (flake8) 2014-04-04 19:17:41 +02:00
Yevgeny Bezman
6aa1cc95cb replaygain: Improved error handling 2014-04-04 19:17:41 +02:00
Yevgeny Bezman
2d9f40d62d replaygain: fixed small errors introduced by previous refactor. Commented the code in key parts. 2014-04-04 19:17:41 +02:00
Adrian Sampson
08b2bff28d eliminate GStreamer globals and initialize_config 2014-04-04 19:17:41 +02:00
Adrian Sampson
2369122075 minor Python style; move namedtuples to module 2014-04-04 19:17:41 +02:00
Yevgeny Bezman
d2c6d00b7b replaygain: Added some informative prints, removed hardcoded debug print 2014-04-04 19:17:40 +02:00
Yevgeny Bezman
9581b91e10 replaygain: Added gstreamer support, fixed some small bugs 2014-04-04 19:17:40 +02:00
Yevgeny Bezman
86ee30df0d replaygain: modified current implementation to fit a backend framework in anticipation of other implementations 2014-04-04 19:17:40 +02:00
Adrian Sampson
c7fe017752 remove Library.{move,store} methods
These methods are now provided by LibModel, which makes dealing with items and
albums symmetric.
2013-08-21 15:34:45 -07:00
Adrian Sampson
7779a5c6f5 replaygain: catch Unicode exc on Windows (GC-499)
(grafted from 89cee0e842b4e553790b0db7daaf2fd31d217e15)

--HG--
extra : source : 89cee0e842b4e553790b0db7daaf2fd31d217e15
2013-01-12 14:38:19 -08:00
Adrian Sampson
7a410f636b happy new year
For future reference, this command did the trick:
ack -l 'Copyright 201' | xargs perl -pi -E 's/Copyright 201./Copyright 2013/'
2013-01-11 10:43:41 -08:00
Adrian Sampson
6d68a4855e per-plugin configuration defaults in __init__()
This uses the new BeetsPlugin.config convenience view heavily. Things are
slowly getting less verbose.
2012-12-18 22:35:44 -08:00
Adrian Sampson
3ef9e006f4 finish confit-ifying all the plugins 2012-12-13 17:14:19 -08:00
Adrian Sampson
6c94358b13 begin Confit-ifying plugins in alphabetical order 2012-12-13 12:31:10 -08:00
Adrian Sampson
2d4b91fa6d replaygain: handle RG tool invocation errors (GC-469) 2012-12-11 13:09:10 -08:00
Adrian Sampson
531025f799 replaygain: restrict file formats (GC-469) 2012-12-11 13:06:57 -08:00
Adrian Sampson
ad9021b9d9 replaygain: normalize peaks to 2^15 (closes #65) 2012-11-09 16:25:19 -08:00
Adrian Sampson
f4fa11f8ca don't use subprocess.check_output
This function was added in Python 2.7 and we're currently targetting 2.6 as a
minimum version. Replaced with a function in util.
2012-11-01 11:59:02 -07:00
Adrian Sampson
dcb9ad7373 fix several non-unicode logging statements
A user reported a problem with one of the logging statements where .format()
tried to convert a Unicode string to bytes because the log message was '', not
u''. As a rule, we should ensure that all logging statements use Unicode
literals.
2012-10-24 15:14:33 -07:00
Adrian Sampson
9368075756 replaygain: reinstate albumgain config option 2012-10-20 16:49:52 -07:00
Adrian Sampson
848b56e54c replaygain: remove album noclip gain adjustment
as suggested by @kraYmer
2012-10-20 16:41:31 -07:00
Adrian Sampson
2c38c15fb8 replaygain: apply album gain in album mode 2012-10-18 11:33:13 -07:00
Adrian Sampson
0ab3426bd9 replaygain: add command
You can now disable automatic analysis and instead use a command to manually
analyze albums or tracks.
2012-10-17 22:12:38 -07:00
Adrian Sampson
1a261db918 replaygain: style and light refactoring 2012-10-17 21:47:17 -07:00
Adrian Sampson
95910a366b replaygain: run in import stage
This is the "new way" to post-process files on import (superseding the imported
events).
2012-10-17 21:43:27 -07:00
Adrian Sampson
3a4e1ca4f7 replaygain: add fields to Item
This has been a long time coming, but we now finally keep track of ReplayGain
values in the database. This is an intermediate step toward a refactoring of the
RG plugin; at the moment, these values are not actually saved!
2012-10-17 20:28:24 -07:00
Adrian Sampson
83f3069d57 replaygain: remove albumgain setting
We now always calculate album gain when importing an album. This is "free" (no
performance cost) now and players are free to ignore the setting if they so
choose.
2012-10-17 20:11:20 -07:00