fast4x / RiMusic

A multilingual Android application for streaming music from YouTube Music.
https://rimusic.xyz
GNU General Public License v3.0
2.09k stars 106 forks source link

[Feature]: Better implementation of 'Song Cache' #925

Open sayyid5416 opened 6 months ago

sayyid5416 commented 6 months ago

Description

User-uploaded image

Currently the 'Song Cache size' restricts the size of all cached songs, which is beneficial, but it could be enhanced for better management.

Suggested Solution

Split this setting into two separate settings:

Benefit

The proposed split will offer more precise control over cached songs. For instance, in my case, nearly 0.5GB is occupied by 'song cache', but only 28 songs are saved in 'Library > Cached'. The rest of the cache comprises songs I haven't finished. With separate settings, I can allocate different sizes for finished and unfinished songs. For example, if I set 1GB for 'saved songs cache', only songs present in 'Library > Cached' will contribute to it. Additionally, I can allocate 100 MB (for instance) to unfinished songs, ensuring better management of my cache space.

fast4x commented 6 months ago

Song cache in new version will be without limit and manual clean from preferites playlist and data settings

sayyid5416 commented 6 months ago

and manual clean from preferites playlist and data settings

what do you mean by this?

fast4x commented 6 months ago

this Screenshot_2024-03-04-20-38-44-329_it.fast4x.rimusic-edit.jpg

fast4x commented 6 months ago

and this Screenshot_2024-03-04-20-40-00-256_it.fast4x.rimusic-edit.jpg

sayyid5416 commented 6 months ago

So, basically you are saying there will be no limits for cache in future! but why did you changed this?

Isn't it good that we can control the size?

fast4x commented 6 months ago

Yes, there was a request for functionality to empty the cache manually. I’m curious to see the reaction of users, if they are happy I will leave the two modes.

fast4x commented 6 months ago

I can also enter the two modes now, what do you think?

sayyid5416 commented 6 months ago

There is already an option to set the 'song cache' to unlimited, You can leave it like that, and add a button clear the cache. A button to clear the cache is a good addition.

But this feature request of mine is not about that.

fast4x commented 6 months ago

Screenshot_20240304_215421

Added manual clean.

Your request is interesting, but there is a problem, the player automatically caches. It means that the preset size is only one. Erasing cannot be automatic but manual. Imagine two different buttons clearing the cache based on your favorite songs.

sayyid5416 commented 6 months ago

there is a problem, the player automatically caches. It means that the preset size is only one.

That seems like an issue.

