mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
get channel media info at runtime
This commit is contained in:
parent
b06fdda96d
commit
3f79032731
22 changed files with 164 additions and 79 deletions
|
@ -919,6 +919,11 @@
|
|||
itemCommands.push('queuefromhere');
|
||||
}
|
||||
|
||||
// There's no detail page with a dedicated delete function
|
||||
if (item.Type == 'Playlist') {
|
||||
itemCommands.push('delete');
|
||||
}
|
||||
|
||||
return itemCommands;
|
||||
},
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@
|
|||
tag: item.ParentLogoImageTag
|
||||
});
|
||||
|
||||
html += '<img src="' + imgUrl + '" style="max-height:' + logoHeight + 'px;max-width:' + maxLogoWidth + 'px;" />';
|
||||
html += '<img src="' + imgUrl + '" style="max-height:' + logoHeight + 'px;max-width:100%;" />';
|
||||
|
||||
}
|
||||
else if (item.ImageTags.Logo) {
|
||||
|
@ -68,7 +68,7 @@
|
|||
tag: item.ImageTags.Logo
|
||||
});
|
||||
|
||||
html += '<img src="' + imgUrl + '" style="max-height:' + logoHeight + 'px;max-width:' + maxLogoWidth + 'px;" />';
|
||||
html += '<img src="' + imgUrl + '" style="max-height:' + logoHeight + 'px;max-width:100%;" />';
|
||||
}
|
||||
else {
|
||||
html += parentName || name;
|
||||
|
@ -234,6 +234,17 @@
|
|||
return false;
|
||||
}
|
||||
|
||||
function onDeleteButtonClick() {
|
||||
|
||||
var id = this.getAttribute('data-itemid');
|
||||
|
||||
closeContextMenu();
|
||||
|
||||
LibraryBrowser.deleteItem(id);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
function onExternalPlayerButtonClick() {
|
||||
|
||||
closeContextMenu();
|
||||
|
@ -398,6 +409,10 @@
|
|||
html += '<li data-icon="delete"><a href="#" class="btnRemoveFromPlaylist" data-playlistitemid="' + playlistItemId + '">' + Globalize.translate('ButtonRemoveFromPlaylist') + '</a></li>';
|
||||
}
|
||||
|
||||
if (commands.indexOf('delete') != -1) {
|
||||
html += '<li data-icon="delete"><a href="#" class="btnDelete" data-itemId="' + itemId + '">' + Globalize.translate('ButtonDelete') + '</a></li>';
|
||||
}
|
||||
|
||||
html += '</ul>';
|
||||
|
||||
html += '</div>';
|
||||
|
@ -421,6 +436,7 @@
|
|||
$('.btnPlayAllFromHere', elem).on('click', onPlayAllFromHereButtonClick);
|
||||
$('.btnQueueAllFromHere', elem).on('click', onQueueAllFromHereButtonClick);
|
||||
$('.btnExternalPlayer', elem).on('click', onExternalPlayerButtonClick);
|
||||
$('.btnDelete', elem).on('click', onDeleteButtonClick);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -543,35 +543,35 @@
|
|||
self.stop();
|
||||
}
|
||||
|
||||
var mediaElement;
|
||||
|
||||
if (item.MediaType === "Video") {
|
||||
|
||||
self.currentItem = item;
|
||||
self.currentMediaSource = getOptimalMediaSource(item.MediaType, item.MediaSources);
|
||||
ApiClient.getJSON(ApiClient.getUrl('Items/' + item.Id + '/MediaInfo', {
|
||||
userId: Dashboard.getCurrentUserId()
|
||||
|
||||
})).done(function(result) {
|
||||
|
||||
self.currentItem = item;
|
||||
self.currentMediaSource = getOptimalMediaSource(item.MediaType, result.MediaSources);
|
||||
|
||||
self.currentMediaElement = self.playVideo(item, self.currentMediaSource, startPosition);
|
||||
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
||||
|
||||
self.updateNowPlayingInfo(item);
|
||||
});
|
||||
|
||||
mediaElement = self.playVideo(item, self.currentMediaSource, startPosition);
|
||||
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
||||
|
||||
} else if (item.MediaType === "Audio") {
|
||||
|
||||
self.currentItem = item;
|
||||
self.currentMediaSource = getOptimalMediaSource(item.MediaType, item.MediaSources);
|
||||
|
||||
mediaElement = playAudio(item, self.currentMediaSource, startPosition);
|
||||
self.currentMediaElement = playAudio(item, self.currentMediaSource, startPosition);
|
||||
|
||||
self.currentDurationTicks = self.currentMediaSource.RunTimeTicks;
|
||||
|
||||
} else {
|
||||
throw new Error("Unrecognized media type");
|
||||
}
|
||||
|
||||
self.currentMediaElement = mediaElement;
|
||||
|
||||
if (item.MediaType === "Video") {
|
||||
|
||||
self.updateNowPlayingInfo(item);
|
||||
}
|
||||
};
|
||||
|
||||
self.getNowPlayingNameHtml = function (playerState) {
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
html += '<h1 class="listHeader">' + title + '</h1>';
|
||||
|
||||
html += '<div class="mobileItemsContainer">';
|
||||
html += '<div>';
|
||||
html += LibraryBrowser.getPosterViewHtml({
|
||||
items: recommendation.Items,
|
||||
lazy: true,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
(function ($, document) {
|
||||
|
||||
var view = LibraryBrowser.getDefaultItemsView('Poster', 'List');
|
||||
var view = LibraryBrowser.getDefaultItemsView('PosterCard', 'PosterCard');
|
||||
|
||||
// The base query options
|
||||
var query = {
|
||||
|
@ -15,7 +15,7 @@
|
|||
|
||||
function getSavedQueryKey() {
|
||||
|
||||
return 'playlists' + (query.ParentId || '');
|
||||
return 'playlists2' + (query.ParentId || '');
|
||||
}
|
||||
|
||||
function showLoadingMessage(page) {
|
||||
|
@ -66,7 +66,7 @@
|
|||
sortBy: query.SortBy
|
||||
});
|
||||
}
|
||||
else if (view == "Poster") {
|
||||
else if (view == "PosterCard") {
|
||||
html = LibraryBrowser.getPosterViewHtml({
|
||||
items: result.Items,
|
||||
shape: "square",
|
||||
|
@ -74,7 +74,8 @@
|
|||
showTitle: true,
|
||||
lazy: true,
|
||||
coverImage: true,
|
||||
showItemCounts: true
|
||||
showItemCounts: true,
|
||||
cardLayout: true
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
|
||||
var cssClass = "card homePageSquareCard bottomPaddedCard";
|
||||
|
||||
html += "<div data-id='" + server.Id + "' class='" + cssClass + "'>";
|
||||
html += "<div data-id='" + server.Id + "' data-connectserverid='" + (server.ConnectServerId || '') + "' class='" + cssClass + "'>";
|
||||
|
||||
html += '<div class="cardBox visualCardBox visualCardBox-b">';
|
||||
html += '<div class="cardScalable">';
|
||||
|
@ -69,7 +69,7 @@
|
|||
|
||||
html += '<div class="cardText" style="text-align:right; float:right;">';
|
||||
|
||||
//html += '<button class="btnServerMenu" type="button" data-inline="true" data-iconpos="notext" data-icon="ellipsis-v" style="margin: 2px 0 0;"></button>';
|
||||
html += '<button class="btnServerMenu" type="button" data-inline="true" data-iconpos="notext" data-icon="ellipsis-v" style="margin: 2px 0 0;"></button>';
|
||||
|
||||
html += "</div>";
|
||||
|
||||
|
@ -147,7 +147,7 @@
|
|||
});
|
||||
}
|
||||
|
||||
function rejectInvitation(page, id) {
|
||||
function deleteServer(page, id) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
|
@ -164,11 +164,29 @@
|
|||
});
|
||||
}
|
||||
|
||||
function rejectInvitation(page, id) {
|
||||
|
||||
Dashboard.showLoadingMsg();
|
||||
|
||||
// Add/Update connect info
|
||||
ConnectionManager.rejectServer(id).done(function () {
|
||||
|
||||
Dashboard.hideLoadingMsg();
|
||||
loadPage(page);
|
||||
|
||||
}).fail(function () {
|
||||
|
||||
showGeneralError();
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function showServerMenu(elem) {
|
||||
|
||||
var card = $(elem).parents('.card');
|
||||
var page = $(elem).parents('.page');
|
||||
var id = card.attr('data-id');
|
||||
var connectserverid = card.attr('data-connectserverid');
|
||||
|
||||
$('.serverMenu', page).popup("close").remove();
|
||||
|
||||
|
@ -177,7 +195,7 @@
|
|||
html += '<ul data-role="listview" style="min-width: 180px;">';
|
||||
html += '<li data-role="list-divider">' + Globalize.translate('HeaderMenu') + '</li>';
|
||||
|
||||
html += '<li><a href="#" class="btnDelete" data-id="' + id + '">' + Globalize.translate('ButtonDelete') + '</a></li>';
|
||||
html += '<li><a href="#" class="btnDelete" data-connectserverid="' + connectserverid + '">' + Globalize.translate('ButtonDelete') + '</a></li>';
|
||||
|
||||
html += '</ul>';
|
||||
|
||||
|
@ -192,7 +210,7 @@
|
|||
});
|
||||
|
||||
$('.btnDelete', flyout).on('click', function () {
|
||||
rejectInvitation(page, this.getAttribute('data-id'));
|
||||
deleteServer(page, this.getAttribute('data-connectserverid'));
|
||||
$('.serverMenu', page).popup("close").remove();
|
||||
});
|
||||
}
|
||||
|
|
|
@ -1275,7 +1275,7 @@ var Dashboard = {
|
|||
|
||||
initializeApiClient(ApiClient);
|
||||
|
||||
ConnectionManager.addApiClient(ApiClient, true);
|
||||
ConnectionManager.addApiClient(ApiClient, true).fail(Dashboard.logout);
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
|
||||
$('#chkDisabled', page).checked(user.Configuration.IsDisabled || false).checkboxradio("refresh");
|
||||
$('#chkIsHidden', page).checked(user.Configuration.IsHidden || false).checkboxradio("refresh");
|
||||
$('#chkEnableRemoteControlOtherUsers', page).checked(user.Configuration.EnableRemoteControlOfOtherUsers || false).checkboxradio("refresh");
|
||||
$('#chkRemoteControlSharedDevices', page).checked(user.Configuration.EnableSharedDeviceControl);
|
||||
$('#chkEnableRemoteControlOtherUsers', page).checked(user.Configuration.EnableRemoteControlOfOtherUsers).checkboxradio("refresh");
|
||||
$('#chkEnableMediaPlayback', page).checked(user.Configuration.EnableMediaPlayback || false).checkboxradio("refresh");
|
||||
|
||||
$('#chkManageLiveTv', page).checked(user.Configuration.EnableLiveTvManagement || false).checkboxradio("refresh");
|
||||
|
@ -72,6 +73,7 @@
|
|||
user.Configuration.EnableLiveTvAccess = $('#chkEnableLiveTvAccess', page).checked();
|
||||
user.Configuration.EnableContentDeletion = $('#chkEnableContentDeletion', page).checked();
|
||||
user.Configuration.EnableUserPreferenceAccess = !$('#chkDisableUserPreferences', page).checked();
|
||||
user.Configuration.EnableSharedDeviceControl = $('#chkRemoteControlSharedDevices', page).checked();
|
||||
|
||||
ApiClient.updateUser(user).done(function () {
|
||||
onSaveComplete(page, user);
|
||||
|
|
|
@ -402,10 +402,29 @@
|
|||
|
||||
function showInvitePopup(page) {
|
||||
|
||||
$('#popupInvite', page).popup('open');
|
||||
Dashboard.getCurrentUser().done(function (user) {
|
||||
|
||||
$('#txtConnectUsername', page).val('');
|
||||
if (user.ConnectUserId) {
|
||||
|
||||
$('#popupInvite', page).popup('open');
|
||||
$('#txtConnectUsername', page).val('');
|
||||
} else {
|
||||
|
||||
var msg = Globalize.translate('MessageConnectAccountRequiredToInviteGuest');
|
||||
|
||||
msg += '<br/>';
|
||||
msg += '<br/>';
|
||||
msg += '<a href="useredit.html?userId=' + user.Id + '">' + Globalize.translate('ButtonLinkMyMediaBrowserAccount') + '</a>';
|
||||
msg += '<br/>';
|
||||
|
||||
Dashboard.alert({
|
||||
message: msg,
|
||||
title: Globalize.translate('HeaderInviteGuest')
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
$(document).on('pageinit', "#userProfilesPage", function () {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue