mirror of
https://github.com/beetbox/beets.git
synced 2025-12-25 10:05:13 +01:00
Opt in chroma plugin.
This commit is contained in:
parent
b62fb10da8
commit
a770cfb669
1 changed files with 13 additions and 5 deletions
|
|
@ -19,12 +19,14 @@ autotagger. Requires the pyacoustid library.
|
|||
import re
|
||||
from collections import defaultdict
|
||||
from functools import cached_property, partial
|
||||
from typing import Iterable
|
||||
|
||||
import acoustid
|
||||
import confuse
|
||||
|
||||
from beets import config, plugins, ui, util
|
||||
from beets import config, ui, util
|
||||
from beets.autotag.distance import Distance
|
||||
from beets.metadata_plugins import MetadataSourcePlugin, TrackInfo
|
||||
from beetsplug.musicbrainz import MusicBrainzPlugin
|
||||
|
||||
API_KEY = "1vOwZtEn"
|
||||
|
|
@ -168,10 +170,8 @@ def _all_releases(items):
|
|||
yield release_id
|
||||
|
||||
|
||||
class AcoustidPlugin(plugins.BeetsPlugin):
|
||||
class AcoustidPlugin(MetadataSourcePlugin):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
|
||||
self.config.add(
|
||||
{
|
||||
"auto": True,
|
||||
|
|
@ -210,7 +210,7 @@ class AcoustidPlugin(plugins.BeetsPlugin):
|
|||
self._log.debug("acoustid album candidates: {0}", len(albums))
|
||||
return albums
|
||||
|
||||
def item_candidates(self, item, artist, title):
|
||||
def item_candidates(self, item, artist, title) -> Iterable[TrackInfo]:
|
||||
if item.path not in _matches:
|
||||
return []
|
||||
|
||||
|
|
@ -223,6 +223,14 @@ class AcoustidPlugin(plugins.BeetsPlugin):
|
|||
self._log.debug("acoustid item candidates: {0}", len(tracks))
|
||||
return tracks
|
||||
|
||||
def album_for_id(self, *args, **kwargs):
|
||||
# Lookup by fingerprint ID does not make too much sense.
|
||||
return None
|
||||
|
||||
def track_for_id(self, *args, **kwargs):
|
||||
# Lookup by fingerprint ID does not make too much sense.
|
||||
return None
|
||||
|
||||
def commands(self):
|
||||
submit_cmd = ui.Subcommand(
|
||||
"submit", help="submit Acoustid fingerprints"
|
||||
|
|
|
|||
Loading…
Reference in a new issue