From 3ce3b102ddd5b663759ed61bd689b7bbda2ceecd Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Sat, 7 Oct 2023 15:10:53 +0200 Subject: Provide "quick" option for loading database into RAM The directory cache and the database's Load to RAM feature each result in a much better user experience. But, when both features are enabled at the same time, it can take a very long time on older players - easily several minutes for larger libraries - until all of the database's dircache references have been updated. Include a 'Quick' option that causes the database to ignore dircache references which can *significantly* reduce disk activity after booting. Change-Id: I25ae779c97d03885b06d5a28d8be55c0d05692a5 --- apps/tagcache.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/tagcache.c') diff --git a/apps/tagcache.c b/apps/tagcache.c index 90f7e01a2f..9463d7c865 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -800,7 +800,8 @@ static long find_entry_ram(const char *filename) struct dircache_fileref dcfref; /* Check if tagcache is loaded into ram. */ - if (!tc_stat.ramcache) + if (!tc_stat.ramcache + || global_settings.tagcache_ram != TAGCACHE_RAM_ON) return -1; if (dircache_search(DCS_CACHED_PATH | DCS_UPDATE_FILEREF, &dcfref, @@ -5247,7 +5248,8 @@ static void tagcache_thread(void) if (!tc_stat.ramcache && global_settings.tagcache_ram) { load_ramcache(); - check_file_refs(global_settings.tagcache_autoupdate); + if (global_settings.tagcache_ram == TAGCACHE_RAM_ON) + check_file_refs(global_settings.tagcache_autoupdate); if (tc_stat.ramcache && global_settings.tagcache_autoupdate) tagcache_build(); } -- cgit v1.2.3