warwickh / plugin.audio.subsonic

Kodi plugin to stream music from Subsonic.
MIT License
61 stars 13 forks source link

The UI is very awkward with large music collections #8

Closed JimGilliland closed 1 year ago

JimGilliland commented 7 years ago

I've been using Subsonic to host my music library for many years now, but today is the first time I've tried to use the client on KODI. I find that it works well, but for my situation it is largely unusable. The problem is that with a library of more than 10,000 albums (almost 150,000 tracks), the UI is no longer practical.

There are four things that would help with this.

1) Provide an option to handle artists the way native Subsonic does. It appears that this add-on draws on the artist information encoded in each individual track, while native Subsonic uses the directory name as the artist info. They are the same in many cases, but there are enough exceptions to make the artists list much longer than it needs to be. Obviously, every "various artists" album generates a separate artist for each track on the album. And since different tracks may be coded differently, I may have listings for (and this is a real example), "Count Basie", "Count Basie Orchestra", "The Count Basie Orchestra","Count Basie & his Orchestra", "Count Basie and his Orchestra", and "Count Basie and His Orchestra". Yes, even though the last two examples differ only in the capitalization of one letter, they still get treated as two separate artists. But since they are all in the same directory, native Subsonic just lists them all under "Count Basie".

2) Provide an index to allow the user to "jump" to a particular letter of the alphabet within the artist listing.

3) Provide the ability to select individual "folders" from the Subsonic library. For example, my library is broken up into rock, country, jazz, and classical (among others), and in native Subsonic I can treat them as one big library or select each one separately.

4) Provide a search feature.

Obviously, this is a HUGE feature request, and I don't for a minute imagine that any of these things are likely to happen in any hurry. But I do want to document the need so that these things can be considered and prioritized among the various other feature requests. I would consider items 1 and 2 to be more important than 3 and 4.

Finally, note that I just joined this forum today so that I could pass these thoughts along. Please forgive any faux pas in community protocol. Thanks!

gordielachance commented 7 years ago

Hi and thanks for your feedback. The addon works with the subsonic official API.

  1. So i'm not sure this is possible, we use the getArtists method here, which returns the full list of all artists from the server. But I see now there is also a getIndexes method. I'm not sure what it does change here, but do you think this is related to what you are explaining ?

  2. Easy, this is native in Kodi. Press shift+[letter] on the keyboard and it will scroll to it.

  3. I don't have a subsonic server myself so I can't check how it works, but the idea is to be able to browse directories instead of ID3 tags ?

  4. Yeah, we should add this.

I'll have a look at this when I have some time to spend on the plugin developement. Meanwhile, other developers could help :)

JimGilliland commented 7 years ago

First of all, Thank You (!!!) for looking into this. I've never really looked at the Subsonic API, but I spent some time with it today after seeing your response. I never knew that Kodi shortcut (for #2). That's very helpful. Now that I've examined the API, I think I can discuss this in more helpful terms.

First of all, some background. A Subsonic library is generally made up of one or more high-level "folders". These folders are defined on the "Media folders" tab of the Settings panel in the Subsonic server itself:

settings

Each of these folders will contain directories representing an artist. Each of the artist directories will contain directories representing albums. Each of the album directories will contain individual media files. Here you can see the Index page on my Subsonic system. At the top, you can see the same high level "folders" that I defined above. Below that you can see the list of directories within each folder. On the right, you can see an alphabetical index that allows jumping to each section of the listing. This screenshot shows only the "A"s, but this panel can be scrolled all the way down to the "Z"s.

index

If I click on one of the artists listed, I'm taken to a listing of all of the albums in that artist's directory:

artistpage

This structure is not the only possible one, but it is the most common. I could, for example, have individual media files in this same directory, along with the album subfolders. Or, within an album folder, I could have additional subdirectories for each volume (CD) of a multi-volume set. I supposed you could even build your directory structure using some criteria other than Artist, but this seems to be the usual structure.

To create the alphabetical list that I showed above, I suspect that Subsonic uses the getMusicFolders method to retrieve all of the high-level folders, using the names to create the tabs across the top. Then, it uses getIndexes to retrieve all of the highest level directories within each of those folders, using one of the IDs returned by getMusicFolders to limit the list to just one folder, or passing no parameter to retrieve the entire list across all folders (which is what is seen in my screenshot). For lower levels of the directory tree, the getMusicDirectory would be used, recursively if necessary, to navigate to the lower levels of the directory tree.

