mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-18 21:34:28 -04:00
New: Show source/seed info in manual search
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
'use strict';
|
||||
|
||||
define(['backgrid'], function (Backgrid) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
className : 'peers-cell',
|
||||
|
||||
render : function () {
|
||||
|
||||
if (this.model.get('protocol') === 'torrent') {
|
||||
|
||||
var seeders = this.model.get('seeders') || 0;
|
||||
var leechers = this.model.get('leechers') || 0;
|
||||
|
||||
var level = 'danger';
|
||||
|
||||
if(seeders > 0){
|
||||
level='warning';
|
||||
}
|
||||
if(seeders > 10){
|
||||
level = 'info';
|
||||
}
|
||||
if(seeders > 50){
|
||||
level = 'primary';
|
||||
}
|
||||
|
||||
this.$el.html('<div class="label label-{2}" title="{0} seeders, {1} leechers">{0} / {1}</div>'.format(seeders, leechers, level));
|
||||
}
|
||||
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,28 @@
|
||||
'use strict';
|
||||
|
||||
define(['backgrid'], function (Backgrid) {
|
||||
return Backgrid.Cell.extend({
|
||||
|
||||
className : 'protocol-cell',
|
||||
|
||||
render : function () {
|
||||
var protocol = this.model.get('protocol') || 'Unknown';
|
||||
|
||||
var label = '??';
|
||||
|
||||
if (protocol) {
|
||||
if (protocol === 'torrent') {
|
||||
label = 'torrent';
|
||||
}
|
||||
else if (protocol === 'usenet') {
|
||||
label = 'nzb';
|
||||
}
|
||||
|
||||
this.$el.html('<div class="label label-default protocol-{0}" title="{0}">{1}</div>'.format(protocol, label));
|
||||
}
|
||||
|
||||
this.delegateEvents();
|
||||
return this;
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
'use strict';
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone.pageable',
|
||||
@@ -19,7 +19,7 @@ define(
|
||||
|
||||
sortMappings: {
|
||||
'quality' : { sortKey: 'qualityWeight' },
|
||||
'rejections' : { sortValue: function (model, attr) {
|
||||
'rejections' : { sortValue: function (model) {
|
||||
var rejections = model.get('rejections');
|
||||
var releaseWeight = model.get('releaseWeight');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user