jreeee / ShowScrobbling

displays the track you're currently scrobbling in discord
MIT License
0 stars 0 forks source link

local mbid-based caching #7

Open jreeee opened 2 weeks ago

jreeee commented 2 weeks ago

for songs where lastfm does not provide length or coverart this app sends one or two queries to musicbrainz to get the album mbid which is then used to get a image link from coverartarchive. although this is queried once per song and thus not very resource intensive, it would make sense to store received data in sth. like a json

jreeee commented 1 week ago

This does not take songs without cover and mbid into account. for those it would make sense to also store the cover art link if it can be retrieved. I thought about hashing the titles to improve lookup, but honestly it's prolly enough if you store it in sth. like artist_url-song_url. it'd then prolly look similar to this:

/.cache/showscrobbling/

with a structure like

{
    "song" : "songname",
    "artist" : "artistname",
    "mbid" : "mbid",
    "key" : "artist_url-song_url",
    "length" : "int",
    "cover" : "link",
}

where key and mbid are used based on which file it is in