[db] add S_RELEASEDATE and idx

This commit is contained in:
whatdoineed2do/Ray 2020-02-16 15:15:52 +00:00 committed by ejurgensen
parent 80921a71a4
commit 78194807db
3 changed files with 7 additions and 0 deletions

View File

@ -426,6 +426,7 @@ static const char *sort_clause[] =
"f.virtual_path COLLATE NOCASE",
"pos",
"shuffle_pos",
"f.date_released DESC",
};
/* Browse clauses, used for SELECT, WHERE, GROUP BY and for default ORDER BY

View File

@ -30,6 +30,7 @@ enum sort_type {
S_VPATH,
S_POS,
S_SHUFFLE_POS,
S_RELEASEDATE,
};
#define Q_F_BROWSE (1 << 15)

View File

@ -368,6 +368,9 @@ static const struct db_init_query db_init_table_queries[] =
#define I_QUEUE_SHUFFLEPOS \
"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[] =
{
{ 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_SHUFFLEPOS, "create queue shuffle pos index" },
{ I_FILE_DATE_RELEASED, "create file date_released index" },
};