mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Fix editMetadata/download didnt work with selected version
This commit is contained in:
parent
99686db96d
commit
fd3f1a7a22
1 changed files with 1756 additions and 1750 deletions
|
@ -30,7 +30,7 @@ import 'emby-select';
|
||||||
|
|
||||||
/* eslint-disable indent */
|
/* eslint-disable indent */
|
||||||
|
|
||||||
function getPromise(apiClient, params) {
|
function getPromise(apiClient, params) {
|
||||||
const id = params.id;
|
const id = params.id;
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
|
@ -54,9 +54,9 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error('Invalid request');
|
throw new Error('Invalid request');
|
||||||
}
|
}
|
||||||
|
|
||||||
function hideAll(page, className, show) {
|
function hideAll(page, className, show) {
|
||||||
for (const elem of page.querySelectorAll('.' + className)) {
|
for (const elem of page.querySelectorAll('.' + className)) {
|
||||||
if (show) {
|
if (show) {
|
||||||
elem.classList.remove('hide');
|
elem.classList.remove('hide');
|
||||||
|
@ -64,9 +64,9 @@ import 'emby-select';
|
||||||
elem.classList.add('hide');
|
elem.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getContextMenuOptions(item, user, button) {
|
function getContextMenuOptions(item, user, button) {
|
||||||
return {
|
return {
|
||||||
item: item,
|
item: item,
|
||||||
open: false,
|
open: false,
|
||||||
|
@ -82,9 +82,9 @@ import 'emby-select';
|
||||||
user: user,
|
user: user,
|
||||||
share: true
|
share: true
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
function getProgramScheduleHtml(items) {
|
function getProgramScheduleHtml(items) {
|
||||||
let html = '';
|
let html = '';
|
||||||
|
|
||||||
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-list" data-contextmenu="false">';
|
html += '<div is="emby-itemscontainer" class="itemsContainer vertical-list" data-contextmenu="false">';
|
||||||
|
@ -104,9 +104,9 @@ import 'emby-select';
|
||||||
html += '</div>';
|
html += '</div>';
|
||||||
|
|
||||||
return html;
|
return html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) {
|
function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) {
|
||||||
apiClient.getLiveTvTimers({
|
apiClient.getLiveTvTimers({
|
||||||
UserId: apiClient.getCurrentUserId(),
|
UserId: apiClient.getCurrentUserId(),
|
||||||
ImageTypeLimit: 1,
|
ImageTypeLimit: 1,
|
||||||
|
@ -126,23 +126,23 @@ import 'emby-select';
|
||||||
scheduleTab.innerHTML = html;
|
scheduleTab.innerHTML = html;
|
||||||
imageLoader.lazyChildren(scheduleTab);
|
imageLoader.lazyChildren(scheduleTab);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderTimerEditor(page, item, apiClient, user) {
|
function renderTimerEditor(page, item, apiClient, user) {
|
||||||
if (item.Type !== 'Recording' || !user.Policy.EnableLiveTvManagement || !item.TimerId || item.Status !== 'InProgress') {
|
if (item.Type !== 'Recording' || !user.Policy.EnableLiveTvManagement || !item.TimerId || item.Status !== 'InProgress') {
|
||||||
return void hideAll(page, 'btnCancelTimer');
|
return void hideAll(page, 'btnCancelTimer');
|
||||||
}
|
}
|
||||||
|
|
||||||
hideAll(page, 'btnCancelTimer', true);
|
hideAll(page, 'btnCancelTimer', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSeriesTimerEditor(page, item, apiClient, user) {
|
function renderSeriesTimerEditor(page, item, apiClient, user) {
|
||||||
if (item.Type !== 'SeriesTimer') {
|
if (item.Type !== 'SeriesTimer') {
|
||||||
return void hideAll(page, 'btnCancelSeriesTimer');
|
return void hideAll(page, 'btnCancelSeriesTimer');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.Policy.EnableLiveTvManagement) {
|
if (user.Policy.EnableLiveTvManagement) {
|
||||||
import('seriesRecordingEditor').then(({default: seriesRecordingEditor}) => {
|
import('seriesRecordingEditor').then(({ default: seriesRecordingEditor }) => {
|
||||||
seriesRecordingEditor.embed(item, apiClient.serverId(), {
|
seriesRecordingEditor.embed(item, apiClient.serverId(), {
|
||||||
context: page.querySelector('.seriesRecordingEditor')
|
context: page.querySelector('.seriesRecordingEditor')
|
||||||
});
|
});
|
||||||
|
@ -155,9 +155,9 @@ import 'emby-select';
|
||||||
|
|
||||||
page.querySelector('.seriesTimerScheduleSection').classList.add('hide');
|
page.querySelector('.seriesTimerScheduleSection').classList.add('hide');
|
||||||
return void hideAll(page, 'btnCancelSeriesTimer');
|
return void hideAll(page, 'btnCancelSeriesTimer');
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderTrackSelections(page, instance, item, forceReload) {
|
function renderTrackSelections(page, instance, item, forceReload) {
|
||||||
const select = page.querySelector('.selectSource');
|
const select = page.querySelector('.selectSource');
|
||||||
|
|
||||||
if (!item.MediaSources || !itemHelper.supportsMediaSourceSelection(item) || playbackManager.getSupportedCommands().indexOf('PlayMediaSource') === -1 || !playbackManager.canPlay(item)) {
|
if (!item.MediaSources || !itemHelper.supportsMediaSourceSelection(item) || playbackManager.getSupportedCommands().indexOf('PlayMediaSource') === -1 || !playbackManager.canPlay(item)) {
|
||||||
|
@ -194,9 +194,9 @@ import 'emby-select';
|
||||||
renderAudioSelections(page, mediaSources);
|
renderAudioSelections(page, mediaSources);
|
||||||
renderSubtitleSelections(page, mediaSources);
|
renderSubtitleSelections(page, mediaSources);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderVideoSelections(page, mediaSources) {
|
function renderVideoSelections(page, mediaSources) {
|
||||||
const mediaSourceId = page.querySelector('.selectSource').value;
|
const mediaSourceId = page.querySelector('.selectSource').value;
|
||||||
const mediaSource = mediaSources.filter(function (m) {
|
const mediaSource = mediaSources.filter(function (m) {
|
||||||
return m.Id === mediaSourceId;
|
return m.Id === mediaSourceId;
|
||||||
|
@ -231,9 +231,9 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
page.querySelector('.selectVideoContainer').classList.add('hide');
|
page.querySelector('.selectVideoContainer').classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderAudioSelections(page, mediaSources) {
|
function renderAudioSelections(page, mediaSources) {
|
||||||
const mediaSourceId = page.querySelector('.selectSource').value;
|
const mediaSourceId = page.querySelector('.selectSource').value;
|
||||||
const mediaSource = mediaSources.filter(function (m) {
|
const mediaSource = mediaSources.filter(function (m) {
|
||||||
return m.Id === mediaSourceId;
|
return m.Id === mediaSourceId;
|
||||||
|
@ -260,9 +260,9 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
page.querySelector('.selectAudioContainer').classList.add('hide');
|
page.querySelector('.selectAudioContainer').classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSubtitleSelections(page, mediaSources) {
|
function renderSubtitleSelections(page, mediaSources) {
|
||||||
const mediaSourceId = page.querySelector('.selectSource').value;
|
const mediaSourceId = page.querySelector('.selectSource').value;
|
||||||
const mediaSource = mediaSources.filter(function (m) {
|
const mediaSource = mediaSources.filter(function (m) {
|
||||||
return m.Id === mediaSourceId;
|
return m.Id === mediaSourceId;
|
||||||
|
@ -297,9 +297,9 @@ import 'emby-select';
|
||||||
select.innerHTML = '';
|
select.innerHTML = '';
|
||||||
page.querySelector('.selectSubtitlesContainer').classList.add('hide');
|
page.querySelector('.selectSubtitlesContainer').classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function reloadPlayButtons(page, item) {
|
function reloadPlayButtons(page, item) {
|
||||||
let canPlay = false;
|
let canPlay = false;
|
||||||
|
|
||||||
if (item.Type == 'Program') {
|
if (item.Type == 'Program') {
|
||||||
|
@ -339,9 +339,9 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
return canPlay;
|
return canPlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
function reloadUserDataButtons(page, item) {
|
function reloadUserDataButtons(page, item) {
|
||||||
let i;
|
let i;
|
||||||
let length;
|
let length;
|
||||||
const btnPlaystates = page.querySelectorAll('.btnPlaystate');
|
const btnPlaystates = page.querySelectorAll('.btnPlaystate');
|
||||||
|
@ -371,9 +371,9 @@ import 'emby-select';
|
||||||
btnUserRating.setItem(null);
|
btnUserRating.setItem(null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getArtistLinksHtml(artists, serverId, context) {
|
function getArtistLinksHtml(artists, serverId, context) {
|
||||||
const html = [];
|
const html = [];
|
||||||
|
|
||||||
for (const artist of artists) {
|
for (const artist of artists) {
|
||||||
|
@ -386,15 +386,15 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
return html.join(' / ');
|
return html.join(' / ');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renders the item's name block
|
* Renders the item's name block
|
||||||
* @param {Object} item - Item used to render the name.
|
* @param {Object} item - Item used to render the name.
|
||||||
* @param {HTMLDivElement} container - Container to render the information into.
|
* @param {HTMLDivElement} container - Container to render the information into.
|
||||||
* @param {Object} context - Application context.
|
* @param {Object} context - Application context.
|
||||||
*/
|
*/
|
||||||
function renderName(item, container, context) {
|
function renderName(item, container, context) {
|
||||||
let parentRoute;
|
let parentRoute;
|
||||||
const parentNameHtml = [];
|
const parentNameHtml = [];
|
||||||
let parentNameLast = false;
|
let parentNameLast = false;
|
||||||
|
@ -504,25 +504,25 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
container.classList.add('hide');
|
container.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function setTrailerButtonVisibility(page, item) {
|
function setTrailerButtonVisibility(page, item) {
|
||||||
if ((item.LocalTrailerCount || item.RemoteTrailers && item.RemoteTrailers.length) && playbackManager.getSupportedCommands().indexOf('PlayTrailers') !== -1) {
|
if ((item.LocalTrailerCount || item.RemoteTrailers && item.RemoteTrailers.length) && playbackManager.getSupportedCommands().indexOf('PlayTrailers') !== -1) {
|
||||||
hideAll(page, 'btnPlayTrailer', true);
|
hideAll(page, 'btnPlayTrailer', true);
|
||||||
} else {
|
} else {
|
||||||
hideAll(page, 'btnPlayTrailer');
|
hideAll(page, 'btnPlayTrailer');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderBackdrop(item) {
|
function renderBackdrop(item) {
|
||||||
if (dom.getWindowSize().innerWidth >= 1000) {
|
if (dom.getWindowSize().innerWidth >= 1000) {
|
||||||
backdrop.setBackdrops([item]);
|
backdrop.setBackdrops([item]);
|
||||||
} else {
|
} else {
|
||||||
backdrop.clearBackdrop();
|
backdrop.clearBackdrop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderDetailPageBackdrop(page, item, apiClient) {
|
function renderDetailPageBackdrop(page, item, apiClient) {
|
||||||
let imgUrl;
|
let imgUrl;
|
||||||
let hasbackdrop = false;
|
let hasbackdrop = false;
|
||||||
const itemBackdropElement = page.querySelector('#itemBackdrop');
|
const itemBackdropElement = page.querySelector('#itemBackdrop');
|
||||||
|
@ -562,9 +562,9 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
return hasbackdrop;
|
return hasbackdrop;
|
||||||
}
|
}
|
||||||
|
|
||||||
function reloadFromItem(instance, page, params, item, user) {
|
function reloadFromItem(instance, page, params, item, user) {
|
||||||
const apiClient = connectionManager.getApiClient(item.ServerId);
|
const apiClient = connectionManager.getApiClient(item.ServerId);
|
||||||
|
|
||||||
Emby.Page.setTitle('');
|
Emby.Page.setTitle('');
|
||||||
|
@ -662,12 +662,12 @@ import 'emby-select';
|
||||||
hideAll(page, 'btnDownload', true);
|
hideAll(page, 'btnDownload', true);
|
||||||
}
|
}
|
||||||
|
|
||||||
import('autoFocuser').then(({default: autoFocuser}) => {
|
import('autoFocuser').then(({ default: autoFocuser }) => {
|
||||||
autoFocuser.autoFocus(page);
|
autoFocuser.autoFocus(page);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function logoImageUrl(item, apiClient, options) {
|
function logoImageUrl(item, apiClient, options) {
|
||||||
options = options || {};
|
options = options || {};
|
||||||
options.type = 'Logo';
|
options.type = 'Logo';
|
||||||
|
|
||||||
|
@ -682,9 +682,9 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderLogo(page, item, apiClient) {
|
function renderLogo(page, item, apiClient) {
|
||||||
const detailLogo = page.querySelector('.detailLogo');
|
const detailLogo = page.querySelector('.detailLogo');
|
||||||
|
|
||||||
const url = logoImageUrl(item, apiClient, {});
|
const url = logoImageUrl(item, apiClient, {});
|
||||||
|
@ -697,14 +697,14 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
detailLogo.classList.add('hide');
|
detailLogo.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function showRecordingFields(instance, page, item, user) {
|
function showRecordingFields(instance, page, item, user) {
|
||||||
if (!instance.currentRecordingFields) {
|
if (!instance.currentRecordingFields) {
|
||||||
const recordingFieldsElement = page.querySelector('.recordingFields');
|
const recordingFieldsElement = page.querySelector('.recordingFields');
|
||||||
|
|
||||||
if (item.Type == 'Program' && user.Policy.EnableLiveTvManagement) {
|
if (item.Type == 'Program' && user.Policy.EnableLiveTvManagement) {
|
||||||
import('recordingFields').then(({default: recordingFields}) => {
|
import('recordingFields').then(({ default: recordingFields }) => {
|
||||||
instance.currentRecordingFields = new recordingFields({
|
instance.currentRecordingFields = new recordingFields({
|
||||||
parent: recordingFieldsElement,
|
parent: recordingFieldsElement,
|
||||||
programId: item.Id,
|
programId: item.Id,
|
||||||
|
@ -717,9 +717,9 @@ import 'emby-select';
|
||||||
recordingFieldsElement.innerHTML = '';
|
recordingFieldsElement.innerHTML = '';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderLinks(page, item) {
|
function renderLinks(page, item) {
|
||||||
const externalLinksElem = page.querySelector('.itemExternalLinks');
|
const externalLinksElem = page.querySelector('.itemExternalLinks');
|
||||||
|
|
||||||
const links = [];
|
const links = [];
|
||||||
|
@ -746,9 +746,9 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
externalLinksElem.classList.add('hide');
|
externalLinksElem.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderDetailImage(elem, item, imageLoader) {
|
function renderDetailImage(elem, item, imageLoader) {
|
||||||
const itemArray = [];
|
const itemArray = [];
|
||||||
itemArray.push(item);
|
itemArray.push(item);
|
||||||
const cardHtml = cardBuilder.getCardsHtml(itemArray, {
|
const cardHtml = cardBuilder.getCardsHtml(itemArray, {
|
||||||
|
@ -765,33 +765,33 @@ import 'emby-select';
|
||||||
|
|
||||||
elem.innerHTML = cardHtml;
|
elem.innerHTML = cardHtml;
|
||||||
imageLoader.lazyChildren(elem);
|
imageLoader.lazyChildren(elem);
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderImage(page, item) {
|
function renderImage(page, item) {
|
||||||
renderDetailImage(
|
renderDetailImage(
|
||||||
page.querySelector('.detailImageContainer'),
|
page.querySelector('.detailImageContainer'),
|
||||||
item,
|
item,
|
||||||
imageLoader
|
imageLoader
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshDetailImageUserData(elem, item) {
|
function refreshDetailImageUserData(elem, item) {
|
||||||
elem.querySelector('.detailImageProgressContainer').innerHTML = indicators.getProgressBarHtml(item);
|
elem.querySelector('.detailImageProgressContainer').innerHTML = indicators.getProgressBarHtml(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
function refreshImage(page, item) {
|
function refreshImage(page, item) {
|
||||||
refreshDetailImageUserData(page.querySelector('.detailImageContainer'), item);
|
refreshDetailImageUserData(page.querySelector('.detailImageContainer'), item);
|
||||||
}
|
}
|
||||||
|
|
||||||
function setPeopleHeader(page, item) {
|
function setPeopleHeader(page, item) {
|
||||||
if (item.MediaType == 'Audio' || item.Type == 'MusicAlbum' || item.MediaType == 'Book' || item.MediaType == 'Photo') {
|
if (item.MediaType == 'Audio' || item.Type == 'MusicAlbum' || item.MediaType == 'Book' || item.MediaType == 'Photo') {
|
||||||
page.querySelector('#peopleHeader').innerHTML = globalize.translate('People');
|
page.querySelector('#peopleHeader').innerHTML = globalize.translate('People');
|
||||||
} else {
|
} else {
|
||||||
page.querySelector('#peopleHeader').innerHTML = globalize.translate('HeaderCastAndCrew');
|
page.querySelector('#peopleHeader').innerHTML = globalize.translate('HeaderCastAndCrew');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderNextUp(page, item, user) {
|
function renderNextUp(page, item, user) {
|
||||||
const section = page.querySelector('.nextUpSection');
|
const section = page.querySelector('.nextUpSection');
|
||||||
|
|
||||||
if (item.Type != 'Series') {
|
if (item.Type != 'Series') {
|
||||||
|
@ -821,9 +821,9 @@ import 'emby-select';
|
||||||
itemsContainer.innerHTML = html;
|
itemsContainer.innerHTML = html;
|
||||||
imageLoader.lazyChildren(itemsContainer);
|
imageLoader.lazyChildren(itemsContainer);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function setInitialCollapsibleState(page, item, apiClient, context, user) {
|
function setInitialCollapsibleState(page, item, apiClient, context, user) {
|
||||||
page.querySelector('.collectionItems').innerHTML = '';
|
page.querySelector('.collectionItems').innerHTML = '';
|
||||||
|
|
||||||
if (item.Type == 'Playlist') {
|
if (item.Type == 'Playlist') {
|
||||||
|
@ -872,9 +872,9 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
page.querySelector('#musicVideosCollapsible').classList.add('hide');
|
page.querySelector('#musicVideosCollapsible').classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function toggleLineClamp(clampTarget, e) {
|
function toggleLineClamp(clampTarget, e) {
|
||||||
const expandButton = e.target;
|
const expandButton = e.target;
|
||||||
const clampClassName = 'detail-clamp-text';
|
const clampClassName = 'detail-clamp-text';
|
||||||
|
|
||||||
|
@ -885,9 +885,9 @@ import 'emby-select';
|
||||||
clampTarget.classList.add(clampClassName);
|
clampTarget.classList.add(clampClassName);
|
||||||
expandButton.innerHTML = globalize.translate('ShowMore');
|
expandButton.innerHTML = globalize.translate('ShowMore');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderOverview(page, item) {
|
function renderOverview(page, item) {
|
||||||
for (const overviewElemnt of page.querySelectorAll('.overview')) {
|
for (const overviewElemnt of page.querySelectorAll('.overview')) {
|
||||||
const overview = item.Overview || '';
|
const overview = item.Overview || '';
|
||||||
|
|
||||||
|
@ -917,9 +917,9 @@ import 'emby-select';
|
||||||
overviewElemnt.classList.add('hide');
|
overviewElemnt.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderGenres(page, item, context = inferContext(item)) {
|
function renderGenres(page, item, context = inferContext(item)) {
|
||||||
const genres = item.GenreItems || [];
|
const genres = item.GenreItems || [];
|
||||||
const type = context === 'music' ? 'MusicGenre' : 'Genre';
|
const type = context === 'music' ? 'MusicGenre' : 'Genre';
|
||||||
|
|
||||||
|
@ -945,9 +945,9 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
genresGroup.classList.add('hide');
|
genresGroup.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderWriter(page, item, context) {
|
function renderWriter(page, item, context) {
|
||||||
const writers = (item.People || []).filter(function (person) {
|
const writers = (item.People || []).filter(function (person) {
|
||||||
return person.Type === 'Writer';
|
return person.Type === 'Writer';
|
||||||
});
|
});
|
||||||
|
@ -974,9 +974,9 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
writersGroup.classList.add('hide');
|
writersGroup.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderDirector(page, item, context) {
|
function renderDirector(page, item, context) {
|
||||||
const directors = (item.People || []).filter(function (person) {
|
const directors = (item.People || []).filter(function (person) {
|
||||||
return person.Type === 'Director';
|
return person.Type === 'Director';
|
||||||
});
|
});
|
||||||
|
@ -1003,9 +1003,9 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
directorsGroup.classList.add('hide');
|
directorsGroup.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderMiscInfo(page, item) {
|
function renderMiscInfo(page, item) {
|
||||||
const primaryItemMiscInfo = page.querySelectorAll('.itemMiscInfo-primary');
|
const primaryItemMiscInfo = page.querySelectorAll('.itemMiscInfo-primary');
|
||||||
|
|
||||||
for (const miscInfo of primaryItemMiscInfo) {
|
for (const miscInfo of primaryItemMiscInfo) {
|
||||||
|
@ -1035,9 +1035,9 @@ import 'emby-select';
|
||||||
miscInfo.classList.add('hide');
|
miscInfo.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderTagline(page, item) {
|
function renderTagline(page, item) {
|
||||||
const taglineElement = page.querySelector('.tagline');
|
const taglineElement = page.querySelector('.tagline');
|
||||||
|
|
||||||
if (item.Taglines && item.Taglines.length) {
|
if (item.Taglines && item.Taglines.length) {
|
||||||
|
@ -1046,9 +1046,9 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
taglineElement.classList.add('hide');
|
taglineElement.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderDetails(page, item, apiClient, context, isStatic) {
|
function renderDetails(page, item, apiClient, context, isStatic) {
|
||||||
renderSimilarItems(page, item, context);
|
renderSimilarItems(page, item, context);
|
||||||
renderMoreFromSeason(page, item, apiClient);
|
renderMoreFromSeason(page, item, apiClient);
|
||||||
renderMoreFromArtist(page, item, apiClient);
|
renderMoreFromArtist(page, item, apiClient);
|
||||||
|
@ -1063,29 +1063,29 @@ import 'emby-select';
|
||||||
renderLinks(page, item);
|
renderLinks(page, item);
|
||||||
renderTags(page, item);
|
renderTags(page, item);
|
||||||
renderSeriesAirTime(page, item, isStatic);
|
renderSeriesAirTime(page, item, isStatic);
|
||||||
}
|
}
|
||||||
|
|
||||||
function enableScrollX() {
|
function enableScrollX() {
|
||||||
return browser.mobile && screen.availWidth <= 1000;
|
return browser.mobile && screen.availWidth <= 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPortraitShape(scrollX) {
|
function getPortraitShape(scrollX) {
|
||||||
if (scrollX == null) {
|
if (scrollX == null) {
|
||||||
scrollX = enableScrollX();
|
scrollX = enableScrollX();
|
||||||
}
|
}
|
||||||
|
|
||||||
return scrollX ? 'overflowPortrait' : 'portrait';
|
return scrollX ? 'overflowPortrait' : 'portrait';
|
||||||
}
|
}
|
||||||
|
|
||||||
function getSquareShape(scrollX) {
|
function getSquareShape(scrollX) {
|
||||||
if (scrollX == null) {
|
if (scrollX == null) {
|
||||||
scrollX = enableScrollX();
|
scrollX = enableScrollX();
|
||||||
}
|
}
|
||||||
|
|
||||||
return scrollX ? 'overflowSquare' : 'square';
|
return scrollX ? 'overflowSquare' : 'square';
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderMoreFromSeason(view, item, apiClient) {
|
function renderMoreFromSeason(view, item, apiClient) {
|
||||||
const section = view.querySelector('.moreFromSeasonSection');
|
const section = view.querySelector('.moreFromSeasonSection');
|
||||||
|
|
||||||
if (section) {
|
if (section) {
|
||||||
|
@ -1127,9 +1127,9 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderMoreFromArtist(view, item, apiClient) {
|
function renderMoreFromArtist(view, item, apiClient) {
|
||||||
const section = view.querySelector('.moreFromArtistSection');
|
const section = view.querySelector('.moreFromArtistSection');
|
||||||
|
|
||||||
if (section) {
|
if (section) {
|
||||||
|
@ -1186,9 +1186,9 @@ import 'emby-select';
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSimilarItems(page, item, context) {
|
function renderSimilarItems(page, item, context) {
|
||||||
const similarCollapsible = page.querySelector('#similarCollapsible');
|
const similarCollapsible = page.querySelector('#similarCollapsible');
|
||||||
|
|
||||||
if (similarCollapsible) {
|
if (similarCollapsible) {
|
||||||
|
@ -1234,9 +1234,9 @@ import 'emby-select';
|
||||||
imageLoader.lazyChildren(similarContent);
|
imageLoader.lazyChildren(similarContent);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSeriesAirTime(page, item, isStatic) {
|
function renderSeriesAirTime(page, item, isStatic) {
|
||||||
const seriesAirTime = page.querySelector('#seriesAirTime');
|
const seriesAirTime = page.querySelector('#seriesAirTime');
|
||||||
if (item.Type != 'Series') {
|
if (item.Type != 'Series') {
|
||||||
seriesAirTime.classList.add('hide');
|
seriesAirTime.classList.add('hide');
|
||||||
|
@ -1275,9 +1275,9 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
seriesAirTime.classList.add('hide');
|
seriesAirTime.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderTags(page, item) {
|
function renderTags(page, item) {
|
||||||
const itemTags = page.querySelector('.itemTags');
|
const itemTags = page.querySelector('.itemTags');
|
||||||
const tagElements = [];
|
const tagElements = [];
|
||||||
let tags = item.Tags || [];
|
let tags = item.Tags || [];
|
||||||
|
@ -1297,9 +1297,9 @@ import 'emby-select';
|
||||||
itemTags.innerHTML = '';
|
itemTags.innerHTML = '';
|
||||||
itemTags.classList.add('hide');
|
itemTags.classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderChildren(page, item) {
|
function renderChildren(page, item) {
|
||||||
let fields = 'ItemCounts,PrimaryImageAspectRatio,BasicSyncInfo,CanDelete,MediaSourceCount';
|
let fields = 'ItemCounts,PrimaryImageAspectRatio,BasicSyncInfo,CanDelete,MediaSourceCount';
|
||||||
const query = {
|
const query = {
|
||||||
ParentId: item.Id,
|
ParentId: item.Id,
|
||||||
|
@ -1461,21 +1461,21 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
page.querySelector('.childrenSectionHeader').classList.remove('hide');
|
page.querySelector('.childrenSectionHeader').classList.remove('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderItemsByName(page, item) {
|
function renderItemsByName(page, item) {
|
||||||
import('scripts/itembynamedetailpage').then(() => {
|
import('scripts/itembynamedetailpage').then(() => {
|
||||||
window.ItemsByName.renderItems(page, item);
|
window.ItemsByName.renderItems(page, item);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderPlaylistItems(page, item) {
|
function renderPlaylistItems(page, item) {
|
||||||
import('scripts/playlistedit').then(() => {
|
import('scripts/playlistedit').then(() => {
|
||||||
PlaylistViewer.render(page, item);
|
PlaylistViewer.render(page, item);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderProgramsForChannel(page, result) {
|
function renderProgramsForChannel(page, result) {
|
||||||
let html = '';
|
let html = '';
|
||||||
let currentItems = [];
|
let currentItems = [];
|
||||||
let currentStartDate = null;
|
let currentStartDate = null;
|
||||||
|
@ -1529,9 +1529,9 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
page.querySelector('.programGuide').innerHTML = html;
|
page.querySelector('.programGuide').innerHTML = html;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderChannelGuide(page, apiClient, item) {
|
function renderChannelGuide(page, apiClient, item) {
|
||||||
if (item.Type === 'TvChannel') {
|
if (item.Type === 'TvChannel') {
|
||||||
page.querySelector('.programGuideSection').classList.remove('hide');
|
page.querySelector('.programGuideSection').classList.remove('hide');
|
||||||
apiClient.getLiveTvPrograms({
|
apiClient.getLiveTvPrograms({
|
||||||
|
@ -1547,9 +1547,9 @@ import 'emby-select';
|
||||||
renderProgramsForChannel(page, result);
|
renderProgramsForChannel(page, result);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSeriesSchedule(page, item) {
|
function renderSeriesSchedule(page, item) {
|
||||||
const apiClient = connectionManager.getApiClient(item.ServerId);
|
const apiClient = connectionManager.getApiClient(item.ServerId);
|
||||||
apiClient.getLiveTvPrograms({
|
apiClient.getLiveTvPrograms({
|
||||||
UserId: apiClient.getCurrentUserId(),
|
UserId: apiClient.getCurrentUserId(),
|
||||||
|
@ -1581,9 +1581,9 @@ import 'emby-select';
|
||||||
});
|
});
|
||||||
loading.hide();
|
loading.hide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function inferContext(item) {
|
function inferContext(item) {
|
||||||
if (item.Type === 'Movie' || item.Type === 'BoxSet') {
|
if (item.Type === 'Movie' || item.Type === 'BoxSet') {
|
||||||
return 'movies';
|
return 'movies';
|
||||||
}
|
}
|
||||||
|
@ -1601,9 +1601,9 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
function filterItemsByCollectionItemType(items, typeInfo) {
|
function filterItemsByCollectionItemType(items, typeInfo) {
|
||||||
return items.filter(function (item) {
|
return items.filter(function (item) {
|
||||||
if (typeInfo.mediaType) {
|
if (typeInfo.mediaType) {
|
||||||
return item.MediaType == typeInfo.mediaType;
|
return item.MediaType == typeInfo.mediaType;
|
||||||
|
@ -1611,9 +1611,9 @@ import 'emby-select';
|
||||||
|
|
||||||
return item.Type == typeInfo.type;
|
return item.Type == typeInfo.type;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function canPlaySomeItemInCollection(items) {
|
function canPlaySomeItemInCollection(items) {
|
||||||
let i = 0;
|
let i = 0;
|
||||||
|
|
||||||
for (let length = items.length; i < length; i++) {
|
for (let length = items.length; i < length; i++) {
|
||||||
|
@ -1623,9 +1623,9 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderCollectionItems(page, parentItem, types, items) {
|
function renderCollectionItems(page, parentItem, types, items) {
|
||||||
page.querySelector('.collectionItems').classList.remove('hide');
|
page.querySelector('.collectionItems').classList.remove('hide');
|
||||||
page.querySelector('.collectionItems').innerHTML = '';
|
page.querySelector('.collectionItems').innerHTML = '';
|
||||||
|
|
||||||
|
@ -1674,12 +1674,12 @@ import 'emby-select';
|
||||||
|
|
||||||
// HACK: Call autoFocuser again because btnPlay may be hidden, but focused by reloadFromItem
|
// HACK: Call autoFocuser again because btnPlay may be hidden, but focused by reloadFromItem
|
||||||
// FIXME: Sometimes focus does not move until all (?) sections are loaded
|
// FIXME: Sometimes focus does not move until all (?) sections are loaded
|
||||||
import('autoFocuser').then(({default: autoFocuser}) => {
|
import('autoFocuser').then(({ default: autoFocuser }) => {
|
||||||
autoFocuser.autoFocus(page);
|
autoFocuser.autoFocus(page);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderCollectionItemType(page, parentItem, type, items) {
|
function renderCollectionItemType(page, parentItem, type, items) {
|
||||||
let html = '';
|
let html = '';
|
||||||
html += '<div class="verticalSection">';
|
html += '<div class="verticalSection">';
|
||||||
html += '<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">';
|
html += '<div class="sectionTitleContainer sectionTitleContainer-cards padded-left">';
|
||||||
|
@ -1707,9 +1707,9 @@ import 'emby-select';
|
||||||
const collectionItems = page.querySelector('.collectionItems');
|
const collectionItems = page.querySelector('.collectionItems');
|
||||||
collectionItems.insertAdjacentHTML('beforeend', html);
|
collectionItems.insertAdjacentHTML('beforeend', html);
|
||||||
imageLoader.lazyChildren(collectionItems);
|
imageLoader.lazyChildren(collectionItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderMusicVideos(page, item, user) {
|
function renderMusicVideos(page, item, user) {
|
||||||
connectionManager.getApiClient(item.ServerId).getItems(user.Id, {
|
connectionManager.getApiClient(item.ServerId).getItems(user.Id, {
|
||||||
SortBy: 'SortName',
|
SortBy: 'SortName',
|
||||||
SortOrder: 'Ascending',
|
SortOrder: 'Ascending',
|
||||||
|
@ -1727,9 +1727,9 @@ import 'emby-select';
|
||||||
page.querySelector('#musicVideosCollapsible').classList.add('hide');
|
page.querySelector('#musicVideosCollapsible').classList.add('hide');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderAdditionalParts(page, item, user) {
|
function renderAdditionalParts(page, item, user) {
|
||||||
connectionManager.getApiClient(item.ServerId).getAdditionalVideoParts(user.Id, item.Id).then(function (result) {
|
connectionManager.getApiClient(item.ServerId).getAdditionalVideoParts(user.Id, item.Id).then(function (result) {
|
||||||
if (result.Items.length) {
|
if (result.Items.length) {
|
||||||
page.querySelector('#additionalPartsCollapsible').classList.remove('hide');
|
page.querySelector('#additionalPartsCollapsible').classList.remove('hide');
|
||||||
|
@ -1740,16 +1740,16 @@ import 'emby-select';
|
||||||
page.querySelector('#additionalPartsCollapsible').classList.add('hide');
|
page.querySelector('#additionalPartsCollapsible').classList.add('hide');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderScenes(page, item) {
|
function renderScenes(page, item) {
|
||||||
let chapters = item.Chapters || [];
|
let chapters = item.Chapters || [];
|
||||||
|
|
||||||
if (chapters.length && !chapters[0].ImageTag && (chapters = []), chapters.length) {
|
if (chapters.length && !chapters[0].ImageTag && (chapters = []), chapters.length) {
|
||||||
page.querySelector('#scenesCollapsible').classList.remove('hide');
|
page.querySelector('#scenesCollapsible').classList.remove('hide');
|
||||||
const scenesContent = page.querySelector('#scenesContent');
|
const scenesContent = page.querySelector('#scenesContent');
|
||||||
|
|
||||||
import('chaptercardbuilder').then(({default: chaptercardbuilder}) => {
|
import('chaptercardbuilder').then(({ default: chaptercardbuilder }) => {
|
||||||
chaptercardbuilder.buildChapterCards(item, chapters, {
|
chaptercardbuilder.buildChapterCards(item, chapters, {
|
||||||
itemsContainer: scenesContent,
|
itemsContainer: scenesContent,
|
||||||
backdropShape: 'overflowBackdrop',
|
backdropShape: 'overflowBackdrop',
|
||||||
|
@ -1760,9 +1760,9 @@ import 'emby-select';
|
||||||
} else {
|
} else {
|
||||||
page.querySelector('#scenesCollapsible').classList.add('hide');
|
page.querySelector('#scenesCollapsible').classList.add('hide');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function getVideosHtml(items) {
|
function getVideosHtml(items) {
|
||||||
return cardBuilder.getCardsHtml({
|
return cardBuilder.getCardsHtml({
|
||||||
items: items,
|
items: items,
|
||||||
shape: 'autooverflow',
|
shape: 'autooverflow',
|
||||||
|
@ -1772,17 +1772,17 @@ import 'emby-select';
|
||||||
centerText: true,
|
centerText: true,
|
||||||
showRuntime: true
|
showRuntime: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderSpecials(page, item, user) {
|
function renderSpecials(page, item, user) {
|
||||||
connectionManager.getApiClient(item.ServerId).getSpecialFeatures(user.Id, item.Id).then(function (specials) {
|
connectionManager.getApiClient(item.ServerId).getSpecialFeatures(user.Id, item.Id).then(function (specials) {
|
||||||
const specialsContent = page.querySelector('#specialsContent');
|
const specialsContent = page.querySelector('#specialsContent');
|
||||||
specialsContent.innerHTML = getVideosHtml(specials);
|
specialsContent.innerHTML = getVideosHtml(specials);
|
||||||
imageLoader.lazyChildren(specialsContent);
|
imageLoader.lazyChildren(specialsContent);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderCast(page, item) {
|
function renderCast(page, item) {
|
||||||
const people = (item.People || []).filter(function (p) {
|
const people = (item.People || []).filter(function (p) {
|
||||||
return p.Type === 'Actor';
|
return p.Type === 'Actor';
|
||||||
});
|
});
|
||||||
|
@ -1794,7 +1794,7 @@ import 'emby-select';
|
||||||
page.querySelector('#castCollapsible').classList.remove('hide');
|
page.querySelector('#castCollapsible').classList.remove('hide');
|
||||||
const castContent = page.querySelector('#castContent');
|
const castContent = page.querySelector('#castContent');
|
||||||
|
|
||||||
import('peoplecardbuilder').then(({default: peoplecardbuilder}) => {
|
import('peoplecardbuilder').then(({ default: peoplecardbuilder }) => {
|
||||||
peoplecardbuilder.buildPeopleCards(people, {
|
peoplecardbuilder.buildPeopleCards(people, {
|
||||||
itemsContainer: castContent,
|
itemsContainer: castContent,
|
||||||
coverImage: true,
|
coverImage: true,
|
||||||
|
@ -1803,31 +1803,31 @@ import 'emby-select';
|
||||||
imageBlurhashes: item.ImageBlurHashes
|
imageBlurhashes: item.ImageBlurHashes
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function itemDetailPage() {
|
function itemDetailPage() {
|
||||||
const self = this;
|
const self = this;
|
||||||
self.setInitialCollapsibleState = setInitialCollapsibleState;
|
self.setInitialCollapsibleState = setInitialCollapsibleState;
|
||||||
self.renderDetails = renderDetails;
|
self.renderDetails = renderDetails;
|
||||||
self.renderCast = renderCast;
|
self.renderCast = renderCast;
|
||||||
}
|
}
|
||||||
|
|
||||||
function bindAll(view, selector, eventName, fn) {
|
function bindAll(view, selector, eventName, fn) {
|
||||||
const elems = view.querySelectorAll(selector);
|
const elems = view.querySelectorAll(selector);
|
||||||
|
|
||||||
for (const elem of elems) {
|
for (const elem of elems) {
|
||||||
elem.addEventListener(eventName, fn);
|
elem.addEventListener(eventName, fn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function onTrackSelectionsSubmit(e) {
|
function onTrackSelectionsSubmit(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
window.ItemDetailPage = new itemDetailPage();
|
window.ItemDetailPage = new itemDetailPage();
|
||||||
|
|
||||||
export default function (view, params) {
|
export default function (view, params) {
|
||||||
function reload(instance, page, params) {
|
function reload(instance, page, params) {
|
||||||
loading.show();
|
loading.show();
|
||||||
|
|
||||||
|
@ -1842,7 +1842,7 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
function splitVersions(instance, page, apiClient, params) {
|
function splitVersions(instance, page, apiClient, params) {
|
||||||
import('confirm').then(({default: confirm}) => {
|
import('confirm').then(({ default: confirm }) => {
|
||||||
confirm('Are you sure you wish to split the media sources into separate items?', 'Split Media Apart').then(function () {
|
confirm('Are you sure you wish to split the media sources into separate items?', 'Split Media Apart').then(function () {
|
||||||
loading.show();
|
loading.show();
|
||||||
apiClient.ajax({
|
apiClient.ajax({
|
||||||
|
@ -1904,7 +1904,7 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCancelSeriesTimerClick() {
|
function onCancelSeriesTimerClick() {
|
||||||
import('recordingHelper').then(({default: recordingHelper}) => {
|
import('recordingHelper').then(({ default: recordingHelper }) => {
|
||||||
recordingHelper.cancelSeriesTimerWithConfirmation(currentItem.Id, currentItem.ServerId).then(function () {
|
recordingHelper.cancelSeriesTimerWithConfirmation(currentItem.Id, currentItem.ServerId).then(function () {
|
||||||
Dashboard.navigate('livetv.html');
|
Dashboard.navigate('livetv.html');
|
||||||
});
|
});
|
||||||
|
@ -1912,7 +1912,7 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
function onCancelTimerClick() {
|
function onCancelTimerClick() {
|
||||||
import('recordingHelper').then(({default: recordingHelper}) => {
|
import('recordingHelper').then(({ default: recordingHelper }) => {
|
||||||
recordingHelper.cancelTimer(connectionManager.getApiClient(currentItem.ServerId), currentItem.TimerId).then(function () {
|
recordingHelper.cancelTimer(connectionManager.getApiClient(currentItem.ServerId), currentItem.TimerId).then(function () {
|
||||||
reload(self, view, params);
|
reload(self, view, params);
|
||||||
});
|
});
|
||||||
|
@ -1924,7 +1924,7 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
function onDownloadClick() {
|
function onDownloadClick() {
|
||||||
import('fileDownloader').then(({default: fileDownloader}) => {
|
import('fileDownloader').then(({ default: fileDownloader }) => {
|
||||||
const downloadHref = apiClient.getItemDownloadUrl(currentItem.Id);
|
const downloadHref = apiClient.getItemDownloadUrl(currentItem.Id);
|
||||||
fileDownloader.download([{
|
fileDownloader.download([{
|
||||||
url: downloadHref,
|
url: downloadHref,
|
||||||
|
@ -1935,9 +1935,13 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
|
|
||||||
function onMoreCommandsClick() {
|
function onMoreCommandsClick() {
|
||||||
const button = this;
|
var button = this;
|
||||||
|
var selectedItem = currentItem;
|
||||||
|
apiClient.getItem(apiClient.getCurrentUserId(), view.querySelector('.selectSource').value).then(function (item) {
|
||||||
|
selectedItem = item;
|
||||||
|
|
||||||
apiClient.getCurrentUser().then(function (user) {
|
apiClient.getCurrentUser().then(function (user) {
|
||||||
itemContextMenu.show(getContextMenuOptions(currentItem, user, button)).then(function (result) {
|
itemContextMenu.show(getContextMenuOptions(selectedItem, user, button)).then(function (result) {
|
||||||
if (result.deleted) {
|
if (result.deleted) {
|
||||||
appRouter.goHome();
|
appRouter.goHome();
|
||||||
} else if (result.updated) {
|
} else if (result.updated) {
|
||||||
|
@ -1945,6 +1949,8 @@ import 'emby-select';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
function onPlayerChange() {
|
function onPlayerChange() {
|
||||||
|
@ -2018,6 +2024,6 @@ import 'emby-select';
|
||||||
self._currentPlaybackMediaSources = null;
|
self._currentPlaybackMediaSources = null;
|
||||||
self.currentRecordingFields = null;
|
self.currentRecordingFields = null;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/* eslint-enable indent */
|
/* eslint-enable indent */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue