mirror of
https://github.com/lidarr/lidarr.git
synced 2025-08-19 21:13:28 -07:00
Fixed issue with Artist page not rendering the artists in DB
This commit is contained in:
parent
50d5693399
commit
0ec8830def
8 changed files with 57 additions and 42 deletions
|
@ -98,7 +98,7 @@ namespace NzbDrone.Api.Music
|
||||||
{
|
{
|
||||||
//var seriesStats = _seriesStatisticsService.SeriesStatistics();
|
//var seriesStats = _seriesStatisticsService.SeriesStatistics();
|
||||||
var artistResources = _artistService.GetAllArtists().ToResource();
|
var artistResources = _artistService.GetAllArtists().ToResource();
|
||||||
|
Console.WriteLine("[DEBUG] Returning {0} Artists", artistResources.Count);
|
||||||
MapCoversToLocal(artistResources.ToArray());
|
MapCoversToLocal(artistResources.ToArray());
|
||||||
//LinkSeriesStatistics(seriesResources, seriesStats);
|
//LinkSeriesStatistics(seriesResources, seriesStats);
|
||||||
//PopulateAlternateTitles(seriesResources);
|
//PopulateAlternateTitles(seriesResources);
|
||||||
|
|
|
@ -6,7 +6,7 @@ var ExistingSeriesCollectionView = require('./Existing/AddExistingSeriesCollecti
|
||||||
var AddSeriesView = require('./AddSeriesView');
|
var AddSeriesView = require('./AddSeriesView');
|
||||||
var ProfileCollection = require('../Profile/ProfileCollection');
|
var ProfileCollection = require('../Profile/ProfileCollection');
|
||||||
var RootFolderCollection = require('./RootFolders/RootFolderCollection');
|
var RootFolderCollection = require('./RootFolders/RootFolderCollection');
|
||||||
require('../Series/SeriesCollection');
|
require('../Artist/ArtistCollection');
|
||||||
|
|
||||||
module.exports = Marionette.Layout.extend({
|
module.exports = Marionette.Layout.extend({
|
||||||
template : 'AddSeries/AddSeriesLayoutTemplate',
|
template : 'AddSeries/AddSeriesLayoutTemplate',
|
||||||
|
|
|
@ -1,34 +1,33 @@
|
||||||
var NzbDroneController = require('../Shared/NzbDroneController');
|
var NzbDroneController = require('../Shared/NzbDroneController');
|
||||||
var AppLayout = require('../AppLayout');
|
var AppLayout = require('../AppLayout');
|
||||||
var ArtistCollection = require('./ArtistCollection');
|
var ArtistCollection = require('./ArtistCollection');
|
||||||
var SeriesIndexLayout = require('./Index/SeriesIndexLayout');
|
var SeriesIndexLayout = require('../Series/Index/SeriesIndexLayout');
|
||||||
var SeriesDetailsLayout = require('../Series/Details/SeriesDetailsLayout');
|
var SeriesDetailsLayout = require('../Series/Details/SeriesDetailsLayout');
|
||||||
|
|
||||||
module.exports = NzbDroneController.extend({
|
module.exports = NzbDroneController.extend({
|
||||||
_originalInit : NzbDroneController.prototype.initialize,
|
_originalInit : NzbDroneController.prototype.initialize,
|
||||||
|
|
||||||
initialize : function() {
|
initialize : function() {
|
||||||
this.route('', this.series);
|
this.route('', this.artist);
|
||||||
this.route('artist', this.series);
|
this.route('artist', this.artist);
|
||||||
this.route('artist/:query', this.seriesDetails);
|
this.route('artist/:query', this.artistDetails);
|
||||||
|
|
||||||
this._originalInit.apply(this, arguments);
|
this._originalInit.apply(this, arguments);
|
||||||
},
|
},
|
||||||
|
|
||||||
artist : function() {
|
artist : function() {
|
||||||
this.setTitle('Lidarr');
|
this.setTitle('Lidarr');
|
||||||
this.setArtistName('Lidarr');
|
|
||||||
this.showMainRegion(new SeriesIndexLayout());
|
this.showMainRegion(new SeriesIndexLayout());
|
||||||
},
|
},
|
||||||
|
|
||||||
seriesDetails : function(query) {
|
artistDetails : function(query) {
|
||||||
var artists = ArtistCollection.where({ artistNameSlug : query });
|
var artists = ArtistCollection.where({ artistNameSlug : query });
|
||||||
console.log('seriesDetails, artists: ', artists);
|
console.log('artistDetails, artists: ', artists);
|
||||||
if (artists.length !== 0) {
|
if (artists.length !== 0) {
|
||||||
var targetSeries = artists[0];
|
var targetSeries = artists[0];
|
||||||
console.log("[ArtistController] targetSeries: ", targetSeries);
|
console.log("[ArtistController] targetSeries: ", targetSeries);
|
||||||
this.setTitle(targetSeries.get('title'));
|
this.setTitle(targetSeries.get('artistName')); // TODO: Update NzbDroneController
|
||||||
this.setArtistName(targetSeries.get('artistName'));
|
//this.setArtistName(targetSeries.get('artistName'));
|
||||||
this.showMainRegion(new SeriesDetailsLayout({ model : targetSeries }));
|
this.showMainRegion(new SeriesDetailsLayout({ model : targetSeries }));
|
||||||
} else {
|
} else {
|
||||||
this.showNotFound();
|
this.showNotFound();
|
||||||
|
|
|
@ -71,6 +71,16 @@ Handlebars.registerHelper('seasonCountHelper', function() {
|
||||||
return new Handlebars.SafeString('<span class="label label-info">{0} Seasons</span>'.format(seasonCount));
|
return new Handlebars.SafeString('<span class="label label-info">{0} Seasons</span>'.format(seasonCount));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Handlebars.registerHelper('albumCountHelper', function() {
|
||||||
|
var albumCount = this.albumCount;
|
||||||
|
|
||||||
|
if (albumCount === 1) {
|
||||||
|
return new Handlebars.SafeString('<span class="label label-info">{0} Albums</span>'.format(albumCount));
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Handlebars.SafeString('<span class="label label-info">{0} Albums</span>'.format(albumCount));
|
||||||
|
});
|
||||||
|
|
||||||
/*Handlebars.registerHelper('titleWithYear', function() {
|
/*Handlebars.registerHelper('titleWithYear', function() {
|
||||||
if (this.title.endsWith(' ({0})'.format(this.year))) {
|
if (this.title.endsWith(' ({0})'.format(this.year))) {
|
||||||
return this.title;
|
return this.title;
|
||||||
|
|
|
@ -8,14 +8,14 @@
|
||||||
<div class="col-md-10 col-xs-9">
|
<div class="col-md-10 col-xs-9">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10 col-xs-10">
|
<div class="col-md-10 col-xs-10">
|
||||||
<a href="{{route}}" target="_blank">
|
<a href="artist/{{artistName}}" target="_blank">
|
||||||
<h2>{{title}}</h2>
|
<h2>{{artistName}}</h2>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2 col-xs-2">
|
<div class="col-md-2 col-xs-2">
|
||||||
<div class="pull-right series-overview-list-actions">
|
<div class="pull-right series-overview-list-actions">
|
||||||
<i class="icon-lidarr-refresh x-refresh" title="Update series info and scan disk"/>
|
<i class="icon-lidarr-refresh x-refresh" title="Update artist info and scan disk"/>
|
||||||
<i class="icon-lidarr-edit x-edit" title="Edit Series"/>
|
<i class="icon-lidarr-edit x-edit" title="Edit Artist"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -35,15 +35,17 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-10 col-xs-8">
|
<div class="col-md-10 col-xs-8">
|
||||||
{{#if_eq status compare="ended"}}
|
<!--{{#if_eq status compare="ended"}}
|
||||||
<span class="label label-danger">Ended</span>
|
<span class="label label-danger">Ended</span>
|
||||||
{{/if_eq}}
|
{{/if_eq}}-->
|
||||||
|
|
||||||
|
<!--
|
||||||
|
NOTE: We can show next drop date of album in future
|
||||||
{{#if nextAiring}}
|
{{#if nextAiring}}
|
||||||
<span class="label label-default">{{RelativeDate nextAiring}}</span>
|
<span class="label label-default">{{RelativeDate nextAiring}}</span>
|
||||||
{{/if}}
|
{{/if}}-->
|
||||||
|
|
||||||
{{seasonCountHelper}}
|
{{albumCountHelper}}
|
||||||
|
|
||||||
{{profile profileId}}
|
{{profile profileId}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -4,7 +4,7 @@ var Backgrid = require('backgrid');
|
||||||
var PosterCollectionView = require('./Posters/SeriesPostersCollectionView');
|
var PosterCollectionView = require('./Posters/SeriesPostersCollectionView');
|
||||||
var ListCollectionView = require('./Overview/SeriesOverviewCollectionView');
|
var ListCollectionView = require('./Overview/SeriesOverviewCollectionView');
|
||||||
var EmptyView = require('./EmptyView');
|
var EmptyView = require('./EmptyView');
|
||||||
var SeriesCollection = require('../SeriesCollection');
|
var ArtistCollection = require('../../Artist/ArtistCollection');
|
||||||
var RelativeDateCell = require('../../Cells/RelativeDateCell');
|
var RelativeDateCell = require('../../Cells/RelativeDateCell');
|
||||||
var SeriesTitleCell = require('../../Cells/SeriesTitleCell');
|
var SeriesTitleCell = require('../../Cells/SeriesTitleCell');
|
||||||
var TemplatedCell = require('../../Cells/TemplatedCell');
|
var TemplatedCell = require('../../Cells/TemplatedCell');
|
||||||
|
@ -111,28 +111,28 @@ module.exports = Marionette.Layout.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
initialize : function() {
|
initialize : function() {
|
||||||
this.seriesCollection = SeriesCollection.clone();
|
this.artistCollection = ArtistCollection.clone();
|
||||||
this.seriesCollection.shadowCollection.bindSignalR();
|
this.artistCollection.shadowCollection.bindSignalR();
|
||||||
|
|
||||||
this.listenTo(this.seriesCollection.shadowCollection, 'sync', function(model, collection, options) {
|
this.listenTo(this.artistCollection, 'sync', function(model, collection, options) {
|
||||||
this.seriesCollection.fullCollection.resetFiltered();
|
this.artistCollection.fullCollection.resetFiltered();
|
||||||
this._renderView();
|
this._renderView();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.listenTo(this.seriesCollection.shadowCollection, 'add', function(model, collection, options) {
|
this.listenTo(this.artistCollection, 'add', function(model, collection, options) {
|
||||||
this.seriesCollection.fullCollection.resetFiltered();
|
this.artistCollection.fullCollection.resetFiltered();
|
||||||
this._renderView();
|
this._renderView();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.listenTo(this.seriesCollection.shadowCollection, 'remove', function(model, collection, options) {
|
this.listenTo(this.artistCollection, 'remove', function(model, collection, options) {
|
||||||
this.seriesCollection.fullCollection.resetFiltered();
|
this.artistCollection.fullCollection.resetFiltered();
|
||||||
this._renderView();
|
this._renderView();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.sortingOptions = {
|
this.sortingOptions = {
|
||||||
type : 'sorting',
|
type : 'sorting',
|
||||||
storeState : false,
|
storeState : false,
|
||||||
viewCollection : this.seriesCollection,
|
viewCollection : this.artistCollection,
|
||||||
items : [
|
items : [
|
||||||
{
|
{
|
||||||
title : 'Title',
|
title : 'Title',
|
||||||
|
@ -243,7 +243,7 @@ module.exports = Marionette.Layout.extend({
|
||||||
|
|
||||||
_showTable : function() {
|
_showTable : function() {
|
||||||
this.currentView = new Backgrid.Grid({
|
this.currentView = new Backgrid.Grid({
|
||||||
collection : this.seriesCollection,
|
collection : this.artistCollection,
|
||||||
columns : this.columns,
|
columns : this.columns,
|
||||||
className : 'table table-hover'
|
className : 'table table-hover'
|
||||||
});
|
});
|
||||||
|
@ -253,7 +253,7 @@ module.exports = Marionette.Layout.extend({
|
||||||
|
|
||||||
_showList : function() {
|
_showList : function() {
|
||||||
this.currentView = new ListCollectionView({
|
this.currentView = new ListCollectionView({
|
||||||
collection : this.seriesCollection
|
collection : this.artistCollection
|
||||||
});
|
});
|
||||||
|
|
||||||
this._renderView();
|
this._renderView();
|
||||||
|
@ -261,14 +261,15 @@ module.exports = Marionette.Layout.extend({
|
||||||
|
|
||||||
_showPosters : function() {
|
_showPosters : function() {
|
||||||
this.currentView = new PosterCollectionView({
|
this.currentView = new PosterCollectionView({
|
||||||
collection : this.seriesCollection
|
collection : this.artistCollection
|
||||||
});
|
});
|
||||||
|
|
||||||
this._renderView();
|
this._renderView();
|
||||||
},
|
},
|
||||||
|
|
||||||
_renderView : function() {
|
_renderView : function() {
|
||||||
if (SeriesCollection.length === 0) {
|
// Problem is this is calling before artistCollection has updated. Where are the promises with backbone?
|
||||||
|
if (this.artistCollection.length === 0) {
|
||||||
this.seriesRegion.show(new EmptyView());
|
this.seriesRegion.show(new EmptyView());
|
||||||
|
|
||||||
this.toolbar.close();
|
this.toolbar.close();
|
||||||
|
@ -282,13 +283,14 @@ module.exports = Marionette.Layout.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
_fetchCollection : function() {
|
_fetchCollection : function() {
|
||||||
this.seriesCollection.fetch();
|
this.artistCollection.fetch();
|
||||||
|
console.log('index page, collection: ', this.artistCollection);
|
||||||
},
|
},
|
||||||
|
|
||||||
_setFilter : function(buttonContext) {
|
_setFilter : function(buttonContext) {
|
||||||
var mode = buttonContext.model.get('key');
|
var mode = buttonContext.model.get('key');
|
||||||
|
|
||||||
this.seriesCollection.setFilterMode(mode);
|
this.artistCollection.setFilterMode(mode);
|
||||||
},
|
},
|
||||||
|
|
||||||
_showToolbar : function() {
|
_showToolbar : function() {
|
||||||
|
@ -317,22 +319,22 @@ module.exports = Marionette.Layout.extend({
|
||||||
|
|
||||||
_showFooter : function() {
|
_showFooter : function() {
|
||||||
var footerModel = new FooterModel();
|
var footerModel = new FooterModel();
|
||||||
var series = SeriesCollection.models.length;
|
var series = this.artistCollection.models.length;
|
||||||
var episodes = 0;
|
var episodes = 0;
|
||||||
var episodeFiles = 0;
|
var episodeFiles = 0;
|
||||||
var ended = 0;
|
var ended = 0;
|
||||||
var continuing = 0;
|
var continuing = 0;
|
||||||
var monitored = 0;
|
var monitored = 0;
|
||||||
|
|
||||||
_.each(SeriesCollection.models, function(model) {
|
_.each(this.artistCollection.models, function(model) {
|
||||||
episodes += model.get('episodeCount');
|
episodes += model.get('episodeCount'); // TODO: Refactor to Seasons and Tracks
|
||||||
episodeFiles += model.get('episodeFileCount');
|
episodeFiles += model.get('episodeFileCount');
|
||||||
|
|
||||||
if (model.get('status').toLowerCase() === 'ended') {
|
/*if (model.get('status').toLowerCase() === 'ended') {
|
||||||
ended++;
|
ended++;
|
||||||
} else {
|
} else {
|
||||||
continuing++;
|
continuing++;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
if (model.get('monitored')) {
|
if (model.get('monitored')) {
|
||||||
monitored++;
|
monitored++;
|
||||||
|
|
|
@ -5,7 +5,7 @@ var RouteBinder = require('./jQuery/RouteBinder');
|
||||||
var SignalRBroadcaster = require('./Shared/SignalRBroadcaster');
|
var SignalRBroadcaster = require('./Shared/SignalRBroadcaster');
|
||||||
var NavbarLayout = require('./Navbar/NavbarLayout');
|
var NavbarLayout = require('./Navbar/NavbarLayout');
|
||||||
var AppLayout = require('./AppLayout');
|
var AppLayout = require('./AppLayout');
|
||||||
var SeriesController = require('./Series/SeriesController');
|
var ArtistController = require('./Artist/ArtistController');
|
||||||
var Router = require('./Router');
|
var Router = require('./Router');
|
||||||
var ModalController = require('./Shared/Modal/ModalController');
|
var ModalController = require('./Shared/Modal/ModalController');
|
||||||
var ControlPanelController = require('./Shared/ControlPanel/ControlPanelController');
|
var ControlPanelController = require('./Shared/ControlPanel/ControlPanelController');
|
||||||
|
@ -20,7 +20,7 @@ require('./Hotkeys/Hotkeys');
|
||||||
require('./Shared/piwikCheck');
|
require('./Shared/piwikCheck');
|
||||||
require('./Shared/VersionChangeMonitor');
|
require('./Shared/VersionChangeMonitor');
|
||||||
|
|
||||||
new SeriesController();
|
new ArtistController();
|
||||||
new ModalController();
|
new ModalController();
|
||||||
new ControlPanelController();
|
new ControlPanelController();
|
||||||
new Router();
|
new Router();
|
||||||
|
|
|
@ -5,6 +5,8 @@ var vent = new Wreqr.EventAggregator();
|
||||||
vent.Events = {
|
vent.Events = {
|
||||||
SeriesAdded : 'series:added',
|
SeriesAdded : 'series:added',
|
||||||
SeriesDeleted : 'series:deleted',
|
SeriesDeleted : 'series:deleted',
|
||||||
|
ArtistAdded : 'artist:added',
|
||||||
|
ArtistDeleted : 'artist:deleted',
|
||||||
CommandComplete : 'command:complete',
|
CommandComplete : 'command:complete',
|
||||||
ServerUpdated : 'server:updated',
|
ServerUpdated : 'server:updated',
|
||||||
EpisodeFileDeleted : 'episodefile:deleted'
|
EpisodeFileDeleted : 'episodefile:deleted'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue