dweymouth / supersonic

A lightweight and full-featured cross-platform desktop client for self-hosted music servers
GNU General Public License v3.0
877 stars 45 forks source link

Offline mode #262

Open dweymouth opened 11 months ago

dweymouth commented 11 months ago

A lot of design questions will go into this - first and foremost is a proper DB needed (sqlite) for the offline library or is it expected to be small enough that the metadata can be loaded from text/json files and searched in-memory

raphmim commented 10 months ago

I'm testing out supersonic and the ability to automatically download all music is a must for me!

dweymouth commented 10 months ago

I'm testing out supersonic and the ability to automatically download all music is a must for me!

Is your use case to sync the entire library offline? I wasn't planning this but I guess I could consider this scenario when designing this. I was imagining the option to individually download albums, playlists, songs to the local library, which could then be browsed and played without a connection to the server. For supporting whole library downloading, I would definitely need a full database for the offline library. Which might complicate things a little bit figuring out how to bundle sqlite or something similar for all the platforms. For just a handful of content - a small fraction of the full library - a json file "database" system would have been fine

raphmim commented 9 months ago

Yes, my usecase is the make the entire library available offline. It's really important for me, because I spent a lot of time without internet connectivity, and most of my library is made of individual songs (rather than entire albums or many from the same artist).

freshgum-bubbles commented 5 months ago

Yes, my usecase is the make the entire library available offline.

If this is added as a feature, I would heavily recommend the addition of some size calculations that warn the user if the library is over a certain size. For instance, my library is 500GB+, and having Supersonic download all that in the background... silently... does make me shudder a bit.

Re: this, perhaps it could be implemented similar to how Ultrasonic does it: essentially you have a totally separate library for offline-downloaded tracks, and then the usual library for the Navidrome server.

Scrobbles should be collected and sent to the server once back online

This is a lot more important than it sounds, IMO: a lot of apps like Tempo don't seem to actually do this, so when you're offline, you lose the log of everything you've listened to.

dweymouth commented 5 months ago

If full sync is added as a feature, it won't be on by default. I am also more in favor of the totally separate offline library option where a subset of the content is manually downloaded for offline use. I feel like, if full local sync is desired, a better option is for someone to make an entirely new project that basically acts as a local Subsonic server that pulls the library from a remote server, and exposes a local OpenSubsonic API that you just connect Supersonic to instead of directly to the remote server. (Unix philosophy and being really good at doing one thing vs trying to do everything...)

dweymouth commented 5 months ago

I'll add the "help wanted" label since this would be a good feature for someone with backend dev/Go knowledge to work on without needing to know much (or anything) about the Fyne library. (hint hint...)

s-fleck commented 4 months ago

I really think a cache mode similar to dsub could be pretty useful:

Enovale commented 4 months ago

I really think a cache mode similar to dsub could be pretty useful:

* You can reserve X mb/gb of space for music to be cached (tracks you played + the next N tracks in the playback queue)

* Additionally you can manually cache and perma-chache (e.g. stays cached until you manually un-set perma cache status) music from the UI if you want to

This is how Symfonium does it as well, and to add to that, being able to have Favorites automatically added to a given cache would be really nice. Coming from Spotify, I like having my Liked (or in Subsonic's case favorites) songs be automatically downloaded, and this works great with Symfonium on Android.

dweymouth commented 4 months ago

Auto-caching of played tracks is interesting. Currently Supersonic is just feeding the stream URL directly to MPV, but to add this I guess Supersonic would need to proxy the stream so it could save it to disk as MPV is playing. It also would need to handle the case where the file is seeked and MPV sends range requests, or the track is skipped before it's fully downloaded (in which case we don't want to cache an incomplete track). Non-permacached tracks should also probably have an expiry, in case the media file itself was updated on the server. Or maybe in online mode it would always stream from the server and the cached tracks would only be played directly in offline mode?

Anyway, this is a good opportunity for someone with Go backend experience but little or no knowledge of Fyne UI to help out ;) I probably won't be picking this up myself for awhile, especially since there are some bigger UI improvements to be made (synced lyrics, etc) that are still in the backlog