Skip to content

Commit

Permalink
feat(subsonic): expose all of album "name"/"title"/"album" for browse…
Browse files Browse the repository at this point in the history
… by tag and browse by folder

related sentriz#404
  • Loading branch information
sentriz committed Nov 8, 2023
1 parent 9bdfc49 commit 2df9052
Show file tree
Hide file tree
Showing 15 changed files with 240 additions and 236 deletions.
2 changes: 2 additions & 0 deletions server/ctrlsubsonic/spec/construct_by_folder.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ func NewAlbumByFolder(f *db.Album) *Album {
ID: f.SID(),
IsDir: true,
ParentID: f.ParentSID(),
Album: f.RightPath,
Name: f.RightPath,
Title: f.RightPath,
TrackCount: f.ChildCount,
Duration: f.Duration,
Expand Down
2 changes: 2 additions & 0 deletions server/ctrlsubsonic/spec/construct_by_tags.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ func NewAlbumByTags(a *db.Album, artists []*db.Artist) *Album {
ret := &Album{
Created: a.CreatedAt,
ID: a.SID(),
Album: a.TagTitle,
Name: a.TagTitle,
Title: a.TagTitle,
Year: a.TagYear,
TrackCount: a.ChildCount,
Duration: a.Duration,
Expand Down
36 changes: 18 additions & 18 deletions server/ctrlsubsonic/testdata/test_get_album_list_alpha_artist
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"artist": "artist-0",
"created": "2019-11-30T00:00:00Z",
"title": "album-0",
"album": "",
"album": "album-0",
"parent": "al-2",
"isDir": true,
"name": "",
"name": "album-0",
"songCount": 3,
"duration": 300
},
Expand All @@ -26,10 +26,10 @@
"artist": "artist-0",
"created": "2019-11-30T00:00:00Z",
"title": "album-1",
"album": "",
"album": "album-1",
"parent": "al-2",
"isDir": true,
"name": "",
"name": "album-1",
"songCount": 3,
"duration": 300
},
Expand All @@ -39,10 +39,10 @@
"artist": "artist-0",
"created": "2019-11-30T00:00:00Z",
"title": "album-2",
"album": "",
"album": "album-2",
"parent": "al-2",
"isDir": true,
"name": "",
"name": "album-2",
"songCount": 3,
"duration": 300
},
Expand All @@ -52,10 +52,10 @@
"artist": "artist-1",
"created": "2019-11-30T00:00:00Z",
"title": "album-0",
"album": "",
"album": "album-0",
"parent": "al-6",
"isDir": true,
"name": "",
"name": "album-0",
"songCount": 3,
"duration": 300
},
Expand All @@ -65,10 +65,10 @@
"artist": "artist-1",
"created": "2019-11-30T00:00:00Z",
"title": "album-1",
"album": "",
"album": "album-1",
"parent": "al-6",
"isDir": true,
"name": "",
"name": "album-1",
"songCount": 3,
"duration": 300
},
Expand All @@ -78,10 +78,10 @@
"artist": "artist-1",
"created": "2019-11-30T00:00:00Z",
"title": "album-2",
"album": "",
"album": "album-2",
"parent": "al-6",
"isDir": true,
"name": "",
"name": "album-2",
"songCount": 3,
"duration": 300
},
Expand All @@ -91,10 +91,10 @@
"artist": "artist-2",
"created": "2019-11-30T00:00:00Z",
"title": "album-0",
"album": "",
"album": "album-0",
"parent": "al-10",
"isDir": true,
"name": "",
"name": "album-0",
"songCount": 3,
"duration": 300
},
Expand All @@ -104,10 +104,10 @@
"artist": "artist-2",
"created": "2019-11-30T00:00:00Z",
"title": "album-1",
"album": "",
"album": "album-1",
"parent": "al-10",
"isDir": true,
"name": "",
"name": "album-1",
"songCount": 3,
"duration": 300
},
Expand All @@ -117,10 +117,10 @@
"artist": "artist-2",
"created": "2019-11-30T00:00:00Z",
"title": "album-2",
"album": "",
"album": "album-2",
"parent": "al-10",
"isDir": true,
"name": "",
"name": "album-2",
"songCount": 3,
"duration": 300
}
Expand Down
36 changes: 18 additions & 18 deletions server/ctrlsubsonic/testdata/test_get_album_list_alpha_name
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"artist": "artist-0",
"created": "2019-11-30T00:00:00Z",
"title": "album-0",
"album": "",
"album": "album-0",
"parent": "al-2",
"isDir": true,
"name": "",
"name": "album-0",
"songCount": 3,
"duration": 300
},
Expand All @@ -26,10 +26,10 @@
"artist": "artist-1",
"created": "2019-11-30T00:00:00Z",
"title": "album-0",
"album": "",
"album": "album-0",
"parent": "al-6",
"isDir": true,
"name": "",
"name": "album-0",
"songCount": 3,
"duration": 300
},
Expand All @@ -39,10 +39,10 @@
"artist": "artist-2",
"created": "2019-11-30T00:00:00Z",
"title": "album-0",
"album": "",
"album": "album-0",
"parent": "al-10",
"isDir": true,
"name": "",
"name": "album-0",
"songCount": 3,
"duration": 300
},
Expand All @@ -52,10 +52,10 @@
"artist": "artist-0",
"created": "2019-11-30T00:00:00Z",
"title": "album-1",
"album": "",
"album": "album-1",
"parent": "al-2",
"isDir": true,
"name": "",
"name": "album-1",
"songCount": 3,
"duration": 300
},
Expand All @@ -65,10 +65,10 @@
"artist": "artist-1",
"created": "2019-11-30T00:00:00Z",
"title": "album-1",
"album": "",
"album": "album-1",
"parent": "al-6",
"isDir": true,
"name": "",
"name": "album-1",
"songCount": 3,
"duration": 300
},
Expand All @@ -78,10 +78,10 @@
"artist": "artist-2",
"created": "2019-11-30T00:00:00Z",
"title": "album-1",
"album": "",
"album": "album-1",
"parent": "al-10",
"isDir": true,
"name": "",
"name": "album-1",
"songCount": 3,
"duration": 300
},
Expand All @@ -91,10 +91,10 @@
"artist": "artist-0",
"created": "2019-11-30T00:00:00Z",
"title": "album-2",
"album": "",
"album": "album-2",
"parent": "al-2",
"isDir": true,
"name": "",
"name": "album-2",
"songCount": 3,
"duration": 300
},
Expand All @@ -104,10 +104,10 @@
"artist": "artist-1",
"created": "2019-11-30T00:00:00Z",
"title": "album-2",
"album": "",
"album": "album-2",
"parent": "al-6",
"isDir": true,
"name": "",
"name": "album-2",
"songCount": 3,
"duration": 300
},
Expand All @@ -117,10 +117,10 @@
"artist": "artist-2",
"created": "2019-11-30T00:00:00Z",
"title": "album-2",
"album": "",
"album": "album-2",
"parent": "al-10",
"isDir": true,
"name": "",
"name": "album-2",
"songCount": 3,
"duration": 300
}
Expand Down
36 changes: 18 additions & 18 deletions server/ctrlsubsonic/testdata/test_get_album_list_newest
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"artist": "artist-0",
"created": "2019-11-30T00:00:00Z",
"title": "album-0",
"album": "",
"album": "album-0",
"parent": "al-2",
"isDir": true,
"name": "",
"name": "album-0",
"songCount": 3,
"duration": 300
},
Expand All @@ -26,10 +26,10 @@
"artist": "artist-0",
"created": "2019-11-30T00:00:00Z",
"title": "album-1",
"album": "",
"album": "album-1",
"parent": "al-2",
"isDir": true,
"name": "",
"name": "album-1",
"songCount": 3,
"duration": 300
},
Expand All @@ -39,10 +39,10 @@
"artist": "artist-0",
"created": "2019-11-30T00:00:00Z",
"title": "album-2",
"album": "",
"album": "album-2",
"parent": "al-2",
"isDir": true,
"name": "",
"name": "album-2",
"songCount": 3,
"duration": 300
},
Expand All @@ -52,10 +52,10 @@
"artist": "artist-1",
"created": "2019-11-30T00:00:00Z",
"title": "album-0",
"album": "",
"album": "album-0",
"parent": "al-6",
"isDir": true,
"name": "",
"name": "album-0",
"songCount": 3,
"duration": 300
},
Expand All @@ -65,10 +65,10 @@
"artist": "artist-1",
"created": "2019-11-30T00:00:00Z",
"title": "album-1",
"album": "",
"album": "album-1",
"parent": "al-6",
"isDir": true,
"name": "",
"name": "album-1",
"songCount": 3,
"duration": 300
},
Expand All @@ -78,10 +78,10 @@
"artist": "artist-1",
"created": "2019-11-30T00:00:00Z",
"title": "album-2",
"album": "",
"album": "album-2",
"parent": "al-6",
"isDir": true,
"name": "",
"name": "album-2",
"songCount": 3,
"duration": 300
},
Expand All @@ -91,10 +91,10 @@
"artist": "artist-2",
"created": "2019-11-30T00:00:00Z",
"title": "album-0",
"album": "",
"album": "album-0",
"parent": "al-10",
"isDir": true,
"name": "",
"name": "album-0",
"songCount": 3,
"duration": 300
},
Expand All @@ -104,10 +104,10 @@
"artist": "artist-2",
"created": "2019-11-30T00:00:00Z",
"title": "album-1",
"album": "",
"album": "album-1",
"parent": "al-10",
"isDir": true,
"name": "",
"name": "album-1",
"songCount": 3,
"duration": 300
},
Expand All @@ -117,10 +117,10 @@
"artist": "artist-2",
"created": "2019-11-30T00:00:00Z",
"title": "album-2",
"album": "",
"album": "album-2",
"parent": "al-10",
"isDir": true,
"name": "",
"name": "album-2",
"songCount": 3,
"duration": 300
}
Expand Down
Loading

0 comments on commit 2df9052

Please sign in to comment.