You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Lidarr/src/UI/Artist/ArtistController.js

36 lines
1.4 KiB

var NzbDroneController = require('../Shared/NzbDroneController');
var AppLayout = require('../AppLayout');
var ArtistCollection = require('./ArtistCollection');
var SeriesIndexLayout = require('../Series/Index/SeriesIndexLayout');
var SeriesDetailsLayout = require('../Series/Details/SeriesDetailsLayout');
module.exports = NzbDroneController.extend({
_originalInit : NzbDroneController.prototype.initialize,
initialize : function() {
this.route('', this.artist);
this.route('artist', this.artist);
this.route('artist/:query', this.artistDetails);
this._originalInit.apply(this, arguments);
},
artist : function() {
this.setTitle('Lidarr');
this.showMainRegion(new SeriesIndexLayout());
},
artistDetails : function(query) {
var artists = ArtistCollection.where({ artistNameSlug : query });
console.log('artistDetails, artists: ', artists);
if (artists.length !== 0) {
var targetSeries = artists[0];
console.log("[ArtistController] targetSeries: ", targetSeries);
this.setTitle(targetSeries.get('artistName')); // TODO: Update NzbDroneController
//this.setArtistName(targetSeries.get('artistName'));
this.showMainRegion(new SeriesDetailsLayout({ model : targetSeries }));
} else {
this.showNotFound();
}
}
});