Open timoreimann opened 12 years ago
I'd to implement this feature by means of building and maintaining the music cache on the server side. An extension to the REST API will then allow clients to request possible cache updates.
A simple log journal managed on the server should provide the basis for cache management. It should work something like this: Every time the music library is modified on the backend (e.g., music content added or removed), an entry describing the change is added to a simple text-based log and tagged with a version (similar to a file system journal). Clients (e.g., Android devices) regularly ask the server for possible music indices updates and provide their local index version with the request. The server then checks if the passed version is smaller than the latest version in the journal, and if so, returns all modifications yet unknown to the client in a merged format. The client updates its local index and remembers the new version which is then provided in future synchronization requests.
Naturally, it should be possible for clients to force a premature synchronization update, or recreate the index from scratch should anything go wrong.
Apparently, the Android app sends a request to the server for every music directory level accessed. This is especially bothering when switching between UI tabs. Some kind of caching mechanism should be implemented and used instead.