By the way, can we already track the songs that are 100% cached? If so, I have an idea (although I'm not very familiar with Android programming):

fast4x commented 6 months ago

I'll check it

ikanakova commented 6 months ago

I think it would be cool if songs that are cached at 100% would be treated as songs downloaded. And until they are cached to 100% they would be taken as not downloaded or cached to 0%. In my opinion, it doesn't matter to the user if the songs are manually downloaded or automatically cached, what matters is that they can play the song offline. So if technically possible, downloaded and cached could be completely merged everywhere including settings.

fast4x commented 6 months ago

Yeah, I agree, and there’s a ticket on this.

sayyid5416 commented 6 months ago

I think it would be cool if songs that are cached at 100% would be treated as songs downloaded. And until they are cached to 100% they would be taken as not downloaded or cached to 0%. In my opinion, it doesn't matter to the user if the songs are manually downloaded or automatically cached, what matters is that they can play the song offline. So if technically possible, downloaded and cached could be completely merged everywhere including settings.

Yes, 100% cached songs should be treated differently than the ones who are still in progress (this feature request is about that)

No, Merging 100% cached songs with downloaded songs would be a horrible idea. Cached songs changes time to time based on listening behaviour and the cache limit set by user, while downloaded songs are the ones which user wants to stay downloaded until he manually delete them. So they should stay in different categories. It's one of the best features of this app.

fast4x commented 6 months ago

Imagine not knowing that the cache is managed by the player, that it is cached or that it is downloaded manually, it is still a song downloaded...

sayyid5416 commented 6 months ago

Imagine not knowing that the cache is managed by the player, that it is cached or that it is downloaded manually,

I guess everyone have this much common sense, specially when they both are put in different categories in Library.

it is still a song downloaded...

Yes it is. But isn't it better to know which songs I downloaded willingly and which songs got cached?

Suppose I've downloaded most of my favourite songs downloaded, and I listens to them on shuffle. Also, I listen to some other songs too, which I don't want to put with my favourite downloaded songs to populate them with songs which I listened to just 1 or 2 times.

If they are cached in different categories, I've the option to have my favourite downloaded songs different from the ones I listened just once or twice.

ikanakova commented 6 months ago

Imagine not knowing that the cache is managed by the player, that it is cached or that it is downloaded manually,

I guess everyone have this much common sense, specially when they both are put in different categories in Library.

it is still a song downloaded...

Yes it is. But isn't it better to know which songs I downloaded willingly and which songs got cached?

Suppose I've downloaded most of my favourite songs downloaded, and I listens to them on shuffle. Also, I listen to some other songs too, which I don't want to put with my favourite downloaded songs to populate them with songs which I listened to just 1 or 2 times.

If they are cached in different categories, I've the option to have my favourite downloaded songs different from the ones I listened just once or twice.

I understand, but I don't like the idea of having 1 button to delete the (manual) cache (i.e. downloaded) and another button to manually delete the (automatic) cache, etc.

But maybe a solution could be that after merging the automatic and manual cache, an option would appear in the settings - I want two different playlists for downloaded and cached. Edit: And maybe options: want cached and downloaded separately / want cached and downloaded together / don't want to show such a playlist at all.

ikanakova commented 6 months ago

And I wouldn't mind if the memory size setting remained split. I'd just change the name downloaded to manually cached to make it clear that it's a cache and not some file downloaded to the device (mainly to make it clear to new users). But I would be happy if I could delete a playlist/song etc manually regardless if it is automatically or manually cached = there would be one icon for that.

fast4x commented 6 months ago

@ikanakova @sayyid5416 Keeping separate or uniting in one voice is not bad because it would give you the freedom to choose according to your own ideas.

sayyid5416 commented 6 months ago
  1. Providing both options (separate or combined downloads) is a good idea, but implementing it might be challenging for @fast4x.

  2. Renaming them to 'manually cached' or 'auto cached' may not be ideal. While it clarifies the backend process for developers, it might not be intuitive for regular users.

  3. I suggest eliminating the setting for a "downloaded songs limit" and the clear button for downloaded songs in settings. Since users manually download songs, limiting them seems unnecessary.

  4. Regarding the misconception that 'downloaded songs' implies local storage, this isn't accurate. Just like Spotify or YT Music, RiMusic's implementation doesn't save downloaded songs to local storage either.

sayyid5416 commented 6 months ago

Basically:

  1. Consider "Cached" a smart playlist, which contains latest songs user was listening to. --> User should be able to put a limit on how many songs can be cached.
  2. Consider "Downloaded" a playlist which contains all the manually downloaded songs from all over RiMusic. --> there should not be a limit on this because user is downloading the song willingly and manually.
ikanakova commented 6 months ago

Basically:

  1. Consider "Cached" a smart playlist, which contains latest songs user was listening to. --> User should be able to put a limit on how many songs can be cached.
  2. Consider "Downloaded" a playlist which contains all the manually downloaded songs from all over RiMusic. --> there should not be a limit on this because user is downloading the song willingly and manually.

So except for the playlist, which would be separate for the downloaded and separate for the cache, the manual and automatic caches would actually be merged, am I understanding this correctly?

sayyid5416 commented 6 months ago

Basically:

  1. Consider "Cached" a smart playlist, which contains latest songs user was listening to. --> User should be able to put a limit on how many songs can be cached.
  2. Consider "Downloaded" a playlist which contains all the manually downloaded songs from all over RiMusic. --> there should not be a limit on this because user is downloading the song willingly and manually.

So except for the playlist, which would be separate for the downloaded and separate for the cache, the manual and automatic caches would actually be merged, am I understanding this correctly?

I'm unable to understand you properly! Can you kindly describe it in a little bit depth?

ikanakova commented 6 months ago

I'm unable to understand you properly! Can you kindly describe it in a little bit depth?

Basically what I mean is that there will be one button that will download/delete downloaded songs and also delete 100% cached songs. Otherwise, I agree with you about the playlist. And I like your idea that the max download size setting is unnecessary and could disappear from the settings. Less than 100% cached songs would be as if they were 0% and maybe there could be an empty cache button in the settings as fast4x suggested but that would only delete the non 100% cache, because I think 100% downloaded cache should be deleted manually e.g. in the playlist.

sayyid5416 commented 6 months ago

there will be one button that will download/delete downloaded songs and also delete 100% cached songs.

By that "one button", do you mean this button or some other button?

Description of the image


Less than 100% cached songs would be as if they were 0% and maybe there could be an empty cache button in the settings as fast4x suggested but that would only delete the non 100% cache, because I think 100% downloaded cache should be deleted manually e.g. in the playlist.

That would be great.


To summarise: Action Description
Delete single song from either the cached or downloaded playlist Using delete/download button on that song (the one in the above screenshot)
(It's already present)
Clear all songs from either the cached or downloaded playlist Using Clear all button in cached or downloaded songs playlists
(already present in downloaded, but absent in cached songs playlist )
Delete unfinished cache songs This should done from the settings. (more on it in next point)
_(This feature request is to differentiate these unfinished songs cache from completely cached songs)_
Limits There should be only two types of limits for songs:
1. Unfinished songs cache
2. Completely Cached songs.
Also, a button to clear them (as fast4x already shown in ss in prev post).
ikanakova commented 6 months ago

By that "one button", do you mean this button or some other button?

I mean this button.

sayyid5416 commented 6 months ago

@fast4x I think this request is not implemented yet. Was this closed by mistake?

fast4x commented 6 months ago

Yes sorry