-
-
Notifications
You must be signed in to change notification settings - Fork 211
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add soundcloud metadata index (#2929)
* Soundcloud Metadata Cache Improvements Use endpoints that provide a richer set of attributes for tracks. * Add release_year, release_month and release_day columns * Add soundcloud metadata index Create soundcloud metadata index considering that it does not have albums.
- Loading branch information
Showing
8 changed files
with
248 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
from typing import Optional | ||
|
||
from listenbrainz.labs_api.labs.api.metadata_index import BaseMetadataIndexOutput | ||
|
||
|
||
class SoundCloudIdFromMBIDOutput(BaseMetadataIndexOutput): | ||
soundcloud_track_ids: Optional[list[str]] |
19 changes: 19 additions & 0 deletions
19
listenbrainz/labs_api/labs/api/soundcloud/soundcloud_from_mbid_lookup.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
from listenbrainz.labs_api.labs.api.metadata_index.metadata_index_from_mbid_lookup import MetadataIndexFromMBIDQuery | ||
from listenbrainz.labs_api.labs.api.soundcloud import SoundCloudIdFromMBIDOutput | ||
|
||
|
||
class SoundCloudIdFromMBIDQuery(MetadataIndexFromMBIDQuery): | ||
""" Query to lookup soundcloud track ids using recording mbids. """ | ||
|
||
def __init__(self): | ||
super().__init__("soundcloud") | ||
|
||
def names(self): | ||
return "soundcloud-id-from-mbid", "SoundCloud Track ID Lookup using recording mbid" | ||
|
||
def introduction(self): | ||
return """Given a recording mbid, lookup its metadata using canonical metadata | ||
tables and using that attempt to find a suitable match in SoundCloud.""" | ||
|
||
def outputs(self): | ||
return SoundCloudIdFromMBIDOutput |
21 changes: 21 additions & 0 deletions
21
listenbrainz/labs_api/labs/api/soundcloud/soundcloud_from_metadata_lookup.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from listenbrainz.labs_api.labs.api.metadata_index.metadata_index_from_metadata_lookup import \ | ||
MetadataIndexFromMetadataQuery | ||
from listenbrainz.labs_api.labs.api.soundcloud import SoundCloudIdFromMBIDOutput | ||
|
||
|
||
class SoundCloudIdFromMetadataQuery(MetadataIndexFromMetadataQuery): | ||
""" Query to lookup soundcloud track ids using artist name, release name and track name. """ | ||
|
||
|
||
def __init__(self): | ||
super().__init__("soundcloud") | ||
|
||
def names(self): | ||
return "soundcloud-id-from-metadata", "SoundCloud Track ID Lookup using metadata" | ||
|
||
def introduction(self): | ||
return """Given the name of an artist, the name of a release and the name of a recording (track) | ||
this query will attempt to find a suitable match in SoundCloud.""" | ||
|
||
def outputs(self): | ||
return SoundCloudIdFromMBIDOutput |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.