mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix undefined item when casting to other device
Fix undefined item when changing cast to other device. Removed NowPlayingAlbum because on smaller device we need more height
This commit is contained in:
parent
8651b8c177
commit
3ab01d471f
1 changed files with 56 additions and 54 deletions
|
@ -114,6 +114,7 @@ define(["browser", "datetime", "backdrop", "libraryBrowser", "listView", "imageL
|
|||
var item = state.NowPlayingItem;
|
||||
var displayName = item ? getNowPlayingNameHtml(item).replace("<br/>", " - ") : "";
|
||||
console.debug(JSON.stringify(item, null, 4));
|
||||
if (typeof item != 'undefined') {
|
||||
if (item.Type == "Audio" || item.MediaStreams[0].Type == "Audio") {
|
||||
var songName = item.Name;
|
||||
if (item.Album != null && item.Artists != null) {
|
||||
|
@ -121,13 +122,13 @@ define(["browser", "datetime", "backdrop", "libraryBrowser", "listView", "imageL
|
|||
var artistName;
|
||||
if (item.ArtistItems != null) {
|
||||
artistName = item.ArtistItems[0].Name;
|
||||
context.querySelector(".nowPlayingAlbum").innerHTML = '<a style="color:inherit;" class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.AlbumId + '&serverId=' + (item.ServerId || serverId) + '">' + albumName + '</a>';
|
||||
// context.querySelector(".nowPlayingAlbum").innerHTML = '<a style="color:inherit;" class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.AlbumId + '&serverId=' + (item.ServerId || serverId) + '">' + albumName + '</a>';
|
||||
context.querySelector(".nowPlayingArtist").innerHTML = '<a style="color:inherit;" class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.ArtistItems[0].Id + '&serverId=' + (item.ServerId || serverId) + '">' + artistName + '</a>';
|
||||
context.querySelector(".contextMenuAlbum").innerHTML = '<a style="color:inherit;" class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.AlbumId + '&serverId=' + (item.ServerId || serverId) + '"><i class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons">album</i> ' + globalize.translate("ViewAlbum") + '</a>';
|
||||
context.querySelector(".contextMenuArtist").innerHTML = '<a style="color:inherit;" class="button-link emby-button" is="emby-linkbutton" href="itemdetails.html?id=' + item.ArtistItems[0].Id + '&serverId=' + (item.ServerId || serverId) + '"><i class="actionsheetMenuItemIcon listItemIcon listItemIcon-transparent material-icons">person</i> ' + globalize.translate("ViewArtist") + '</a>';
|
||||
} else {
|
||||
artistName = item.Artists;
|
||||
context.querySelector(".nowPlayingAlbum").innerHTML = albumName;
|
||||
// context.querySelector(".nowPlayingAlbum").innerHTML = albumName;
|
||||
context.querySelector(".nowPlayingArtist").innerHTML = artistName;
|
||||
}
|
||||
}
|
||||
|
@ -176,6 +177,7 @@ define(["browser", "datetime", "backdrop", "libraryBrowser", "listView", "imageL
|
|||
context.querySelector(".nowPlayingPageUserDataButtons").innerHTML = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function setImageUrl(context, state, url) {
|
||||
currentImgUrl = url;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue