diff --git a/beetsplug/touhoudb.py b/beetsplug/touhoudb.py index 82bdbfc..ab225a3 100644 --- a/beetsplug/touhoudb.py +++ b/beetsplug/touhoudb.py @@ -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" diff --git a/beetsplug/utaitedb.py b/beetsplug/utaitedb.py index dc49147..4e62141 100644 --- a/beetsplug/utaitedb.py +++ b/beetsplug/utaitedb.py @@ -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" diff --git a/beetsplug/vocadb.py b/beetsplug/vocadb.py index bfe276c..48c214d 100644 --- a/beetsplug/vocadb.py +++ b/beetsplug/vocadb.py @@ -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" @@ -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", @@ -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) @@ -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) @@ -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): @@ -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, ) @@ -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,