Commit Graph
95 Commits
Author SHA1 Message Date
Šarūnas Nejus 0b5a5b0350 typing: fix missing types in plugins 2026-08-31 11:27:12 +01:00
Šarūnas Nejus 11d41aee7d typing: add missing types to plugins 2026-08-31 11:27:12 +01:00
Šarūnas Nejus 6241139600 typing: define explicit optparse.Values for each command 2026-08-19 23:57:05 +01:00
Šarūnas Nejus 14eabc6060 typing: add types to command handlers 2026-08-19 23:57:01 +01:00
Sebastian Mohr 54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Šarūnas Nejus 29580d2f00 Import everything from parent beets.autotag 2026-06-02 08:57:35 +01:00
ShimmerGlass 65ccaf1408 fix(mbsync): do not clear metadata if import.from_scratch is set
if import.from_scratch was set in the config, runnning mbsync would
clear any metadata not provided by MBz (replay gain, lyrics, genres...).
we now ignore this setting when running mbsync to preserve metadata.

Fixes: #6613
2026-05-13 18:06:08 +02:00
Šarūnas Nejus 5fad834ad2 Ensure we use Distance to initialise Match objects 2026-03-22 19:23:53 +00:00
Šarūnas Nejus df6f5c5826 import: simplify tagging item 2026-03-22 19:23:52 +00:00
Šarūnas Nejus 35361a63b6 Require data_source in album_for_id and track_for_id functions
These functions now accept both an ID and data_source parameter,
enabling plugins like mbsync and missing to retrieve metadata from the
correct source.

Update mbsync and missing plugins to use the restored functions with
explicit data_source parameters. Add data_source validation to prevent
lookups when the source is not specified.

Add get_metadata_source helper function to retrieve plugins by their
data_source name, cached for performance.
2026-03-10 00:56:35 +00:00
Šarūnas Nejus c52656fb0a Enable RUF rules 2026-01-13 20:55:40 +00:00
Šarūnas Nejus ea157832fe hooks: make AlbumMatch.mapping a tuple 2025-12-24 11:01:26 +00:00
Sebastian Mohr 3ce33631a6 Renamed import in mbsync and missing plugins. 2025-07-15 15:03:14 +02:00
Šarūnas Nejus afe97cf31e Do not assign args to query 2025-07-08 11:37:34 +01:00
Šarūnas Nejus 7cada1c9f8 Remove no-op decargs 2025-07-08 11:37:33 +01:00
Šarūnas Nejus de0958ca65 Use candidate function from plugins instead of hooks 2025-05-17 03:31:57 +01:00
Šarūnas Nejus 8f209d85b9 Tidy up mbsync logs
No need to call `format` since this is done automatically at the point
the object is logged (if required).
2025-04-14 02:58:58 +01:00
Šarūnas Nejus d1d681c1ff mbsync: support other data sources 2025-04-14 02:28:43 +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 1ec87a3bdd pyupgrade beetsplug and tests
All tests working
More tidy up to be done
2021-08-26 19:12:51 +10:00
Aksh Gupta 79858975a9 chore: refactor code quality issues 2021-03-11 08:45:42 +05:30
Rahul Ahuja ce90b2aae5 Improve documentation 2019-10-05 15:07:20 -07:00
Rahul Ahuja 14b8f30ead Appease flake8 2019-10-03 19:13:40 -07:00
Rahul Ahuja f14137fcc2 Add BPSyncPlugin 2019-10-03 18:04:12 -07:00
Adrian Sampson 8b59b20ef8 Tiny style fix for #3028 2018-09-16 20:56:06 -04:00
Andrew Rogl 865940746c More clean up requests 2018-09-11 18:52:55 +10:00
Andrew Rogl 308dccab95 Address requested changes from Adrian 2018-09-10 20:47:58 +10:00
Andrew Rogl c43a957f46 Clean up flake errors 2018-09-09 15:48:07 +10:00
Andrew Rogl 919f3f9c34 mbsync no longer queries MusicBrainz when the either the mb_albumid or mb_trackid field is invalid 2018-09-09 15:20:26 +10:00
Bin Jin 69d6dfe097 mbsync: fix updating album with invalid first track MBID
MBID of recording could become invalid after merging. The existing
code always copies metadata from first track after updating. But for
albums with invalid track MBID that happens to be the first track,
MusicBrainz changes won't be applied to whole album, only whose
tracks with valid MBID. This is particularly annoying since those
changes are actually displayed for every `beet mbsync` run, but never
get applied.

Fix this issue by finding any track that get MusicBrainz updates, and
apply it to whole album.
2018-05-10 16:38:30 +08:00
Jérémie Detrey 3b03372502 mbsync: Use release-track-id to construct track mapping.
Fixes #1234 by following recording MBIDs changes.
2018-05-08 16:30:07 +02:00
Ivan Shapovalov 4d40b058d3 treewide: add u to instances of 'singleton:true'
Fixes #1901.
2016-03-06 02:12:43 +03: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 48098c3741 Removed import of unicode_literals from plugins
* lastgenere
* mbcollection
* mbsubmit
* mbsync
* missing
2016-02-20 14:08:05 +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 34e6e39fe5 mbsync: Debug logging
Log *something* for each album, so you can tell that it's doing something even
when there are no changes. To help diagnose #1707.
2015-11-07 15:37:13 -08:00
Adrian Sampson 80bfd186ae Use should_write for modify, update, and mbsync
This should address the surprising situation in #1697, where `import` went
fine but then `update` unexpectedly changed filenames.
2015-11-07 13:34:47 -08: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
Bruno Cauet 650305c9a1 All suitable plugins use CommonOptionsParser features 2015-03-05 17:03:02 +01: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 4e904c78af Simplify LibModel format management
Delete `ui.format_` and then `ui.print_obj`. Simply ensure that when
there is no format it defaults to '' = default format = config option.
2015-01-26 23:09:56 +01:00
Bruno Cauet 62cd6e37aa Update ui.print_obj_(), add ui.format_()
Code now relies on `format()` for items and albums displaying/logging.
`ui.print_()` calls `unicode()` or `str()` on the strings so for most
usages calling `ui.print_(obj)` replaces `ui.print_(obj, lib, None)`.

Where there is a special format `ui.print_(format(obj, fmt))` is fine,
but when `fmt` can be None then one has to call
`ui.print_(ui.format_(obj, fmt))` -- which is what `ui.print_obj` now
does.
2015-01-25 21:07:03 +01:00
Bruno Cauet c2f8cb9983 Merge branch 'master' into future
Conflicts:
	test/test_plugins.py
2015-01-21 10:04:33 +01:00
David Logie 99e89a29e2 mbsync: Don't overwrite the format built-in. 2015-01-21 08:05:27 +00:00
David Logie 7db3e1d80c mbsync: Fix bug where singletons always used the album format. 2015-01-21 08:05:27 +00:00
David Logie 2fae94a93a Make the Template object an attribute. 2015-01-21 08:05:26 +00:00
David Logie 3317580296 mbsync: Support custom output format. 2015-01-21 08:05:26 +00: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