mirror of
https://github.com/Dvorinka/SpotifyRecAlg.git
synced 2026-06-05 04:53:02 +00:00
first commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
@dataclass
|
||||
class SimilarArtistEntry:
|
||||
artisthash: str
|
||||
name: str
|
||||
weight: float
|
||||
scrobbles: int
|
||||
listeners: int
|
||||
|
||||
|
||||
@dataclass
|
||||
class SimilarArtist:
|
||||
artisthash: str
|
||||
similar_artists: list[SimilarArtistEntry]
|
||||
|
||||
def get_artist_hash_set(self) -> set[str]:
|
||||
"""
|
||||
Returns a set of similar artists.
|
||||
"""
|
||||
if not self.similar_artists:
|
||||
return set()
|
||||
|
||||
# INFO:
|
||||
return {a["artisthash"] for a in self.similar_artists}
|
||||
Reference in New Issue
Block a user