From 5e8b617625a5716a9b07c77cff504e8f84da19cc Mon Sep 17 00:00:00 2001 From: Leonardo Galli Date: Wed, 11 Jan 2017 22:27:37 +0100 Subject: [PATCH] Sorting now working according to quality in release collection. Fixes #85. --- src/NzbDrone.Api/Indexers/ReleaseResource.cs | 2 +- src/UI/Cells/QualityCell.js | 6 ++++-- src/UI/Movies/Search/ManualLayout.js | 4 ++-- src/UI/Movies/Search/ManualLayoutTemplate.hbs | 1 - src/UI/Release/ReleaseCollection.js | 5 ++++- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/NzbDrone.Api/Indexers/ReleaseResource.cs b/src/NzbDrone.Api/Indexers/ReleaseResource.cs index fea1ee353..2be0acbb9 100644 --- a/src/NzbDrone.Api/Indexers/ReleaseResource.cs +++ b/src/NzbDrone.Api/Indexers/ReleaseResource.cs @@ -97,7 +97,7 @@ namespace NzbDrone.Api.Indexers { Guid = releaseInfo.Guid, Quality = parsedMovieInfo.Quality, - //QualityWeight + QualityWeight = parsedMovieInfo.Quality.Quality.Id, //Id kinda hacky for wheight, but what you gonna do? TODO: Fix this shit! Age = releaseInfo.Age, AgeHours = releaseInfo.AgeHours, AgeMinutes = releaseInfo.AgeMinutes, diff --git a/src/UI/Cells/QualityCell.js b/src/UI/Cells/QualityCell.js index 962bd2ab4..947eb4e91 100644 --- a/src/UI/Cells/QualityCell.js +++ b/src/UI/Cells/QualityCell.js @@ -4,5 +4,7 @@ var QualityCellEditor = require('./Edit/QualityCellEditor'); module.exports = TemplatedCell.extend({ className : 'quality-cell', template : 'Cells/QualityCellTemplate', - editor : QualityCellEditor -}); \ No newline at end of file + editor : QualityCellEditor, + + +}); diff --git a/src/UI/Movies/Search/ManualLayout.js b/src/UI/Movies/Search/ManualLayout.js index af5413779..304b08911 100644 --- a/src/UI/Movies/Search/ManualLayout.js +++ b/src/UI/Movies/Search/ManualLayout.js @@ -37,7 +37,7 @@ module.exports = Marionette.Layout.extend({ name : 'edition', label : 'Edition', cell : EditionCell, - title : "Edition" + title : "Edition", }, { name : 'indexer', @@ -57,7 +57,7 @@ module.exports = Marionette.Layout.extend({ { name : 'quality', label : 'Quality', - cell : QualityCell + cell : QualityCell, }, { name : 'rejections', diff --git a/src/UI/Movies/Search/ManualLayoutTemplate.hbs b/src/UI/Movies/Search/ManualLayoutTemplate.hbs index 1797eb289..3a5f59438 100644 --- a/src/UI/Movies/Search/ManualLayoutTemplate.hbs +++ b/src/UI/Movies/Search/ManualLayoutTemplate.hbs @@ -1,2 +1 @@
- \ No newline at end of file diff --git a/src/UI/Release/ReleaseCollection.js b/src/UI/Release/ReleaseCollection.js index 1e67296be..2b810982a 100644 --- a/src/UI/Release/ReleaseCollection.js +++ b/src/UI/Release/ReleaseCollection.js @@ -16,7 +16,7 @@ var Collection = PagableCollection.extend({ sortMappings : { 'quality' : { - sortKey : 'qualityWeight' + sortKey : "qualityWeight" }, 'rejections' : { sortValue : function(model) { @@ -30,6 +30,9 @@ var Collection = PagableCollection.extend({ return releaseWeight; } }, + "edition" : { + sortKey : "edition" + }, 'download' : { sortKey : 'releaseWeight' },