Skip to content

Commit

Permalink
Merge pull request #4 from amogus07/patch-1
Browse files Browse the repository at this point in the history
Patch 1
  • Loading branch information
amogus07 authored Aug 22, 2024
2 parents f214448 + 3fd4ae1 commit 38d51ba
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion beetsplug/touhoudb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class TouhouDBPlugin(VocaDBPlugin):
def __init__(self):
super().__init__()
self.db_name = "TouhouDB"
self.data_source = "TouhouDB"
self.base_url = "https://touhoudb.com/"
self.api_url = "https://touhoudb.com/api/"
self.subcommand = "tdbsync"
2 changes: 1 addition & 1 deletion beetsplug/utaitedb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
class UtaiteDBPlugin(VocaDBPlugin):
def __init__(self):
super().__init__()
self.db_name = "UtaiteDB"
self.data_source = "UtaiteDB"
self.base_url = "https://utaiteadb.net/"
self.api_url = "https://utaitedb.net/api/"
self.subcommand = "udbsync"
20 changes: 10 additions & 10 deletions beetsplug/vocadb.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class VocaDBPlugin(BeetsPlugin):
def __init__(self):
super().__init__()
self.db_name = "VocaDB"
self.data_source = "VocaDB"
self.base_url = "https://vocadb.net/"
self.api_url = "https://vocadb.net/api/"
self.subcommand = "vdbsync"
Expand All @@ -29,7 +29,7 @@ def __init__(self):
)

def commands(self):
cmd = ui.Subcommand(self.subcommand, help=f"update metadata from {self.db_name}")
cmd = ui.Subcommand(self.subcommand, help=f"update metadata from {self.data_source}")
cmd.parser.add_option(
"-p",
"--pretend",
Expand Down Expand Up @@ -84,10 +84,10 @@ def singletons(self, lib, query, move, pretend, write):
)
continue
if not (
item.get("data_source") == self.db_name and item.mb_trackid.isnumeric()
item.get("data_source") == self.data_source and item.mb_trackid.isnumeric()
):
self._log.debug(
"Skipping non-{0} singleton: {1}", self.db_name, item_formatted
"Skipping non-{0} singleton: {1}", self.data_source, item_formatted
)
continue
track_info = self.track_for_id(item.mb_trackid)
Expand Down Expand Up @@ -116,10 +116,10 @@ def albums(self, lib, query, move, pretend, write):
continue
items = list(album.items())
if not (
album.get("data_source") == self.db_name and album.mb_albumid.isnumeric()
album.get("data_source") == self.data_source and album.mb_albumid.isnumeric()
):
self._log.debug(
"Skipping non-{0} album: {1}", self.db_name, album_formatted
"Skipping non-{0} album: {1}", self.data_source, album_formatted
)
continue
album_info = self.album_for_id(album.mb_albumid)
Expand Down Expand Up @@ -183,12 +183,12 @@ def albums(self, lib, query, move, pretend, write):

def track_distance(self, item, info):
"""Returns the track distance."""
return get_distance(data_source=self.db_name, info=info, config=self.config)
return get_distance(data_source=self.data_source, info=info, config=self.config)

def album_distance(self, items, album_info, mapping):
"""Returns the album distance."""
return get_distance(
data_source=self.db_name, info=album_info, config=self.config
data_source=self.data_source, info=album_info, config=self.config
)

def candidates(self, items, artist, album, va_likely, extra_tags=None):
Expand Down Expand Up @@ -383,7 +383,7 @@ def album_info(self, release, search_lang=None):
language=language,
genre=genre,
media=media,
data_source=self.db_name,
data_source=self.data_source,
data_url=data_url,
)

Expand Down Expand Up @@ -446,7 +446,7 @@ def track_info(
medium=medium,
medium_index=medium_index,
medium_total=medium_total,
data_source=self.db_name,
data_source=self.data_source,
data_url=data_url,
lyricist=lyricist,
composer=composer,
Expand Down

0 comments on commit 38d51ba

Please sign in to comment.