0.1.2 Update API + Docker composer

This commit is contained in:
Daniel Mason 2022-01-06 10:20:30 +13:00
parent 73bfa838ae
commit 5217419945
16 changed files with 332 additions and 34 deletions

View file

@ -1,3 +1,7 @@
# 0.1.2
- Add docker-compose file for local dev
- Implemented top listeners for artist/album endpoints to match track
# 0.1.1
- Cached all config values
- Updated spotify sdk package to v2

View file

@ -11,3 +11,32 @@ This is by no means recommended.. But during testing I somehow scrobbled movies.
DELETE tracks FROM tracks LEFT JOIN track_artist ON track_artist.track = tracks.uuid WHERE track_artist.track IS NULL;
DELETE scrobbles FROM scrobbles LEFT JOIN tracks ON tracks.uuid = scrobbles.track WHERE tracks.uuid is null;
SET FOREIGN_KEY_CHECKS=1;
Removing duplicates (based on same song played in same hour)
-- backup stuff first
DROP TABLE BACKUP_scrobbles;
CREATE TABLE BACKUP_scrobbles (primary key (uuid)) as select * from scrobbles;
SELECT BIN_TO_UUID(`user`, true), scrobbles.*, count(*) FROM scrobbles
-- WHERE `user`= UUID_TO_BIN('<userUUID>', true)
GROUP BY track, HOUR(created_at)
HAVING count(*) > 1
ORDER BY COUNT(*) DESC;
-- will only delete one set of dupes at a time, run until 0 updated rows
DELETE scrobbles
FROM scrobbles
WHERE uuid IN (
SELECT uuid FROM (
SELECT `uuid` FROM scrobbles
WHERE `user`= UUID_TO_BIN('<userUUID>', true)
GROUP BY track, HOUR(created_at)
HAVING count(*) > 1
) x
);