mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-27 12:53:49 -05:00
[db] *_ping_excl_bymatch() for partial scans
This commit is contained in:
36
src/db.c
36
src/db.c
@@ -3056,6 +3056,18 @@ db_file_ping_bymatch(const char *path, int isdir)
|
||||
#undef Q_TMPL_NODIR
|
||||
}
|
||||
|
||||
void
|
||||
db_file_ping_excl_bymatch(const char *path)
|
||||
{
|
||||
#define Q_TMPL_DIR "UPDATE files SET db_timestamp = %" PRIi64 " WHERE path NOT LIKE '%q/%%';"
|
||||
char *query;
|
||||
|
||||
query = sqlite3_mprintf(Q_TMPL_DIR, (int64_t)time(NULL), path);
|
||||
db_query_run(query, 1, 0);
|
||||
|
||||
#undef Q_TMPL_DIR
|
||||
}
|
||||
|
||||
char *
|
||||
db_file_path_byid(int id)
|
||||
{
|
||||
@@ -3639,6 +3651,18 @@ db_pl_ping_bymatch(const char *path, int isdir)
|
||||
#undef Q_TMPL_NODIR
|
||||
}
|
||||
|
||||
void
|
||||
db_pl_ping_excl_bymatch(const char *path)
|
||||
{
|
||||
#define Q_TMPL_DIR "UPDATE playlists SET db_timestamp = %" PRIi64 " WHERE path NOT LIKE '%q/%%';"
|
||||
char *query;
|
||||
|
||||
query = sqlite3_mprintf(Q_TMPL_DIR, (int64_t)time(NULL), path);
|
||||
db_query_run(query, 1, 0);
|
||||
|
||||
#undef Q_TMPL_DIR
|
||||
}
|
||||
|
||||
void
|
||||
db_pl_ping_items_bymatch(const char *path, int id)
|
||||
{
|
||||
@@ -4453,6 +4477,18 @@ db_directory_ping_bymatch(char *virtual_path)
|
||||
#undef Q_TMPL_DIR
|
||||
}
|
||||
|
||||
void
|
||||
db_directory_ping_excl_bymatch(const char *virtual_path)
|
||||
{
|
||||
#define Q_TMPL_DIR "UPDATE directories SET db_timestamp = %" PRIi64 " WHERE virtual_path <> '%q' OR virtual_path NOT LIKE '%q/%%';"
|
||||
char *query;
|
||||
|
||||
query = sqlite3_mprintf(Q_TMPL_DIR, (int64_t)time(NULL), virtual_path, virtual_path);
|
||||
|
||||
db_query_run(query, 1, 0);
|
||||
#undef Q_TMPL_DIR
|
||||
}
|
||||
|
||||
void
|
||||
db_directory_disable_bymatch(const char *path, enum strip_type strip, uint32_t cookie)
|
||||
{
|
||||
|
||||
9
src/db.h
9
src/db.h
@@ -682,6 +682,9 @@ db_file_ping_bypath(const char *path, time_t mtime_max);
|
||||
void
|
||||
db_file_ping_bymatch(const char *path, int isdir);
|
||||
|
||||
void
|
||||
db_file_ping_excl_bymatch(const char *path);
|
||||
|
||||
char *
|
||||
db_file_path_byid(int id);
|
||||
|
||||
@@ -746,6 +749,9 @@ db_pl_ping(int id);
|
||||
void
|
||||
db_pl_ping_bymatch(const char *path, int isdir);
|
||||
|
||||
void
|
||||
db_pl_ping_excl_bymatch(const char *path);
|
||||
|
||||
void
|
||||
db_pl_ping_items_bymatch(const char *path, int id);
|
||||
|
||||
@@ -827,6 +833,9 @@ db_directory_update(struct directory_info *di);
|
||||
void
|
||||
db_directory_ping_bymatch(char *virtual_path);
|
||||
|
||||
void
|
||||
db_directory_ping_excl_bymatch(const char *virtual_path);
|
||||
|
||||
void
|
||||
db_directory_disable_bymatch(const char *path, enum strip_type strip, uint32_t cookie);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user