mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
add ArtistItems to api output
This commit is contained in:
parent
f4acc2ad61
commit
66813c9b27
7 changed files with 46 additions and 45 deletions
|
@ -74,8 +74,7 @@
|
|||
</div>
|
||||
<div data-role="fieldcontain" id="fldAlbumArtist" style="display: none;">
|
||||
<label for="txtAlbumArtist">${LabelAlbumArtists}</label>
|
||||
<input type="text" id="txtAlbumArtist" />
|
||||
<input type="text" id="txtArtist" placeholder="${LabelArtistsHelp}" />
|
||||
<input type="text" id="txtAlbumArtist" placeholder="${LabelArtistsHelp}" />
|
||||
</div>
|
||||
<div data-role="fieldcontain" id="fldAlbum" style="display: none;">
|
||||
<label for="txtAlbum">${LabelAlbum}</label>
|
||||
|
|
|
@ -502,13 +502,19 @@
|
|||
|
||||
$('#txtAlbum', page).val(item.Album || "");
|
||||
|
||||
var albumArtists = item.AlbumArtists || [];
|
||||
$('#txtAlbumArtist', page).val(albumArtists.join(';'));
|
||||
$('#txtAlbumArtist', page).val((item.AlbumArtists || []).map(function (a) {
|
||||
|
||||
return a.Name;
|
||||
|
||||
}).join(';'));
|
||||
|
||||
$('#selectDisplayOrder', page).val(item.DisplayOrder).selectmenu('refresh');
|
||||
|
||||
var artists = item.Artists || [];
|
||||
$('#txtArtist', page).val(artists.join(';'));
|
||||
$('#txtArtist', page).val((item.ArtistItems || []).map(function (a) {
|
||||
|
||||
return a.Name;
|
||||
|
||||
}).join(';'));
|
||||
|
||||
var date;
|
||||
|
||||
|
@ -814,6 +820,16 @@
|
|||
});
|
||||
}
|
||||
|
||||
function getArtists(form) {
|
||||
|
||||
return $('#txtArtist', form).val().split(';').map(function (a) {
|
||||
|
||||
return {
|
||||
Name: a
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
function editItemMetadataPage() {
|
||||
|
||||
var self = this;
|
||||
|
@ -847,7 +863,7 @@
|
|||
Players: $('#txtPlayers', form).val(),
|
||||
Album: $('#txtAlbum', form).val(),
|
||||
AlbumArtist: getAlbumArtists(form),
|
||||
Artists: $('#txtArtist', form).val().split(';'),
|
||||
ArtistItems: getArtists(form),
|
||||
Metascore: $('#txtMetascore', form).val(),
|
||||
AwardSummary: $('#txtAwardSummary', form).val(),
|
||||
Overview: $('#txtOverview', form).val(),
|
||||
|
|
|
@ -229,7 +229,7 @@
|
|||
MediaTypes: "",
|
||||
IncludeItemTypes: "MusicVideo",
|
||||
PersonTypes: "",
|
||||
Artists: ""
|
||||
ArtistIds: ""
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -241,7 +241,7 @@
|
|||
MediaTypes: "",
|
||||
IncludeItemTypes: "Movie",
|
||||
PersonTypes: "",
|
||||
Artists: ""
|
||||
ArtistIds: ""
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -253,7 +253,7 @@
|
|||
MediaTypes: "",
|
||||
IncludeItemTypes: "Series",
|
||||
PersonTypes: "",
|
||||
Artists: ""
|
||||
ArtistIds: ""
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -264,7 +264,7 @@
|
|||
MediaTypes: "",
|
||||
IncludeItemTypes: "Trailer",
|
||||
PersonTypes: "",
|
||||
Artists: ""
|
||||
ArtistIds: ""
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -275,7 +275,7 @@
|
|||
IncludeItemTypes: "",
|
||||
MediaTypes: "Game",
|
||||
PersonTypes: "",
|
||||
Artists: ""
|
||||
ArtistIds: ""
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -286,7 +286,7 @@
|
|||
MediaTypes: "",
|
||||
IncludeItemTypes: "Episode",
|
||||
PersonTypes: "",
|
||||
Artists: ""
|
||||
ArtistIds: ""
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -297,7 +297,7 @@
|
|||
MediaTypes: "",
|
||||
IncludeItemTypes: "MusicAlbum",
|
||||
PersonTypes: "",
|
||||
Artists: ""
|
||||
ArtistIds: ""
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -307,7 +307,7 @@
|
|||
MediaTypes: "",
|
||||
IncludeItemTypes: "Audio",
|
||||
PersonTypes: "",
|
||||
Artists: ""
|
||||
ArtistIds: ""
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -381,7 +381,7 @@
|
|||
query.Studios = currentItem.Name;
|
||||
}
|
||||
else if (currentItem.Type == "MusicArtist") {
|
||||
query.Artists = currentItem.Name;
|
||||
query.ArtistIds = currentItem.Id;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -406,8 +406,8 @@
|
|||
$('#players', page).hide();
|
||||
}
|
||||
|
||||
if (item.Artists && item.Artists.length && item.Type != "MusicAlbum") {
|
||||
$('#artist', page).show().html(getArtistLinksHtml(item.Artists, context)).trigger('create');
|
||||
if (item.ArtistItems && item.ArtistItems.length && item.Type != "MusicAlbum") {
|
||||
$('#artist', page).show().html(getArtistLinksHtml(item.ArtistItems, context)).trigger('create');
|
||||
} else {
|
||||
$('#artist', page).hide();
|
||||
}
|
||||
|
@ -512,7 +512,7 @@
|
|||
|
||||
var artist = artists[i];
|
||||
|
||||
html.push('<a class="textlink" href="itembynamedetails.html?context=' + context + '&musicartist=' + ApiClient.encodeName(artist) + '">' + artist + '</a>');
|
||||
html.push('<a class="textlink" href="itembynamedetails.html?context=' + context + '&id=' + artist.Id + '">' + artist.Name + '</a>');
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -214,24 +214,7 @@
|
|||
return counts.join(' • ');
|
||||
},
|
||||
|
||||
getArtistLinksHtml: function (artists) {
|
||||
|
||||
var html = [];
|
||||
|
||||
for (var i = 0, length = artists.length; i < length; i++) {
|
||||
|
||||
var artist = artists[i];
|
||||
|
||||
html.push('<a href="itembynamedetails.html?context=music&musicartist=' + ApiClient.encodeName(artist) + '">' + artist + '</a>');
|
||||
|
||||
}
|
||||
|
||||
html = html.join(' / ');
|
||||
|
||||
return html;
|
||||
},
|
||||
|
||||
getAlbumArtistLinksHtml: function (artists, cssClass) {
|
||||
getArtistLinksHtml: function (artists, cssClass) {
|
||||
|
||||
var html = [];
|
||||
|
||||
|
@ -815,7 +798,10 @@
|
|||
textlines.push(displayName);
|
||||
|
||||
if (item.Type == 'Audio') {
|
||||
textlines.push(item.Artists.join(', ') || ' ');
|
||||
textlines.push(item.ArtistItems.map(function (a) {
|
||||
return a.Name;
|
||||
|
||||
}).join(', ') || ' ');
|
||||
}
|
||||
|
||||
if (item.Type == 'Game') {
|
||||
|
@ -1763,9 +1749,9 @@
|
|||
var contextParam = context ? ('&context=' + context) : '';
|
||||
|
||||
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>');
|
||||
html.push(LibraryBrowser.getArtistLinksHtml(item.AlbumArtists, "detailPageParentLink"));
|
||||
} else if (item.ArtistItems && item.ArtistItems.length && item.Type == "MusicVideo") {
|
||||
html.push(LibraryBrowser.getArtistLinksHtml(item.ArtistItems, "detailPageParentLink"));
|
||||
} else if (item.SeriesName && item.Type == "Episode") {
|
||||
|
||||
html.push('<a class="detailPageParentLink" href="itemdetails.html?id=' + item.SeriesId + contextParam + '">' + item.SeriesName + '</a>');
|
||||
|
|
|
@ -423,7 +423,7 @@
|
|||
else if (firstItem.Type == "MusicArtist") {
|
||||
|
||||
promise = self.getItemsForPlayback({
|
||||
Artists: firstItem.Name,
|
||||
ArtistIds: firstItem.Id,
|
||||
Filters: "IsNotFolder",
|
||||
Recursive: true,
|
||||
SortBy: "SortName",
|
||||
|
@ -938,7 +938,7 @@
|
|||
if (item.Type == "MusicArtist") {
|
||||
|
||||
query.MediaTypes = "Audio";
|
||||
query.Artists = item.Name;
|
||||
query.ArtistIds = item.Id;
|
||||
|
||||
}
|
||||
else if (item.Type == "MusicGenre") {
|
||||
|
|
|
@ -37,12 +37,12 @@
|
|||
html += '</td>';
|
||||
|
||||
html += '<td>';
|
||||
html += LibraryBrowser.getArtistLinksHtml(item.Artists || []);
|
||||
html += LibraryBrowser.getArtistLinksHtml(item.ArtistItems || []);
|
||||
html += '</td>';
|
||||
|
||||
html += '<td>';
|
||||
if (item.AlbumArtist) {
|
||||
html += LibraryBrowser.getAlbumArtistLinksHtml(item.AlbumArtists || []);
|
||||
html += LibraryBrowser.getArtistLinksHtml(item.AlbumArtists || []);
|
||||
}
|
||||
html += '</td>';
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue