mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-09 21:49:48 -05:00
Allow user to trigger full rescan with a .force-rescan file
This commit is contained in:
@@ -90,6 +90,9 @@ static pthread_t tid_scan;
|
||||
static struct deferred_pl *playlists;
|
||||
static struct stacked_dir *dirstack;
|
||||
|
||||
/* Forward */
|
||||
static void
|
||||
bulk_scan(void);
|
||||
|
||||
static int
|
||||
push_dir(struct stacked_dir **s, char *path)
|
||||
@@ -560,6 +563,19 @@ process_file(char *file, time_t mtime, off_t size, int type, int flags)
|
||||
|
||||
return;
|
||||
}
|
||||
else if (strcmp(ext, ".force-rescan") == 0)
|
||||
{
|
||||
if (flags & F_SCAN_BULK)
|
||||
return;
|
||||
else
|
||||
{
|
||||
DPRINTF(E_LOG, L_SCAN, "Forcing full rescan, found force-rescan file: %s\n", file);
|
||||
db_purge_all();
|
||||
bulk_scan();
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/* Not any kind of special file, so let's see if it's a media file */
|
||||
|
||||
Reference in New Issue
Block a user