Commit graph

59 commits

Author SHA1 Message Date
Michael Krieger
b1c87cd98c Change parameter name, add return, add tests
Change the parameter name to omit_single_disc (vs previously zero_disc_if_single_disc)

Add return of 'fields_set' so that, if triggered by the command line `beets zero`, it will still effect the item.write.

Added tests.
2025-10-14 03:17:34 +01:00
Michael Krieger
5fc15bcfa4 Misc formatting changes 2025-10-14 03:17:34 +01:00
Michael Krieger
33b350a612 Adds a zero_disc_if_single_disc to the zero plugin
Adds a zero_disc_number_if_single_disc boolean to the zero plugin for writing to files. Adds the logic that, if disctotal is set and there is only one disc in disctotal, that the disc is not set.

This keeps tags cleaner, only using disc on multi-disc albums. The disctotal is not touched, particularly as this is not usually displayed in most clients.

The field is removed only for writing the tags, but the disc number is maintained in the database to avoid breaking anything that may depend on a disc number or avoid possible loops or failed logic.
2025-10-14 03:17:34 +01:00
Šarūnas Nejus
d93ddf8dd4
Do not use explicit indices for logging args when not needed 2025-08-30 23:10:21 +01:00
Šarūnas Nejus
7cada1c9f8
Remove no-op decargs 2025-07-08 11:37:33 +01:00
Sebastian Mohr
68acaa6470 Renamed all action occurrences with Action. 2025-05-13 13:01:46 +02:00
Šarūnas Nejus
c490ac5810
Fix formatting 2025-05-07 10:41:01 +01:00
Šarūnas Nejus
85a17ee503
Reformat the codebase 2024-09-21 11:57:48 +01:00
Serene-Arc
a6e5201ff3 Apply formatting tools to all files
This is 'the big one', which touches every file so that it all conforms
to the given standard.
2023-10-22 09:53:18 +10:00
Andrew Rogl
ee4268dabb Remove unused imports
Fix imports
Fix formatting
2021-08-26 20:59:48 +10:00
Andrew Rogl
1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Carl Suster
6382c364e2 confit: replace with confuse in plugins 2019-06-01 10:03:41 +10:00
Carl Suster
546bf3af7e mediafile: import from standalone module 2019-05-29 09:35:14 +10:00
nath@home
8e29a3ffcb Zero: Last minute unimportant fixes:
*Remove the artifact of a debug log.
*Remove meaningless version number.
*Rephrase some docstrings.
*Remove tautological comments.
2016-12-27 19:13:29 +01:00
Josh Brown
b6577b4226 refactor long line for PEP8 2016-12-26 14:42:10 -06:00
Josh Brown
7833469261 add confirmation for empty query 2016-12-26 14:13:01 -06:00
Josh Brown
2903925e2f Rewrite zero plugin manual mode 2016-12-26 13:34:34 -06:00
nathdwek@laptop
96d331ace0 Zero: cleanup plugin 2016-12-24 19:13:10 +01:00
Johnny Robeson
fcbfce3984 replace deprecated log.warn() with log.warning() 2016-08-09 00:33:38 -04:00
Johnny Robeson
e8afcbe7ec replace unicode with six.text_type 2016-06-24 05:53:49 -04: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
Peter Kessen
feab3df910 Removed import of unicode_literals from plugins
* mpdstats
* mpdupdate
* permissions
* zero
2016-02-20 14:12:37 +01:00
Jack Wilsdon
12cd5306b7 Update copyright dates to 2016 2015-12-30 15:42:06 +00: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
8c35a24073 zero: Check for conflicts only once (#1641)
The old version would trigger the warning twice.
2015-10-17 14:39:53 -07:00
Adrian Kowalski
d180d42ddb Fix flake8 complaint about line length 2015-10-12 09:50:12 +02:00
Adrian Kowalski
da655534ae Change function name and correct documentation style 2015-10-12 09:39:20 +02:00
Adrian Kowalski
158486319f Improve code quality, separate shared logic into functions 2015-10-09 21:23:59 +02:00
Adrian Kowalski
9f51e46bae Add whitelist feature to zero plugin 2015-10-09 18:41:42 +02:00
David Logie
71d3be238b zero: optionally update tags in the database. 2015-07-21 16:54:23 +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
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
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
e14a54df05 Convert multiple plugins' logger usage (easy ones)
Those plugins only called methods and no function, which eases the
conversion.
2015-01-06 21:34:13 +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
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
Thomas Scholtes
e2b2a505fc zero: Can delete embedded images
Fixes #1100.
2014-12-01 17:33:45 +01:00
Thomas Scholtes
db391c8f20 zero: Only changes media file tags not database
Uses the new API from the previous commit and fixes #963.

There is a possible issue with backwards compatibility: Changes to the
item in the 'write' event do not propagate to the tags anymore. But I'm
not aware of other plugins that use the API in that way.
2014-09-17 12:17:20 +02:00
Thomas Scholtes
492cf38927 Use item[field] instead of getattr(item, field) 2014-09-14 16:13:35 +02:00
Bruno Cauet
469ec40c0f Zero plugin: do not zero important fields
Prevent zeroing fields id, album_id and path.

Fix issue #475.
2014-06-08 17:26:17 +02:00
Adrian Sampson
fb37be44db restore some comments from #684
I wanted to leave a few of these as comments -- they serve more as separators
than as internal documentation.
2014-04-13 17:43:43 -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
c27d26ddbf Refactor zero plugin 2014-04-10 22:01:04 +02:00
Thomas Scholtes
f6f974ec87 Remove ITEM_* constants
We might consider renaming `Item._fields` to `Item.fields` since other parts of
beets use it as a replacement for `ITEM_KEYS`.

See also #650.
2014-04-10 17:11:21 +02:00
Adrian Sampson
9a6b6240d0 zero: fix nulling fields containing None 2013-06-01 17:28:59 -07:00
Adrian Sampson
e6ea6dc875 zero: remove redundant list of dict's keys 2013-01-31 12:15:18 -08:00
Adrian Sampson
58d9a775cc remove singleton enforcement from plugins
The plugin system itself now enforces single instances.
2013-01-31 12:13: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