1
0
Fork 0
mirror of https://github.com/Sonarr/Sonarr synced 2025-02-13 09:56:01 +00:00
Sonarr/NzbDrone.Web/_backboneApp/AddSeries/SearchResultModel.js
2013-02-15 16:52:41 -08:00

23 lines
771 B
JavaScript

/// <reference path="../app.js" />
/// <reference path="RootFolders/RootDirCollection.js" />
/// <reference path="../Quality/qualityProfileCollection.js" />
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: new NzbDrone.AddSeries.RootDirCollection()
}
});