Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Nextcloud Music as a participating server #84

Merged
merged 1 commit into from
Jan 28, 2024

Conversation

paulijar
Copy link
Member

@paulijar paulijar commented Jan 27, 2024

The Nextcloud Music app has a rudimentary support for the OpenAmpache OpenSubsonic API extensions starting from the version 1.10.0 (released today 2024-01-27).

The same application may be called also ownCloud Music, depending on the host cloud used.

The Nextcloud Music app has a rudimentary support for the OpenAmpache API
extensions starting from the version 1.10.0.
Copy link

netlify bot commented Jan 27, 2024

Deploy Preview for opensubsonic ready!

Name Link
🔨 Latest commit 44d97c3
🔍 Latest deploy log https://app.netlify.com/sites/opensubsonic/deploys/65b568e5c072c90008ea4a3d
😎 Deploy Preview https://deploy-preview-84--opensubsonic.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@Tolriq
Copy link
Member

Tolriq commented Jan 27, 2024

OpenAmpache: it's OpenSubsonic :)

But nice! Do you plan to add support for extensions and additional fields? If yes do you want to be added to the OS org in the server group?

@paulijar
Copy link
Member Author

OpenAmpache: it's OpenSubsonic :)

Oops, sorry, that's what I meant to say :D

Do you plan to add support for extensions and additional fields?

I probably will support at least some of them, eventually. Especially if there are any low-hanging-fruits.

If yes do you want to be added to the OS org in the server group?

I'm not quite sure what are the implications of this. But if this doesn't come with any commitments, then it probably wouldn't hurt.

@Tolriq
Copy link
Member

Tolriq commented Jan 28, 2024

But if this doesn't come with any commitments

It does not really have any, it gives you a vote on new APIs.

The only commitment here is not really tied to being in the org, it's just that if you propose an API, field, whatever and it's implemented you engage yourself in supporting it in your server or client as a sign of respect. But since you are the initiator it's mostly just common sense.

@Tolriq Tolriq requested review from a team January 28, 2024 07:52
@Tolriq Tolriq merged commit 7e4180e into opensubsonic:main Jan 28, 2024
4 checks passed
@paulijar
Copy link
Member Author

@Tolriq Okay, by all means, sign me in.

@Tolriq
Copy link
Member

Tolriq commented Feb 14, 2024

@paulijar Seems there's some issues in the search3 end point returning duplicates : https://support.symfonium.app/t/no-tracks-listed-in-any-of-the-synced-albums/3512

You probably miss a sort in the query in that case most SQL servers with pagination results are undefined.

@paulijar
Copy link
Member Author

@Tolriq Thanks for the report. However, I couldn't immediately reproduce the problem. The DB queries here also sort the results by the title/name fields so that shouldn't be the issue here. What kind of API requests do you send when you see this?

@Tolriq
Copy link
Member

Tolriq commented Feb 14, 2024

@paulijar The user is supposed to report to your repo I'll join there when he does it's not the good place :)

https://xxxx/index.php/apps/music/subsonic/rest/search3.view?query=%22%22&musicFolderId=-1&songOffset=0&songCount=0&albumOffset=0&albumCount=500&artistOffset=0&artistCount=0&u=REDACTED&p=REDACTED&v=1.13.0&c=Symfonium&f=json

But I think the root issue might be
https://xxxxxx/index.php/apps/music/subsonic/rest/getMusicFolders.view?u=REDACTED&p=REDACTED&v=1.13.0&c=Symfonium&f=json that returns

{"subsonic-response":{"musicFolders":{"musicFolder":[{"id":-1,"name":"Artists"},{"id":-2,"name":"Folders"}]},"status":"ok","version":"1.16.1","type":"nextcloud music","serverVersion":"1.10.0","openSubsonic":true}}

And then both search3 with the 2 folderIds returns the same data.

Is this something normal?

@paulijar
Copy link
Member Author

Yes, that's normal. Is it a problem for your client?

The thing is, Nextcloud Music abuses the folder system of the Subsonic API a bit. To understand why, it should be noted that the first reference clients I used 5 years ago were targeting quite old API versions and they didn't have any support for the metadata browsing using the methods like getArtists. Still, browsing by metadata is very much the core feature of Nextcloud Music so I came up with a solution where there's two fake folders: "Folders" and "Artists". The first of these presents the folders and files as they actually are stored in the file system. The second one creates an artificial directory hierarchy Artist > Album > Song according the metadata.

There are never any other musicFolders except these two fake folders as we support only single top-level folder for the music library. This may be subject to change in the future, though. If that happens, then I need to rethink the use of musicFolders in the Subsonic API and I might decide to drop this legacy hack or at least make it configurable.

@Tolriq
Copy link
Member

Tolriq commented Feb 14, 2024

The app sync all for offline first usage via search3. Since it sees 2 library it sync both so triggers duplicate that I can filter, but still duplicate all the requests and data so highly inefficient.

I can add a special handling to ignore the second one for your server type. Do you return different values for next cloud/owncloud ?

Are the IDs always the same? So that if the future you support real multiple folders you can avoid reusing the -2 to avoid me skipping a valid folder ?

@paulijar
Copy link
Member Author

The Subsonic API works exactly the same on Nextcloud and ownCloud. The IDs are always the same for these two fake folders: -1 and -2. If the real multi-folder support will come, then those folders will have positive ID values.

@paulijar paulijar deleted the feature/add_nextcloud_music branch June 30, 2024 09:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants