Cache played files

Is it possible to cache files when played once?
I don’t want to pre-select files to cache, but I’d like files to cache when played once instead.

Would this be possible to integrate? I would like to switch from DSub/Airsonic to this app with Jellyfin. DSub supports this feature and is the only thing with holding me from changing.

2 Likes

I’ll more context about this.

What do you mean by played, like 100% played and it’s downloaded after, it’s downloaded before, during ? Any automatic uncache?
It’s easy to forget about such option and fill your phone with data.

How DSub works from what I know by just using it;

  • you specify a cache max size. If it’s over this limit, it will delete the oldest cached files to make room.
  • If you click it to play, it will start streaming when it’s not cached. If you stop this before it ends, it will download/stream the rest in order to cache.
    A threshold / grace period of a couple seconds into the stream for not caching the file, might be ideal for accidental playback (this is not part of DSub afaik).

Downloading before playback would incur quite some latency, and I would not prefer this myself.
The most ideal situation from my point of view;

  • It will start to stream/playback, and write this stream to the specified cache location .
  • When it’s stopped before the grace period, the stream written to disk will be automatically deleted.
  • When it’s stopped after the grace period, the stream will continue in the background so it will be written to disk completly.
  • When it’s stopped at the end the whole file is already written to disk.

I love this app, it’s very powerfull and I’ve already bought a license!
If you can find time to implement something to this extend I would be very grateful, but I also know that I might be asking a lot, and therefore do understand if this is either low priority, not feasible etc.

1 Like

The thing is that download and playback are 100% unrelated in Symfonium. So offline cache is not a playback cache but really a wanted offline copy of the media.

This leads to the main issue, there’s no notion of cache max size and eviction since it’s built around the concept that the user have control and do not want random thing to be deleted.
Adding a cache size only for automated offline cache from this option but not impacting the manual wanted offline caching of media from the users is would be insanely complicated to maintain. And clearing what the user on purpose cached to cache the currently playing media that he’ll probably won’t need is an horrible alternative.

So the end result is that while I can add an option to auto cache, adding an auto prune / max cache size option is not really wanted. And so this would make this option less useful and so does it worth to be added? I personally don’t think so.
You can auto offline cache a playlist for example and just add songs to the playlist so they are auto cached.
You can also already build a smart playlist that contains songs that have a playcount > 1 and a last played < 1 week and auto cache it. It will mostly do what you want without the cleaning.

2 Likes

Found this thread looking for an automatic way to keep most recently played songs cached.
As suggested I made a smart playlist filtered by played within 1 day (sadly 0.25 didn’t work) and songs are being added fine…
The only problem is that, because the already streamed file is being discarded and redownloaded immediately after playback, it sometimes interferes with buffering for playback.
(mostly when skipping and for tracks longer than 15 min because they take a while)

Is there any way to prioritize buffering over offline-downloading?

Not really no you can try to enable the slower download In advanced settings.

1 Like

I second this feature request. Similarly to other users, the reason I would like to see this feature is that I rarely look for albums to download for later. When I am offline, I want to play albums that were cached for me as I was playing them before.

I am coming from Qmusic which offers a similar feature: files downloaded can be stored in an offline cache of configurable size. I understand that this automatic cache could be conflicting with the manual caching mechanism that is already present. Another way I could see this working for me is if I was able to automatically cache music according to certain media tags (if the provider allows for it), for example a track or album rating > X.

1 Like

There’s many posts about how to achieve nearly anything via smartplaylists and auto download.

Create a smartplaylist with your rules. (Like last played in last 2 days) or ratings or anything then enable auto offline cache on it.

2 Likes

Oh, perfect! Now I’m all set. Thank you!

Some feedback on the process, if it’s of interest to you: I had to look up the documentation to create the filter as I had trouble finding the option in the UI. Adding the playlist to the home menu was also not the most intuitive, I couldn’t find an option to add a “Playlists” category to the home menu and realized a little late that I had to favourite the playlist to have it appear there.

Smart filters are advanced topics it’s normal to look at the doc anyway and it’s written for that :slight_smile:

For smart playlists there’s a create smart playlist at top of the playlist screen don’t know how to make it more visible.

