Commit graph

90 commits

Author SHA1 Message Date
Šarūnas Nejus
b3d434f58f
Delegate attribute access to logging 2025-08-30 23:10:21 +01:00
Šarūnas Nejus
e334e81d40
Use item.filepath instead of displayable_path in logging 2025-08-30 23:10:21 +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
a7c83d91e9
Replace slightly more advanced attempts to use format calls 2025-08-30 22:35:00 +01:00
Šarūnas Nejus
7cada1c9f8
Remove no-op decargs 2025-07-08 11:37:33 +01:00
J0J0 Todos
47eee070ba duplicates: remove or delete options mutually exclusive
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
2025-07-05 07:22:33 +02:00
J0J0 Todos
537a71ff82 duplicates: Add --remove option to duplicates plugin
Removes from library but keeps files.
2025-07-05 07:17:59 +02:00
Šarūnas Nejus
c490ac5810
Fix formatting 2025-05-07 10:41:01 +01:00
Šarūnas Nejus
f36bc497c8
Fix lint issues
- Fix imports
- Fix pytest issues
- Do not assign lambda as variable
- Use isinstance instead of type to check type
- Rename ambiguously named variables
- Name custom errors with Error suffix
2024-09-21 11:59:18 +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
Adrian Sampson
82d41446a2
Use fsdecode for template substitution
The idea in this PR is to converge on Python's `fsdecode` and `fsencode`
for argument manipulation. This seems to match up with the Python
standard library's assumptions: namely, on Windows, we use `fsdecode` to
get back to Unicode strings:
54bbb5e336/Lib/subprocess.py (L561)

So let's start by dropping this utility and going straight for
`fsdecode` here to match.
2022-10-01 16:37:47 -07: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
wisp3rwind
d6ca1cc242 duplicates: fix crash when query return empty results 2021-06-18 17:18:50 +02:00
Andrew Rogl
39ca5b7be6 Changes as requested 2021-05-23 14:45:02 +10:00
Andrew Rogl
923e3bacd6 Attempt to fix duplicates #2873 2021-05-03 16:03:40 +10:00
Zsin Skri
30395911e2 util.command_output: return stderr, too
Return a namedtuple CommandOutput(stdout, stderr) instead of just stdout from
util.command_ouput, allowing separate access to stdout and stderr.

This change is required by the ffmpeg replaygain backend (GitHub
PullRequest #3056) as ffmpeg's ebur128 filter outputs only to stderr.
2019-07-14 18:32:59 +02:00
Constantine Evans
dd2b44ef20 minor fixes and changelog entry 2017-12-11 13:31:40 -08:00
Constantine Evans
c9b4e9b414 only use tiebreak if tiebreak includes an entry for the kind being considered, otherwise use default (eg, if only items is specified, and -a is being used, use default order of priority 2017-12-10 12:28:47 -08:00
Jonas Wagner
114a6f80da Fix the --key option in the duplicates plugin.
During a refactoring, the "dest='keys'" parameter was lost. This caused
the option to not have any effect.
2017-09-22 20:27:47 +02:00
zigarrre
b376139663 Refactored move functions for clarity according to #2682
The move functions in library.py and manipule_files in importer.py where
changed to use a single parameter for the file operation instead of
multiple boolean flags.

A typo in the documentation of the Album.move and Item.move functions
confusing True and False when describing the store parameter was fixed
as well.
2017-09-11 17:03:44 +02:00
wordofglass
bb5629ea1d Remove untyped except statements 2017-04-29 00:05:20 +02:00
Adrian Sampson
77a6b0edf8 duplicates: Fix 2nd bug in #2444 about path types 2017-02-21 22:00:31 -05:00
Adrian Sampson
d00c0fb5cf Replace varargs_callback in duplicates
Now you just use `-k KEY1 -k KEY2`, which seems more natural to me anyway.
2016-09-10 05:13:06 -04:00
Adrian Sampson
ed8d04f594 Unicode templates in duplicates (fix #2188) 2016-09-07 21:04:05 -04:00
Johnny Robeson
4c4d8cff60 s/get(list)/as_str_seq() for keys in duplicates plugin
stolen from @sampsyo in the click branch
2016-08-17 02:18:48 -04:00
Adrian Sampson
e16cc58cb9 Walk back some six.iter* uses
In places where it doesn't much matter whether we use an iterator or the old
Python 2 list way, using the six name just hurts legibility.
2016-06-25 18:29:55 -07:00
Johnny Robeson
edb1cbc5fc replace iter{items|values} with six.iter{items|values} 2016-06-24 05:53:55 -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
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
5547a82848 Removed unicode_literals from plugin duplicates 2016-02-20 13:26:27 +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
7d52fa72ae Fix #1699: Outdated API call
get_fields() was removed in 5420599839.
2015-11-04 20:25:17 -08:00
Adrian Sampson
f6ecbf659f Silly oversight in fix for #1551 2015-07-28 22:39:53 -07:00
Adrian Sampson
ebf98d7bf0 duplicates: Avoid Unicode-to-bytes comparison
Fix #1551.
2015-07-28 22:36:27 -07:00
Adrian Sampson
5420599839 New all_keys() method on dbcore.Model
Rather than the ad-hoc one on library classes. This also avoids some confusing
duplication in the `beet fields` output, at the cost of turning off the plugin
distinction.
2015-07-28 22:27:43 -07:00
Pedro Silva
3be593693d add merging functionality to duplicates plugin
This patch depends on %aunique not being present in config.paths
for behavior as intended.

The logic surrounding moving/copying a track from a duplicated album to
the original one could probably be extracted out and put into
library.Album.

This is based on the ordering imposed by the tiebreaking facility
introduced in 6be98b0a36. Once a natural
duplicate ordering is in place, then the strategies for merging are:

Items:

Iterate through each available field:
    Iterate through each duplicate:
        If current duplicate has a field not set in the original, set it there
        Break

Albums:

Iterate through each duplicate:
    Iterate through each item in duplicate:
        If current item is not present in original, copy it there
        Continue
2015-05-25 18:12:06 +02:00
Pedro Silva
0377510522 handle albums during default attribute set completeness sorting 2015-05-17 23:56:10 +02:00
Pedro Silva
684f4deadc fix typo during tagging: option -t now actually works 2015-05-17 15:01:48 +02:00
Pedro Silva
6be98b0a36 add tiebreaking facility 2015-05-16 19:25:47 +02:00
Pedro Silva
834418de6d fix #1457: enforce correct config typing 2015-05-15 11:48:27 +02:00
Pedro Silva
82ce6f054d make helper functions methods in plugin
This helps use the _log attribute that is now available
2015-03-28 10:08:07 +01:00
Pedro Silva
9999460cb4 hash attribute values as tuples instead of stringifying on SOH char 2015-03-27 11:48:51 +01:00
Pedro Silva
fb0e03dd6b remove redundant plugin name from logging 2015-03-27 11:47:40 +01:00
Pedro Silva
66e06baca7 fix #1000: provide --strict option (don't match on null attributes) 2015-03-27 11:34:45 +01:00
Bruno Cauet
650305c9a1 All suitable plugins use CommonOptionsParser features 2015-03-05 17:03:02 +01:00
Tom Jaspers
50dbd18493 Duplicates: fix error caused by formatting
Function arguement `format` was shadowing the built-in format function

Fix #1300
2015-02-03 13:31:54 +01:00