diff --git a/gen_handler_tests b/gen_handler_tests index f965dfd..af47879 100755 --- a/gen_handler_tests +++ b/gen_handler_tests @@ -1,29 +1,69 @@ -#!/bin/sh +#!/bin/bash + +test_data_path="server/handler/test_data" +test_listen_addr="localhost:9353" +test_music_path=~/music +test_db_path="$test_data_path/db" + +if [[ "$1" == "--scan" ]]; then + echo -e "\e[91mwarning: \e[39mthe --scan option was passed" + echo "- this option should only be used if the database schema changes" + echo "- the test json will likely change a lot" + echo "- make sure you carefully read the diff of old and new json after this script" + rm "$test_db_path" 2>/dev/null + go run cmd/scanner/main.go \ + -music-path "$test_music_path" \ + -db-path "$test_db_path" +fi + +# start server in fd 3 +mkdir "$test_music_path" 2>/dev/null +exec 3< <( + go run cmd/server/main.go \ + -music-path "$test_music_path" \ + -db-path "$test_db_path" \ + -listen-addr "$test_listen_addr" \ + 2>&1 +) + +# wait for start message +echo "waiting for server to start" +while read line; do + echo "from server: $line" + if [[ "$line" == *'starting server'* ]]; then + break + fi +done <&3 +sleep '0.5' # by folder -curl "http://localhost:6969/rest/getAlbumList.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&type=alphabeticalByArtist" | jq > server/handler/test_data/test_get_album_list_alpha_artist -curl "http://localhost:6969/rest/getAlbumList.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&type=alphabeticalByName" | jq > server/handler/test_data/test_get_album_list_alpha_name -curl "http://localhost:6969/rest/getAlbumList.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&type=alphabeticalByName" | jq > server/handler/test_data/test_get_album_list_two_alpha_name -curl "http://localhost:6969/rest/getAlbumList.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&type=newest" | jq > server/handler/test_data/test_get_album_list_newest -curl "http://localhost:6969/rest/getAlbumList.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&type=random" | jq > server/handler/test_data/test_get_album_list_random -curl "http://localhost:6969/rest/search2.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&query=13" | jq > server/handler/test_data/test_search_two_q_13 -curl "http://localhost:6969/rest/search2.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&query=ani" | jq > server/handler/test_data/test_search_two_q_ani -curl "http://localhost:6969/rest/search2.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&query=cert" | jq > server/handler/test_data/test_search_two_q_cert -curl 'http://localhost:6969/rest/getIndexes.view?c=Jamstash&p=admin&u=admin&v=1.9.0&f=json' | jq > server/handler/test_data/test_get_indexes_no_args -curl 'http://localhost:6969/rest/getMusicDirectory.view?c=Jamsstash&id=2&p=admin&u=admin&v=1.9.0&f=json' | jq > server/handler/test_data/test_get_music_directory_without_tracks -curl 'http://localhost:6969/rest/getMusicDirectory.view?c=Jamsstash&id=3&p=admin&u=admin&v=1.9.0&f=json' | jq > server/handler/test_data/test_get_music_directory_with_tracks +curl -s "http://$test_listen_addr/rest/getAlbumList.view?c=c&f=json&p=admin&u=admin&v=v&type=alphabeticalByArtist" | jq > "$test_data_path/test_get_album_list_alpha_artist" +curl -s "http://$test_listen_addr/rest/getAlbumList.view?c=c&f=json&p=admin&u=admin&v=v&type=alphabeticalByName" | jq > "$test_data_path/test_get_album_list_alpha_name" +curl -s "http://$test_listen_addr/rest/getAlbumList.view?c=c&f=json&p=admin&u=admin&v=v&type=alphabeticalByName" | jq > "$test_data_path/test_get_album_list_two_alpha_name" +curl -s "http://$test_listen_addr/rest/getAlbumList.view?c=c&f=json&p=admin&u=admin&v=v&type=newest" | jq > "$test_data_path/test_get_album_list_newest" +curl -s "http://$test_listen_addr/rest/getAlbumList.view?c=c&f=json&p=admin&u=admin&v=v&type=random" | jq > "$test_data_path/test_get_album_list_random" +curl -s "http://$test_listen_addr/rest/search2.view?c=c&f=json&p=admin&u=admin&v=v&query=13" | jq > "$test_data_path/test_search_two_q_13" +curl -s "http://$test_listen_addr/rest/search2.view?c=c&f=json&p=admin&u=admin&v=v&query=ani" | jq > "$test_data_path/test_search_two_q_ani" +curl -s "http://$test_listen_addr/rest/search2.view?c=c&f=json&p=admin&u=admin&v=v&query=cert" | jq > "$test_data_path/test_search_two_q_cert" +curl -s "http://$test_listen_addr/rest/getIndexes.view?c=c&p=admin&u=admin&v=v&f=json" | jq > "$test_data_path/test_get_indexes_no_args" +curl -s "http://$test_listen_addr/rest/getMusicDirectory.view?c=Jamsstash&id=2&p=admin&u=admin&v=v&f=json" | jq > "$test_data_path/test_get_music_directory_without_tracks" +curl -s "http://$test_listen_addr/rest/getMusicDirectory.view?c=Jamsstash&id=3&p=admin&u=admin&v=v&f=json" | jq > "$test_data_path/test_get_music_directory_with_tracks" # by tags -curl "http://localhost:6969/rest/getAlbum.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&id=2" | jq > server/handler/test_data/test_get_album_without_cover -curl "http://localhost:6969/rest/getAlbum.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&id=3" | jq > server/handler/test_data/test_get_album_with_cover -curl "http://localhost:6969/rest/getAlbumList2.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&type=alphabeticalByArtist" | jq > server/handler/test_data/test_get_album_list_two_alpha_artist -curl "http://localhost:6969/rest/getAlbumList2.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&type=alphabeticalByName" | jq > server/handler/test_data/test_get_album_list_two_alpha_name -curl "http://localhost:6969/rest/getAlbumList2.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&type=newest" | jq > server/handler/test_data/test_get_album_list_two_newest -curl "http://localhost:6969/rest/getAlbumList2.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&type=random" | jq > server/handler/test_data/test_get_album_list_two_random -curl "http://localhost:6969/rest/getArtist.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&id=1" | jq > server/handler/test_data/test_get_artist_id_one -curl "http://localhost:6969/rest/getArtist.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&id=2" | jq > server/handler/test_data/test_get_artist_id_two -curl "http://localhost:6969/rest/getArtist.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&id=3" | jq > server/handler/test_data/test_get_artist_id_three -curl "http://localhost:6969/rest/getArtists.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0" | jq > server/handler/test_data/test_get_artists_no_args -curl "http://localhost:6969/rest/search3.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&query=13" | jq > server/handler/test_data/test_search_three_q_13 -curl "http://localhost:6969/rest/search3.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&query=ani" | jq > server/handler/test_data/test_search_three_q_ani -curl "http://localhost:6969/rest/search3.view?c=Jamstash&f=json&p=admin&u=admin&v=1.9.0&query=cert" | jq > server/handler/test_data/test_search_three_q_cert +curl -s "http://$test_listen_addr/rest/getAlbum.view?c=c&f=json&p=admin&u=admin&v=v&id=2" | jq > "$test_data_path/test_get_album_without_cover" +curl -s "http://$test_listen_addr/rest/getAlbum.view?c=c&f=json&p=admin&u=admin&v=v&id=3" | jq > "$test_data_path/test_get_album_with_cover" +curl -s "http://$test_listen_addr/rest/getAlbumList2.view?c=c&f=json&p=admin&u=admin&v=v&type=alphabeticalByArtist" | jq > "$test_data_path/test_get_album_list_two_alpha_artist" +curl -s "http://$test_listen_addr/rest/getAlbumList2.view?c=c&f=json&p=admin&u=admin&v=v&type=alphabeticalByName" | jq > "$test_data_path/test_get_album_list_two_alpha_name" +curl -s "http://$test_listen_addr/rest/getAlbumList2.view?c=c&f=json&p=admin&u=admin&v=v&type=newest" | jq > "$test_data_path/test_get_album_list_two_newest" +curl -s "http://$test_listen_addr/rest/getAlbumList2.view?c=c&f=json&p=admin&u=admin&v=v&type=random" | jq > "$test_data_path/test_get_album_list_two_random" +curl -s "http://$test_listen_addr/rest/getArtist.view?c=c&f=json&p=admin&u=admin&v=v&id=1" | jq > "$test_data_path/test_get_artist_id_one" +curl -s "http://$test_listen_addr/rest/getArtist.view?c=c&f=json&p=admin&u=admin&v=v&id=2" | jq > "$test_data_path/test_get_artist_id_two" +curl -s "http://$test_listen_addr/rest/getArtist.view?c=c&f=json&p=admin&u=admin&v=v&id=3" | jq > "$test_data_path/test_get_artist_id_three" +curl -s "http://$test_listen_addr/rest/getArtists.view?c=c&f=json&p=admin&u=admin&v=v" | jq > "$test_data_path/test_get_artists_no_args" +curl -s "http://$test_listen_addr/rest/search3.view?c=c&f=json&p=admin&u=admin&v=v&query=13" | jq > "$test_data_path/test_search_three_q_13" +curl -s "http://$test_listen_addr/rest/search3.view?c=c&f=json&p=admin&u=admin&v=v&query=ani" | jq > "$test_data_path/test_search_three_q_ani" +curl -s "http://$test_listen_addr/rest/search3.view?c=c&f=json&p=admin&u=admin&v=v&query=cert" | jq > "$test_data_path/test_search_three_q_cert" + +# stop server +pkill -INT -f ".*go.*$test_listen_addr.*" +exec 3<&- diff --git a/server/handler/test_data/db b/server/handler/test_data/db index 194561a..35b48f4 100644 Binary files a/server/handler/test_data/db and b/server/handler/test_data/db differ diff --git a/server/handler/test_data/test_get_album_list_alpha_artist b/server/handler/test_data/test_get_album_list_alpha_artist index 0a232b9..fc7f932 100644 --- a/server/handler/test_data/test_get_album_list_alpha_artist +++ b/server/handler/test_data/test_get_album_list_alpha_artist @@ -5,47 +5,92 @@ "albumList": { "album": [ { - "id": 6, - "coverArt": 6, + "id": 10, + "coverArt": 10, "artist": "13th Floor Lowervators", "title": "(1967) Easter Nowhere", - "parent": 5, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 7, - "coverArt": 7, - "artist": "13th Floor Lowervators", - "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", - "parent": 5, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 3, - "coverArt": 3, - "artist": "A Certain Ratio", - "title": "(1994) The Graveyard and the Ballroom", - "parent": 2, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 4, - "coverArt": 4, - "artist": "A Certain Ratio", - "title": "(1981) To Each.", - "parent": 2, + "parent": 9, "isDir": true, "created": "0001-01-01T00:00:00Z" }, { "id": 11, "coverArt": 11, + "artist": "13th Floor Lowervators", + "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", + "parent": 9, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 7, + "coverArt": 7, + "artist": "A Certain Ratio", + "title": "(1994) The Graveyard and the Ballroom", + "parent": 6, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 8, + "coverArt": 8, + "artist": "A Certain Ratio", + "title": "(1981) To Each.", + "parent": 6, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 5, + "coverArt": 5, + "artist": "Dead Moon", + "title": "(1989) Unknown Passage", + "parent": 4, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 3, + "coverArt": 3, + "artist": "Jah Wobble, The Edge, Holger Czukay", + "title": "(1983) Snake Charmer", + "parent": 2, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 18, + "coverArt": 18, + "artist": "Swell Maps", + "title": "(1980) Jane From Occupied Europe", + "parent": 17, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 19, + "coverArt": 19, + "artist": "Swell Maps", + "title": "(1979) A Trip to Marineville", + "parent": 17, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 21, + "coverArt": 21, + "artist": "Ten Years After", + "title": "(1967) Ten Years After", + "parent": 20, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 15, + "coverArt": 15, "artist": "There", "title": "(2010) Anika", - "parent": 10, + "parent": 14, "isDir": true, "created": "0001-01-01T00:00:00Z" } diff --git a/server/handler/test_data/test_get_album_list_alpha_name b/server/handler/test_data/test_get_album_list_alpha_name index f6a3fa6..2ad9f87 100644 --- a/server/handler/test_data/test_get_album_list_alpha_name +++ b/server/handler/test_data/test_get_album_list_alpha_name @@ -5,47 +5,92 @@ "albumList": { "album": [ { - "id": 7, - "coverArt": 7, + "id": 11, + "coverArt": 11, "artist": "13th Floor Lowervators", "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", - "parent": 5, + "parent": 9, "isDir": true, "created": "0001-01-01T00:00:00Z" }, { - "id": 6, - "coverArt": 6, + "id": 10, + "coverArt": 10, "artist": "13th Floor Lowervators", "title": "(1967) Easter Nowhere", - "parent": 5, + "parent": 9, "isDir": true, "created": "0001-01-01T00:00:00Z" }, { - "id": 4, - "coverArt": 4, + "id": 21, + "coverArt": 21, + "artist": "Ten Years After", + "title": "(1967) Ten Years After", + "parent": 20, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 19, + "coverArt": 19, + "artist": "Swell Maps", + "title": "(1979) A Trip to Marineville", + "parent": 17, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 18, + "coverArt": 18, + "artist": "Swell Maps", + "title": "(1980) Jane From Occupied Europe", + "parent": 17, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 8, + "coverArt": 8, "artist": "A Certain Ratio", "title": "(1981) To Each.", - "parent": 2, + "parent": 6, "isDir": true, "created": "0001-01-01T00:00:00Z" }, { "id": 3, "coverArt": 3, - "artist": "A Certain Ratio", - "title": "(1994) The Graveyard and the Ballroom", + "artist": "Jah Wobble, The Edge, Holger Czukay", + "title": "(1983) Snake Charmer", "parent": 2, "isDir": true, "created": "0001-01-01T00:00:00Z" }, { - "id": 11, - "coverArt": 11, + "id": 5, + "coverArt": 5, + "artist": "Dead Moon", + "title": "(1989) Unknown Passage", + "parent": 4, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 7, + "coverArt": 7, + "artist": "A Certain Ratio", + "title": "(1994) The Graveyard and the Ballroom", + "parent": 6, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 15, + "coverArt": 15, "artist": "There", "title": "(2010) Anika", - "parent": 10, + "parent": 14, "isDir": true, "created": "0001-01-01T00:00:00Z" } diff --git a/server/handler/test_data/test_get_album_list_newest b/server/handler/test_data/test_get_album_list_newest index cdeff1a..b647239 100644 --- a/server/handler/test_data/test_get_album_list_newest +++ b/server/handler/test_data/test_get_album_list_newest @@ -5,46 +5,91 @@ "albumList": { "album": [ { - "id": 11, - "coverArt": 11, + "id": 21, + "coverArt": 21, + "artist": "Ten Years After", + "title": "(1967) Ten Years After", + "parent": 20, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 19, + "coverArt": 19, + "artist": "Swell Maps", + "title": "(1979) A Trip to Marineville", + "parent": 17, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 18, + "coverArt": 18, + "artist": "Swell Maps", + "title": "(1980) Jane From Occupied Europe", + "parent": 17, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 15, + "coverArt": 15, "artist": "There", "title": "(2010) Anika", - "parent": 10, + "parent": 14, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 11, + "coverArt": 11, + "artist": "13th Floor Lowervators", + "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", + "parent": 9, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 10, + "coverArt": 10, + "artist": "13th Floor Lowervators", + "title": "(1967) Easter Nowhere", + "parent": 9, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 8, + "coverArt": 8, + "artist": "A Certain Ratio", + "title": "(1981) To Each.", + "parent": 6, "isDir": true, "created": "0001-01-01T00:00:00Z" }, { "id": 7, "coverArt": 7, - "artist": "13th Floor Lowervators", - "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", - "parent": 5, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 6, - "coverArt": 6, - "artist": "13th Floor Lowervators", - "title": "(1967) Easter Nowhere", - "parent": 5, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 4, - "coverArt": 4, "artist": "A Certain Ratio", - "title": "(1981) To Each.", - "parent": 2, + "title": "(1994) The Graveyard and the Ballroom", + "parent": 6, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 5, + "coverArt": 5, + "artist": "Dead Moon", + "title": "(1989) Unknown Passage", + "parent": 4, "isDir": true, "created": "0001-01-01T00:00:00Z" }, { "id": 3, "coverArt": 3, - "artist": "A Certain Ratio", - "title": "(1994) The Graveyard and the Ballroom", + "artist": "Jah Wobble, The Edge, Holger Czukay", + "title": "(1983) Snake Charmer", "parent": 2, "isDir": true, "created": "0001-01-01T00:00:00Z" diff --git a/server/handler/test_data/test_get_album_list_random b/server/handler/test_data/test_get_album_list_random index b48a5e3..84adc8b 100644 --- a/server/handler/test_data/test_get_album_list_random +++ b/server/handler/test_data/test_get_album_list_random @@ -4,48 +4,93 @@ "version": "1.9.0", "albumList": { "album": [ - { - "id": 11, - "coverArt": 11, - "artist": "There", - "title": "(2010) Anika", - "parent": 10, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, { "id": 7, "coverArt": 7, - "artist": "13th Floor Lowervators", - "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", - "parent": 5, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 4, - "coverArt": 4, "artist": "A Certain Ratio", - "title": "(1981) To Each.", - "parent": 2, + "title": "(1994) The Graveyard and the Ballroom", + "parent": 6, "isDir": true, "created": "0001-01-01T00:00:00Z" }, { "id": 3, "coverArt": 3, - "artist": "A Certain Ratio", - "title": "(1994) The Graveyard and the Ballroom", + "artist": "Jah Wobble, The Edge, Holger Czukay", + "title": "(1983) Snake Charmer", "parent": 2, "isDir": true, "created": "0001-01-01T00:00:00Z" }, { - "id": 6, - "coverArt": 6, + "id": 15, + "coverArt": 15, + "artist": "There", + "title": "(2010) Anika", + "parent": 14, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 19, + "coverArt": 19, + "artist": "Swell Maps", + "title": "(1979) A Trip to Marineville", + "parent": 17, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 18, + "coverArt": 18, + "artist": "Swell Maps", + "title": "(1980) Jane From Occupied Europe", + "parent": 17, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 8, + "coverArt": 8, + "artist": "A Certain Ratio", + "title": "(1981) To Each.", + "parent": 6, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 11, + "coverArt": 11, + "artist": "13th Floor Lowervators", + "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", + "parent": 9, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 5, + "coverArt": 5, + "artist": "Dead Moon", + "title": "(1989) Unknown Passage", + "parent": 4, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 21, + "coverArt": 21, + "artist": "Ten Years After", + "title": "(1967) Ten Years After", + "parent": 20, + "isDir": true, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": 10, + "coverArt": 10, "artist": "13th Floor Lowervators", "title": "(1967) Easter Nowhere", - "parent": 5, + "parent": 9, "isDir": true, "created": "0001-01-01T00:00:00Z" } diff --git a/server/handler/test_data/test_get_album_list_two_alpha_artist b/server/handler/test_data/test_get_album_list_two_alpha_artist index dde3bdc..d020b9f 100644 --- a/server/handler/test_data/test_get_album_list_two_alpha_artist +++ b/server/handler/test_data/test_get_album_list_two_alpha_artist @@ -5,43 +5,83 @@ "albumList2": { "album": [ { - "id": 6, - "coverArt": 6, - "artistId": 2, + "id": 10, + "coverArt": 10, + "artistId": 4, "artist": "13th Floor Elevators", "name": "Easter Everywhere", - "created": "2019-06-06T16:38:39.306600701+01:00" + "created": "2019-06-10T17:06:26.01139089+01:00" + }, + { + "id": 11, + "coverArt": 11, + "artistId": 4, + "artist": "13th Floor Elevators", + "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "created": "2019-06-10T17:06:26.015039416+01:00" }, { "id": 7, "coverArt": 7, + "artistId": 3, + "artist": "A Certain Ratio", + "name": "The Graveyard and the Ballroom", + "created": "2019-06-10T17:06:26.003805335+01:00" + }, + { + "id": 8, + "artistId": 3, + "artist": "A Certain Ratio", + "name": "To Each...", + "created": "2019-06-10T17:06:26.00810814+01:00" + }, + { + "id": 15, + "coverArt": 15, + "artistId": 5, + "artist": "Anikas", + "name": "Anika", + "created": "2019-06-10T17:06:26.028934348+01:00" + }, + { + "id": 5, + "coverArt": 5, "artistId": 2, - "artist": "13th Floor Elevators", - "name": "The Psychedelic Sounds of the 13th Floor Elevators", - "created": "2019-06-06T16:38:39.309763889+01:00" + "artist": "Dead Moon", + "name": "Unknown Passage", + "created": "2019-06-10T17:06:26.000595013+01:00" }, { "id": 3, "coverArt": 3, "artistId": 1, - "artist": "A Certain Ratio", - "name": "The Graveyard and the Ballroom", - "created": "2019-06-06T16:38:39.298724062+01:00" + "artist": "Jah Wobble, The Edge & Holger Czukay", + "name": "Snake Charmer", + "created": "2019-06-10T17:06:25.998358476+01:00" }, { - "id": 4, - "artistId": 1, - "artist": "A Certain Ratio", - "name": "To Each...", - "created": "2019-06-06T16:38:39.303278797+01:00" + "id": 18, + "coverArt": 18, + "artistId": 6, + "artist": "Swell Maps", + "name": "Jane From Occupied Europe", + "created": "2019-06-10T17:06:26.031594709+01:00" }, { - "id": 11, - "coverArt": 11, - "artistId": 3, - "artist": "Anikas", - "name": "Anika", - "created": "2019-06-06T16:38:39.31657693+01:00" + "id": 19, + "coverArt": 19, + "artistId": 6, + "artist": "Swell Maps", + "name": "A Trip to Marineville", + "created": "2019-06-10T17:06:26.036222364+01:00" + }, + { + "id": 21, + "coverArt": 21, + "artistId": 7, + "artist": "Ten Years After", + "name": "Ten Years After", + "created": "2019-06-10T17:06:26.041345532+01:00" } ] } diff --git a/server/handler/test_data/test_get_album_list_two_alpha_name b/server/handler/test_data/test_get_album_list_two_alpha_name index 0257551..d619573 100644 --- a/server/handler/test_data/test_get_album_list_two_alpha_name +++ b/server/handler/test_data/test_get_album_list_two_alpha_name @@ -5,43 +5,83 @@ "albumList2": { "album": [ { - "id": 11, - "coverArt": 11, - "artistId": 3, - "artist": "Anikas", - "name": "Anika", - "created": "2019-06-06T16:38:39.31657693+01:00" + "id": 19, + "coverArt": 19, + "artistId": 6, + "artist": "Swell Maps", + "name": "A Trip to Marineville", + "created": "2019-06-10T17:06:26.036222364+01:00" }, { - "id": 6, - "coverArt": 6, - "artistId": 2, + "id": 15, + "coverArt": 15, + "artistId": 5, + "artist": "Anikas", + "name": "Anika", + "created": "2019-06-10T17:06:26.028934348+01:00" + }, + { + "id": 10, + "coverArt": 10, + "artistId": 4, "artist": "13th Floor Elevators", "name": "Easter Everywhere", - "created": "2019-06-06T16:38:39.306600701+01:00" + "created": "2019-06-10T17:06:26.01139089+01:00" + }, + { + "id": 18, + "coverArt": 18, + "artistId": 6, + "artist": "Swell Maps", + "name": "Jane From Occupied Europe", + "created": "2019-06-10T17:06:26.031594709+01:00" }, { "id": 3, "coverArt": 3, "artistId": 1, - "artist": "A Certain Ratio", - "name": "The Graveyard and the Ballroom", - "created": "2019-06-06T16:38:39.298724062+01:00" + "artist": "Jah Wobble, The Edge & Holger Czukay", + "name": "Snake Charmer", + "created": "2019-06-10T17:06:25.998358476+01:00" + }, + { + "id": 21, + "coverArt": 21, + "artistId": 7, + "artist": "Ten Years After", + "name": "Ten Years After", + "created": "2019-06-10T17:06:26.041345532+01:00" }, { "id": 7, "coverArt": 7, - "artistId": 2, - "artist": "13th Floor Elevators", - "name": "The Psychedelic Sounds of the 13th Floor Elevators", - "created": "2019-06-06T16:38:39.309763889+01:00" + "artistId": 3, + "artist": "A Certain Ratio", + "name": "The Graveyard and the Ballroom", + "created": "2019-06-10T17:06:26.003805335+01:00" }, { - "id": 4, - "artistId": 1, + "id": 11, + "coverArt": 11, + "artistId": 4, + "artist": "13th Floor Elevators", + "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "created": "2019-06-10T17:06:26.015039416+01:00" + }, + { + "id": 8, + "artistId": 3, "artist": "A Certain Ratio", "name": "To Each...", - "created": "2019-06-06T16:38:39.303278797+01:00" + "created": "2019-06-10T17:06:26.00810814+01:00" + }, + { + "id": 5, + "coverArt": 5, + "artistId": 2, + "artist": "Dead Moon", + "name": "Unknown Passage", + "created": "2019-06-10T17:06:26.000595013+01:00" } ] } diff --git a/server/handler/test_data/test_get_album_list_two_newest b/server/handler/test_data/test_get_album_list_two_newest index d1c062a..2f61c71 100644 --- a/server/handler/test_data/test_get_album_list_two_newest +++ b/server/handler/test_data/test_get_album_list_two_newest @@ -5,43 +5,83 @@ "albumList2": { "album": [ { - "id": 11, - "coverArt": 11, - "artistId": 3, + "id": 21, + "coverArt": 21, + "artistId": 7, + "artist": "Ten Years After", + "name": "Ten Years After", + "created": "2019-06-10T17:06:26.041345532+01:00" + }, + { + "id": 19, + "coverArt": 19, + "artistId": 6, + "artist": "Swell Maps", + "name": "A Trip to Marineville", + "created": "2019-06-10T17:06:26.036222364+01:00" + }, + { + "id": 18, + "coverArt": 18, + "artistId": 6, + "artist": "Swell Maps", + "name": "Jane From Occupied Europe", + "created": "2019-06-10T17:06:26.031594709+01:00" + }, + { + "id": 15, + "coverArt": 15, + "artistId": 5, "artist": "Anikas", "name": "Anika", - "created": "2019-06-06T16:38:39.31657693+01:00" + "created": "2019-06-10T17:06:26.028934348+01:00" + }, + { + "id": 11, + "coverArt": 11, + "artistId": 4, + "artist": "13th Floor Elevators", + "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "created": "2019-06-10T17:06:26.015039416+01:00" + }, + { + "id": 10, + "coverArt": 10, + "artistId": 4, + "artist": "13th Floor Elevators", + "name": "Easter Everywhere", + "created": "2019-06-10T17:06:26.01139089+01:00" + }, + { + "id": 8, + "artistId": 3, + "artist": "A Certain Ratio", + "name": "To Each...", + "created": "2019-06-10T17:06:26.00810814+01:00" }, { "id": 7, "coverArt": 7, - "artistId": 2, - "artist": "13th Floor Elevators", - "name": "The Psychedelic Sounds of the 13th Floor Elevators", - "created": "2019-06-06T16:38:39.309763889+01:00" - }, - { - "id": 6, - "coverArt": 6, - "artistId": 2, - "artist": "13th Floor Elevators", - "name": "Easter Everywhere", - "created": "2019-06-06T16:38:39.306600701+01:00" - }, - { - "id": 4, - "artistId": 1, + "artistId": 3, "artist": "A Certain Ratio", - "name": "To Each...", - "created": "2019-06-06T16:38:39.303278797+01:00" + "name": "The Graveyard and the Ballroom", + "created": "2019-06-10T17:06:26.003805335+01:00" + }, + { + "id": 5, + "coverArt": 5, + "artistId": 2, + "artist": "Dead Moon", + "name": "Unknown Passage", + "created": "2019-06-10T17:06:26.000595013+01:00" }, { "id": 3, "coverArt": 3, "artistId": 1, - "artist": "A Certain Ratio", - "name": "The Graveyard and the Ballroom", - "created": "2019-06-06T16:38:39.298724062+01:00" + "artist": "Jah Wobble, The Edge & Holger Czukay", + "name": "Snake Charmer", + "created": "2019-06-10T17:06:25.998358476+01:00" } ] } diff --git a/server/handler/test_data/test_get_album_list_two_random b/server/handler/test_data/test_get_album_list_two_random index ecff8b8..f61b30a 100644 --- a/server/handler/test_data/test_get_album_list_two_random +++ b/server/handler/test_data/test_get_album_list_two_random @@ -4,44 +4,84 @@ "version": "1.9.0", "albumList2": { "album": [ - { - "id": 6, - "coverArt": 6, - "artistId": 2, - "artist": "13th Floor Elevators", - "name": "Easter Everywhere", - "created": "2019-06-06T16:38:39.306600701+01:00" - }, { "id": 3, "coverArt": 3, "artistId": 1, - "artist": "A Certain Ratio", - "name": "The Graveyard and the Ballroom", - "created": "2019-06-06T16:38:39.298724062+01:00" + "artist": "Jah Wobble, The Edge & Holger Czukay", + "name": "Snake Charmer", + "created": "2019-06-10T17:06:25.998358476+01:00" }, { - "id": 4, - "artistId": 1, - "artist": "A Certain Ratio", - "name": "To Each...", - "created": "2019-06-06T16:38:39.303278797+01:00" + "id": 10, + "coverArt": 10, + "artistId": 4, + "artist": "13th Floor Elevators", + "name": "Easter Everywhere", + "created": "2019-06-10T17:06:26.01139089+01:00" }, { "id": 7, "coverArt": 7, - "artistId": 2, - "artist": "13th Floor Elevators", - "name": "The Psychedelic Sounds of the 13th Floor Elevators", - "created": "2019-06-06T16:38:39.309763889+01:00" + "artistId": 3, + "artist": "A Certain Ratio", + "name": "The Graveyard and the Ballroom", + "created": "2019-06-10T17:06:26.003805335+01:00" + }, + { + "id": 8, + "artistId": 3, + "artist": "A Certain Ratio", + "name": "To Each...", + "created": "2019-06-10T17:06:26.00810814+01:00" }, { "id": 11, "coverArt": 11, - "artistId": 3, + "artistId": 4, + "artist": "13th Floor Elevators", + "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "created": "2019-06-10T17:06:26.015039416+01:00" + }, + { + "id": 5, + "coverArt": 5, + "artistId": 2, + "artist": "Dead Moon", + "name": "Unknown Passage", + "created": "2019-06-10T17:06:26.000595013+01:00" + }, + { + "id": 15, + "coverArt": 15, + "artistId": 5, "artist": "Anikas", "name": "Anika", - "created": "2019-06-06T16:38:39.31657693+01:00" + "created": "2019-06-10T17:06:26.028934348+01:00" + }, + { + "id": 21, + "coverArt": 21, + "artistId": 7, + "artist": "Ten Years After", + "name": "Ten Years After", + "created": "2019-06-10T17:06:26.041345532+01:00" + }, + { + "id": 19, + "coverArt": 19, + "artistId": 6, + "artist": "Swell Maps", + "name": "A Trip to Marineville", + "created": "2019-06-10T17:06:26.036222364+01:00" + }, + { + "id": 18, + "coverArt": 18, + "artistId": 6, + "artist": "Swell Maps", + "name": "Jane From Occupied Europe", + "created": "2019-06-10T17:06:26.031594709+01:00" } ] } diff --git a/server/handler/test_data/test_get_album_with_cover b/server/handler/test_data/test_get_album_with_cover index cd94224..461bf4a 100644 --- a/server/handler/test_data/test_get_album_with_cover +++ b/server/handler/test_data/test_get_album_with_cover @@ -6,274 +6,108 @@ "id": 3, "coverArt": 3, "artistId": 1, - "artist": "A Certain Ratio", - "name": "The Graveyard and the Ballroom", - "created": "2019-06-06T16:38:39.298724062+01:00", + "artist": "Jah Wobble, The Edge & Holger Czukay", + "name": "Snake Charmer", + "created": "2019-06-10T17:06:25.998358476+01:00", "song": [ { - "album": "The Graveyard and the Ballroom", + "album": "Snake Charmer", "albumId": 3, - "artist": "A Certain Ratio", + "artist": "Jah Wobble, The Edge & Holger Czukay", "artistId": 1, - "bitRate": 922, + "bitRate": 866, "contentType": "audio/x-flac", "coverArt": 3, - "created": "2019-06-06T16:38:39.302489659+01:00", - "duration": 174, - "id": 12, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/01.14 Do the Du (casse).flac", - "size": 20545509, - "suffix": "flac", - "title": "Do the Du (casse)", - "track": 1, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 916, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.301301007+01:00", - "duration": 142, - "id": 8, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/02.14 Faceless.flac", - "size": 16657561, - "suffix": "flac", - "title": "Faceless", - "track": 2, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 957, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.300698509+01:00", - "duration": 174, - "id": 6, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/03.14 Crippled Child.flac", - "size": 21325811, - "suffix": "flac", - "title": "Crippled Child", - "track": 3, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 961, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.302194015+01:00", - "duration": 201, - "id": 11, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/04.14 Choir.flac", - "size": 24728976, - "suffix": "flac", - "title": "Choir", - "track": 4, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 924, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.299490189+01:00", - "duration": 210, - "id": 2, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/05.14 Flight.flac", - "size": 24860635, - "suffix": "flac", - "title": "Flight", - "track": 5, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 961, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.302789079+01:00", - "duration": 131, - "id": 13, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/06.14 I Feel.flac", - "size": 16118749, - "suffix": "flac", - "title": "I Feel", - "track": 6, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 929, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.303072046+01:00", - "duration": 148, - "id": 14, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/07.14 Strain.flac", - "size": 17608752, - "suffix": "flac", - "title": "Strain", - "track": 7, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 898, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.300381932+01:00", - "duration": 217, - "id": 5, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/08.14 All Night Party.flac", - "size": 24960016, - "suffix": "flac", - "title": "All Night Party", - "track": 8, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 877, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.300087164+01:00", - "duration": 235, - "id": 4, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/09.14 Oceans.flac", - "size": 26401567, - "suffix": "flac", - "title": "Oceans", - "track": 9, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 888, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.301890876+01:00", - "duration": 212, - "id": 10, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/10.14 The Choir.flac", - "size": 24106680, - "suffix": "flac", - "title": "The Choir", - "track": 10, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 916, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.301604638+01:00", - "duration": 205, - "id": 9, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/11.14 The Fox.flac", - "size": 24054498, - "suffix": "flac", - "title": "The Fox", - "track": 11, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 900, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.301006358+01:00", - "duration": 144, - "id": 7, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/12.14 Suspect.flac", - "size": 16592296, - "suffix": "flac", - "title": "Suspect", - "track": 12, - "type": "music" - }, - { - "album": "The Graveyard and the Ballroom", - "albumId": 3, - "artist": "A Certain Ratio", - "artistId": 1, - "bitRate": 877, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "2019-06-06T16:38:39.299163755+01:00", - "duration": 332, + "created": "2019-06-10T17:06:25.998787704+01:00", + "duration": 372, "id": 1, "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/13.14 Flight.flac", - "size": 37302417, + "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/01.05 Snake Charmer.flac", + "size": 41274185, "suffix": "flac", - "title": "Flight", - "track": 13, + "title": "Snake Charmer", + "track": 1, + "discNumber": 1, "type": "music" }, { - "album": "The Graveyard and the Ballroom", + "album": "Snake Charmer", "albumId": 3, - "artist": "A Certain Ratio", + "artist": "Jah Wobble, The Edge & Holger Czukay", "artistId": 1, - "bitRate": 893, + "bitRate": 733, "contentType": "audio/x-flac", "coverArt": 3, - "created": "2019-06-06T16:38:39.299791782+01:00", - "duration": 213, + "created": "2019-06-10T17:06:25.999138309+01:00", + "duration": 331, + "id": 2, + "parent": 3, + "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/03.05 It Was a Camel.flac", + "size": 31080508, + "suffix": "flac", + "title": "It Was a Camel", + "track": 1, + "discNumber": 1, + "type": "music" + }, + { + "album": "Snake Charmer", + "albumId": 3, + "artist": "Jah Wobble, The Edge & Holger Czukay", + "artistId": 1, + "bitRate": 798, + "contentType": "audio/x-flac", + "coverArt": 3, + "created": "2019-06-10T17:06:25.999449918+01:00", + "duration": 523, "id": 3, "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/14.14 Genotype_Phenotype.flac", - "size": 24349252, + "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/02.05 Hold On to Your Dreams.flac", + "size": 53447545, "suffix": "flac", - "title": "Genotype/Phenotype", - "track": 14, + "title": "Hold On to Your Dreams", + "track": 1, + "discNumber": 1, + "type": "music" + }, + { + "album": "Snake Charmer", + "albumId": 3, + "artist": "Jah Wobble, The Edge & Holger Czukay", + "artistId": 1, + "bitRate": 867, + "contentType": "audio/x-flac", + "coverArt": 3, + "created": "2019-06-10T17:06:25.999768289+01:00", + "duration": 418, + "id": 4, + "parent": 3, + "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/05.05 Snake Charmer (reprise).flac", + "size": 46427922, + "suffix": "flac", + "title": "Snake Charmer (reprise)", + "track": 1, + "discNumber": 1, + "type": "music" + }, + { + "album": "Snake Charmer", + "albumId": 3, + "artist": "Jah Wobble, The Edge & Holger Czukay", + "artistId": 1, + "bitRate": 961, + "contentType": "audio/x-flac", + "coverArt": 3, + "created": "2019-06-10T17:06:26.000111656+01:00", + "duration": 227, + "id": 5, + "parent": 3, + "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/04.05 Sleazy.flac", + "size": 27938750, + "suffix": "flac", + "title": "Sleazy", + "track": 1, + "discNumber": 1, "type": "music" } ] diff --git a/server/handler/test_data/test_get_album_without_cover b/server/handler/test_data/test_get_album_without_cover index 309f458..84ba29f 100644 --- a/server/handler/test_data/test_get_album_without_cover +++ b/server/handler/test_data/test_get_album_without_cover @@ -4,7 +4,7 @@ "version": "1.9.0", "album": { "id": 2, - "created": "2019-06-06T16:38:39.298507437+01:00" + "created": "2019-06-10T17:06:25.998150103+01:00" } } } diff --git a/server/handler/test_data/test_get_artist_id_one b/server/handler/test_data/test_get_artist_id_one index 1ece5d9..de52da6 100644 --- a/server/handler/test_data/test_get_artist_id_one +++ b/server/handler/test_data/test_get_artist_id_one @@ -4,22 +4,15 @@ "version": "1.9.0", "artist": { "id": 1, - "name": "A Certain Ratio", + "name": "Jah Wobble, The Edge & Holger Czukay", "album": [ { "id": 3, "coverArt": 3, "artistId": 1, - "artist": "A Certain Ratio", - "name": "The Graveyard and the Ballroom", - "created": "2019-06-06T16:38:39.298724062+01:00" - }, - { - "id": 4, - "artistId": 1, - "artist": "A Certain Ratio", - "name": "To Each...", - "created": "2019-06-06T16:38:39.303278797+01:00" + "artist": "Jah Wobble, The Edge & Holger Czukay", + "name": "Snake Charmer", + "created": "2019-06-10T17:06:25.998358476+01:00" } ] } diff --git a/server/handler/test_data/test_get_artist_id_three b/server/handler/test_data/test_get_artist_id_three index 10fbb5c..cccae96 100644 --- a/server/handler/test_data/test_get_artist_id_three +++ b/server/handler/test_data/test_get_artist_id_three @@ -4,15 +4,22 @@ "version": "1.9.0", "artist": { "id": 3, - "name": "Anikas", + "name": "A Certain Ratio", "album": [ { - "id": 11, - "coverArt": 11, + "id": 7, + "coverArt": 7, "artistId": 3, - "artist": "Anikas", - "name": "Anika", - "created": "2019-06-06T16:38:39.31657693+01:00" + "artist": "A Certain Ratio", + "name": "The Graveyard and the Ballroom", + "created": "2019-06-10T17:06:26.003805335+01:00" + }, + { + "id": 8, + "artistId": 3, + "artist": "A Certain Ratio", + "name": "To Each...", + "created": "2019-06-10T17:06:26.00810814+01:00" } ] } diff --git a/server/handler/test_data/test_get_artist_id_two b/server/handler/test_data/test_get_artist_id_two index e314709..874e11d 100644 --- a/server/handler/test_data/test_get_artist_id_two +++ b/server/handler/test_data/test_get_artist_id_two @@ -4,23 +4,15 @@ "version": "1.9.0", "artist": { "id": 2, - "name": "13th Floor Elevators", + "name": "Dead Moon", "album": [ { - "id": 6, - "coverArt": 6, + "id": 5, + "coverArt": 5, "artistId": 2, - "artist": "13th Floor Elevators", - "name": "Easter Everywhere", - "created": "2019-06-06T16:38:39.306600701+01:00" - }, - { - "id": 7, - "coverArt": 7, - "artistId": 2, - "artist": "13th Floor Elevators", - "name": "The Psychedelic Sounds of the 13th Floor Elevators", - "created": "2019-06-06T16:38:39.309763889+01:00" + "artist": "Dead Moon", + "name": "Unknown Passage", + "created": "2019-06-10T17:06:26.000595013+01:00" } ] } diff --git a/server/handler/test_data/test_get_artists_no_args b/server/handler/test_data/test_get_artists_no_args index a7f5358..46e8e78 100644 --- a/server/handler/test_data/test_get_artists_no_args +++ b/server/handler/test_data/test_get_artists_no_args @@ -8,8 +8,9 @@ "name": "#", "artist": [ { - "id": 2, - "name": "13th Floor Elevators" + "id": 4, + "name": "13th Floor Elevators", + "albumCount": 2 } ] }, @@ -17,12 +18,54 @@ "name": "a", "artist": [ { - "id": 1, - "name": "A Certain Ratio" + "id": 3, + "name": "A Certain Ratio", + "albumCount": 2 }, { - "id": 3, - "name": "Anikas" + "id": 5, + "name": "Anikas", + "albumCount": 1 + } + ] + }, + { + "name": "d", + "artist": [ + { + "id": 2, + "name": "Dead Moon", + "albumCount": 1 + } + ] + }, + { + "name": "j", + "artist": [ + { + "id": 1, + "name": "Jah Wobble, The Edge & Holger Czukay", + "albumCount": 1 + } + ] + }, + { + "name": "s", + "artist": [ + { + "id": 6, + "name": "Swell Maps", + "albumCount": 2 + } + ] + }, + { + "name": "t", + "artist": [ + { + "id": 7, + "name": "Ten Years After", + "albumCount": 1 } ] } diff --git a/server/handler/test_data/test_get_indexes_no_args b/server/handler/test_data/test_get_indexes_no_args index f988b22..b56be40 100644 --- a/server/handler/test_data/test_get_indexes_no_args +++ b/server/handler/test_data/test_get_indexes_no_args @@ -9,21 +9,64 @@ "name": "#", "artist": [ { - "id": 5, - "name": "13th Floor Lowervators" + "id": 9, + "name": "13th Floor Lowervators", + "albumCount": 2 }, { - "id": 8, - "name": "___Anika" + "id": 12, + "name": "___Anika", + "albumCount": 2 } ] }, { "name": "a", + "artist": [ + { + "id": 6, + "name": "A Certain Ratio", + "albumCount": 2 + } + ] + }, + { + "name": "d", + "artist": [ + { + "id": 4, + "name": "Dead Moon", + "albumCount": 1 + } + ] + }, + { + "name": "j", "artist": [ { "id": 2, - "name": "A Certain Ratio" + "name": "Jah Wobble, The Edge, Holger Czukay", + "albumCount": 1 + } + ] + }, + { + "name": "s", + "artist": [ + { + "id": 17, + "name": "Swell Maps", + "albumCount": 2 + } + ] + }, + { + "name": "t", + "artist": [ + { + "id": 20, + "name": "Ten Years After", + "albumCount": 1 } ] } diff --git a/server/handler/test_data/test_get_music_directory_with_tracks b/server/handler/test_data/test_get_music_directory_with_tracks index 35a5a40..968a572 100644 --- a/server/handler/test_data/test_get_music_directory_with_tracks +++ b/server/handler/test_data/test_get_music_directory_with_tracks @@ -5,244 +5,96 @@ "directory": { "id": 3, "parent": 2, - "name": "(1994) The Graveyard and the Ballroom", + "name": "(1983) Snake Charmer", "child": [ { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 922, + "album": "(1983) Snake Charmer", + "artist": "Jah Wobble, The Edge & Holger Czukay", + "bitRate": 866, "contentType": "audio/x-flac", "coverArt": 3, "created": "0001-01-01T00:00:00Z", - "duration": 174, - "id": 12, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/01.14 Do the Du (casse).flac", - "size": 20545509, - "suffix": "flac", - "title": "Do the Du (casse)", - "track": 1, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 916, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 142, - "id": 8, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/02.14 Faceless.flac", - "size": 16657561, - "suffix": "flac", - "title": "Faceless", - "track": 2, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 957, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 174, - "id": 6, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/03.14 Crippled Child.flac", - "size": 21325811, - "suffix": "flac", - "title": "Crippled Child", - "track": 3, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 961, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 201, - "id": 11, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/04.14 Choir.flac", - "size": 24728976, - "suffix": "flac", - "title": "Choir", - "track": 4, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 924, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 210, - "id": 2, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/05.14 Flight.flac", - "size": 24860635, - "suffix": "flac", - "title": "Flight", - "track": 5, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 961, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 131, - "id": 13, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/06.14 I Feel.flac", - "size": 16118749, - "suffix": "flac", - "title": "I Feel", - "track": 6, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 929, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 148, - "id": 14, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/07.14 Strain.flac", - "size": 17608752, - "suffix": "flac", - "title": "Strain", - "track": 7, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 898, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 217, - "id": 5, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/08.14 All Night Party.flac", - "size": 24960016, - "suffix": "flac", - "title": "All Night Party", - "track": 8, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 877, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 235, - "id": 4, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/09.14 Oceans.flac", - "size": 26401567, - "suffix": "flac", - "title": "Oceans", - "track": 9, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 888, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 212, - "id": 10, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/10.14 The Choir.flac", - "size": 24106680, - "suffix": "flac", - "title": "The Choir", - "track": 10, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 916, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 205, - "id": 9, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/11.14 The Fox.flac", - "size": 24054498, - "suffix": "flac", - "title": "The Fox", - "track": 11, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 900, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 144, - "id": 7, - "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/12.14 Suspect.flac", - "size": 16592296, - "suffix": "flac", - "title": "Suspect", - "track": 12, - "type": "music" - }, - { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 877, - "contentType": "audio/x-flac", - "coverArt": 3, - "created": "0001-01-01T00:00:00Z", - "duration": 332, + "duration": 372, "id": 1, "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/13.14 Flight.flac", - "size": 37302417, + "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/01.05 Snake Charmer.flac", + "size": 41274185, "suffix": "flac", - "title": "Flight", - "track": 13, + "title": "Snake Charmer", + "track": 1, + "discNumber": 1, "type": "music" }, { - "album": "(1994) The Graveyard and the Ballroom", - "artist": "A Certain Ratio", - "bitRate": 893, + "album": "(1983) Snake Charmer", + "artist": "Jah Wobble, The Edge & Holger Czukay", + "bitRate": 798, "contentType": "audio/x-flac", "coverArt": 3, "created": "0001-01-01T00:00:00Z", - "duration": 213, + "duration": 523, "id": 3, "parent": 3, - "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/14.14 Genotype_Phenotype.flac", - "size": 24349252, + "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/02.05 Hold On to Your Dreams.flac", + "size": 53447545, "suffix": "flac", - "title": "Genotype/Phenotype", - "track": 14, + "title": "Hold On to Your Dreams", + "track": 1, + "discNumber": 1, + "type": "music" + }, + { + "album": "(1983) Snake Charmer", + "artist": "Jah Wobble, The Edge & Holger Czukay", + "bitRate": 733, + "contentType": "audio/x-flac", + "coverArt": 3, + "created": "0001-01-01T00:00:00Z", + "duration": 331, + "id": 2, + "parent": 3, + "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/03.05 It Was a Camel.flac", + "size": 31080508, + "suffix": "flac", + "title": "It Was a Camel", + "track": 1, + "discNumber": 1, + "type": "music" + }, + { + "album": "(1983) Snake Charmer", + "artist": "Jah Wobble, The Edge & Holger Czukay", + "bitRate": 961, + "contentType": "audio/x-flac", + "coverArt": 3, + "created": "0001-01-01T00:00:00Z", + "duration": 227, + "id": 5, + "parent": 3, + "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/04.05 Sleazy.flac", + "size": 27938750, + "suffix": "flac", + "title": "Sleazy", + "track": 1, + "discNumber": 1, + "type": "music" + }, + { + "album": "(1983) Snake Charmer", + "artist": "Jah Wobble, The Edge & Holger Czukay", + "bitRate": 867, + "contentType": "audio/x-flac", + "coverArt": 3, + "created": "0001-01-01T00:00:00Z", + "duration": 418, + "id": 4, + "parent": 3, + "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/05.05 Snake Charmer (reprise).flac", + "size": 46427922, + "suffix": "flac", + "title": "Snake Charmer (reprise)", + "track": 1, + "discNumber": 1, "type": "music" } ] diff --git a/server/handler/test_data/test_get_music_directory_without_tracks b/server/handler/test_data/test_get_music_directory_without_tracks index 325fb24..8604a74 100644 --- a/server/handler/test_data/test_get_music_directory_without_tracks +++ b/server/handler/test_data/test_get_music_directory_without_tracks @@ -5,7 +5,7 @@ "directory": { "id": 2, "parent": 1, - "name": "A Certain Ratio", + "name": "Jah Wobble, The Edge, Holger Czukay", "child": [ { "coverArt": 3, @@ -13,14 +13,7 @@ "id": 3, "isDir": true, "parent": 2, - "title": "(1994) The Graveyard and the Ballroom" - }, - { - "created": "0001-01-01T00:00:00Z", - "id": 4, - "isDir": true, - "parent": 2, - "title": "(1981) To Each." + "title": "(1983) Snake Charmer" } ] } diff --git a/server/handler/test_data/test_search_three_q_13 b/server/handler/test_data/test_search_three_q_13 index c70a7c2..dff8055 100644 --- a/server/handler/test_data/test_search_three_q_13 +++ b/server/handler/test_data/test_search_three_q_13 @@ -5,18 +5,18 @@ "searchResult3": { "artist": [ { - "id": 2, + "id": 4, "name": "13th Floor Elevators" } ], "album": [ { - "id": 7, - "coverArt": 7, - "artistId": 2, + "id": 11, + "coverArt": 11, + "artistId": 4, "artist": "13th Floor Elevators", "name": "The Psychedelic Sounds of the 13th Floor Elevators", - "created": "2019-06-06T16:38:39.309763889+01:00" + "created": "2019-06-10T17:06:26.015039416+01:00" } ] } diff --git a/server/handler/test_data/test_search_three_q_ani b/server/handler/test_data/test_search_three_q_ani index bf21ecf..016359a 100644 --- a/server/handler/test_data/test_search_three_q_ani +++ b/server/handler/test_data/test_search_three_q_ani @@ -5,18 +5,18 @@ "searchResult3": { "artist": [ { - "id": 3, + "id": 5, "name": "Anikas" } ], "album": [ { - "id": 11, - "coverArt": 11, - "artistId": 3, + "id": 15, + "coverArt": 15, + "artistId": 5, "artist": "Anikas", "name": "Anika", - "created": "2019-06-06T16:38:39.31657693+01:00" + "created": "2019-06-10T17:06:26.028934348+01:00" } ] } diff --git a/server/handler/test_data/test_search_three_q_cert b/server/handler/test_data/test_search_three_q_cert index 2020872..caf05c7 100644 --- a/server/handler/test_data/test_search_three_q_cert +++ b/server/handler/test_data/test_search_three_q_cert @@ -5,7 +5,7 @@ "searchResult3": { "artist": [ { - "id": 1, + "id": 3, "name": "A Certain Ratio" } ] diff --git a/server/handler/test_data/test_search_two_q_13 b/server/handler/test_data/test_search_two_q_13 index db2f5a2..b2041a8 100644 --- a/server/handler/test_data/test_search_two_q_13 +++ b/server/handler/test_data/test_search_two_q_13 @@ -5,18 +5,18 @@ "searchResult2": { "artist": [ { - "id": 5, + "id": 9, "parent": 1, "name": "13th Floor Lowervators" } ], "album": [ { - "coverArt": 7, + "coverArt": 11, "created": "0001-01-01T00:00:00Z", - "id": 7, + "id": 11, "isDir": true, - "parent": 5, + "parent": 9, "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators" } ], @@ -26,16 +26,17 @@ "artist": "A Certain Ratio", "bitRate": 877, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": 7, "created": "0001-01-01T00:00:00Z", "duration": 332, - "id": 1, - "parent": 3, + "id": 15, + "parent": 7, "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/13.14 Flight.flac", "size": 37302417, "suffix": "flac", "title": "Flight", - "track": 13, + "track": 1, + "discNumber": 1, "type": "music" }, { @@ -43,16 +44,71 @@ "artist": "13th Floor Elevators", "bitRate": 245, "contentType": "audio/mpeg", - "coverArt": 7, + "coverArt": 11, "created": "0001-01-01T00:00:00Z", "duration": 154, - "id": 35, - "parent": 7, + "id": 49, + "parent": 11, "path": "13th Floor Lowervators/(1966) The Psychedelic Sounds of the 13th Floor Elevators/13.21 Before You Accuse Me.mp3", "size": 4722688, "suffix": "mp3", "title": "Before You Accuse Me", "track": 13, + "discNumber": 1, + "type": "music" + }, + { + "album": "(1980) Jane From Occupied Europe", + "artist": "Swell Maps", + "bitRate": 1176, + "contentType": "audio/x-flac", + "coverArt": 18, + "created": "0001-01-01T00:00:00Z", + "duration": 220, + "id": 85, + "parent": 18, + "path": "Swell Maps/(1980) Jane From Occupied Europe/13.16 Blenheim Shots.flac", + "size": 33140852, + "suffix": "flac", + "title": "Blenheim Shots", + "track": 1, + "discNumber": 1, + "type": "music" + }, + { + "album": "(1979) A Trip to Marineville", + "artist": "Swell Maps", + "bitRate": 295, + "contentType": "audio/mpeg", + "coverArt": 19, + "created": "0001-01-01T00:00:00Z", + "duration": 463, + "id": 102, + "parent": 19, + "path": "Swell Maps/(1979) A Trip to Marineville/d01 13.14 Adventuring Into Basketry.mp3", + "size": 17119309, + "suffix": "mp3", + "title": "Adventuring Into Basketry", + "track": 13, + "discNumber": 1, + "type": "music" + }, + { + "album": "(1967) Ten Years After", + "artist": "Ten Years After", + "bitRate": 192, + "contentType": "audio/ogg", + "coverArt": 21, + "created": "0001-01-01T00:00:00Z", + "duration": 433, + "id": 115, + "parent": 21, + "path": "Ten Years After/(1967) Ten Years After/13.15 Spider in My Web.ogg", + "size": 10400948, + "suffix": "ogg", + "title": "Spider in My Web", + "track": 13, + "discNumber": 1, "type": "music" } ] diff --git a/server/handler/test_data/test_search_two_q_ani b/server/handler/test_data/test_search_two_q_ani index c199c25..2ab697d 100644 --- a/server/handler/test_data/test_search_two_q_ani +++ b/server/handler/test_data/test_search_two_q_ani @@ -5,18 +5,18 @@ "searchResult2": { "artist": [ { - "id": 8, + "id": 12, "parent": 1, "name": "___Anika" } ], "album": [ { - "coverArt": 11, + "coverArt": 15, "created": "0001-01-01T00:00:00Z", - "id": 11, + "id": 15, "isDir": true, - "parent": 10, + "parent": 14, "title": "(2010) Anika" } ] diff --git a/server/handler/test_data/test_search_two_q_cert b/server/handler/test_data/test_search_two_q_cert index c838b36..4625ac6 100644 --- a/server/handler/test_data/test_search_two_q_cert +++ b/server/handler/test_data/test_search_two_q_cert @@ -5,7 +5,7 @@ "searchResult2": { "artist": [ { - "id": 2, + "id": 6, "parent": 1, "name": "A Certain Ratio" }