diff --git a/db/db.go b/db/db.go index 14b6769..8cc0be4 100644 --- a/db/db.go +++ b/db/db.go @@ -54,7 +54,7 @@ func NewMock() (*DB, error) { func (db *DB) GetSetting(key string) string { setting := &Setting{} db. - Where("key = ?", key). + Where("key=?", key). First(setting) return setting.Value } @@ -69,7 +69,7 @@ func (db *DB) SetSetting(key, value string) { func (db *DB) GetUserFromName(name string) *User { user := &User{} err := db. - Where("name = ?", name). + Where("name=?", name). First(user). Error if gorm.IsRecordNotFoundError(err) { diff --git a/db/migrations.go b/db/migrations.go index 47b1311..3f8eb9f 100644 --- a/db/migrations.go +++ b/db/migrations.go @@ -33,7 +33,7 @@ var migrationCreateInitUser = gormigrate.Migration{ initPassword = "admin" ) err := tx. - Where("name = ?", initUsername). + Where("name=?", initUsername). First(&User{}). Error if !gorm.IsRecordNotFoundError(err) { @@ -56,7 +56,7 @@ var migrationMergePlaylist = gormigrate.Migration{ } return tx.Exec(` UPDATE playlists - SET items = ( SELECT group_concat(track_id) FROM ( + SET items=( SELECT group_concat(track_id) FROM ( SELECT track_id FROM playlist_items WHERE playlist_items.playlist_id=playlists.id diff --git a/scanner/scanner.go b/scanner/scanner.go index 54a0c96..3bacbbf 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -132,17 +132,17 @@ func (s *Scanner) Start() error { }) // delete albums without tracks s.db.Exec(` - DELETE FROM albums - WHERE tag_artist_id NOT NULL - AND NOT EXISTS (SELECT 1 FROM tracks - WHERE tracks.album_id = albums.id) - `) + DELETE FROM albums + WHERE tag_artist_id NOT NULL + AND NOT EXISTS ( SELECT 1 FROM tracks + WHERE tracks.album_id=albums.id + )`) // delete artists without albums s.db.Exec(` - DELETE FROM artists - WHERE NOT EXISTS (SELECT 1 from albums - WHERE albums.tag_artist_id = artists.id) - `) + DELETE FROM artists + WHERE NOT EXISTS ( SELECT 1 from albums + WHERE albums.tag_artist_id=artists.id + )`) // finish up strNow := strconv.FormatInt(time.Now().Unix(), 10) s.db.SetSetting("last_scan_time", strNow) @@ -352,7 +352,7 @@ func (s *Scanner) handleTrack(it *item) error { artist := &db.Artist{} err = s.trTx. Select("id"). - Where("name = ?", artistName). + Where("name=?", artistName). First(artist). Error if gorm.IsRecordNotFoundError(err) { diff --git a/server/ctrladmin/handlers.go b/server/ctrladmin/handlers.go index 0d29e84..3e0474d 100644 --- a/server/ctrladmin/handlers.go +++ b/server/ctrladmin/handlers.go @@ -56,7 +56,7 @@ func (c *Controller) ServeHome(r *http.Request) *Response { // ** begin playlists box user := r.Context().Value(CtxUser).(*db.User) c.DB. - Where("user_id = ?", user.ID). + Where("user_id=?", user.ID). Limit(20). Find(&data.Playlists) // diff --git a/server/ctrladmin/playlist.go b/server/ctrladmin/playlist.go index 4832c57..90c0ff4 100644 --- a/server/ctrladmin/playlist.go +++ b/server/ctrladmin/playlist.go @@ -8,6 +8,7 @@ import ( "github.com/jinzhu/gorm" "github.com/pkg/errors" + "senan.xyz/g/gonic/db" ) @@ -18,9 +19,9 @@ func playlistParseLine(c *Controller, path string) (int, error) { var track db.Track query := c.DB.Raw(` SELECT tracks.id FROM TRACKS - JOIN albums ON tracks.album_id = albums.id - WHERE (? || '/' || albums.left_path || albums.right_path || '/' || tracks.filename) = ? - `, c.MusicPath, path) + JOIN albums ON tracks.album_id=albums.id + WHERE (? || '/' || albums.left_path || albums.right_path || '/' || tracks.filename)=?`, + c.MusicPath, path) err := query.First(&track).Error switch { case gorm.IsRecordNotFoundError(err): diff --git a/server/ctrlsubsonic/handlers_by_folder.go b/server/ctrlsubsonic/handlers_by_folder.go index f298a9e..0f52bac 100644 --- a/server/ctrlsubsonic/handlers_by_folder.go +++ b/server/ctrlsubsonic/handlers_by_folder.go @@ -22,12 +22,9 @@ import ( func (c *Controller) ServeGetIndexes(r *http.Request) *spec.Response { var folders []*db.Album c.DB. - Select("*, count(sub.id) as child_count"). - Joins(` - LEFT JOIN albums sub - ON albums.id = sub.parent_id - `). - Where("albums.parent_id = 1"). + Select("*, count(sub.id) child_count"). + Joins("JOIN albums sub ON albums.id=sub.parent_id"). + Where("albums.parent_id=1"). Group("albums.id"). Find(&folders) // [a-z#] -> 27 @@ -71,7 +68,7 @@ func (c *Controller) ServeGetMusicDirectory(r *http.Request) *spec.Response { // start looking for child childFolders in the current dir var childFolders []*db.Album c.DB. - Where("parent_id = ?", id). + Where("parent_id=?", id). Find(&childFolders) for _, c := range childFolders { childrenObj = append(childrenObj, spec.NewTCAlbumByFolder(c)) @@ -80,7 +77,7 @@ func (c *Controller) ServeGetMusicDirectory(r *http.Request) *spec.Response { // start looking for child childTracks in the current dir var childTracks []*db.Track c.DB. - Where("album_id = ?", id). + Where("album_id=?", id). Preload("Album"). Order("filename"). Find(&childTracks) @@ -112,8 +109,8 @@ func (c *Controller) ServeGetAlbumList(r *http.Request) *spec.Response { switch listType { case "alphabeticalByArtist": q = q.Joins(` - JOIN albums AS parent_albums - ON albums.parent_id = parent_albums.id`) + JOIN albums parent_albums + ON albums.parent_id=parent_albums.id`) q = q.Order("parent_albums.right_path") case "alphabeticalByName": q = q.Order("right_path") @@ -121,7 +118,7 @@ func (c *Controller) ServeGetAlbumList(r *http.Request) *spec.Response { user := r.Context().Value(CtxUser).(*db.User) q = q.Joins(` JOIN plays - ON albums.id = plays.album_id AND plays.user_id = ?`, + ON albums.id=plays.album_id AND plays.user_id=?`, user.ID) q = q.Order("plays.count DESC") case "newest": @@ -132,14 +129,19 @@ func (c *Controller) ServeGetAlbumList(r *http.Request) *spec.Response { user := r.Context().Value(CtxUser).(*db.User) q = q.Joins(` JOIN plays - ON albums.id = plays.album_id AND plays.user_id = ?`, + ON albums.id=plays.album_id AND plays.user_id=?`, user.ID) q = q.Order("plays.time DESC") default: return spec.NewError(10, "unknown value `%s` for parameter 'type'", listType) } var folders []*db.Album + // TODO: think about removing this extra join to count number + // of children. it might make sense to store that in the db q. + Select("albums.*, count(tracks.id) child_count"). + Joins("JOIN tracks ON tracks.album_id=albums.id"). + Group("albums.id"). Where("albums.tag_artist_id IS NOT NULL"). Offset(params.GetIntOr("offset", 0)). Limit(params.GetIntOr("size", 10)). @@ -168,10 +170,10 @@ func (c *Controller) ServeSearchTwo(r *http.Request) *spec.Response { var artists []*db.Album c.DB. Where(` - parent_id = 1 - AND (right_path LIKE ? OR - right_path_u_dec LIKE ?) - `, query, query). + parent_id=1 + AND ( right_path LIKE ? OR + right_path_u_dec LIKE ? )`, + query, query). Offset(params.GetIntOr("artistOffset", 0)). Limit(params.GetIntOr("artistCount", 20)). Find(&artists) @@ -184,10 +186,10 @@ func (c *Controller) ServeSearchTwo(r *http.Request) *spec.Response { var albums []*db.Album c.DB. Where(` - tag_artist_id IS NOT NULL - AND (right_path LIKE ? OR - right_path_u_dec LIKE ?) - `, query, query). + tag_artist_id IS NOT NULL + AND ( right_path LIKE ? OR + right_path_u_dec LIKE ? )`, + query, query). Offset(params.GetIntOr("albumOffset", 0)). Limit(params.GetIntOr("albumCount", 20)). Find(&albums) @@ -199,10 +201,8 @@ func (c *Controller) ServeSearchTwo(r *http.Request) *spec.Response { var tracks []*db.Track c.DB. Preload("Album"). - Where(` - filename LIKE ? OR - filename_u_dec LIKE ? - `, query, query). + Where("filename LIKE ? OR filename_u_dec LIKE ?", + query, query). Offset(params.GetIntOr("songOffset", 0)). Limit(params.GetIntOr("songCount", 20)). Find(&tracks) diff --git a/server/ctrlsubsonic/handlers_by_tags.go b/server/ctrlsubsonic/handlers_by_tags.go index 4c3d80b..548ccf9 100644 --- a/server/ctrlsubsonic/handlers_by_tags.go +++ b/server/ctrlsubsonic/handlers_by_tags.go @@ -17,11 +17,8 @@ import ( func (c *Controller) ServeGetArtists(r *http.Request) *spec.Response { var artists []*db.Artist c.DB. - Select("*, count(sub.id) as album_count"). - Joins(` - LEFT JOIN albums sub - ON artists.id = sub.tag_artist_id - `). + Select("*, count(sub.id) album_count"). + Joins("JOIN albums sub ON artists.id=sub.tag_artist_id"). Group("artists.id"). Find(&artists) // [a-z#] -> 27 @@ -108,9 +105,7 @@ func (c *Controller) ServeGetAlbumListTwo(r *http.Request) *spec.Response { q := c.DB.DB switch listType { case "alphabeticalByArtist": - q = q.Joins(` - JOIN artists - ON albums.tag_artist_id = artists.id`) + q = q.Joins("JOIN artists ON albums.tag_artist_id=artists.id") q = q.Order("artists.name") case "alphabeticalByName": q = q.Order("tag_title") @@ -122,9 +117,7 @@ func (c *Controller) ServeGetAlbumListTwo(r *http.Request) *spec.Response { q = q.Order("tag_year") case "frequent": user := r.Context().Value(CtxUser).(*db.User) - q = q.Joins(` - JOIN plays - ON albums.id = plays.album_id AND plays.user_id = ?`, + q = q.Joins("JOIN plays ON albums.id=plays.album_id AND plays.user_id=?", user.ID) q = q.Order("plays.count DESC") case "newest": @@ -133,16 +126,19 @@ func (c *Controller) ServeGetAlbumListTwo(r *http.Request) *spec.Response { q = q.Order(gorm.Expr("random()")) case "recent": user := r.Context().Value(CtxUser).(*db.User) - q = q.Joins(` - JOIN plays - ON albums.id = plays.album_id AND plays.user_id = ?`, + q = q.Joins("JOIN plays ON albums.id=plays.album_id AND plays.user_id=?", user.ID) q = q.Order("plays.time DESC") default: return spec.NewError(10, "unknown value `%s` for parameter 'type'", listType) } var albums []*db.Album + // TODO: think about removing this extra join to count number + // of children. it might make sense to store that in the db q. + Select("albums.*, count(tracks.id) child_count"). + Joins("JOIN tracks ON tracks.album_id=albums.id"). + Group("albums.id"). Where("albums.tag_artist_id IS NOT NULL"). Offset(params.GetIntOr("offset", 0)). Limit(params.GetIntOr("size", 10)). @@ -171,10 +167,8 @@ func (c *Controller) ServeSearchThree(r *http.Request) *spec.Response { // search "artists" var artists []*db.Artist c.DB. - Where(` - name LIKE ? OR - name_u_dec LIKE ? - `, query, query). + Where("name LIKE ? OR name_u_dec LIKE ?", + query, query). Offset(params.GetIntOr("artistOffset", 0)). Limit(params.GetIntOr("artistCount", 20)). Find(&artists) @@ -187,10 +181,8 @@ func (c *Controller) ServeSearchThree(r *http.Request) *spec.Response { var albums []*db.Album c.DB. Preload("TagArtist"). - Where(` - tag_title LIKE ? OR - tag_title_u_dec LIKE ? - `, query, query). + Where("tag_title LIKE ? OR tag_title_u_dec LIKE ?", + query, query). Offset(params.GetIntOr("albumOffset", 0)). Limit(params.GetIntOr("albumCount", 20)). Find(&albums) @@ -203,10 +195,8 @@ func (c *Controller) ServeSearchThree(r *http.Request) *spec.Response { var tracks []*db.Track c.DB. Preload("Album"). - Where(` - tag_title LIKE ? OR - tag_title_u_dec LIKE ? - `, query, query). + Where("tag_title LIKE ? OR tag_title_u_dec LIKE ?", + query, query). Offset(params.GetIntOr("songOffset", 0)). Limit(params.GetIntOr("songCount", 20)). Find(&tracks) @@ -231,7 +221,7 @@ func (c *Controller) ServeGetArtistInfoTwo(r *http.Request) *spec.Response { } artist := &db.Artist{} err = c.DB. - Where("id = ?", id). + Where("id=?", id). Find(artist). Error if gorm.IsRecordNotFoundError(err) { @@ -265,9 +255,9 @@ func (c *Controller) ServeGetArtistInfoTwo(r *http.Request) *spec.Response { } artist = &db.Artist{} err = c.DB. - Select("*, count(albums.id) as album_count"). - Where("name = ?", similarInfo.Name). - Joins(`LEFT JOIN albums ON artists.id = albums.tag_artist_id`). + Select("artists.*, count(albums.id) album_count"). + Where("name=?", similarInfo.Name). + Joins("JOIN albums ON artists.id=albums.tag_artist_id"). Group("artists.id"). Find(artist). Error diff --git a/server/ctrlsubsonic/handlers_common.go b/server/ctrlsubsonic/handlers_common.go index 2f33214..d929f58 100644 --- a/server/ctrlsubsonic/handlers_common.go +++ b/server/ctrlsubsonic/handlers_common.go @@ -125,7 +125,7 @@ func (c *Controller) ServeNotFound(r *http.Request) *spec.Response { func (c *Controller) ServeGetPlaylists(r *http.Request) *spec.Response { user := r.Context().Value(CtxUser).(*db.User) var playlists []*db.Playlist - c.DB.Where("user_id = ?", user.ID).Find(&playlists) + c.DB.Where("user_id=?", user.ID).Find(&playlists) sub := spec.NewResponse() sub.Playlists = &spec.Playlists{ List: make([]*spec.Playlist, len(playlists)), @@ -146,7 +146,7 @@ func (c *Controller) ServeGetPlaylist(r *http.Request) *spec.Response { } playlist := db.Playlist{} err = c.DB. - Where("id = ?", playlistID). + Where("id=?", playlistID). Find(&playlist). Error if gorm.IsRecordNotFoundError(err) { @@ -162,7 +162,7 @@ func (c *Controller) ServeGetPlaylist(r *http.Request) *spec.Response { for i, id := range trackIDs { track := db.Track{} c.DB. - Where("id = ?", id). + Where("id=?", id). Preload("Album"). Find(&track) sub.Playlist.List[i] = spec.NewTCTrackByFolder(&track, track.Album) @@ -181,7 +181,7 @@ func (c *Controller) ServeUpdatePlaylist(r *http.Request) *spec.Response { // as intended var playlist db.Playlist c.DB. - Where("id = ?", playlistID). + Where("id=?", playlistID). FirstOrCreate(&playlist) // ** begin update meta info playlist.UserID = user.ID @@ -212,7 +212,7 @@ func (c *Controller) ServeUpdatePlaylist(r *http.Request) *spec.Response { func (c *Controller) ServeDeletePlaylist(r *http.Request) *spec.Response { params := r.Context().Value(CtxParams).(params.Params) c.DB. - Where("id = ?", params.GetIntOr("id", 0)). + Where("id=?", params.GetIntOr("id", 0)). Delete(&db.Playlist{}) return spec.NewResponse() } @@ -221,7 +221,7 @@ func (c *Controller) ServeGetPlayQueue(r *http.Request) *spec.Response { user := r.Context().Value(CtxUser).(*db.User) queue := db.PlayQueue{} err := c.DB. - Where("user_id = ?", user.ID). + Where("user_id=?", user.ID). Find(&queue). Error if gorm.IsRecordNotFoundError(err) { @@ -239,7 +239,7 @@ func (c *Controller) ServeGetPlayQueue(r *http.Request) *spec.Response { for i, id := range trackIDs { track := db.Track{} c.DB. - Where("id = ?", id). + Where("id=?", id). Preload("Album"). Find(&track) sub.PlayQueue.List[i] = spec.NewTCTrackByFolder(&track, track.Album) @@ -272,7 +272,7 @@ func (c *Controller) ServeGetSong(r *http.Request) *spec.Response { } track := &db.Track{} err = c.DB. - Where("id = ?", id). + Where("id=?", id). Preload("Album"). First(track). Error diff --git a/server/ctrlsubsonic/testdata/db b/server/ctrlsubsonic/testdata/db index c4d26aa..e01c490 100644 Binary files a/server/ctrlsubsonic/testdata/db and b/server/ctrlsubsonic/testdata/db differ diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_alpha_artist b/server/ctrlsubsonic/testdata/test_get_album_list_alpha_artist index 2893cdb..3d4c10c 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_alpha_artist +++ b/server/ctrlsubsonic/testdata/test_get_album_list_alpha_artist @@ -7,93 +7,112 @@ "albumList": { "album": [ { - "id": 8, - "coverArt": 8, + "id": "8", + "coverArt": "8", "artist": "13th Floor Lowervators", "title": "(1967) Easter Nowhere", - "parent": 7, + "parent": "7", "isDir": true, + "songCount": 10, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 9, - "coverArt": 9, + "id": "9", + "coverArt": "9", "artist": "13th Floor Lowervators", "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", - "parent": 7, + "parent": "7", "isDir": true, + "songCount": 21, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 5, - "coverArt": 5, + "id": "5", + "coverArt": "5", "artist": "A Certain Ratio", "title": "(1994) The Graveyard and the Ballroom", - "parent": 4, + "parent": "4", "isDir": true, + "songCount": 14, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 6, - "coverArt": 6, + "id": "6", "artist": "A Certain Ratio", "title": "(1981) To EachOTHER.", - "parent": 4, + "parent": "4", "isDir": true, + "songCount": 9, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 21, - "coverArt": 21, + "id": "21", + "coverArt": "21", "artist": "Captain Beefheart", "title": "(1970) Lick My Decals Off, Bitch", - "parent": 20, + "parent": "20", "isDir": true, + "songCount": 15, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 3, - "coverArt": 3, + "id": "3", + "coverArt": "3", "artist": "Jah Wobble, The Edge, Holger Czukay", "title": "(1983) Snake Charmer", - "parent": 2, + "parent": "2", "isDir": true, + "songCount": 5, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 16, - "coverArt": 16, + "id": "16", + "coverArt": "16", "artist": "Swell Maps", "title": "(1980) Jane From Occupied Europe", - "parent": 15, + "parent": "15", "isDir": true, + "songCount": 16, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 17, - "coverArt": 17, + "id": "17", + "coverArt": "17", "artist": "Swell Maps", "title": "(1979) A Trip to Marineville", - "parent": 15, + "parent": "15", "isDir": true, + "songCount": 18, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 19, - "coverArt": 19, + "id": "19", + "coverArt": "19", "artist": "Ten Years After", "title": "(1967) Ten Years After", - "parent": 18, + "parent": "18", "isDir": true, + "songCount": 15, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 13, - "coverArt": 13, + "id": "13", + "coverArt": "13", "artist": "There", "title": "(2010) Anika", - "parent": 12, + "parent": "12", "isDir": true, + "songCount": 9, + "duration": 0, "created": "0001-01-01T00:00:00Z" } ] diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_alpha_name b/server/ctrlsubsonic/testdata/test_get_album_list_alpha_name index b069311..3a97ada 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_alpha_name +++ b/server/ctrlsubsonic/testdata/test_get_album_list_alpha_name @@ -7,93 +7,112 @@ "albumList": { "album": [ { - "id": 9, - "coverArt": 9, + "id": "9", + "coverArt": "9", "artist": "13th Floor Lowervators", "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", - "parent": 7, + "parent": "7", "isDir": true, + "songCount": 21, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 8, - "coverArt": 8, + "id": "8", + "coverArt": "8", "artist": "13th Floor Lowervators", "title": "(1967) Easter Nowhere", - "parent": 7, + "parent": "7", "isDir": true, + "songCount": 10, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 19, - "coverArt": 19, + "id": "19", + "coverArt": "19", "artist": "Ten Years After", "title": "(1967) Ten Years After", - "parent": 18, + "parent": "18", "isDir": true, + "songCount": 15, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 21, - "coverArt": 21, + "id": "21", + "coverArt": "21", "artist": "Captain Beefheart", "title": "(1970) Lick My Decals Off, Bitch", - "parent": 20, + "parent": "20", "isDir": true, + "songCount": 15, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 17, - "coverArt": 17, + "id": "17", + "coverArt": "17", "artist": "Swell Maps", "title": "(1979) A Trip to Marineville", - "parent": 15, + "parent": "15", "isDir": true, + "songCount": 18, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 16, - "coverArt": 16, + "id": "16", + "coverArt": "16", "artist": "Swell Maps", "title": "(1980) Jane From Occupied Europe", - "parent": 15, + "parent": "15", "isDir": true, + "songCount": 16, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 6, - "coverArt": 6, + "id": "6", "artist": "A Certain Ratio", "title": "(1981) To EachOTHER.", - "parent": 4, + "parent": "4", "isDir": true, + "songCount": 9, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 3, - "coverArt": 3, + "id": "3", + "coverArt": "3", "artist": "Jah Wobble, The Edge, Holger Czukay", "title": "(1983) Snake Charmer", - "parent": 2, + "parent": "2", "isDir": true, + "songCount": 5, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 5, - "coverArt": 5, + "id": "5", + "coverArt": "5", "artist": "A Certain Ratio", "title": "(1994) The Graveyard and the Ballroom", - "parent": 4, + "parent": "4", "isDir": true, + "songCount": 14, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 13, - "coverArt": 13, + "id": "13", + "coverArt": "13", "artist": "There", "title": "(2010) Anika", - "parent": 12, + "parent": "12", "isDir": true, + "songCount": 9, + "duration": 0, "created": "0001-01-01T00:00:00Z" } ] diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_newest b/server/ctrlsubsonic/testdata/test_get_album_list_newest index 9f1ae8e..a6aaac7 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_newest +++ b/server/ctrlsubsonic/testdata/test_get_album_list_newest @@ -7,93 +7,112 @@ "albumList": { "album": [ { - "id": 8, - "coverArt": 8, + "id": "8", + "coverArt": "8", "artist": "13th Floor Lowervators", "title": "(1967) Easter Nowhere", - "parent": 7, + "parent": "7", "isDir": true, + "songCount": 10, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 9, - "coverArt": 9, + "id": "9", + "coverArt": "9", "artist": "13th Floor Lowervators", "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", - "parent": 7, + "parent": "7", "isDir": true, + "songCount": 21, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 21, - "coverArt": 21, + "id": "21", + "coverArt": "21", "artist": "Captain Beefheart", "title": "(1970) Lick My Decals Off, Bitch", - "parent": 20, + "parent": "20", "isDir": true, + "songCount": 15, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 5, - "coverArt": 5, + "id": "5", + "coverArt": "5", "artist": "A Certain Ratio", "title": "(1994) The Graveyard and the Ballroom", - "parent": 4, + "parent": "4", "isDir": true, + "songCount": 14, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 6, - "coverArt": 6, + "id": "6", "artist": "A Certain Ratio", "title": "(1981) To EachOTHER.", - "parent": 4, + "parent": "4", "isDir": true, + "songCount": 9, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 13, - "coverArt": 13, + "id": "13", + "coverArt": "13", "artist": "There", "title": "(2010) Anika", - "parent": 12, + "parent": "12", "isDir": true, + "songCount": 9, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 3, - "coverArt": 3, + "id": "3", + "coverArt": "3", "artist": "Jah Wobble, The Edge, Holger Czukay", "title": "(1983) Snake Charmer", - "parent": 2, + "parent": "2", "isDir": true, + "songCount": 5, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 16, - "coverArt": 16, + "id": "16", + "coverArt": "16", "artist": "Swell Maps", "title": "(1980) Jane From Occupied Europe", - "parent": 15, + "parent": "15", "isDir": true, + "songCount": 16, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 17, - "coverArt": 17, + "id": "17", + "coverArt": "17", "artist": "Swell Maps", "title": "(1979) A Trip to Marineville", - "parent": 15, + "parent": "15", "isDir": true, + "songCount": 18, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 19, - "coverArt": 19, + "id": "19", + "coverArt": "19", "artist": "Ten Years After", "title": "(1967) Ten Years After", - "parent": 18, + "parent": "18", "isDir": true, + "songCount": 15, + "duration": 0, "created": "0001-01-01T00:00:00Z" } ] diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_random b/server/ctrlsubsonic/testdata/test_get_album_list_random index a3342bc..a4f8801 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_random +++ b/server/ctrlsubsonic/testdata/test_get_album_list_random @@ -7,93 +7,112 @@ "albumList": { "album": [ { - "id": 17, - "coverArt": 17, - "artist": "Swell Maps", - "title": "(1979) A Trip to Marineville", - "parent": 15, - "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": 6, - "coverArt": 6, - "artist": "A Certain Ratio", - "title": "(1981) To EachOTHER.", - "parent": 4, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 19, - "coverArt": 19, - "artist": "Ten Years After", - "title": "(1967) Ten Years After", - "parent": 18, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 21, - "coverArt": 21, + "id": "21", + "coverArt": "21", "artist": "Captain Beefheart", "title": "(1970) Lick My Decals Off, Bitch", - "parent": 20, + "parent": "20", "isDir": true, + "songCount": 15, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 16, - "coverArt": 16, - "artist": "Swell Maps", - "title": "(1980) Jane From Occupied Europe", - "parent": 15, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 5, - "coverArt": 5, - "artist": "A Certain Ratio", - "title": "(1994) The Graveyard and the Ballroom", - "parent": 4, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 9, - "coverArt": 9, - "artist": "13th Floor Lowervators", - "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", - "parent": 7, - "isDir": true, - "created": "0001-01-01T00:00:00Z" - }, - { - "id": 8, - "coverArt": 8, + "id": "8", + "coverArt": "8", "artist": "13th Floor Lowervators", "title": "(1967) Easter Nowhere", - "parent": 7, + "parent": "7", "isDir": true, + "songCount": 10, + "duration": 0, "created": "0001-01-01T00:00:00Z" }, { - "id": 13, - "coverArt": 13, + "id": "19", + "coverArt": "19", + "artist": "Ten Years After", + "title": "(1967) Ten Years After", + "parent": "18", + "isDir": true, + "songCount": 15, + "duration": 0, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": "5", + "coverArt": "5", + "artist": "A Certain Ratio", + "title": "(1994) The Graveyard and the Ballroom", + "parent": "4", + "isDir": true, + "songCount": 14, + "duration": 0, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": "6", + "artist": "A Certain Ratio", + "title": "(1981) To EachOTHER.", + "parent": "4", + "isDir": true, + "songCount": 9, + "duration": 0, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": "13", + "coverArt": "13", "artist": "There", "title": "(2010) Anika", - "parent": 12, + "parent": "12", "isDir": true, + "songCount": 9, + "duration": 0, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": "9", + "coverArt": "9", + "artist": "13th Floor Lowervators", + "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators", + "parent": "7", + "isDir": true, + "songCount": 21, + "duration": 0, + "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, + "songCount": 5, + "duration": 0, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": "16", + "coverArt": "16", + "artist": "Swell Maps", + "title": "(1980) Jane From Occupied Europe", + "parent": "15", + "isDir": true, + "songCount": 16, + "duration": 0, + "created": "0001-01-01T00:00:00Z" + }, + { + "id": "17", + "coverArt": "17", + "artist": "Swell Maps", + "title": "(1979) A Trip to Marineville", + "parent": "15", + "isDir": true, + "songCount": 18, + "duration": 0, "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 176253d..41684b5 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_artist +++ b/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_artist @@ -7,82 +7,102 @@ "albumList2": { "album": [ { - "id": 8, - "coverArt": 8, - "artistId": 3, + "id": "8", + "coverArt": "8", + "artistId": "3", "artist": "13th Floor Elevators", "name": "Easter Everywhere", + "songCount": 10, + "duration": 0, "created": "2019-06-13T12:57:28.850090338+01:00" }, { - "id": 9, - "coverArt": 9, - "artistId": 3, + "id": "9", + "coverArt": "9", + "artistId": "3", "artist": "13th Floor Elevators", "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "songCount": 21, + "duration": 0, "created": "2019-06-13T12:57:24.306717554+01:00" }, { - "id": 5, - "coverArt": 5, - "artistId": 2, + "id": "5", + "coverArt": "5", + "artistId": "2", "artist": "A Certain Ratio", "name": "The Graveyard and the Ballroom", + "songCount": 14, + "duration": 0, "created": "2019-06-05T17:46:37.675917974+01:00" }, { - "id": 6, - "artistId": 2, + "id": "6", + "artistId": "2", "artist": "A Certain Ratio", "name": "To Each...", + "songCount": 9, + "duration": 0, "created": "2019-05-23T15:12:02.921473302+01:00" }, { - "id": 13, - "coverArt": 13, - "artistId": 4, + "id": "13", + "coverArt": "13", + "artistId": "4", "artist": "Anikas", "name": "Anika", + "songCount": 9, + "duration": 0, "created": "2019-05-23T15:12:02.921473302+01:00" }, { - "id": 21, - "coverArt": 21, - "artistId": 7, + "id": "21", + "coverArt": "21", + "artistId": "7", "artist": "Captain Beefheart & His Magic Band", "name": "Lick My Decals Off, Baby", + "songCount": 15, + "duration": 0, "created": "2019-06-10T19:26:30.944742894+01:00" }, { - "id": 3, - "coverArt": 3, - "artistId": 1, + "id": "3", + "coverArt": "3", + "artistId": "1", "artist": "Jah Wobble, The Edge & Holger Czukay", "name": "Snake Charmer", + "songCount": 5, + "duration": 0, "created": "2019-05-16T22:10:52+01:00" }, { - "id": 16, - "coverArt": 16, - "artistId": 5, + "id": "16", + "coverArt": "16", + "artistId": "5", "artist": "Swell Maps", "name": "Jane From Occupied Europe", + "songCount": 16, + "duration": 0, "created": "2019-04-30T16:48:48+01:00" }, { - "id": 17, - "coverArt": 17, - "artistId": 5, + "id": "17", + "coverArt": "17", + "artistId": "5", "artist": "Swell Maps", "name": "A Trip to Marineville", + "songCount": 18, + "duration": 0, "created": "2019-04-30T16:48:48+01:00" }, { - "id": 19, - "coverArt": 19, - "artistId": 6, + "id": "19", + "coverArt": "19", + "artistId": "6", "artist": "Ten Years After", "name": "Ten Years After", + "songCount": 15, + "duration": 0, "created": "2019-04-30T16:48:30+01:00" } ] 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 56d21ae..b2c3195 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_name +++ b/server/ctrlsubsonic/testdata/test_get_album_list_two_alpha_name @@ -7,82 +7,102 @@ "albumList2": { "album": [ { - "id": 17, - "coverArt": 17, - "artistId": 5, + "id": "17", + "coverArt": "17", + "artistId": "5", "artist": "Swell Maps", "name": "A Trip to Marineville", + "songCount": 18, + "duration": 0, "created": "2019-04-30T16:48:48+01:00" }, { - "id": 13, - "coverArt": 13, - "artistId": 4, + "id": "13", + "coverArt": "13", + "artistId": "4", "artist": "Anikas", "name": "Anika", + "songCount": 9, + "duration": 0, "created": "2019-05-23T15:12:02.921473302+01:00" }, { - "id": 8, - "coverArt": 8, - "artistId": 3, + "id": "8", + "coverArt": "8", + "artistId": "3", "artist": "13th Floor Elevators", "name": "Easter Everywhere", + "songCount": 10, + "duration": 0, "created": "2019-06-13T12:57:28.850090338+01:00" }, { - "id": 16, - "coverArt": 16, - "artistId": 5, + "id": "16", + "coverArt": "16", + "artistId": "5", "artist": "Swell Maps", "name": "Jane From Occupied Europe", + "songCount": 16, + "duration": 0, "created": "2019-04-30T16:48:48+01:00" }, { - "id": 21, - "coverArt": 21, - "artistId": 7, + "id": "21", + "coverArt": "21", + "artistId": "7", "artist": "Captain Beefheart & His Magic Band", "name": "Lick My Decals Off, Baby", + "songCount": 15, + "duration": 0, "created": "2019-06-10T19:26:30.944742894+01:00" }, { - "id": 3, - "coverArt": 3, - "artistId": 1, + "id": "3", + "coverArt": "3", + "artistId": "1", "artist": "Jah Wobble, The Edge & Holger Czukay", "name": "Snake Charmer", + "songCount": 5, + "duration": 0, "created": "2019-05-16T22:10:52+01:00" }, { - "id": 19, - "coverArt": 19, - "artistId": 6, + "id": "19", + "coverArt": "19", + "artistId": "6", "artist": "Ten Years After", "name": "Ten Years After", + "songCount": 15, + "duration": 0, "created": "2019-04-30T16:48:30+01:00" }, { - "id": 5, - "coverArt": 5, - "artistId": 2, + "id": "5", + "coverArt": "5", + "artistId": "2", "artist": "A Certain Ratio", "name": "The Graveyard and the Ballroom", + "songCount": 14, + "duration": 0, "created": "2019-06-05T17:46:37.675917974+01:00" }, { - "id": 9, - "coverArt": 9, - "artistId": 3, + "id": "9", + "coverArt": "9", + "artistId": "3", "artist": "13th Floor Elevators", "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "songCount": 21, + "duration": 0, "created": "2019-06-13T12:57:24.306717554+01:00" }, { - "id": 6, - "artistId": 2, + "id": "6", + "artistId": "2", "artist": "A Certain Ratio", "name": "To Each...", + "songCount": 9, + "duration": 0, "created": "2019-05-23T15:12:02.921473302+01:00" } ] diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_two_newest b/server/ctrlsubsonic/testdata/test_get_album_list_two_newest index b25f068..9506ac3 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_two_newest +++ b/server/ctrlsubsonic/testdata/test_get_album_list_two_newest @@ -7,82 +7,102 @@ "albumList2": { "album": [ { - "id": 8, - "coverArt": 8, - "artistId": 3, + "id": "8", + "coverArt": "8", + "artistId": "3", "artist": "13th Floor Elevators", "name": "Easter Everywhere", + "songCount": 10, + "duration": 0, "created": "2019-06-13T12:57:28.850090338+01:00" }, { - "id": 9, - "coverArt": 9, - "artistId": 3, + "id": "9", + "coverArt": "9", + "artistId": "3", "artist": "13th Floor Elevators", "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "songCount": 21, + "duration": 0, "created": "2019-06-13T12:57:24.306717554+01:00" }, { - "id": 21, - "coverArt": 21, - "artistId": 7, + "id": "21", + "coverArt": "21", + "artistId": "7", "artist": "Captain Beefheart & His Magic Band", "name": "Lick My Decals Off, Baby", + "songCount": 15, + "duration": 0, "created": "2019-06-10T19:26:30.944742894+01:00" }, { - "id": 5, - "coverArt": 5, - "artistId": 2, + "id": "5", + "coverArt": "5", + "artistId": "2", "artist": "A Certain Ratio", "name": "The Graveyard and the Ballroom", + "songCount": 14, + "duration": 0, "created": "2019-06-05T17:46:37.675917974+01:00" }, { - "id": 6, - "artistId": 2, + "id": "6", + "artistId": "2", "artist": "A Certain Ratio", "name": "To Each...", + "songCount": 9, + "duration": 0, "created": "2019-05-23T15:12:02.921473302+01:00" }, { - "id": 13, - "coverArt": 13, - "artistId": 4, + "id": "13", + "coverArt": "13", + "artistId": "4", "artist": "Anikas", "name": "Anika", + "songCount": 9, + "duration": 0, "created": "2019-05-23T15:12:02.921473302+01:00" }, { - "id": 3, - "coverArt": 3, - "artistId": 1, + "id": "3", + "coverArt": "3", + "artistId": "1", "artist": "Jah Wobble, The Edge & Holger Czukay", "name": "Snake Charmer", + "songCount": 5, + "duration": 0, "created": "2019-05-16T22:10:52+01:00" }, { - "id": 16, - "coverArt": 16, - "artistId": 5, + "id": "16", + "coverArt": "16", + "artistId": "5", "artist": "Swell Maps", "name": "Jane From Occupied Europe", + "songCount": 16, + "duration": 0, "created": "2019-04-30T16:48:48+01:00" }, { - "id": 17, - "coverArt": 17, - "artistId": 5, + "id": "17", + "coverArt": "17", + "artistId": "5", "artist": "Swell Maps", "name": "A Trip to Marineville", + "songCount": 18, + "duration": 0, "created": "2019-04-30T16:48:48+01:00" }, { - "id": 19, - "coverArt": 19, - "artistId": 6, + "id": "19", + "coverArt": "19", + "artistId": "6", "artist": "Ten Years After", "name": "Ten Years After", + "songCount": 15, + "duration": 0, "created": "2019-04-30T16:48:30+01:00" } ] diff --git a/server/ctrlsubsonic/testdata/test_get_album_list_two_random b/server/ctrlsubsonic/testdata/test_get_album_list_two_random index b22ede3..95a46ba 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_list_two_random +++ b/server/ctrlsubsonic/testdata/test_get_album_list_two_random @@ -7,83 +7,103 @@ "albumList2": { "album": [ { - "id": 8, - "coverArt": 8, - "artistId": 3, + "id": "5", + "coverArt": "5", + "artistId": "2", + "artist": "A Certain Ratio", + "name": "The Graveyard and the Ballroom", + "songCount": 14, + "duration": 0, + "created": "2019-06-05T17:46:37.675917974+01:00" + }, + { + "id": "8", + "coverArt": "8", + "artistId": "3", "artist": "13th Floor Elevators", "name": "Easter Everywhere", + "songCount": 10, + "duration": 0, "created": "2019-06-13T12:57:28.850090338+01:00" }, { - "id": 21, - "coverArt": 21, - "artistId": 7, - "artist": "Captain Beefheart & His Magic Band", - "name": "Lick My Decals Off, Baby", - "created": "2019-06-10T19:26:30.944742894+01:00" + "id": "16", + "coverArt": "16", + "artistId": "5", + "artist": "Swell Maps", + "name": "Jane From Occupied Europe", + "songCount": 16, + "duration": 0, + "created": "2019-04-30T16:48:48+01:00" }, { - "id": 9, - "coverArt": 9, - "artistId": 3, + "id": "13", + "coverArt": "13", + "artistId": "4", + "artist": "Anikas", + "name": "Anika", + "songCount": 9, + "duration": 0, + "created": "2019-05-23T15:12:02.921473302+01:00" + }, + { + "id": "9", + "coverArt": "9", + "artistId": "3", "artist": "13th Floor Elevators", "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "songCount": 21, + "duration": 0, "created": "2019-06-13T12:57:24.306717554+01:00" }, { - "id": 19, - "coverArt": 19, - "artistId": 6, - "artist": "Ten Years After", - "name": "Ten Years After", - "created": "2019-04-30T16:48:30+01:00" + "id": "6", + "artistId": "2", + "artist": "A Certain Ratio", + "name": "To Each...", + "songCount": 9, + "duration": 0, + "created": "2019-05-23T15:12:02.921473302+01:00" }, { - "id": 3, - "coverArt": 3, - "artistId": 1, + "id": "3", + "coverArt": "3", + "artistId": "1", "artist": "Jah Wobble, The Edge & Holger Czukay", "name": "Snake Charmer", + "songCount": 5, + "duration": 0, "created": "2019-05-16T22:10:52+01:00" }, { - "id": 16, - "coverArt": 16, - "artistId": 5, - "artist": "Swell Maps", - "name": "Jane From Occupied Europe", - "created": "2019-04-30T16:48:48+01:00" - }, - { - "id": 13, - "coverArt": 13, - "artistId": 4, - "artist": "Anikas", - "name": "Anika", - "created": "2019-05-23T15:12:02.921473302+01:00" - }, - { - "id": 17, - "coverArt": 17, - "artistId": 5, + "id": "17", + "coverArt": "17", + "artistId": "5", "artist": "Swell Maps", "name": "A Trip to Marineville", + "songCount": 18, + "duration": 0, "created": "2019-04-30T16:48:48+01:00" }, { - "id": 6, - "artistId": 2, - "artist": "A Certain Ratio", - "name": "To Each...", - "created": "2019-05-23T15:12:02.921473302+01:00" + "id": "21", + "coverArt": "21", + "artistId": "7", + "artist": "Captain Beefheart & His Magic Band", + "name": "Lick My Decals Off, Baby", + "songCount": 15, + "duration": 0, + "created": "2019-06-10T19:26:30.944742894+01:00" }, { - "id": 5, - "coverArt": 5, - "artistId": 2, - "artist": "A Certain Ratio", - "name": "The Graveyard and the Ballroom", - "created": "2019-06-05T17:46:37.675917974+01:00" + "id": "19", + "coverArt": "19", + "artistId": "6", + "artist": "Ten Years After", + "name": "Ten Years After", + "songCount": 15, + "duration": 0, + "created": "2019-04-30T16:48:30+01:00" } ] } diff --git a/server/ctrlsubsonic/testdata/test_get_album_with_cover b/server/ctrlsubsonic/testdata/test_get_album_with_cover index b9c4836..64ff635 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_with_cover +++ b/server/ctrlsubsonic/testdata/test_get_album_with_cover @@ -5,27 +5,29 @@ "type": "gonic", "gonicVersion": "v0.6.3", "album": { - "id": 3, - "coverArt": 3, - "artistId": 1, + "id": "3", + "coverArt": "3", + "artistId": "1", "artist": "Jah Wobble, The Edge & Holger Czukay", "name": "Snake Charmer", + "songCount": 0, + "duration": 0, "created": "2019-05-16T22:10:52+01:00", "song": [ { "album": "Snake Charmer", - "albumId": 3, + "albumId": "3", "artist": "Jah Wobble, The Edge & Holger Czukay", - "artistId": 1, + "artistId": "1", "bitRate": 882, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.978045401+01:00", "duration": 372, - "id": 1, + "id": "1", "isDir": false, "isVideo": false, - "parent": 3, + "parent": "3", "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/01.05 Snake Charmer.flac", "size": 41274185, "suffix": "flac", @@ -36,18 +38,18 @@ }, { "album": "Snake Charmer", - "albumId": 3, + "albumId": "3", "artist": "Jah Wobble, The Edge & Holger Czukay", - "artistId": 1, + "artistId": "1", "bitRate": 814, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.981605306+01:00", "duration": 523, - "id": 3, + "id": "3", "isDir": false, "isVideo": false, - "parent": 3, + "parent": "3", "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/02.05 Hold On to Your Dreams.flac", "size": 53447545, "suffix": "flac", @@ -58,18 +60,18 @@ }, { "album": "Snake Charmer", - "albumId": 3, + "albumId": "3", "artist": "Jah Wobble, The Edge & Holger Czukay", - "artistId": 1, + "artistId": "1", "bitRate": 745, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.979981084+01:00", "duration": 331, - "id": 2, + "id": "2", "isDir": false, "isVideo": false, - "parent": 3, + "parent": "3", "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/03.05 It Was a Camel.flac", "size": 31080508, "suffix": "flac", @@ -80,18 +82,18 @@ }, { "album": "Snake Charmer", - "albumId": 3, + "albumId": "3", "artist": "Jah Wobble, The Edge & Holger Czukay", - "artistId": 1, + "artistId": "1", "bitRate": 976, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.984853203+01:00", "duration": 227, - "id": 5, + "id": "5", "isDir": false, "isVideo": false, - "parent": 3, + "parent": "3", "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/04.05 Sleazy.flac", "size": 27938750, "suffix": "flac", @@ -102,18 +104,18 @@ }, { "album": "Snake Charmer", - "albumId": 3, + "albumId": "3", "artist": "Jah Wobble, The Edge & Holger Czukay", - "artistId": 1, + "artistId": "1", "bitRate": 884, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.983301328+01:00", "duration": 418, - "id": 4, + "id": "4", "isDir": false, "isVideo": false, - "parent": 3, + "parent": "3", "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/05.05 Snake Charmer (reprise).flac", "size": 46427922, "suffix": "flac", diff --git a/server/ctrlsubsonic/testdata/test_get_album_without_cover b/server/ctrlsubsonic/testdata/test_get_album_without_cover index 547b3bb..84ccfe3 100644 --- a/server/ctrlsubsonic/testdata/test_get_album_without_cover +++ b/server/ctrlsubsonic/testdata/test_get_album_without_cover @@ -5,7 +5,9 @@ "type": "gonic", "gonicVersion": "v0.6.3", "album": { - "id": 2, + "id": "2", + "songCount": 0, + "duration": 0, "created": "2019-05-16T22:10:21+01:00" } } diff --git a/server/ctrlsubsonic/testdata/test_get_artist_id_one b/server/ctrlsubsonic/testdata/test_get_artist_id_one index 934a557..8881009 100644 --- a/server/ctrlsubsonic/testdata/test_get_artist_id_one +++ b/server/ctrlsubsonic/testdata/test_get_artist_id_one @@ -5,15 +5,18 @@ "type": "gonic", "gonicVersion": "v0.6.3", "artist": { - "id": 1, + "id": "1", "name": "Jah Wobble, The Edge & Holger Czukay", + "albumCount": 1, "album": [ { - "id": 3, - "coverArt": 3, - "artistId": 1, + "id": "3", + "coverArt": "3", + "artistId": "1", "artist": "Jah Wobble, The Edge & Holger Czukay", "name": "Snake Charmer", + "songCount": 0, + "duration": 0, "created": "2019-05-16T22:10:52+01:00" } ] diff --git a/server/ctrlsubsonic/testdata/test_get_artist_id_three b/server/ctrlsubsonic/testdata/test_get_artist_id_three index a825912..550cfe1 100644 --- a/server/ctrlsubsonic/testdata/test_get_artist_id_three +++ b/server/ctrlsubsonic/testdata/test_get_artist_id_three @@ -5,23 +5,28 @@ "type": "gonic", "gonicVersion": "v0.6.3", "artist": { - "id": 3, + "id": "3", "name": "13th Floor Elevators", + "albumCount": 2, "album": [ { - "id": 8, - "coverArt": 8, - "artistId": 3, + "id": "8", + "coverArt": "8", + "artistId": "3", "artist": "13th Floor Elevators", "name": "Easter Everywhere", + "songCount": 0, + "duration": 0, "created": "2019-06-13T12:57:28.850090338+01:00" }, { - "id": 9, - "coverArt": 9, - "artistId": 3, + "id": "9", + "coverArt": "9", + "artistId": "3", "artist": "13th Floor Elevators", "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "songCount": 0, + "duration": 0, "created": "2019-06-13T12:57:24.306717554+01:00" } ] diff --git a/server/ctrlsubsonic/testdata/test_get_artist_id_two b/server/ctrlsubsonic/testdata/test_get_artist_id_two index 475f762..e758d58 100644 --- a/server/ctrlsubsonic/testdata/test_get_artist_id_two +++ b/server/ctrlsubsonic/testdata/test_get_artist_id_two @@ -5,22 +5,27 @@ "type": "gonic", "gonicVersion": "v0.6.3", "artist": { - "id": 2, + "id": "2", "name": "A Certain Ratio", + "albumCount": 2, "album": [ { - "id": 5, - "coverArt": 5, - "artistId": 2, + "id": "5", + "coverArt": "5", + "artistId": "2", "artist": "A Certain Ratio", "name": "The Graveyard and the Ballroom", + "songCount": 0, + "duration": 0, "created": "2019-06-05T17:46:37.675917974+01:00" }, { - "id": 6, - "artistId": 2, + "id": "6", + "artistId": "2", "artist": "A Certain Ratio", "name": "To Each...", + "songCount": 0, + "duration": 0, "created": "2019-05-23T15:12:02.921473302+01:00" } ] diff --git a/server/ctrlsubsonic/testdata/test_get_artists_no_args b/server/ctrlsubsonic/testdata/test_get_artists_no_args index f702a51..a997252 100644 --- a/server/ctrlsubsonic/testdata/test_get_artists_no_args +++ b/server/ctrlsubsonic/testdata/test_get_artists_no_args @@ -10,7 +10,7 @@ "name": "#", "artist": [ { - "id": 3, + "id": "3", "name": "13th Floor Elevators", "albumCount": 2 } @@ -20,12 +20,12 @@ "name": "a", "artist": [ { - "id": 2, + "id": "2", "name": "A Certain Ratio", "albumCount": 2 }, { - "id": 4, + "id": "4", "name": "Anikas", "albumCount": 1 } @@ -35,7 +35,7 @@ "name": "c", "artist": [ { - "id": 7, + "id": "7", "name": "Captain Beefheart & His Magic Band", "albumCount": 1 } @@ -45,7 +45,7 @@ "name": "j", "artist": [ { - "id": 1, + "id": "1", "name": "Jah Wobble, The Edge & Holger Czukay", "albumCount": 1 } @@ -55,7 +55,7 @@ "name": "s", "artist": [ { - "id": 5, + "id": "5", "name": "Swell Maps", "albumCount": 2 } @@ -65,7 +65,7 @@ "name": "t", "artist": [ { - "id": 6, + "id": "6", "name": "Ten Years After", "albumCount": 1 } diff --git a/server/ctrlsubsonic/testdata/test_get_indexes_no_args b/server/ctrlsubsonic/testdata/test_get_indexes_no_args index 7bf5afc..1ccc634 100644 --- a/server/ctrlsubsonic/testdata/test_get_indexes_no_args +++ b/server/ctrlsubsonic/testdata/test_get_indexes_no_args @@ -11,12 +11,12 @@ "name": "#", "artist": [ { - "id": 7, + "id": "7", "name": "13th Floor Lowervators", "albumCount": 2 }, { - "id": 10, + "id": "10", "name": "___Anika", "albumCount": 2 } @@ -26,7 +26,7 @@ "name": "a", "artist": [ { - "id": 4, + "id": "4", "name": "A Certain Ratio", "albumCount": 2 } @@ -36,7 +36,7 @@ "name": "c", "artist": [ { - "id": 20, + "id": "20", "name": "Captain Beefheart", "albumCount": 1 } @@ -46,7 +46,7 @@ "name": "j", "artist": [ { - "id": 2, + "id": "2", "name": "Jah Wobble, The Edge, Holger Czukay", "albumCount": 1 } @@ -56,7 +56,7 @@ "name": "s", "artist": [ { - "id": 15, + "id": "15", "name": "Swell Maps", "albumCount": 2 } @@ -66,7 +66,7 @@ "name": "t", "artist": [ { - "id": 18, + "id": "18", "name": "Ten Years After", "albumCount": 1 } diff --git a/server/ctrlsubsonic/testdata/test_get_music_directory_with_tracks b/server/ctrlsubsonic/testdata/test_get_music_directory_with_tracks index 4330789..839660e 100644 --- a/server/ctrlsubsonic/testdata/test_get_music_directory_with_tracks +++ b/server/ctrlsubsonic/testdata/test_get_music_directory_with_tracks @@ -5,8 +5,8 @@ "type": "gonic", "gonicVersion": "v0.6.3", "directory": { - "id": 3, - "parent": 2, + "id": "3", + "parent": "2", "name": "(1983) Snake Charmer", "child": [ { @@ -14,13 +14,13 @@ "artist": "Jah Wobble, The Edge & Holger Czukay", "bitRate": 882, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.978045401+01:00", "duration": 372, - "id": 1, + "id": "1", "isDir": false, "isVideo": false, - "parent": 3, + "parent": "3", "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/01.05 Snake Charmer.flac", "size": 41274185, "suffix": "flac", @@ -34,13 +34,13 @@ "artist": "Jah Wobble, The Edge & Holger Czukay", "bitRate": 814, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.981605306+01:00", "duration": 523, - "id": 3, + "id": "3", "isDir": false, "isVideo": false, - "parent": 3, + "parent": "3", "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/02.05 Hold On to Your Dreams.flac", "size": 53447545, "suffix": "flac", @@ -54,13 +54,13 @@ "artist": "Jah Wobble, The Edge & Holger Czukay", "bitRate": 745, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.979981084+01:00", "duration": 331, - "id": 2, + "id": "2", "isDir": false, "isVideo": false, - "parent": 3, + "parent": "3", "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/03.05 It Was a Camel.flac", "size": 31080508, "suffix": "flac", @@ -74,13 +74,13 @@ "artist": "Jah Wobble, The Edge & Holger Czukay", "bitRate": 976, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.984853203+01:00", "duration": 227, - "id": 5, + "id": "5", "isDir": false, "isVideo": false, - "parent": 3, + "parent": "3", "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/04.05 Sleazy.flac", "size": 27938750, "suffix": "flac", @@ -94,13 +94,13 @@ "artist": "Jah Wobble, The Edge & Holger Czukay", "bitRate": 884, "contentType": "audio/x-flac", - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.983301328+01:00", "duration": 418, - "id": 4, + "id": "4", "isDir": false, "isVideo": false, - "parent": 3, + "parent": "3", "path": "Jah Wobble, The Edge, Holger Czukay/(1983) Snake Charmer/05.05 Snake Charmer (reprise).flac", "size": 46427922, "suffix": "flac", diff --git a/server/ctrlsubsonic/testdata/test_get_music_directory_without_tracks b/server/ctrlsubsonic/testdata/test_get_music_directory_without_tracks index 196bcb3..09d6857 100644 --- a/server/ctrlsubsonic/testdata/test_get_music_directory_without_tracks +++ b/server/ctrlsubsonic/testdata/test_get_music_directory_without_tracks @@ -5,17 +5,16 @@ "type": "gonic", "gonicVersion": "v0.6.3", "directory": { - "id": 2, - "parent": 1, + "id": "2", "name": "Jah Wobble, The Edge, Holger Czukay", "child": [ { - "coverArt": 3, + "coverArt": "3", "created": "2019-07-08T21:49:40.995905275+01:00", - "id": 3, + "id": "3", "isDir": true, "isVideo": false, - "parent": 2, + "parent": "2", "title": "(1983) Snake Charmer" } ] diff --git a/server/ctrlsubsonic/testdata/test_search_three_q_13 b/server/ctrlsubsonic/testdata/test_search_three_q_13 index 418489f..a5c3543 100644 --- a/server/ctrlsubsonic/testdata/test_search_three_q_13 +++ b/server/ctrlsubsonic/testdata/test_search_three_q_13 @@ -7,17 +7,20 @@ "searchResult3": { "artist": [ { - "id": 3, - "name": "13th Floor Elevators" + "id": "3", + "name": "13th Floor Elevators", + "albumCount": 0 } ], "album": [ { - "id": 9, - "coverArt": 9, - "artistId": 3, + "id": "9", + "coverArt": "9", + "artistId": "3", "artist": "13th Floor Elevators", "name": "The Psychedelic Sounds of the 13th Floor Elevators", + "songCount": 0, + "duration": 0, "created": "2019-06-13T12:57:24.306717554+01:00" } ] diff --git a/server/ctrlsubsonic/testdata/test_search_three_q_ani b/server/ctrlsubsonic/testdata/test_search_three_q_ani index 58cd105..e1109ad 100644 --- a/server/ctrlsubsonic/testdata/test_search_three_q_ani +++ b/server/ctrlsubsonic/testdata/test_search_three_q_ani @@ -7,17 +7,20 @@ "searchResult3": { "artist": [ { - "id": 4, - "name": "Anikas" + "id": "4", + "name": "Anikas", + "albumCount": 0 } ], "album": [ { - "id": 13, - "coverArt": 13, - "artistId": 4, + "id": "13", + "coverArt": "13", + "artistId": "4", "artist": "Anikas", "name": "Anika", + "songCount": 0, + "duration": 0, "created": "2019-05-23T15:12:02.921473302+01:00" } ] diff --git a/server/ctrlsubsonic/testdata/test_search_three_q_cert b/server/ctrlsubsonic/testdata/test_search_three_q_cert index b565e2a..6de9602 100644 --- a/server/ctrlsubsonic/testdata/test_search_three_q_cert +++ b/server/ctrlsubsonic/testdata/test_search_three_q_cert @@ -7,8 +7,9 @@ "searchResult3": { "artist": [ { - "id": 2, - "name": "A Certain Ratio" + "id": "2", + "name": "A Certain Ratio", + "albumCount": 0 } ] } diff --git a/server/ctrlsubsonic/testdata/test_search_two_q_13 b/server/ctrlsubsonic/testdata/test_search_two_q_13 index a00ef3c..cb344dc 100644 --- a/server/ctrlsubsonic/testdata/test_search_two_q_13 +++ b/server/ctrlsubsonic/testdata/test_search_two_q_13 @@ -7,19 +7,18 @@ "searchResult2": { "artist": [ { - "id": 7, - "parent": 1, + "id": "7", "name": "13th Floor Lowervators" } ], "album": [ { - "coverArt": 9, + "coverArt": "9", "created": "2019-07-08T21:49:41.246041678+01:00", - "id": 9, + "id": "9", "isDir": true, "isVideo": false, - "parent": 7, + "parent": "7", "title": "(1966) The Psychedelic Sounds of the 13th Floor Elevators" } ], @@ -29,13 +28,13 @@ "artist": "A Certain Ratio", "bitRate": 894, "contentType": "audio/x-flac", - "coverArt": 5, + "coverArt": "5", "created": "2019-07-08T21:49:41.037683099+01:00", "duration": 332, - "id": 6, + "id": "6", "isDir": false, "isVideo": false, - "parent": 5, + "parent": "5", "path": "A Certain Ratio/(1994) The Graveyard and the Ballroom/13.14 Flight.flac", "size": 37302417, "suffix": "flac", @@ -49,13 +48,13 @@ "artist": "13th Floor Elevators", "bitRate": 244, "contentType": "audio/mpeg", - "coverArt": 9, + "coverArt": "9", "created": "2019-07-08T21:49:41.209108272+01:00", "duration": 154, - "id": 40, + "id": "40", "isDir": false, "isVideo": false, - "parent": 9, + "parent": "9", "path": "13th Floor Lowervators/(1966) The Psychedelic Sounds of the 13th Floor Elevators/13.21 Before You Accuse Me.mp3", "size": 4722688, "suffix": "mp3", @@ -69,13 +68,13 @@ "artist": "Swell Maps", "bitRate": 1204, "contentType": "audio/x-flac", - "coverArt": 16, + "coverArt": "16", "created": "2019-07-08T21:49:41.43457798+01:00", "duration": 220, - "id": 76, + "id": "76", "isDir": false, "isVideo": false, - "parent": 16, + "parent": "16", "path": "Swell Maps/(1980) Jane From Occupied Europe/13.16 Blenheim Shots.flac", "size": 33140852, "suffix": "flac", @@ -89,13 +88,13 @@ "artist": "Swell Maps", "bitRate": 295, "contentType": "audio/mpeg", - "coverArt": 17, + "coverArt": "17", "created": "2019-07-08T21:49:41.493347193+01:00", "duration": 463, - "id": 93, + "id": "93", "isDir": false, "isVideo": false, - "parent": 17, + "parent": "17", "path": "Swell Maps/(1979) A Trip to Marineville/d01 13.14 Adventuring Into Basketry.mp3", "size": 17119309, "suffix": "mp3", @@ -109,13 +108,13 @@ "artist": "Ten Years After", "bitRate": 192, "contentType": "audio/ogg", - "coverArt": 19, + "coverArt": "19", "created": "2019-07-08T21:49:41.573811068+01:00", "duration": 433, - "id": 107, + "id": "107", "isDir": false, "isVideo": false, - "parent": 19, + "parent": "19", "path": "Ten Years After/(1967) Ten Years After/13.15 Spider in My Web.ogg", "size": 10400948, "suffix": "ogg", @@ -129,13 +128,13 @@ "artist": "Captain Beefheart & His Magic Band", "bitRate": 160, "contentType": "audio/mpeg", - "coverArt": 21, + "coverArt": "21", "created": "2019-07-08T21:49:41.687805489+01:00", "duration": 152, - "id": 129, + "id": "129", "isDir": false, "isVideo": false, - "parent": 21, + "parent": "21", "path": "Captain Beefheart/(1970) Lick My Decals Off, Bitch/13.15 Space-Age Couple.mp3", "size": 3054515, "suffix": "mp3", diff --git a/server/ctrlsubsonic/testdata/test_search_two_q_ani b/server/ctrlsubsonic/testdata/test_search_two_q_ani index c54ace4..aa2daae 100644 --- a/server/ctrlsubsonic/testdata/test_search_two_q_ani +++ b/server/ctrlsubsonic/testdata/test_search_two_q_ani @@ -7,19 +7,18 @@ "searchResult2": { "artist": [ { - "id": 10, - "parent": 1, + "id": "10", "name": "___Anika" } ], "album": [ { - "coverArt": 13, + "coverArt": "13", "created": "2019-07-08T21:49:41.334460116+01:00", - "id": 13, + "id": "13", "isDir": true, "isVideo": false, - "parent": 12, + "parent": "12", "title": "(2010) Anika" } ] diff --git a/server/ctrlsubsonic/testdata/test_search_two_q_cert b/server/ctrlsubsonic/testdata/test_search_two_q_cert index de41389..520e717 100644 --- a/server/ctrlsubsonic/testdata/test_search_two_q_cert +++ b/server/ctrlsubsonic/testdata/test_search_two_q_cert @@ -7,8 +7,7 @@ "searchResult2": { "artist": [ { - "id": 4, - "parent": 1, + "id": "4", "name": "A Certain Ratio" } ]