Skip to content

Commit

Permalink
OpenSubsonic API: root music folders are returned using ids
Browse files Browse the repository at this point in the history
  • Loading branch information
epoupon committed Dec 18, 2024
1 parent a72171d commit dfa03ab
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 9 deletions.
6 changes: 0 additions & 6 deletions src/libs/subsonic/impl/SubsonicId.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,6 @@ namespace lms::api::subsonic
return "dir-" + id.toString();
}

std::string idToString(db::MediaLibraryId id)
{
// No need to prefix as this is only used at well known places
return id.toString();
}

std::string idToString(db::ReleaseId id)
{
return "al-" + id.toString();
Expand Down
1 change: 0 additions & 1 deletion src/libs/subsonic/impl/SubsonicId.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ namespace lms::api::subsonic
{
std::string idToString(db::ArtistId id);
std::string idToString(db::DirectoryId id);
std::string idToString(db::MediaLibraryId id);
std::string idToString(db::ReleaseId id);
std::string idToString(db::TrackId id);
std::string idToString(db::TrackListId id);
Expand Down
2 changes: 1 addition & 1 deletion src/libs/subsonic/impl/endpoints/Browsing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ namespace lms::api::subsonic
MediaLibrary::find(context.dbSession, [&](const MediaLibrary::pointer& library) {
Response::Node& musicFolderNode{ musicFoldersNode.createArrayChild("musicFolder") };

musicFolderNode.setAttribute("id", idToString(library->getId()));
musicFolderNode.setAttribute("id", library->getId().getValue());
musicFolderNode.setAttribute("name", library->getName());
});

Expand Down
2 changes: 1 addition & 1 deletion src/libs/subsonic/impl/responses/User.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ namespace lms::api::subsonic

// users can access all libraries
db::MediaLibrary::find(context.dbSession, [&](const db::MediaLibrary::pointer& library) {
userNode.addArrayValue("folder", idToString(library->getId()));
userNode.addArrayValue("folder", library->getId().getValue());
});

return userNode;
Expand Down

0 comments on commit dfa03ab

Please sign in to comment.