mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 13:10:13 -07:00
Updated the code to allow a search to be made from UI to iTunes and return a mock result.
This commit is contained in:
parent
684e4f4c80
commit
2813fccc78
32 changed files with 1401 additions and 65 deletions
37
src/UI/Artist/ArtistController.js
Normal file
37
src/UI/Artist/ArtistController.js
Normal file
|
@ -0,0 +1,37 @@
|
|||
var NzbDroneController = require('../Shared/NzbDroneController');
|
||||
var AppLayout = require('../AppLayout');
|
||||
var ArtistCollection = require('./ArtistCollection');
|
||||
var SeriesIndexLayout = require('./Index/SeriesIndexLayout');
|
||||
var SeriesDetailsLayout = require('../Series/Details/SeriesDetailsLayout');
|
||||
|
||||
module.exports = NzbDroneController.extend({
|
||||
_originalInit : NzbDroneController.prototype.initialize,
|
||||
|
||||
initialize : function() {
|
||||
this.route('', this.series);
|
||||
this.route('artist', this.series);
|
||||
this.route('artist/:query', this.seriesDetails);
|
||||
|
||||
this._originalInit.apply(this, arguments);
|
||||
},
|
||||
|
||||
artist : function() {
|
||||
this.setTitle('Lidarr');
|
||||
this.setArtistName('Lidarr');
|
||||
this.showMainRegion(new SeriesIndexLayout());
|
||||
},
|
||||
|
||||
seriesDetails : function(query) {
|
||||
var artists = ArtistCollection.where({ artistNameSlug : query });
|
||||
console.log('seriesDetails, artists: ', artists);
|
||||
if (artists.length !== 0) {
|
||||
var targetSeries = artists[0];
|
||||
console.log("[ArtistController] targetSeries: ", targetSeries);
|
||||
this.setTitle(targetSeries.get('title'));
|
||||
this.setArtistName(targetSeries.get('artistName'));
|
||||
this.showMainRegion(new SeriesDetailsLayout({ model : targetSeries }));
|
||||
} else {
|
||||
this.showNotFound();
|
||||
}
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue