summaryrefslogtreecommitdiff
path: root/apps/tagcache.c
diff options
context:
space:
mode:
authorChristian Soffke <christian.soffke@gmail.com>2023-10-07 15:10:53 +0200
committerChristian Soffke <christian.soffke@gmail.com>2024-04-23 23:02:47 -0400
commit3ce3b102ddd5b663759ed61bd689b7bbda2ceecd (patch)
tree73034503c3c4ee4416f2acc6369fd18f99ed8d80 /apps/tagcache.c
parent4a52147122847afa14e00f12e2b5f813cd1ee41d (diff)
downloadrockbox-3ce3b102ddd5b663759ed61bd689b7bbda2ceecd.tar.gz
rockbox-3ce3b102ddd5b663759ed61bd689b7bbda2ceecd.zip
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
Diffstat (limited to 'apps/tagcache.c')
-rw-r--r--apps/tagcache.c6
1 files changed, 4 insertions, 2 deletions
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)
800 struct dircache_fileref dcfref; 800 struct dircache_fileref dcfref;
801 801
802 /* Check if tagcache is loaded into ram. */ 802 /* Check if tagcache is loaded into ram. */
803 if (!tc_stat.ramcache) 803 if (!tc_stat.ramcache
804 || global_settings.tagcache_ram != TAGCACHE_RAM_ON)
804 return -1; 805 return -1;
805 806
806 if (dircache_search(DCS_CACHED_PATH | DCS_UPDATE_FILEREF, &dcfref, 807 if (dircache_search(DCS_CACHED_PATH | DCS_UPDATE_FILEREF, &dcfref,
@@ -5247,7 +5248,8 @@ static void tagcache_thread(void)
5247 if (!tc_stat.ramcache && global_settings.tagcache_ram) 5248 if (!tc_stat.ramcache && global_settings.tagcache_ram)
5248 { 5249 {
5249 load_ramcache(); 5250 load_ramcache();
5250 check_file_refs(global_settings.tagcache_autoupdate); 5251 if (global_settings.tagcache_ram == TAGCACHE_RAM_ON)
5252 check_file_refs(global_settings.tagcache_autoupdate);
5251 if (tc_stat.ramcache && global_settings.tagcache_autoupdate) 5253 if (tc_stat.ramcache && global_settings.tagcache_autoupdate)
5252 tagcache_build(); 5254 tagcache_build();
5253 } 5255 }