diff --git a/src/db.c b/src/db.c index 60e13ad7..d945a7ee 100644 --- a/src/db.c +++ b/src/db.c @@ -2312,6 +2312,7 @@ db_file_stamp_bypath(char *path, time_t *stamp, int *id) sqlite3_stmt *stmt; int ret; + *id = 0; *stamp = 0; query = sqlite3_mprintf(Q_TMPL, path); diff --git a/src/filescanner.c b/src/filescanner.c index d8e93e2d..daf9b3fa 100644 --- a/src/filescanner.c +++ b/src/filescanner.c @@ -626,7 +626,7 @@ filescanner_process_media(char *path, time_t mtime, off_t size, int type, struct mfi = external_mfi; if (stamp) - mfi->id = db_file_id_bypath(path); + mfi->id = id; mfi->fname = strdup(filename); if (!mfi->fname)