So, that's a long answer to say, yes, I think you're right that the getIndexes method is the one needed for #1 on my feature wishlist. And getMusicFolders, along with getIndexes, would be used for #3.

In either case, getMusicDirectories would be used, recursively if necessary, to navigate downward to individual albums and songs. The response to getMusicDirectories might include lower level directories or individual media files or both. The difference being whether the returned XML contained 'isDir="false"' or 'isDir="true"'.

Bottom line: It appears that Subsonic provides two completely separate methods for navigating a library, one based on directory structure, the other based on ID3 tags. For its main set of indexes, the native Subsonic browser-based client uses the directory structure, not the tags, which makes navigation much easier. Subsonic clients (apps) that I've seen for Android, IOS, and Windows appear to use the same approach.

Let me know if any of this isn't clear. And if it would help you to be able to navigate through my Subsonic system, let me know and I'll get you a URL and ID.

gordielachance commented 7 years ago

Ok, thanks for your feedback ! I'm now able to list the media folders within the plugin. ...But it freezes once I try to open one. On the subsonic I have access to, there is only one folder. So maybe there is to much informations to grab.

As a matter of fact, yes I would be glad to get an access to your server so i'm able to test it with your configuration. Still possible ?

JimGilliland commented 7 years ago

Absolutely. Let me figure out how to send it to you privately. Obviously, though, my music DB is pretty big, too.

Later edit: OK, I give up. :) How do you send a private message here? .... I've updated my settings to make my email visible. If you send me a note directly, I'll reply with credentials and URL for my Subsonic.

BTW, it's probably obvious from my earlier response that I have quite a bit of background in software development. But I haven't written any significant code in more than 30 years - before "objects" were even a thing. So I probably won't be digging in too deep. :) But if I can help, I will.

gordielachance commented 7 years ago

Okay!

You can send it to this temporary email : lquk77hgto65l3y@jetable.org

Thanks !

gordielachance commented 7 years ago

Hi Jim ! I can almost see your background in software development by looking to your (great) issue report :) Also, I didn't knew that 'objects' didn't exists once :)
I'm just doing some coding as a hobby, not being a great expert.

Well, good news, I think I got your points 1 & 3 resolved. It was not so difficult. I guess point 2 may be considered as resolved too (the shortcut hint). Could you test this branch (download the zip) ? If it works fine for you, i'll merge it to the master.

Enjoy !

gordielachance commented 7 years ago

Note that there is a data caching system existing in the plugin (so data will be faster to load) but I can't currently make it work. :/ I opened an issue about that.

JimGilliland commented 7 years ago

I noticed a couple of other anomalies, but in general I think it looks great! I'll try to document the issues that I noticed, but I won't be able to do so until - I hope - later today.

One of them is that if it doesn't successfully connect to the server, it takes a very long time to time out (several minutes at least), and it does not try again. Some of the other clients that I've seen will try 4 times before quitting, with about 5-10 seconds between tries. You might try making it wait 2 seconds for the first try, 4 for the second, 8 for the third, 16 for the fourth. That would mean that it would time out after 30 seconds if it failed all 4 times.

Looking over the API, though, I have no idea how the timeout is set. Nor does there seem to be an error code for timeout (except maybe error 0). Is there a forum for developers that talks about use of the API? There must be some way to handle it.

On Mon, Jan 9, 2017 at 5:08 AM, gordielachance notifications@github.com wrote:

Note that there is a data caching system existing in the plugin (so data will be faster to load) but I can't currently make it work. :/ I opened an issue https://github.com/gordielachance/plugin.audio.subsonic/issues/11 about that.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/gordielachance/plugin.audio.subsonic/issues/8#issuecomment-271248092, or mute the thread https://github.com/notifications/unsubscribe-auth/AXrprW2-X-K1yp_Zk2Mm0_JI8H23HAgpks5rQgc5gaJpZM4LX35m .

gordielachance commented 7 years ago

Yeah, I noticed that there was some timeouts with your server, that's strange because I don't have timeouts on the server I have access to. Well, we'll see. Take your time, i will probably not have the time to work on this in the next days.

warwickh commented 1 year ago

Closing this as the issue is very old and the plugin is quite different since this was logged.