diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2006-11-19 19:11:30 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-11-19 19:11:30 +0000 |
| commit | f752a5aa9002a42c3105b2cd8c13100a50bfea28 (patch) | |
| tree | a9c13c90e6e83f8a1c0077eb1b37e8ee71da5457 | |
| parent | d1077a8a0c21fc864e0abcd14ba9b8f4976ced45 (diff) | |
| download | rockbox-f752a5aa9002a42c3105b2cd8c13100a50bfea28.zip rockbox-f752a5aa9002a42c3105b2cd8c13100a50bfea28.tar.gz rockbox-f752a5aa9002a42c3105b2cd8c13100a50bfea28.tar.bz2 rockbox-f752a5aa9002a42c3105b2cd8c13100a50bfea28.tar.xz | |
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.c | 12 | ||||
| -rw-r--r-- | apps/tagcache.h | 1 | ||||
| -rw-r--r-- | tools/database.c | 1 |
3 files changed, 14 insertions, 0 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index 7f12bab..dea2039 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -3420,6 +3420,10 @@ static bool check_deleted_files(void) return false; } + /* Check if the file has already deleted from the db. */ + if (*buf == '\0') + continue; + /* Now check if the file exists. */ testfd = open(buf, O_RDONLY); if (testfd < 0) @@ -3859,6 +3863,14 @@ void tagcache_init(void) #endif } +#ifdef __PCTOOL__ +void tagcache_reverse_scan(void) +{ + logf("Checking for deleted files"); + check_deleted_files(); +} +#endif + bool tagcache_is_initialized(void) { return tc_stat.initialized; diff --git a/apps/tagcache.h b/apps/tagcache.h index ea4d255..281f3b8 100644 --- a/apps/tagcache.h +++ b/apps/tagcache.h @@ -138,6 +138,7 @@ struct tagcache_search { #ifdef __PCTOOL__ void build_tagcache(const char *path); +void tagcache_reverse_scan(void); #endif int tagcache_str_to_tag(const char *str); diff --git a/tools/database.c b/tools/database.c index 780586e..3826249 100644 --- a/tools/database.c +++ b/tools/database.c @@ -7,6 +7,7 @@ int main(int argc, char **argv) { tagcache_init(); build_tagcache("/export/stuff/mp3"); + tagcache_reverse_scan(); return 0; } |