mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-27 22:46:02 -05:00
[db] add S_RELEASEDATE and idx
This commit is contained in:
parent
80921a71a4
commit
78194807db
1
src/db.c
1
src/db.c
@ -426,6 +426,7 @@ static const char *sort_clause[] =
|
|||||||
"f.virtual_path COLLATE NOCASE",
|
"f.virtual_path COLLATE NOCASE",
|
||||||
"pos",
|
"pos",
|
||||||
"shuffle_pos",
|
"shuffle_pos",
|
||||||
|
"f.date_released DESC",
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Browse clauses, used for SELECT, WHERE, GROUP BY and for default ORDER BY
|
/* Browse clauses, used for SELECT, WHERE, GROUP BY and for default ORDER BY
|
||||||
|
1
src/db.h
1
src/db.h
@ -30,6 +30,7 @@ enum sort_type {
|
|||||||
S_VPATH,
|
S_VPATH,
|
||||||
S_POS,
|
S_POS,
|
||||||
S_SHUFFLE_POS,
|
S_SHUFFLE_POS,
|
||||||
|
S_RELEASEDATE,
|
||||||
};
|
};
|
||||||
|
|
||||||
#define Q_F_BROWSE (1 << 15)
|
#define Q_F_BROWSE (1 << 15)
|
||||||
|
@ -368,6 +368,9 @@ static const struct db_init_query db_init_table_queries[] =
|
|||||||
#define I_QUEUE_SHUFFLEPOS \
|
#define I_QUEUE_SHUFFLEPOS \
|
||||||
"CREATE INDEX IF NOT EXISTS idx_queue_shufflepos ON queue(shuffle_pos);"
|
"CREATE INDEX IF NOT EXISTS idx_queue_shufflepos ON queue(shuffle_pos);"
|
||||||
|
|
||||||
|
#define I_FILE_DATE_RELEASED \
|
||||||
|
"CREATE INDEX IF NOT EXISTS idx_file_datereleased ON files(date_released);"
|
||||||
|
|
||||||
static const struct db_init_query db_init_index_queries[] =
|
static const struct db_init_query db_init_index_queries[] =
|
||||||
{
|
{
|
||||||
{ I_RESCAN, "create rescan index" },
|
{ I_RESCAN, "create rescan index" },
|
||||||
@ -401,6 +404,8 @@ static const struct db_init_query db_init_index_queries[] =
|
|||||||
|
|
||||||
{ I_QUEUE_POS, "create queue pos index" },
|
{ I_QUEUE_POS, "create queue pos index" },
|
||||||
{ I_QUEUE_SHUFFLEPOS, "create queue shuffle pos index" },
|
{ I_QUEUE_SHUFFLEPOS, "create queue shuffle pos index" },
|
||||||
|
|
||||||
|
{ I_FILE_DATE_RELEASED, "create file date_released index" },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user