Offline files deleted after media provider refresh

Issue description:

I am using a subsonic server (navidrome) as a media provider. I have my entire media library in the permanent offline cache.

When one or more new albums are added to the server, the next time Symfonium refreshes the media provider it starts to delete files in the permanent offline cache even though those tracks are still present on the server.

Logs:

Upload description: gidofflinefiles

Additional information:

 

 

Reproduction steps:

 
1.Add new album to media server
2. Open Symfonium, wait for it to refresh the media provider
3. Notice that permanent offline cache files start to be deleted
 

Media provider:

Subsonic

Screenshots:

     

19:47:47.061 P:Verbose T:DownloadManager 
Removing auto cached media without matching rule MediaItem{externalId='e68b4ae1225158bceb209699238a54de', mediaType=Song, file='/media/ssd/Music/Full of Hell/2019-05-17 - Weeping Choir/02 - Haunted Arches.flac', title='Haunted Arches', resume=0}

You cached those media via some rules and those rules no more exists, so after a sync the cleaner runs and remove the files auto cached via rules that no more exists.

How are you caching the media?

I have a smart playlist that contains all tracks, and I’ve set up an auto-download rule for that playlist.

The tracks getting deleted after a media provider refresh haven’t changed on the media server so I don’t understand why they’re getting removed from the offline cache.

To cache everything it’s better to just check the option in the provider itself it’s a lot lot lot more efficient.

Well this smart playlist filters out silence tracks in my library (that I have rated 1 star out of 5). I have a large library and don’t want to cache those silence tracks.

Hum then when Navidrome supports multiple libraries you should split them in another library.

With so much songs, you use more battery than necessary to check them a lot more frequently than required.

From your logs seems there was a race and the sync and cleanup starts more or less at the same time. Should be fixed in next release.

Thanks very much for fixing this. And I appreciate the advice about multiple libraries.