For the playlist on main screen, this is the same for all the rows in settings / interface. It’s just that the Favorites playlist row is already added by default, but you can spot it in the list when you edit.

On smart filters, I agree that it makes sense to have to look at the doc to know how it works. But I do think that the option is quite hidden away, such that those that would want it (here, me), don’t even know it exists in the first place. The filter (and smart filter) widget could for example be added to the search tab, as a kind of advanced search? It could combine well with the current search functionality.

On creating smart playlists, maybe I’m blind but I cannot find the playlist screen you mention. The only way I found to create one is to follow these steps and save the filter as a smart playlist: [Wiki] Smart filters

About playlists, the trouble was that I couldn’t find the playlist I just created at first, since it doesn’t appear in the Home tab where I was expecting it. I had to go to the search tab to find it again and favourite it. Would it make sense to add Playlists as an available shortcut for the Home tab?

The filters are there to filter the current view with an icon that represent a filter in most apps.

They are meant to be there, search can search in all media smart filters don’t work there.

For the playlists you probably have removed the tab but by default there’s a library tab that contains everything including playlists.

You’re absolutely right, resetting the settings to default fixed it, now I see the playlist button. I also figured out why I didn’t see the option in the first place, I didn’t notice/remember you could scroll down the Library shortcuts… My bad. Sorry for the trouble and thanks for the help.

Hi, I’m joining the discussion trying to understand the basic concept as I just joined.

Without smart filter, when I play a selected album, it does not automatically cache it? Meaning that if I am offline (plane mode for example) I cannot read this album anymore?

I thought the “cache de roulement” was doing this but seems not? Sorry I am lost even though I feel that I have read the docs but there are too many different caching options and I don’t quite understand the difference and which is used when? :smirk::pray:

Edit : it seems to work now, not sure what changed. However it only downloads the number of song listed in the pre-cache settings of playback (9 songs for me). I would love to have an option unlimited limit to load the whole playlist/album in the limit of the max cache size (4gb for me).

  • Playback cache: only temporarily caches the currently queued (now playing) songs up to the amount set in the “pre-cache” settings and up to the playback cache size. Only meant to cope for network issues. You can’t control what’s in there exactly.
  • Rolling cache: caches songs you select for caching (manually, e.g. through selecting an album for caching; or automatically, e.g. by selecting a smart playlist for caching). The oldest songs are removed from the cache once you hit the cache size limit.
  • Permanent cache: permanently caches songs you manually or automatically select for caching. You can even select in the settings to auto-cache favorites, or in the provider settings to auto-cache all songs. Files are never removed automatically from the permanent cache (as long as they are in the library). The size cannot be limited.

What you want is the rolling cache.You need to activate it in the settings by seting the max size, and then select albums or playlists to be cached (album → Three dots → Offline Cache and Download → Use rolling cache). If you want a more “dynamic” caching (e.g. caching of favorites or of all albums of genre X or of all songs longer than 5:00), then create a smart playlist with your dynamic settings and select it to be cached, but automatic caching goes to the permanent cache only (not the rolling cache).

Edit: fixed details about rolling cache not supporting automatic caching.

1 Like

Is there a way to add all songs in a queue to the rolling cache, automatically when the queue is created? Basically like playback cache except add the songs to the rolling cache, and limited by the size of the rolling cache rather than a number of songs

No as it does not really works as soon as the queue is larger there rolling occuring and next played media are removed.

Gotcha. For me, I have my rolling cache set very large, so using something like the song mix button will be very unlikely to be too large. I can add the queue to a temporary playlist, then cache that playlist via the rolling cache, but it would be nice if there was a button to add the current queue to the rolling cache. For example, a playlist could also be too large for the rolling queue

Song mix can be very large too.
And exploding the rolling cache for the current queue would mean playing media not cached so annihilate the purpose and users complaining.

What do you what to achieve ? You can also just cache everything.

What do you mean it would play media not cached?

I guess what I’m really trying to do is pre-cache songs. I have pre cache songs set to the max (9), but usually songs don’t seem to pre cache, they still show the buffer bar even though my connection is definitely fast enough to pre cache the whole song (based on speed when manually adding something to the offline cache)