mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-25 01:02:05 +00:00
Fixed: Wanted Page Count in UI and Paging, Sort by Album Title
This commit is contained in:
parent
df4e1e9b26
commit
a96df79572
2 changed files with 12 additions and 2 deletions
|
@ -41,6 +41,7 @@ export const defaultState = {
|
|||
{
|
||||
name: 'albumTitle',
|
||||
label: 'Album Title',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
|
@ -119,6 +120,7 @@ export const defaultState = {
|
|||
{
|
||||
name: 'albumTitle',
|
||||
label: 'Album Title',
|
||||
isSortable: true,
|
||||
isVisible: true
|
||||
},
|
||||
{
|
||||
|
|
|
@ -119,6 +119,10 @@ private QueryBuilder<Album> GetMissingAlbumsQuery(PagingSpec<Album> pagingSpec,
|
|||
{
|
||||
sortKey = "Artists." + pagingSpec.SortKey.Split('.').Last();
|
||||
}
|
||||
else if (pagingSpec.SortKey == "albumTitle")
|
||||
{
|
||||
sortKey = "Albums.title";
|
||||
}
|
||||
else
|
||||
{
|
||||
sortKey = "Albums.releaseDate";
|
||||
|
@ -138,11 +142,11 @@ private QueryBuilder<Album> GetMissingAlbumsQuery(PagingSpec<Album> pagingSpec,
|
|||
|
||||
private int GetMissingAlbumsQueryCount(PagingSpec<Album> pagingSpec, DateTime currentTime)
|
||||
{
|
||||
var monitored = 0;
|
||||
var monitored = "(Albums.[Monitored] = 0) OR (Artists.[Monitored] = 0)";
|
||||
|
||||
if (pagingSpec.FilterExpressions.FirstOrDefault().ToString().Contains("True"))
|
||||
{
|
||||
monitored = 1;
|
||||
monitored = "(Albums.[Monitored] = 1) AND (Artists.[Monitored] = 1)";
|
||||
}
|
||||
|
||||
string query = string.Format("SELECT Albums.* FROM (SELECT Tracks.AlbumId, COUNT(*) AS TotalTrackCount," +
|
||||
|
@ -180,6 +184,10 @@ private QueryBuilder<Album> GetCutOffAlbumsQuery(PagingSpec<Album> pagingSpec, L
|
|||
{
|
||||
sortKey = "Artists." + pagingSpec.SortKey.Split('.').Last();
|
||||
}
|
||||
else if (pagingSpec.SortKey == "albumTitle")
|
||||
{
|
||||
sortKey = "Albums.title";
|
||||
}
|
||||
else
|
||||
{
|
||||
sortKey = "Albums.releaseDate";
|
||||
|
|
Loading…
Reference in a new issue