Change show list second level sort criteria.

This commit is contained in:
JackDandy 2016-03-16 18:54:44 +00:00
parent c7a5f410b0
commit ba6874b7cc
3 changed files with 24 additions and 4 deletions

View file

@ -45,6 +45,7 @@
* Remove redundant Adult Swim logos
* Add scene qualities WEB.h264 to SDTV, 720p.WEB.h264 to WEB DL 720p, and 1080p.WEB.h264 to WEB DL 1080p
* Change improve handling when provider PiSexy is missing expected data
* Change show list second level sort criteria
### 0.11.10 (2016-03-17 19:00:00 UTC)

View file

@ -491,7 +491,7 @@
<input type="text" name="torrent_path" id="torrent_path" value="$sickbeard.TORRENT_PATH" class="form-control input-sm input350">
<p class="clear-left note">where <span id="torrent_client">the torrent client</span> will save downloaded files <span id="path_blank">(blank for client default)</span>
<span id="path_synology"> <b>note:</b> the destination has to be a shared folder for Synology DS</span>
<span id="path_transmission" class="red-text"> (v2.92 and newer <em>cannot</em> be blank)</span></p>
<span id="path_transmission" class="grey-text"> (v2.92 and newer should <em>not</em> be blank)</span></p>
</span>
</label>
</div>

View file

@ -50,9 +50,25 @@ $(document).ready(function () {
if (config.isPoster) {
$('.container').each(function (i, obj) {
var sortCriteria;
switch (config.posterSortby) {
case 'date':
sortCriteria = ['date', 'name', 'network', 'progress'];
break;
case 'network':
sortCriteria = ['network', 'name', 'date', 'progress'];
break;
case 'progress':
sortCriteria = ['progress', 'name', 'date', 'network'];
break;
default:
sortCriteria = ['name', 'date', 'network', 'progress'];
break;
}
$(obj).isotope({
itemSelector: '.show-card',
sortBy: config.posterSortby,
sortBy: sortCriteria,
sortAscending: config.posterSortdir,
layoutMode: 'masonry',
masonry: {
@ -62,14 +78,17 @@ $(document).ready(function () {
},
getSortData: {
name: function (itemElem) {
var name = $(itemElem).attr('data-name') || '';
var name = $(itemElem).attr('data-name').toLowerCase() || '';
return config.sortArticle ? name : name.replace(/^(?:(?:A(?!\s+to)n?)|The)\s(\w)/i, '$1');
},
date: function (itemElem) {
var date = $(itemElem).attr('data-date');
return date.length && parseInt(date, 10) || Number.POSITIVE_INFINITY;
},
network: '[data-network]',
network: function (itemElem) {
return $(itemElem).attr('data-network').toLowerCase()
.replace(/^(.*?)\W*[(]\w{2,3}[)]|1$/i, '$1') || '';
},
progress: function (itemElem) {
var progress = $(itemElem).children('.sort-data').attr('data-progress');
return progress.length && parseInt(progress, 10) || Number.NEGATIVE_INFINITY;