summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-11-19 19:11:30 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-11-19 19:11:30 +0000
commitf752a5aa9002a42c3105b2cd8c13100a50bfea28 (patch)
treea9c13c90e6e83f8a1c0077eb1b37e8ee71da5457
parentd1077a8a0c21fc864e0abcd14ba9b8f4976ced45 (diff)
downloadrockbox-f752a5aa9002a42c3105b2cd8c13100a50bfea28.tar.gz
rockbox-f752a5aa9002a42c3105b2cd8c13100a50bfea28.zip
Check if file has already been removed from DB when manually invoking
reverse scan. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11556 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/tagcache.c12
-rw-r--r--apps/tagcache.h1
-rw-r--r--tools/database.c1
3 files changed, 14 insertions, 0 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c
index 7f12bab849..dea20393ff 100644
--- a/apps/tagcache.c
+++ b/apps/tagcache.c
@@ -3420,6 +3420,10 @@ static bool check_deleted_files(void)
3420 return false; 3420 return false;
3421 } 3421 }
3422 3422
3423 /* Check if the file has already deleted from the db. */
3424 if (*buf == '\0')
3425 continue;
3426
3423 /* Now check if the file exists. */ 3427 /* Now check if the file exists. */
3424 testfd = open(buf, O_RDONLY); 3428 testfd = open(buf, O_RDONLY);
3425 if (testfd < 0) 3429 if (testfd < 0)
@@ -3859,6 +3863,14 @@ void tagcache_init(void)
3859#endif 3863#endif
3860} 3864}
3861 3865
3866#ifdef __PCTOOL__
3867void tagcache_reverse_scan(void)
3868{
3869 logf("Checking for deleted files");
3870 check_deleted_files();
3871}
3872#endif
3873
3862bool tagcache_is_initialized(void) 3874bool tagcache_is_initialized(void)
3863{ 3875{
3864 return tc_stat.initialized; 3876 return tc_stat.initialized;
diff --git a/apps/tagcache.h b/apps/tagcache.h
index ea4d255630..281f3b86a2 100644
--- a/apps/tagcache.h
+++ b/apps/tagcache.h
@@ -138,6 +138,7 @@ struct tagcache_search {
138 138
139#ifdef __PCTOOL__ 139#ifdef __PCTOOL__
140void build_tagcache(const char *path); 140void build_tagcache(const char *path);
141void tagcache_reverse_scan(void);
141#endif 142#endif
142 143
143int tagcache_str_to_tag(const char *str); 144int tagcache_str_to_tag(const char *str);
diff --git a/tools/database.c b/tools/database.c
index 780586ea90..3826249d75 100644
--- a/tools/database.c
+++ b/tools/database.c
@@ -7,6 +7,7 @@ int main(int argc, char **argv)
7{ 7{
8 tagcache_init(); 8 tagcache_init();
9 build_tagcache("/export/stuff/mp3"); 9 build_tagcache("/export/stuff/mp3");
10 tagcache_reverse_scan();
10 11
11 return 0; 12 return 0;
12} 13}