feat: implemented search for track

This commit is contained in:
Hellow 2023-09-12 16:30:08 +02:00
parent a45db5cfa9
commit fbc20d7f4d
2 changed files with 16 additions and 5 deletions

View File

@ -29,7 +29,7 @@ if __name__ == "__main__":
]
youtube_music_test = [
"s: hello"
"s: #t Self Loather"
]
music_kraken.cli.download(genre="test", command_list=youtube_music_test, process_metadata_anyway=True)

View File

@ -86,7 +86,18 @@ class Bandcamp(Page):
)
if object_type is BandcampTypes.SONG:
print("NEEDING TO IMPLEMENT SONG")
return Song(
title=name,
source_list=source_list,
main_artist_list=[
Artist(
name=data["band_name"],
source_list=[
Source(self.SOURCE_TYPE, data["item_url_root"])
]
)
]
)
def general_search(self, search_query: str, filter_string: str = "") -> List[DatabaseObject]:
results = []
@ -113,16 +124,16 @@ class Bandcamp(Page):
return results
def label_search(self, label: Label) -> List[Label]:
return self.general_search(artist.name, filter_string="b")
return self.general_search(label.name, filter_string="b")
def artist_search(self, artist: Artist) -> List[Artist]:
return self.general_search(artist.name, filter_string="b")
def album_search(self, album: Album) -> List[Album]:
return self.general_search(artist.name, filter_string="a")
return self.general_search(album.title, filter_string="a")
def song_search(self, song: Song) -> List[Song]:
return self.general_search(artist.name, filter_string="t")
return self.general_search(song.title, filter_string="t")
def fetch_song(self, source: Source, stop_at_level: int = 1) -> Song:
return Song()