-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Empty metadata support for autotagger plugins #6065
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a27cf64
e5d5ce1
a280237
ddca7c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -231,7 +231,10 @@ def get_track_from_album( | |
| return track_info | ||
|
|
||
| def item_candidates( | ||
| self, item: Item, artist: str, title: str | ||
| self, | ||
| item: Item, | ||
| artist: str, | ||
| title: str, | ||
| ) -> Iterable[TrackInfo]: | ||
| albums = self.candidates([item], artist, title, False) | ||
|
|
||
|
|
@@ -291,6 +294,15 @@ def get_albums(self, query: str) -> Iterable[AlbumInfo]: | |
| # can also negate an otherwise positive result. | ||
| query = re.sub(r"(?i)\b(CD|disc|vinyl)\s*\d+", "", query) | ||
|
|
||
| # query may be empty strings | ||
| # We want to skip the lookup in this case. | ||
| if not query.strip(): | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't like this logic being duplicated in every data source. Can we not check this in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we can't move this logic easily. Some metadataplugins do not require artist or title/album at all. We can't move the check one layer up as this would break plugins only depending on item. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems like this logic is present in all internal plugins. I also don't see a use case in When does There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have a look at chroma. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Completely forgot about this one 😞 |
||
| self._log.debug( | ||
| "Empty search query after preprocessing, skipping {.data_source}.", | ||
| self, | ||
| ) | ||
| return [] | ||
|
|
||
| try: | ||
| results = self.discogs_client.search(query, type="release") | ||
| results.per_page = self.config["search_limit"].get() | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.