1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Web/_backboneApp/AddSeries/SearchResultModel.js

26 lines
799 B
JavaScript
Raw Normal View History

define(['app', 'AddSeries/RootFolders/RootFolderCollection', 'Quality/QualityProfileCollection'], function (RootFolderCollection) {
NzbDrone.AddSeries.SearchResultModel = Backbone.Model.extend({
mutators: {
seriesYear: function () {
var date = Date.utc.create(this.get('firstAired')).format('({yyyy})');
//don't append year, if the series name already has the name appended.
if (this.get('seriesName').endsWith(date)) {
return "";
} else {
return date;
}
}
},
defaults: {
qualityProfiles: new NzbDrone.Quality.QualityProfileCollection(),
rootFolders: RootFolderCollection
}
});
2013-01-23 04:23:27 +03:00
});