Added task to delete unused cached files

This commit is contained in:
Eliot Berriot 2018-04-13 21:31:40 +02:00
parent 6a04779125
commit c20e4d7c9a
No known key found for this signature in database
GPG key ID: DD6965E2476E5C27
4 changed files with 73 additions and 0 deletions

View file

@ -4,3 +4,17 @@ from dynamic_preferences import types
from dynamic_preferences.registries import global_preferences_registry
federation = types.Section('federation')
@global_preferences_registry.register
class MusicCacheDuration(types.IntPreference):
show_in_api = True
section = federation
name = 'music_cache_duration'
default = 60 * 24 * 2
verbose_name = 'Music cache duration'
help_text = (
'How much minutes do you want to keep a copy of federated tracks'
'locally? Federated files that were not listened in this interval '
'will be erased and refetched from the remote on the next listening.'
)