Fixes misc issues on Artist Detail Page (#57)

Get MB link working, bring in album-type from db instead of hard code, sort albums by release date, fix quirk with track number sorting, rename tool-tips
This commit is contained in:
Qstick 2017-08-19 21:03:09 -04:00 committed by GitHub
parent 0c2880c2fe
commit 1a1721b4ee
7 changed files with 27 additions and 9 deletions

View File

@ -19,6 +19,7 @@ namespace NzbDrone.Api.Albums
public string Path { get; set; }
public int ProfileId { get; set; }
public int Duration { get; set; }
public string AlbumType { get; set; }
public Ratings Ratings { get; set; }
public DateTime? ReleaseDate { get; set; }
public List<string> Genres { get; set; }
@ -48,6 +49,7 @@ namespace NzbDrone.Api.Albums
Images = model.Images,
Ratings = model.Ratings,
Duration = model.Duration,
AlbumType = model.AlbumType
};
}
@ -68,6 +70,7 @@ namespace NzbDrone.Api.Albums
Title = resource.Title,
Images = resource.Images,
Ratings = resource.Ratings,
AlbumType = resource.AlbumType
};
}

View File

@ -2,7 +2,7 @@ var Backbone = require('backbone');
var AlbumModel = require('./AlbumModel');
module.exports = Backbone.Collection.extend({
url : window.NzbDrone.ApiRoot + '/album',
url : window.NzbDrone.ApiRoot + '/album',
model : AlbumModel,
originalFetch : Backbone.Collection.prototype.fetch,
@ -12,6 +12,21 @@ module.exports = Backbone.Collection.extend({
this.models = [];
},
comparator : function(model1, model2) {
var album1 = model1.get('releaseDate');
var album2 = model2.get('releaseDate');
if (album1 > album2) {
return -1;
}
if (album1 < album2) {
return 1;
}
return 0;
},
fetch : function(options) {
if (!this.artistId) {
throw 'artistId is required';

View File

@ -99,7 +99,7 @@ module.exports = Marionette.Layout.extend({
label : 'Status',
cell : TrackStatusCell,
sortable : false
},
}
//{
// name : 'this',
// label : '',

View File

@ -47,7 +47,7 @@
Release Date: {{albumReleaseDate}}
</div>
<div class="album-detail-type">
Type: Album
Type: {{albumType}}
</div>
<div id="album-info" class="album-info"></div>

View File

@ -8,17 +8,17 @@
<i class="x-monitored" title="Toggle monitored state for entire artist"/>
{{name}}
<div class="artist-actions pull-right">
<div class="x-episode-file-editor">
<i class="icon-lidarr-track-file" title="Modify episode files for artist"/>
<div class="x-track-file-editor">
<i class="icon-lidarr-track-file" title="Modify track files for artist"/>
</div>
<div class="x-refresh">
<i class="icon-lidarr-refresh icon-can-spin" title="Update artist info and scan disk"/>
</div>
<div class="x-rename">
<i class="icon-lidarr-rename" title="Preview rename for all episodes"/>
<i class="icon-lidarr-rename" title="Preview rename for all albums"/>
</div>
<div class="x-search">
<i class="icon-lidarr-search" title="Search for monitored episodes in this artist"/>
<i class="icon-lidarr-search" title="Search for monitored albums in this artist"/>
</div>
<div class="x-edit">
<i class="icon-lidarr-edit" title="Edit artist"/>

View File

@ -9,7 +9,7 @@ module.exports = PageableCollection.extend({
state : {
sortKey : 'trackNumber',
order : 1,
order : -1,
pageSize : 100000
},

View File

@ -22,7 +22,7 @@ Handlebars.registerHelper('poster', function() {
Handlebars.registerHelper('MBUrl', function() {
return 'https://musicbrainz.org/artist/' + this.mbId;
return 'https://musicbrainz.org/artist/' + this.foreignArtistId;
});
Handlebars.registerHelper('TADBUrl', function() {