Page 1 of 3
Eliminate Constant Re-Indexing of Music-Android App

Posted:
Sat Oct 29, 2011 3:51 pm
by Pishtim
First I would like to say that I absolutely LOVE subsonic since I bought it over 1 1/2 years ago BUT:
I absolutely hate waiting at the "Contacting server, please wait" and "Reading from server" stages every time I click on my individual folders when browsing for music. I am assuming it is re-indexing or refreshing my music list every time I jump into a folder, but this seems completely unnecessary to me, since I rarely add music or change my music folder structures. Certainly, I would say that most people also do not add music to their library everyday, so it seems unnecessary to force a retrieval of our music list every time we're browsing music.
Please allow the Android Subsonic application to cache my entire music library list (not the music itself) and folder structure for instant music browsing, and add an option to MANUALLY re-index or refresh when that necessity arises.
I know there are probably reasons Subsonic for Android works the way it does, and please forgive me if I am ignorant of these reasons. But if my request is at all possible please consider it!
Thanks!
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Sat Nov 12, 2011 1:04 am
by Funktopus
Coincidentally, I was about to post about this very issue when I came across this thread. From what I can tell by taking a (yet incomplete) look at the relevant code section, the Android app provides some kind of timeout-based caching mechanism. From my personal experience with Subsonic, however, caching doesn't completely eliminate server access as there's still some latency involved in listing the artist directory.
In addition to providing as much artist directory content from cache as possible, I'm also interested in being able to browse the directory in offline mode. The use case I have for this is that I often listen to previously downloaded music so network access shouldn't be necessary IMHO. For the purpose of retrieving the artist directory, however, I have to turn on and use 3G for a moment which can be time-consuming in EDGE/GPRS-only situations.
I agree with Pishtim that there's no need to reach out for the server every time the artist directory is being accessed as library updates are usually much less frequent than browse requests. Instead of only relying on the the user to manually sync artist content, however, I'd like to see the Subsonic app refresh the artist list periodically in the background or when network access is needed anyway. Pressing a button to trigger synchronization explicitly is perfectly valid but some smart logic should be there IMHO so that sync demands "just work".
I'll try to outline the modifications required from my perspective and see what other people have to say. Of course, if there's already something people would like the share in, please go ahead so we can try to get this feature right. I'd be perfectly willing (and eager) to implement some code, test new functionality, and create a patch.
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Mon Nov 14, 2011 12:57 pm
by bushman4
Funktopus wrote:In addition to providing as much artist directory content from cache as possible, I'm also interested in being able to browse the directory in offline mode. The use case I have for this is that I often listen to previously downloaded music so network access shouldn't be necessary IMHO. For the purpose of retrieving the artist directory, however, I have to turn on and use 3G for a moment which can be time-consuming in EDGE/GPRS-only situations.
This is already a feature... go into the server list and choose "Offline" and you will only see artists/albums/songs that you have cached locally.
HTH,
Glenn
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Mon Nov 14, 2011 8:25 pm
by Funktopus
Hey Glenn,
bushman4 wrote:Funktopus wrote:In addition to providing as much artist directory content from cache as possible, I'm also interested in being able to browse the directory in offline mode. The use case I have for this is that I often listen to previously downloaded music so network access shouldn't be necessary IMHO. For the purpose of retrieving the artist directory, however, I have to turn on and use 3G for a moment which can be time-consuming in EDGE/GPRS-only situations.
This is already a feature... go into the server list and choose "Offline" and you will only see artists/albums/songs that you have cached locally.
I didn't know this, thanks for the note. However, I'd still prefer a rather seamless integration no matter what my online/offline status is instead of having to switch between access modes explicitly. (Think of flaky connectivity situations.) As a suggestion, the app could automatically hide non-cached content when the device is offline, or mark downloaded content, or do either as a configurable option.
Besides, the OP's request to cache the artist (in online mode) index still holds. Maybe this could be implemented as a first step (simply because it seems easier to do).
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Mon Nov 14, 2011 8:30 pm
by bushman4
Totally agree. Just giving the best possible workaround at the moment...
Remember, the Droid app is free. Sindre's primary focus (I believe) is feature enhancement to the Server App, and droid app upgrades come later or in batches. But he does maintain a wishlist, and I am pretty sure the file info caching is definitely on there.
I love what Subsonic has done for my ability to listen and watch my content remotely but I also totally respect that this is really a "hobby" project and that sometime I just have to wait for an improvement request to become enough of a thorn in Sindre's side for him to want to tackle it...
I for one am glad that the base functionality works as well as it does, and the rest is just jimmies on the already delicious ice cream.
My $.02,
Glenn
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Mon Nov 14, 2011 11:24 pm
by Funktopus
It's completely understandable that Sindre's (free) time is limited and its allocation exclusively up to him. What I was trying to suggest though is that I would like to take a stab in providing the required changes. I already wrote a small patch before and got a rough understanding of how certain parts of the Subsonic Android app work. It was my primary intent to get a common understanding on how the new feature should behave and look like so that we'll end up with some functionality that many people can benefit from.
I'm very happy that you pointed me to the offline server mode already so I can push the "seamless integration feature" (as mentioned in my last post) further down the priority list. Instead, I'd like to focus on caching the index such that latencies can be hidden as good as possible while keeping battery drain to a minimum. Once I get a full picture of the relevant code sections I can outline the suggested modifications, publish a patch, and hope for Sindre to consider it for upstream integration.
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Mon Nov 14, 2011 11:48 pm
by bushman4
Sounds great to me. I'm sorry if I came off as preachy... it was totally unintentional, but apparent now that I re-read my response.
Glenn
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Wed Nov 16, 2011 9:30 pm
by Funktopus
No offense taken. We're all just trying to help creating the best music app for Android there is.

Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Sat Jan 21, 2012 3:15 pm
by sindre_mehus
Hi,
The artist list is in fact cached, but the app sends a request to the server to check for updates (but never more frequent than once per hour). If there is no change, the artist list is not retrieved.
But I agree, it's annoying to wait for the artist list to appear. It would be better to show the cached value immediately and check for updates in the background.
I'll take a closer look at it later today, shouldn't be too hard to implement.
Thanks,
Sindre
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Sat Jan 21, 2012 10:33 pm
by Funktopus
Hey Sindre,
sindre_mehus wrote:The artist list is in fact cached, but the app sends a request to the server to check for updates (but never more frequent than once per hour). If there is no change, the artist list is not retrieved.
Are you sure it works like this, especially with regards to the update frequency? I just did the following on my device to observe the exact network behavior:
- Browsed through the music library on the music library tab on the very left. On every directory, the server seems to be contacted (I can see a contacting server, please wait message appearing for a short time).
- Switched over to the player tab (the one on the very right which shows the play, pause, and other control buttons).
- Switched back to the music library tab. If I re-walk the very same music library path, I see contacting server, please wait messages on every traversed directory again.
So it seems to me that there is no caching mechanism involved; the server gets contacted every time a piece of the music library is accessed. Sindre, did I get you wrong? Can you explain how the current caching mechanism works and when network access is involved?
sindre_mehus wrote:But I agree, it's annoying to wait for the artist list to appear. It would be better to show the cached value immediately and check for updates in the background.
I'll take a closer look at it later today, shouldn't be too hard to implement.
If you would like some help with implementing this feature please let me know. I'd be more than willing to contribute on the issue.
Cheers,
funktopus
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Sun Jan 22, 2012 8:25 pm
by sindre_mehus
Hi,
It's only the top-level list of artists that is cached, not the entire folder structure (although the 20 last visited folder are cached up to 5 minutes).
Regards
Sindre
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Sun Jan 22, 2012 8:44 pm
by Funktopus
Doing another quick test, it seems that the top-level artist cache isn't used in all cases: Try switching between the artist selection tab and other tabs back and forth. You'll notice that the top-level artist list is sometimes retrieved from cache but at other times the network is accessed. I couldn't really detect the exact pattern though.
Overall, I believe that a new synchronization mechanism that operates in the background without much notice to the user is highly desirable.
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Mon Feb 06, 2012 1:20 pm
by Pishtim
Thank you SO much for responding Sindre!!! I am so happy this has come to your attention. As I said before, this is the only real qualm I have with subsonic, if it were addressed, this app would be PERFECT in my eyes

Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Tue Feb 07, 2012 9:08 pm
by text
I don't want my entire music library directory cached on my phone. My music library is encrypted. To cache the directory on my phone would open up a security vulnerability for me. Anyone who took my phone could potentially find out exactly what music I have on my computer just by looking at the directory on my phone. That's no good for me. I'd rather it update every time.
Re: Eliminate Constant Re-Indexing of Music-Android App

Posted:
Tue Feb 07, 2012 10:14 pm
by Pishtim
text wrote:I don't want my entire music library directory cached on my phone. My music library is encrypted. To cache the directory on my phone would open up a security vulnerability for me. Anyone who took my phone could potentially find out exactly what music I have on my computer just by looking at the directory on my phone. That's no good for me. I'd rather it update every time.
Please explain how on gods green earth would people knowing what music you listen to be a security vulnerability. Do you think someone is going to break into your house and steal your computer if they like your musical taste? Or do you think they will get you ostracized for your lack of musical taste? Why do you encrypt your music library?
fyi there are programs out there that allow you to remotely wipe the data on your phone if it were to get stolen, e.g. Lookout. If you are so concerned with security that you go as far as encrypting your music, then Lookout, or some similar program, would be a far better solution for you than attempting to block this much desired modification.