From 58624f07dc81c36fda79827cc41ac57e89e18b37 Mon Sep 17 00:00:00 2001 From: sentriz Date: Sat, 8 May 2021 18:13:04 +0100 Subject: [PATCH] feat(subsonic)!: don't return gonic version from responses --- server/ctrlsubsonic/spec/spec.go | 13 +- .../testdata/test_get_album_list_alpha_artist | 1 - .../testdata/test_get_album_list_alpha_name | 1 - .../testdata/test_get_album_list_newest | 1 - .../testdata/test_get_album_list_random | 119 ++++++++------- .../test_get_album_list_two_alpha_artist | 1 - .../test_get_album_list_two_alpha_name | 1 - .../testdata/test_get_album_list_two_newest | 1 - .../testdata/test_get_album_list_two_random | 141 +++++++++--------- .../testdata/test_get_album_with_cover | 1 - .../testdata/test_get_album_without_cover | 1 - .../testdata/test_get_artist_id_one | 1 - .../testdata/test_get_artist_id_three | 1 - .../testdata/test_get_artist_id_two | 1 - .../testdata/test_get_artists_no_args | 1 - .../testdata/test_get_indexes_no_args | 1 - .../test_get_music_directory_with_tracks | 1 - .../test_get_music_directory_without_tracks | 1 - .../testdata/test_search_three_q_13 | 1 - .../testdata/test_search_three_q_ani | 1 - .../testdata/test_search_three_q_cert | 1 - .../testdata/test_search_two_q_13 | 1 - .../testdata/test_search_two_q_ani | 1 - .../testdata/test_search_two_q_cert | 1 - 24 files changed, 134 insertions(+), 160 deletions(-) diff --git a/server/ctrlsubsonic/spec/spec.go b/server/ctrlsubsonic/spec/spec.go index 3c2a7af2..e242ed90 100644 --- a/server/ctrlsubsonic/spec/spec.go +++ b/server/ctrlsubsonic/spec/spec.go @@ -18,7 +18,6 @@ type Response struct { Version string `xml:"version,attr" json:"version"` XMLNS string `xml:"xmlns,attr" json:"-"` Type string `xml:"type,attr" json:"type"` - GonicVersion string `xml:"gonicVersion,attr" json:"gonicVersion"` Error *Error `xml:"error" json:"error,omitempty"` Albums *Albums `xml:"albumList" json:"albumList,omitempty"` AlbumsTwo *Albums `xml:"albumList2" json:"albumList2,omitempty"` @@ -50,11 +49,10 @@ type Response struct { func NewResponse() *Response { return &Response{ - Status: "ok", - XMLNS: xmlns, - Version: apiVersion, - Type: gonic.Name, - GonicVersion: gonic.Version, + Status: "ok", + XMLNS: xmlns, + Version: apiVersion, + Type: gonic.Name, } } @@ -82,8 +80,7 @@ func NewError(code int, message string, a ...interface{}) *Response { Code: code, Message: fmt.Sprintf(message, a...), }, - Type: gonic.Name, - GonicVersion: gonic.Version, + Type: gonic.Name, } } diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_alpha_artist b/server/ctrlsubsonic/testdata/test_get_album_list_alpha_artist index cd1fd4d1..b3869461 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_alpha_artist +++ b/server/ctrlsubsonic/testdata/test_get_album_list_alpha_artist @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "albumList": { "album": [ { diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_alpha_name b/server/ctrlsubsonic/testdata/test_get_album_list_alpha_name index e8c10f35..f9d749f8 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_alpha_name +++ b/server/ctrlsubsonic/testdata/test_get_album_list_alpha_name @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "albumList": { "album": [ { diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_newest b/server/ctrlsubsonic/testdata/test_get_album_list_newest index 7aecc3ed..41719280 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_newest +++ b/server/ctrlsubsonic/testdata/test_get_album_list_newest @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "albumList": { "album": [ { diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_random b/server/ctrlsubsonic/testdata/test_get_album_list_random index 1ce59cf7..a0a44499 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_random +++ b/server/ctrlsubsonic/testdata/test_get_album_list_random @@ -3,20 +3,32 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "albumList": { "album": [ { - "id": "al-8", - "coverArt": "al-8", - "artist": "13th Floor Lowervators", - "title": "(1967) Easter Nowhere", + "id": "al-16", + "coverArt": "al-16", + "artist": "Swell Maps", + "title": "(1980) Jane From Occupied Europe", "album": "", - "parent": "al-7", + "parent": "al-15", "isDir": true, "name": "", - "songCount": 10, - "duration": 2609, + "songCount": 16, + "duration": 3040, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": "al-19", + "coverArt": "al-19", + "artist": "Ten Years After", + "title": "(1967) Ten Years After", + "album": "", + "parent": "al-18", + "isDir": true, + "name": "", + "songCount": 15, + "duration": 3812, "created": "0001-01-01T00:00:00Z" }, { @@ -33,54 +45,55 @@ "created": "0001-01-01T00:00:00Z" }, { - "id": "al-16", - "coverArt": "al-16", - "artist": "Swell Maps", - "title": "(1980) Jane From Occupied Europe", + "id": "al-3", + "coverArt": "al-3", + "artist": "Jah Wobble, The Edge, Holger Czukay", + "title": "(1983) Snake Charmer", "album": "", - "parent": "al-15", + "parent": "al-2", "isDir": true, "name": "", - "songCount": 16, - "duration": 3040, + "songCount": 5, + "duration": 1871, "created": "0001-01-01T00:00:00Z" }, { - "id": "al-5", - "coverArt": "al-5", - "artist": "A Certain Ratio", - "title": "(1994) The Graveyard and the Ballroom", + "id": "al-21", + "coverArt": "al-21", + "artist": "Captain Beefheart", + "title": "(1970) Lick My Decals Off, Bitch", "album": "", - "parent": "al-4", + "parent": "al-20", "isDir": true, "name": "", - "songCount": 14, - "duration": 2738, + "songCount": 15, + "duration": 2324, "created": "0001-01-01T00:00:00Z" }, { - "id": "al-6", + "id": "al-5", + "coverArt": "al-5", "artist": "A Certain Ratio", - "title": "(1981) To EachOTHER.", + "title": "(1994) The Graveyard and the Ballroom", "album": "", "parent": "al-4", "isDir": true, "name": "", - "songCount": 9, - "duration": 2801, + "songCount": 14, + "duration": 2738, "created": "0001-01-01T00:00:00Z" }, { - "id": "al-13", - "coverArt": "al-13", - "artist": "There", - "title": "(2010) Anika", + "id": "al-8", + "coverArt": "al-8", + "artist": "13th Floor Lowervators", + "title": "(1967) Easter Nowhere", "album": "", - "parent": "al-12", + "parent": "al-7", "isDir": true, "name": "", - "songCount": 9, - "duration": 2169, + "songCount": 10, + "duration": 2609, "created": "0001-01-01T00:00:00Z" }, { @@ -97,42 +110,28 @@ "created": "0001-01-01T00:00:00Z" }, { - "id": "al-21", - "coverArt": "al-21", - "artist": "Captain Beefheart", - "title": "(1970) Lick My Decals Off, Bitch", - "album": "", - "parent": "al-20", - "isDir": true, - "name": "", - "songCount": 15, - "duration": 2324, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": "al-3", - "coverArt": "al-3", - "artist": "Jah Wobble, The Edge, Holger Czukay", - "title": "(1983) Snake Charmer", + "id": "al-6", + "artist": "A Certain Ratio", + "title": "(1981) To EachOTHER.", "album": "", - "parent": "al-2", + "parent": "al-4", "isDir": true, "name": "", - "songCount": 5, - "duration": 1871, + "songCount": 9, + "duration": 2801, "created": "0001-01-01T00:00:00Z" }, { - "id": "al-19", - "coverArt": "al-19", - "artist": "Ten Years After", - "title": "(1967) Ten Years After", + "id": "al-13", + "coverArt": "al-13", + "artist": "There", + "title": "(2010) Anika", "album": "", - "parent": "al-18", + "parent": "al-12", "isDir": true, "name": "", - "songCount": 15, - "duration": 3812, + "songCount": 9, + "duration": 2169, "created": "0001-01-01T00:00:00Z" } ] diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_artist b/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_artist index a25f86d8..32d92948 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_artist +++ b/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_artist @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "albumList2": { "album": [ { diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_name b/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_name index 2a355ba6..d7432860 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_name +++ b/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_name @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "albumList2": { "album": [ { diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_two_newest b/server/ctrlsubsonic/testdata/test_get_album_list_two_newest index 7a686899..09ebebf1 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_two_newest +++ b/server/ctrlsubsonic/testdata/test_get_album_list_two_newest @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "albumList2": { "album": [ { diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_two_random b/server/ctrlsubsonic/testdata/test_get_album_list_two_random index 6e60d210..87dea95a 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_two_random +++ b/server/ctrlsubsonic/testdata/test_get_album_list_two_random @@ -3,59 +3,33 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "albumList2": { "album": [ { - "id": "al-19", - "coverArt": "al-19", - "artistId": "ar-6", - "artist": "Ten Years After", - "title": "", - "album": "", - "name": "Ten Years After", - "songCount": 15, - "duration": 3812, - "created": "2019-04-30T16:48:30+01:00", - "year": 1967 - }, - { - "id": "al-6", - "artistId": "ar-2", - "artist": "A Certain Ratio", - "title": "", - "album": "", - "name": "To Each...", - "songCount": 9, - "duration": 2801, - "created": "2019-05-23T15:12:02.921473302+01:00", - "year": 1981 - }, - { - "id": "al-5", - "coverArt": "al-5", - "artistId": "ar-2", - "artist": "A Certain Ratio", + "id": "al-17", + "coverArt": "al-17", + "artistId": "ar-5", + "artist": "Swell Maps", "title": "", "album": "", - "name": "The Graveyard and the Ballroom", - "songCount": 14, - "duration": 2738, - "created": "2019-06-05T17:46:37.675917974+01:00", - "year": 1994 + "name": "A Trip to Marineville", + "songCount": 18, + "duration": 3266, + "created": "2019-04-30T16:48:48+01:00", + "year": 1979 }, { - "id": "al-9", - "coverArt": "al-9", - "artistId": "ar-3", - "artist": "13th Floor Elevators", + "id": "al-16", + "coverArt": "al-16", + "artistId": "ar-5", + "artist": "Swell Maps", "title": "", "album": "", - "name": "The Psychedelic Sounds of the 13th Floor Elevators", - "songCount": 21, - "duration": 4222, - "created": "2019-06-13T12:57:24.306717554+01:00", - "year": 1966 + "name": "Jane From Occupied Europe", + "songCount": 16, + "duration": 3040, + "created": "2019-04-30T16:48:48+01:00", + "year": 1980 }, { "id": "al-21", @@ -84,43 +58,42 @@ "year": 1967 }, { - "id": "al-17", - "coverArt": "al-17", - "artistId": "ar-5", - "artist": "Swell Maps", + "id": "al-19", + "coverArt": "al-19", + "artistId": "ar-6", + "artist": "Ten Years After", "title": "", "album": "", - "name": "A Trip to Marineville", - "songCount": 18, - "duration": 3266, - "created": "2019-04-30T16:48:48+01:00", - "year": 1979 + "name": "Ten Years After", + "songCount": 15, + "duration": 3812, + "created": "2019-04-30T16:48:30+01:00", + "year": 1967 }, { - "id": "al-16", - "coverArt": "al-16", - "artistId": "ar-5", - "artist": "Swell Maps", + "id": "al-6", + "artistId": "ar-2", + "artist": "A Certain Ratio", "title": "", "album": "", - "name": "Jane From Occupied Europe", - "songCount": 16, - "duration": 3040, - "created": "2019-04-30T16:48:48+01:00", - "year": 1980 + "name": "To Each...", + "songCount": 9, + "duration": 2801, + "created": "2019-05-23T15:12:02.921473302+01:00", + "year": 1981 }, { - "id": "al-3", - "coverArt": "al-3", - "artistId": "ar-1", - "artist": "Jah Wobble, The Edge & Holger Czukay", + "id": "al-9", + "coverArt": "al-9", + "artistId": "ar-3", + "artist": "13th Floor Elevators", "title": "", "album": "", - "name": "Snake Charmer", - "songCount": 5, - "duration": 1871, - "created": "2019-05-16T22:10:52+01:00", - "year": 1983 + "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "songCount": 21, + "duration": 4222, + "created": "2019-06-13T12:57:24.306717554+01:00", + "year": 1966 }, { "id": "al-13", @@ -134,6 +107,32 @@ "duration": 2169, "created": "2019-05-23T15:12:02.921473302+01:00", "year": 2010 + }, + { + "id": "al-3", + "coverArt": "al-3", + "artistId": "ar-1", + "artist": "Jah Wobble, The Edge & Holger Czukay", + "title": "", + "album": "", + "name": "Snake Charmer", + "songCount": 5, + "duration": 1871, + "created": "2019-05-16T22:10:52+01:00", + "year": 1983 + }, + { + "id": "al-5", + "coverArt": "al-5", + "artistId": "ar-2", + "artist": "A Certain Ratio", + "title": "", + "album": "", + "name": "The Graveyard and the Ballroom", + "songCount": 14, + "duration": 2738, + "created": "2019-06-05T17:46:37.675917974+01:00", + "year": 1994 } ] } diff --git a/server/ctrlsubsonic/testdata/test_get_album_with_cover b/server/ctrlsubsonic/testdata/test_get_album_with_cover index 6c9f8eef..837e2ad5 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_with_cover +++ b/server/ctrlsubsonic/testdata/test_get_album_with_cover @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "album": { "id": "al-3", "coverArt": "al-3", diff --git a/server/ctrlsubsonic/testdata/test_get_album_without_cover b/server/ctrlsubsonic/testdata/test_get_album_without_cover index eb87afb1..46aa4bd7 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_without_cover +++ b/server/ctrlsubsonic/testdata/test_get_album_without_cover @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "album": { "id": "al-2", "title": "", diff --git a/server/ctrlsubsonic/testdata/test_get_artist_id_one b/server/ctrlsubsonic/testdata/test_get_artist_id_one index 057a43b6..2697244d 100644 --- a/server/ctrlsubsonic/testdata/test_get_artist_id_one +++ b/server/ctrlsubsonic/testdata/test_get_artist_id_one @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "artist": { "id": "ar-1", "name": "Jah Wobble, The Edge & Holger Czukay", diff --git a/server/ctrlsubsonic/testdata/test_get_artist_id_three b/server/ctrlsubsonic/testdata/test_get_artist_id_three index 9c1ac73a..8d81f2a6 100644 --- a/server/ctrlsubsonic/testdata/test_get_artist_id_three +++ b/server/ctrlsubsonic/testdata/test_get_artist_id_three @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "artist": { "id": "ar-3", "name": "13th Floor Elevators", diff --git a/server/ctrlsubsonic/testdata/test_get_artist_id_two b/server/ctrlsubsonic/testdata/test_get_artist_id_two index 890c5254..a63a6e5b 100644 --- a/server/ctrlsubsonic/testdata/test_get_artist_id_two +++ b/server/ctrlsubsonic/testdata/test_get_artist_id_two @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "artist": { "id": "ar-2", "name": "A Certain Ratio", diff --git a/server/ctrlsubsonic/testdata/test_get_artists_no_args b/server/ctrlsubsonic/testdata/test_get_artists_no_args index 3230454f..0d31203d 100644 --- a/server/ctrlsubsonic/testdata/test_get_artists_no_args +++ b/server/ctrlsubsonic/testdata/test_get_artists_no_args @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "artists": { "ignoredArticles": "", "index": [ diff --git a/server/ctrlsubsonic/testdata/test_get_indexes_no_args b/server/ctrlsubsonic/testdata/test_get_indexes_no_args index d340fbbb..e82d6ee5 100644 --- a/server/ctrlsubsonic/testdata/test_get_indexes_no_args +++ b/server/ctrlsubsonic/testdata/test_get_indexes_no_args @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "indexes": { "lastModified": 0, "ignoredArticles": "", diff --git a/server/ctrlsubsonic/testdata/test_get_music_directory_with_tracks b/server/ctrlsubsonic/testdata/test_get_music_directory_with_tracks index 0ed71f6b..2cc15b94 100644 --- a/server/ctrlsubsonic/testdata/test_get_music_directory_with_tracks +++ b/server/ctrlsubsonic/testdata/test_get_music_directory_with_tracks @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "directory": { "id": "al-3", "parent": "al-2", diff --git a/server/ctrlsubsonic/testdata/test_get_music_directory_without_tracks b/server/ctrlsubsonic/testdata/test_get_music_directory_without_tracks index 77359c49..87f01c12 100644 --- a/server/ctrlsubsonic/testdata/test_get_music_directory_without_tracks +++ b/server/ctrlsubsonic/testdata/test_get_music_directory_without_tracks @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "directory": { "id": "al-2", "name": "Jah Wobble, The Edge, Holger Czukay", diff --git a/server/ctrlsubsonic/testdata/test_search_three_q_13 b/server/ctrlsubsonic/testdata/test_search_three_q_13 index 60a84677..99f99332 100644 --- a/server/ctrlsubsonic/testdata/test_search_three_q_13 +++ b/server/ctrlsubsonic/testdata/test_search_three_q_13 @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "searchResult3": { "artist": [ { diff --git a/server/ctrlsubsonic/testdata/test_search_three_q_ani b/server/ctrlsubsonic/testdata/test_search_three_q_ani index 34e20c02..7535719d 100644 --- a/server/ctrlsubsonic/testdata/test_search_three_q_ani +++ b/server/ctrlsubsonic/testdata/test_search_three_q_ani @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "searchResult3": { "artist": [ { diff --git a/server/ctrlsubsonic/testdata/test_search_three_q_cert b/server/ctrlsubsonic/testdata/test_search_three_q_cert index 87b17029..712d992e 100644 --- a/server/ctrlsubsonic/testdata/test_search_three_q_cert +++ b/server/ctrlsubsonic/testdata/test_search_three_q_cert @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "searchResult3": { "artist": [ { diff --git a/server/ctrlsubsonic/testdata/test_search_two_q_13 b/server/ctrlsubsonic/testdata/test_search_two_q_13 index 3cf57c75..05bf1c36 100644 --- a/server/ctrlsubsonic/testdata/test_search_two_q_13 +++ b/server/ctrlsubsonic/testdata/test_search_two_q_13 @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "searchResult2": { "artist": [ { diff --git a/server/ctrlsubsonic/testdata/test_search_two_q_ani b/server/ctrlsubsonic/testdata/test_search_two_q_ani index fd8171c7..6f6ee0a4 100644 --- a/server/ctrlsubsonic/testdata/test_search_two_q_ani +++ b/server/ctrlsubsonic/testdata/test_search_two_q_ani @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "searchResult2": { "artist": [ { diff --git a/server/ctrlsubsonic/testdata/test_search_two_q_cert b/server/ctrlsubsonic/testdata/test_search_two_q_cert index 6d89771e..5e6e6432 100644 --- a/server/ctrlsubsonic/testdata/test_search_two_q_cert +++ b/server/ctrlsubsonic/testdata/test_search_two_q_cert @@ -3,7 +3,6 @@ "status": "ok", "version": "1.15.0", "type": "gonic", - "gonicVersion": "v0.12.3", "searchResult2": { "artist": [ {