mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add AlbumArtists to item dto's
This commit is contained in:
parent
ad29857eae
commit
f4acc2ad61
4 changed files with 37 additions and 11 deletions
|
@ -73,8 +73,9 @@
|
|||
<input type="text" id="txtArtist" placeholder="${LabelArtistsHelp}" />
|
||||
</div>
|
||||
<div data-role="fieldcontain" id="fldAlbumArtist" style="display: none;">
|
||||
<label for="txtAlbumArtist">${LabelAlbumArtist}</label>
|
||||
<label for="txtAlbumArtist">${LabelAlbumArtists}</label>
|
||||
<input type="text" id="txtAlbumArtist" />
|
||||
<input type="text" id="txtArtist" placeholder="${LabelArtistsHelp}" />
|
||||
</div>
|
||||
<div data-role="fieldcontain" id="fldAlbum" style="display: none;">
|
||||
<label for="txtAlbum">${LabelAlbum}</label>
|
||||
|
|
|
@ -501,7 +501,9 @@
|
|||
$('#txtAirsBeforeEpisode', page).val(('AirsBeforeEpisodeNumber' in item) ? item.AirsBeforeEpisodeNumber : "");
|
||||
|
||||
$('#txtAlbum', page).val(item.Album || "");
|
||||
$('#txtAlbumArtist', page).val(item.AlbumArtist || "");
|
||||
|
||||
var albumArtists = item.AlbumArtists || [];
|
||||
$('#txtAlbumArtist', page).val(albumArtists.join(';'));
|
||||
|
||||
$('#selectDisplayOrder', page).val(item.DisplayOrder).selectmenu('refresh');
|
||||
|
||||
|
@ -802,6 +804,16 @@
|
|||
.jstree("delete_node", '#' + id);
|
||||
}
|
||||
|
||||
function getAlbumArtists(form) {
|
||||
|
||||
return $('#txtAlbumArtist', form).val().split(';').map(function (a) {
|
||||
|
||||
return {
|
||||
Name: a
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function editItemMetadataPage() {
|
||||
|
||||
var self = this;
|
||||
|
@ -834,7 +846,7 @@
|
|||
DisplayOrder: $('#selectDisplayOrder', form).val(),
|
||||
Players: $('#txtPlayers', form).val(),
|
||||
Album: $('#txtAlbum', form).val(),
|
||||
AlbumArtist: $('#txtAlbumArtist', form).val(),
|
||||
AlbumArtist: getAlbumArtists(form),
|
||||
Artists: $('#txtArtist', form).val().split(';'),
|
||||
Metascore: $('#txtMetascore', form).val(),
|
||||
AwardSummary: $('#txtAwardSummary', form).val(),
|
||||
|
|
|
@ -231,6 +231,24 @@
|
|||
return html;
|
||||
},
|
||||
|
||||
getAlbumArtistLinksHtml: function (artists, cssClass) {
|
||||
|
||||
var html = [];
|
||||
|
||||
for (var i = 0, length = artists.length; i < length; i++) {
|
||||
|
||||
var artist = artists[i];
|
||||
|
||||
var css = cssClass ? (' class="' + cssClass + '"') : '';
|
||||
html.push('<a' + css + ' href="itembynamedetails.html?context=music&id=' + artist.Id + '">' + artist.Name + '</a>');
|
||||
|
||||
}
|
||||
|
||||
html = html.join(' / ');
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
showPlayMenu: function (positionTo, itemId, itemType, isFolder, mediaType, resumePositionTicks, showAddToPlaylist) {
|
||||
|
||||
var externalPlayers = ExternalPlayer.getExternalPlayers();
|
||||
|
@ -1744,10 +1762,8 @@
|
|||
|
||||
var contextParam = context ? ('&context=' + context) : '';
|
||||
|
||||
if (item.AlbumArtist && item.Type == "Audio") {
|
||||
html.push('<a class="detailPageParentLink" href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(item.AlbumArtist) + contextParam + '">' + item.AlbumArtist + '</a>');
|
||||
} else if (item.AlbumArtist && item.Type == "MusicAlbum") {
|
||||
html.push('<a class="detailPageParentLink" href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(item.AlbumArtist) + contextParam + '">' + item.AlbumArtist + '</a>');
|
||||
if (item.AlbumArtists) {
|
||||
html.push(LibraryBrowser.getAlbumArtistLinksHtml(item.AlbumArtists, "detailPageParentLink"));
|
||||
} else if (item.Artists && item.Artists.length && item.Type == "MusicVideo") {
|
||||
html.push('<a class="detailPageParentLink" href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(item.Artists[0]) + contextParam + '">' + item.Artists[0] + '</a>');
|
||||
} else if (item.SeriesName && item.Type == "Episode") {
|
||||
|
@ -1769,11 +1785,8 @@
|
|||
} else if (item.Album && item.Type == "MusicVideo" && item.AlbumId) {
|
||||
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.AlbumId + contextParam + '">' + item.Album + '</a>');
|
||||
|
||||
} else if (item.AlbumArtist && item.Type == "MusicAlbum") {
|
||||
|
||||
} else if (item.Album) {
|
||||
html.push(item.Album);
|
||||
|
||||
}
|
||||
|
||||
if (html.length) {
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
|
||||
html += '<td>';
|
||||
if (item.AlbumArtist) {
|
||||
html += LibraryBrowser.getArtistLinksHtml([item.AlbumArtist]);
|
||||
html += LibraryBrowser.getAlbumArtistLinksHtml(item.AlbumArtists || []);
|
||||
}
|
||||
html += '</td>';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue