idk i added a bunch of stuff like a month ago
This commit is contained in:
1 parent
95c4dc96f6
commit
851d5ebb35
13 files changed
+5044
-40
No files matched your search
@@ -1,9 +1,12 @@
|
||||
|
||||
import time
|
||||
import json
|
||||
import configparser
|
||||
|
||||
import SubSonic
|
||||
import ListenBrainz
|
||||
import MusicDatabase
|
||||
|
||||
import scrobble
|
||||
|
||||
def main():
|
||||
config = configparser.ConfigParser()
|
||||
@@ -17,17 +20,35 @@ def main():
|
||||
|
||||
now_playing = conn.getNowPlaying()
|
||||
|
||||
print(json.dumps(now_playing, indent=4))
|
||||
# print(json.dumps(now_playing, indent=4))
|
||||
|
||||
# album_id = now_playing['nowPlaying']['entry'][0]['albumId']
|
||||
|
||||
# album_info = conn.getAlbum(album_id)
|
||||
|
||||
track_id = now_playing['nowPlaying']['entry'][0]['id']
|
||||
track_mbid = now_playing['nowPlaying']['entry'][0]['musicBrainzId']
|
||||
track_name = now_playing['nowPlaying']['entry'][0]['title']
|
||||
album_id = now_playing['nowPlaying']['entry'][0]['albumId']
|
||||
|
||||
album_info = conn.getAlbum(album_id)
|
||||
album_mbid = album_info['album']['musicBrainzId']
|
||||
album_name = album_info['album']['name']
|
||||
|
||||
# print(json.dumps(album_info, indent=4))
|
||||
artist_id = now_playing['nowPlaying']['entry'][0]['artistId']
|
||||
|
||||
artist_info = conn.getArtist(now_playing['nowPlaying']['entry'][0]['artistId'], raw_json=True)
|
||||
artist_info = conn.getArtist(artist_id, raw_json=True)
|
||||
artist_mbid = artist_info['artist']['musicBrainzId']
|
||||
artist_name = artist_info['artist']['name']
|
||||
|
||||
print(json.dumps(artist_info, indent=4))
|
||||
# print(json.dumps(artist_info, indent=4))
|
||||
|
||||
print(f'{track_name=} {album_name=} {artist_name=}')
|
||||
|
||||
dummy_scrobble = ListenBrainz.ListenBrainzScrobble(artist_name, album_name, track_name)
|
||||
|
||||
listenBrainz_match = scrobble.get_mbid(dummy_scrobble)
|
||||
print(listenBrainz_match)
|
||||
print(album_mbid)
|
||||
assert album_mbid == listenBrainz_match[1]
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in new issue
Block a user