Add option to disable disk caching (RAM only mode)
Some checks failed
Build JellyCon / build (py2) (push) Has been cancelled
Build JellyCon / build (py3) (push) Has been cancelled
CodeQL Analysis / analyze (python, 3.9) (push) Has been cancelled
Release Drafter / Update release draft (push) Has been cancelled
Test JellyCon / test (3.9) (push) Has been cancelled
Some checks failed
Build JellyCon / build (py2) (push) Has been cancelled
Build JellyCon / build (py3) (push) Has been cancelled
CodeQL Analysis / analyze (python, 3.9) (push) Has been cancelled
Release Drafter / Update release draft (push) Has been cancelled
Test JellyCon / test (3.9) (push) Has been cancelled
Adds new advanced setting to disable disk-based caching, keeping data only in RAM. When enabled, prevents writing .pickle cache files and disables artwork preloading. Significantly reduces SD card wear on devices like Raspberry Pi while maintaining performance through RAM caching.
This commit is contained in:
@@ -41,6 +41,13 @@ class CacheArtwork(threading.Thread):
|
||||
last_update = 0
|
||||
home_window = HomeWindow()
|
||||
settings = xbmcaddon.Addon()
|
||||
|
||||
# Check if disk caching is disabled
|
||||
disable_disk_cache = settings.getSetting('disable_disk_cache') == 'true'
|
||||
if disable_disk_cache:
|
||||
log.debug("CacheArtwork : Disk caching disabled, artwork caching skipped")
|
||||
return
|
||||
|
||||
latest_content_hash = "never"
|
||||
check_interval = int(settings.getSetting('cacheImagesOnScreenSaver_interval'))
|
||||
check_interval = check_interval * 60
|
||||
|
||||
@@ -54,6 +54,13 @@ class DataManager:
|
||||
log.debug("last_content_url : use_cache={0} url={1}".format(use_cache, url))
|
||||
home_window.set_property("last_content_url", url)
|
||||
|
||||
# Check if disk caching is disabled
|
||||
settings = xbmcaddon.Addon()
|
||||
disable_disk_cache = settings.getSetting('disable_disk_cache') == 'true'
|
||||
if disable_disk_cache:
|
||||
use_cache = False
|
||||
log.debug("Disk caching disabled - data will be kept in RAM only")
|
||||
|
||||
user_id = self.user_details.get('user_id')
|
||||
server = self.api.server
|
||||
|
||||
@@ -164,6 +171,13 @@ class CacheManagerThread(threading.Thread):
|
||||
log.debug("CacheManagerThread : Started")
|
||||
|
||||
home_window = HomeWindow()
|
||||
settings = xbmcaddon.Addon()
|
||||
disable_disk_cache = settings.getSetting('disable_disk_cache') == 'true'
|
||||
|
||||
if disable_disk_cache:
|
||||
log.debug("CacheManagerThread : Disk caching disabled, skipping cache operations")
|
||||
return
|
||||
|
||||
is_fresh = False
|
||||
|
||||
# if the data is fresh then just save it
|
||||
|
||||
Reference in New Issue
Block a user