Closed sprnza closed 3 years ago
Hi could you execute album_songs test with
python -m unittest tests/api/test_album_songs.py -vv
to isolate an issue with your database
Hi! Actually just before posting the issue I've dropped the DB and rescanned my collection (3186 albums currently). Here is the unit test results:
/tmp/supysonic # python3 -m unittest tests/api/test_album_songs.py -vv
test_get_album_list (tests.api.test_album_songs.AlbumSongsTestCase) ... ok
test_get_album_list2 (tests.api.test_album_songs.AlbumSongsTestCase) ... ok
test_get_random_songs (tests.api.test_album_songs.AlbumSongsTestCase) ... ok
test_get_starred (tests.api.test_album_songs.AlbumSongsTestCase) ... ok
test_get_starred2 (tests.api.test_album_songs.AlbumSongsTestCase) ... ok
test_now_playing (tests.api.test_album_songs.AlbumSongsTestCase) ... ok
----------------------------------------------------------------------
Ran 6 tests in 2.584s
OK
do you have check postgresql log?
2021-01-07 17:26:25.280 GMT [125819] ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list at character 277
2021-01-07 17:26:25.280 GMT [125819] STATEMENT: SELECT DISTINCT "folder"."id", "folder"."root", "folder"."name", "folder"."path", "folder"."path_hash", "folder"."created", "folder"."cover_art", "folder"."last_scan", "folder"."parent_id"
FROM "track" "t-1", "folder" "folder"
WHERE "t-1"."folder_id" = "folder"."id"
ORDER BY random()
LIMIT 15
I just test with Jamstash and I have same error with my instance it seem that jamstash use this end point to get random song
getAlbumList.view?c=Jamstash&callback=angular.callbacks._6&f=jsonp&offset=0&p=enc:pass&size=15&type=random&u=vincent&v=1.9.0
on dsub no issues but he use rest/getRandomSongs.view endpoint
seem link to postgress no issue on my dev environment on SQLITE
ponyorm's bug then? As I can see supysonic doesn't compose queries ponyorm does it instead.
Thanks! The issue is solved for me with these changes!
Thank you @vincentDcmps for the help on the issue 👍
DB backend: Postgres 10.4, Supysonic- current master Jamstash: Auto Albums -> Random Ultrasonic: Ultrasonic Main -> Albums -> Random
Supysonic logs an error like this:
Random tracks works fine though.