Revert default sort
This commit is contained in:
parent
358ccc7eed
commit
dca5b43600
@ -92,10 +92,14 @@ static int
|
||||
query_authors(const char* sort, const char *order)
|
||||
{
|
||||
int query = STMT_AUTHORS_ID_ASC;
|
||||
if (NULL != sort && 0 == strcmp(sort, "name"))
|
||||
if (NULL != sort && 0 == strcmp(sort, "name")) {
|
||||
query = STMT_AUTHORS_NAME_ASC;
|
||||
if (NULL != order && 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
} else {
|
||||
if (NULL == order || 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
|
18
db_book.c
18
db_book.c
@ -255,10 +255,14 @@ static int
|
||||
query_books(const char* sort, const char *order)
|
||||
{
|
||||
int query = STMT_BOOKS_ID_ASC;
|
||||
if (NULL != sort && 0 == strcmp(sort, "title"))
|
||||
if (NULL != sort && 0 == strcmp(sort, "title")) {
|
||||
query = STMT_BOOKS_TITLE_ASC;
|
||||
if (NULL != order && 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
} else {
|
||||
if (NULL == order || 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
@ -266,10 +270,14 @@ static int
|
||||
query_books_authors(const char* sort, const char *order)
|
||||
{
|
||||
int query = STMT_BOOKS_AUTHORS_ID_ASC;
|
||||
if (NULL != sort && 0 == strcmp(sort, "title"))
|
||||
if (NULL != sort && 0 == strcmp(sort, "title")) {
|
||||
query = STMT_BOOKS_AUTHORS_TITLE_ASC;
|
||||
if (NULL != order && 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
} else {
|
||||
if (NULL == order || 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
@ -277,10 +285,14 @@ static int
|
||||
query_books_tags(const char* sort, const char *order)
|
||||
{
|
||||
int query = STMT_BOOKS_TAGS_ID_ASC;
|
||||
if (NULL != sort && 0 == strcmp(sort, "title"))
|
||||
if (NULL != sort && 0 == strcmp(sort, "title")) {
|
||||
query = STMT_BOOKS_TAGS_TITLE_ASC;
|
||||
if (NULL != order && 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
} else {
|
||||
if (NULL == order || 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
|
12
db_series.c
12
db_series.c
@ -124,10 +124,14 @@ static int
|
||||
query_series(const char* sort, const char *order)
|
||||
{
|
||||
int query = STMT_SERIES_ID_ASC;
|
||||
if (NULL != sort && 0 == strcmp(sort, "name"))
|
||||
if (NULL != sort && 0 == strcmp(sort, "name")) {
|
||||
query = STMT_SERIES_NAME_ASC;
|
||||
if (NULL != order && 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
} else {
|
||||
if (NULL == order || 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
@ -135,10 +139,14 @@ static int
|
||||
query_seriesauth(const char* sort, const char *order)
|
||||
{
|
||||
int query = STMT_SERIES_AUTHORS_ID_ASC;
|
||||
if (NULL != sort && 0 == strcmp(sort, "name"))
|
||||
if (NULL != sort && 0 == strcmp(sort, "name")) {
|
||||
query = STMT_SERIES_AUTHORS_NAME_ASC;
|
||||
if (NULL != order && 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
} else {
|
||||
if (NULL == order || 0 == strcmp(order, "desc"))
|
||||
query++;
|
||||
}
|
||||
return query;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user