mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-14 10:47:08 -07:00
updated json serilizer to return defaults
use enum text instead of number
This commit is contained in:
parent
a6aba16902
commit
40f384968a
7 changed files with 31 additions and 34 deletions
|
@ -11,12 +11,22 @@ define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'AddSeries/New/Sear
|
|||
regions: {
|
||||
searchResult: '#search-result'
|
||||
},
|
||||
collection: new NzbDrone.Series.SeriesCollection(),
|
||||
|
||||
initialize: function () {
|
||||
|
||||
this.collection = new NzbDrone.Series.SeriesCollection();
|
||||
|
||||
this.collection.parse = function (response) {
|
||||
_.each(response, function (model) {
|
||||
model.id = null;
|
||||
});
|
||||
|
||||
return response;
|
||||
};
|
||||
|
||||
NzbDrone.AddSeries.New.AddNewSeriesContext = this;
|
||||
|
||||
NzbDrone.vent.on(NzbDrone.Events.SeriesAdded, function (options){
|
||||
NzbDrone.vent.on(NzbDrone.Events.SeriesAdded, function (options) {
|
||||
if (!options.existing) {
|
||||
NzbDrone.AddSeries.New.AddNewSeriesContext.ui.seriesSearch.val('');
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";
|
||||
|
||||
Backbone.Collection.prototype.BindSignalR = function (options) {
|
||||
_.extend(Backbone.Collection.prototype, {BindSignalR: function (options) {
|
||||
|
||||
if (!options || !options.url) {
|
||||
console.assert(this.url, 'url must be provided or collection must have url');
|
||||
|
@ -34,14 +34,15 @@ Backbone.Collection.prototype.BindSignalR = function (options) {
|
|||
console.debug('{0} [{1}]'.format(options.url, _getStatus(change.newState)));
|
||||
});
|
||||
|
||||
connection.received(function () {
|
||||
connection.received(function (model) {
|
||||
console.debug(model);
|
||||
self.fetch();
|
||||
});
|
||||
|
||||
connection.start({ transport: ['longPolling'] });
|
||||
|
||||
return this;
|
||||
};
|
||||
}});
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -33,11 +33,11 @@
|
|||
{{#if bestDateString}}
|
||||
<span class="label">{{bestDateString}}</span>
|
||||
{{else}}
|
||||
<span class="label label-inverse">{{statusText}}</span>
|
||||
<span class="label label-inverse">{{status}}</span>
|
||||
{{/if}}
|
||||
<span class="label label-info">Season {{seasonCount}}</span>
|
||||
{{else}}
|
||||
<span class="label label-important">{{statusText}}</span>
|
||||
<span class="label label-important">{{status}}</span>
|
||||
<span class="label label-info">{{seasonCount}} Seasons</span>
|
||||
{{/if}}
|
||||
</div>
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
{{#if bestDateString}}
|
||||
<span class="label label-inverse air-date" title="{{shortDate}}">{{bestDateString}}</span>
|
||||
{{else}}
|
||||
<span class="label label-inverse">{{statusText}}</span>
|
||||
<span class="label label-inverse">{{status}}</span>
|
||||
{{/if}}
|
||||
<span class="label label-info">Season {{seasonCount}}</span>
|
||||
{{else}}
|
||||
|
|
|
@ -23,7 +23,7 @@ define(['app', 'Quality/QualityProfileCollection', 'AddSeries/RootFolders/RootFo
|
|||
},
|
||||
poster : function () {
|
||||
var poster = _.find(this.get('images'), function (image) {
|
||||
return image.coverType === 1;
|
||||
return image.coverType === 'poster';
|
||||
});
|
||||
|
||||
if (poster) {
|
||||
|
@ -47,14 +47,7 @@ define(['app', 'Quality/QualityProfileCollection', 'AddSeries/RootFolders/RootFo
|
|||
return "http://trakt.tv/show/" + this.get('titleSlug');
|
||||
},
|
||||
isContinuing : function () {
|
||||
return this.get('status') === 0;
|
||||
},
|
||||
statusText : function () {
|
||||
if (this.get('status') === 0) {
|
||||
return 'Continuing';
|
||||
}
|
||||
|
||||
return 'Ended';
|
||||
return this.get('status') === 'continuing';
|
||||
},
|
||||
shortDate : function () {
|
||||
var date = this.get('nextAiring');
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue