mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
fix return statements
This commit is contained in:
parent
161f531523
commit
27cd24f5fc
9 changed files with 53 additions and 28 deletions
|
@ -23,7 +23,8 @@ import ServerConnections from './ServerConnections';
|
||||||
if (!actionableParent || actionableParent.classList.contains('cardContent')) {
|
if (!actionableParent || actionableParent.classList.contains('cardContent')) {
|
||||||
apiClient.getJSON(apiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
|
apiClient.getJSON(apiClient.getUrl('Users/' + userId + '/Items/Latest', options)).then(function (items) {
|
||||||
if (items.length === 1) {
|
if (items.length === 1) {
|
||||||
return appRouter.showItem(items[0]);
|
appRouter.showItem(items[0]);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const url = 'details?id=' + itemId + '&serverId=' + serverId;
|
const url = 'details?id=' + itemId + '&serverId=' + serverId;
|
||||||
|
|
|
@ -323,7 +323,8 @@ import template from './libraryoptionseditor.template.html';
|
||||||
function onImageFetchersContainerClick(e) {
|
function onImageFetchersContainerClick(e) {
|
||||||
const btnImageOptionsForType = dom.parentWithClass(e.target, 'btnImageOptionsForType');
|
const btnImageOptionsForType = dom.parentWithClass(e.target, 'btnImageOptionsForType');
|
||||||
if (btnImageOptionsForType) {
|
if (btnImageOptionsForType) {
|
||||||
return showImageOptionsForType(dom.parentWithClass(btnImageOptionsForType, 'imageFetcher').getAttribute('data-type'));
|
showImageOptionsForType(dom.parentWithClass(btnImageOptionsForType, 'imageFetcher').getAttribute('data-type'));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
onSortableContainerClick.call(this, e);
|
onSortableContainerClick.call(this, e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -122,9 +122,10 @@ export default function (page, providerId, options) {
|
||||||
const selectedListingsId = $('#selectListing', page).val();
|
const selectedListingsId = $('#selectListing', page).val();
|
||||||
|
|
||||||
if (!selectedListingsId) {
|
if (!selectedListingsId) {
|
||||||
return Dashboard.alert({
|
Dashboard.alert({
|
||||||
message: globalize.translate('ErrorPleaseSelectLineup')
|
message: globalize.translate('ErrorPleaseSelectLineup')
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.show();
|
loading.show();
|
||||||
|
@ -168,7 +169,8 @@ export default function (page, providerId, options) {
|
||||||
|
|
||||||
function refreshListings(value) {
|
function refreshListings(value) {
|
||||||
if (!value) {
|
if (!value) {
|
||||||
return $('#selectListing', page).html('');
|
$('#selectListing', page).html('');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
loading.show();
|
loading.show();
|
||||||
|
|
|
@ -140,7 +140,8 @@ function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) {
|
||||||
|
|
||||||
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 hideAll(page, 'btnCancelTimer');
|
hideAll(page, 'btnCancelTimer');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
hideAll(page, 'btnCancelTimer', true);
|
hideAll(page, 'btnCancelTimer', true);
|
||||||
|
@ -148,7 +149,8 @@ function renderTimerEditor(page, item, apiClient, user) {
|
||||||
|
|
||||||
function renderSeriesTimerEditor(page, item, apiClient, user) {
|
function renderSeriesTimerEditor(page, item, apiClient, user) {
|
||||||
if (item.Type !== 'SeriesTimer') {
|
if (item.Type !== 'SeriesTimer') {
|
||||||
return hideAll(page, 'btnCancelSeriesTimer');
|
hideAll(page, 'btnCancelSeriesTimer');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.Policy.EnableLiveTvManagement) {
|
if (user.Policy.EnableLiveTvManagement) {
|
||||||
|
@ -160,11 +162,13 @@ function renderSeriesTimerEditor(page, item, apiClient, user) {
|
||||||
|
|
||||||
page.querySelector('.seriesTimerScheduleSection').classList.remove('hide');
|
page.querySelector('.seriesTimerScheduleSection').classList.remove('hide');
|
||||||
hideAll(page, 'btnCancelSeriesTimer', true);
|
hideAll(page, 'btnCancelSeriesTimer', true);
|
||||||
return renderSeriesTimerSchedule(page, apiClient, item.Id);
|
renderSeriesTimerSchedule(page, apiClient, item.Id);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
page.querySelector('.seriesTimerScheduleSection').classList.add('hide');
|
page.querySelector('.seriesTimerScheduleSection').classList.add('hide');
|
||||||
return hideAll(page, 'btnCancelSeriesTimer');
|
hideAll(page, 'btnCancelSeriesTimer');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function renderTrackSelections(page, instance, item, forceReload) {
|
function renderTrackSelections(page, instance, item, forceReload) {
|
||||||
|
@ -807,7 +811,7 @@ function renderNextUp(page, item, user) {
|
||||||
|
|
||||||
if (item.Type != 'Series') {
|
if (item.Type != 'Series') {
|
||||||
section.classList.add('hide');
|
section.classList.add('hide');
|
||||||
return undefined;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerConnections.getApiClient(item.ServerId).getNextUpEpisodes({
|
ServerConnections.getApiClient(item.ServerId).getNextUpEpisodes({
|
||||||
|
@ -1114,7 +1118,8 @@ function renderMoreFromSeason(view, item, apiClient) {
|
||||||
|
|
||||||
if (section) {
|
if (section) {
|
||||||
if (item.Type !== 'Episode' || !item.SeasonId || !item.SeriesId) {
|
if (item.Type !== 'Episode' || !item.SeasonId || !item.SeriesId) {
|
||||||
return section.classList.add('hide');
|
section.classList.add('hide');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const userId = apiClient.getCurrentUserId();
|
const userId = apiClient.getCurrentUserId();
|
||||||
|
@ -1124,7 +1129,8 @@ function renderMoreFromSeason(view, item, apiClient) {
|
||||||
Fields: 'ItemCounts,PrimaryImageAspectRatio,BasicSyncInfo,CanDelete,MediaSourceCount'
|
Fields: 'ItemCounts,PrimaryImageAspectRatio,BasicSyncInfo,CanDelete,MediaSourceCount'
|
||||||
}).then(function (result) {
|
}).then(function (result) {
|
||||||
if (result.Items.length < 2) {
|
if (result.Items.length < 2) {
|
||||||
return section.classList.add('hide');
|
section.classList.add('hide');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.classList.remove('hide');
|
section.classList.remove('hide');
|
||||||
|
@ -1159,10 +1165,12 @@ function renderMoreFromArtist(view, item, apiClient) {
|
||||||
if (section) {
|
if (section) {
|
||||||
if (item.Type === 'MusicArtist') {
|
if (item.Type === 'MusicArtist') {
|
||||||
if (!apiClient.isMinServerVersion('3.4.1.19')) {
|
if (!apiClient.isMinServerVersion('3.4.1.19')) {
|
||||||
return section.classList.add('hide');
|
section.classList.add('hide');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
} else if (item.Type !== 'MusicAlbum' || !item.AlbumArtists || !item.AlbumArtists.length) {
|
} else if (item.Type !== 'MusicAlbum' || !item.AlbumArtists || !item.AlbumArtists.length) {
|
||||||
return section.classList.add('hide');
|
section.classList.add('hide');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const query = {
|
const query = {
|
||||||
|
@ -1181,7 +1189,8 @@ function renderMoreFromArtist(view, item, apiClient) {
|
||||||
|
|
||||||
apiClient.getItems(apiClient.getCurrentUserId(), query).then(function (result) {
|
apiClient.getItems(apiClient.getCurrentUserId(), query).then(function (result) {
|
||||||
if (!result.Items.length) {
|
if (!result.Items.length) {
|
||||||
return section.classList.add('hide');
|
section.classList.add('hide');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.classList.remove('hide');
|
section.classList.remove('hide');
|
||||||
|
@ -1215,7 +1224,8 @@ function renderSimilarItems(page, item, context) {
|
||||||
|
|
||||||
if (similarCollapsible) {
|
if (similarCollapsible) {
|
||||||
if (item.Type != 'Movie' && item.Type != 'Trailer' && item.Type != 'Series' && item.Type != 'Program' && item.Type != 'Recording' && item.Type != 'MusicAlbum' && item.Type != 'MusicArtist' && item.Type != 'Playlist') {
|
if (item.Type != 'Movie' && item.Type != 'Trailer' && item.Type != 'Series' && item.Type != 'Program' && item.Type != 'Recording' && item.Type != 'MusicAlbum' && item.Type != 'MusicArtist' && item.Type != 'Playlist') {
|
||||||
return similarCollapsible.classList.add('hide');
|
similarCollapsible.classList.add('hide');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
similarCollapsible.classList.remove('hide');
|
similarCollapsible.classList.remove('hide');
|
||||||
|
@ -1232,7 +1242,8 @@ function renderSimilarItems(page, item, context) {
|
||||||
|
|
||||||
apiClient.getSimilarItems(item.Id, options).then(function (result) {
|
apiClient.getSimilarItems(item.Id, options).then(function (result) {
|
||||||
if (!result.Items.length) {
|
if (!result.Items.length) {
|
||||||
return similarCollapsible.classList.add('hide');
|
similarCollapsible.classList.add('hide');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
similarCollapsible.classList.remove('hide');
|
similarCollapsible.classList.remove('hide');
|
||||||
|
@ -1820,7 +1831,7 @@ function renderCast(page, item) {
|
||||||
|
|
||||||
if (!people.length) {
|
if (!people.length) {
|
||||||
page.querySelector('#castCollapsible').classList.add('hide');
|
page.querySelector('#castCollapsible').classList.add('hide');
|
||||||
return undefined;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
page.querySelector('#castCollapsible').classList.remove('hide');
|
page.querySelector('#castCollapsible').classList.remove('hide');
|
||||||
|
@ -1915,11 +1926,12 @@ export default function (view, params) {
|
||||||
|
|
||||||
if (item.Type === 'Program') {
|
if (item.Type === 'Program') {
|
||||||
const apiClient = ServerConnections.getApiClient(item.ServerId);
|
const apiClient = ServerConnections.getApiClient(item.ServerId);
|
||||||
return apiClient.getLiveTvChannel(item.ChannelId, apiClient.getCurrentUserId()).then(function (channel) {
|
apiClient.getLiveTvChannel(item.ChannelId, apiClient.getCurrentUserId()).then(function (channel) {
|
||||||
playbackManager.play({
|
playbackManager.play({
|
||||||
items: [channel]
|
items: [channel]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
playItem(item, item.UserData && mode === 'resume' ? item.UserData.PlaybackPositionTicks : 0);
|
playItem(item, item.UserData && mode === 'resume' ? item.UserData.PlaybackPositionTicks : 0);
|
||||||
|
|
|
@ -721,7 +721,7 @@ class ItemsView {
|
||||||
return globalize.translate('Videos');
|
return globalize.translate('Videos');
|
||||||
}
|
}
|
||||||
|
|
||||||
return undefined;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
function play() {
|
function play() {
|
||||||
|
|
|
@ -54,14 +54,16 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
recordingButtonManager = null;
|
recordingButtonManager = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return view.querySelector('.btnRecord').classList.add('hide');
|
view.querySelector('.btnRecord').classList.add('hide');
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ServerConnections.getApiClient(item.ServerId).getCurrentUser().then(function (user) {
|
ServerConnections.getApiClient(item.ServerId).getCurrentUser().then(function (user) {
|
||||||
if (user.Policy.EnableLiveTvManagement) {
|
if (user.Policy.EnableLiveTvManagement) {
|
||||||
import('../../../components/recordingcreator/recordingbutton').then(({default: RecordingButton}) => {
|
import('../../../components/recordingcreator/recordingbutton').then(({default: RecordingButton}) => {
|
||||||
if (recordingButtonManager) {
|
if (recordingButtonManager) {
|
||||||
return recordingButtonManager.refreshItem(item);
|
recordingButtonManager.refreshItem(item);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
recordingButtonManager = new RecordingButton({
|
recordingButtonManager = new RecordingButton({
|
||||||
|
@ -1449,7 +1451,8 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
/* eslint-disable-next-line compat/compat */
|
/* eslint-disable-next-line compat/compat */
|
||||||
dom.addEventListener(view, window.PointerEvent ? 'pointerdown' : 'click', function (e) {
|
dom.addEventListener(view, window.PointerEvent ? 'pointerdown' : 'click', function (e) {
|
||||||
if (dom.parentWithClass(e.target, ['videoOsdBottom', 'upNextContainer'])) {
|
if (dom.parentWithClass(e.target, ['videoOsdBottom', 'upNextContainer'])) {
|
||||||
return showOsd();
|
showOsd();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pointerType = e.pointerType || (layoutManager.mobile ? 'touch' : 'mouse');
|
const pointerType = e.pointerType || (layoutManager.mobile ? 'touch' : 'mouse');
|
||||||
|
|
|
@ -5,17 +5,19 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
|
|
||||||
function processForgotPasswordResult(result) {
|
function processForgotPasswordResult(result) {
|
||||||
if (result.Action == 'ContactAdmin') {
|
if (result.Action == 'ContactAdmin') {
|
||||||
return Dashboard.alert({
|
Dashboard.alert({
|
||||||
message: globalize.translate('MessageContactAdminToResetPassword'),
|
message: globalize.translate('MessageContactAdminToResetPassword'),
|
||||||
title: globalize.translate('ButtonForgotPassword')
|
title: globalize.translate('ButtonForgotPassword')
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.Action == 'InNetworkRequired') {
|
if (result.Action == 'InNetworkRequired') {
|
||||||
return Dashboard.alert({
|
Dashboard.alert({
|
||||||
message: globalize.translate('MessageForgotPasswordInNetworkRequired'),
|
message: globalize.translate('MessageForgotPasswordInNetworkRequired'),
|
||||||
title: globalize.translate('ButtonForgotPassword')
|
title: globalize.translate('ButtonForgotPassword')
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result.Action == 'PinCode') {
|
if (result.Action == 'PinCode') {
|
||||||
|
@ -26,13 +28,14 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
msg += '<br/>';
|
msg += '<br/>';
|
||||||
msg += result.PinFile;
|
msg += result.PinFile;
|
||||||
msg += '<br/>';
|
msg += '<br/>';
|
||||||
return Dashboard.alert({
|
Dashboard.alert({
|
||||||
message: msg,
|
message: msg,
|
||||||
title: globalize.translate('ButtonForgotPassword'),
|
title: globalize.translate('ButtonForgotPassword'),
|
||||||
callback: function () {
|
callback: function () {
|
||||||
Dashboard.navigate('forgotpasswordpin.html');
|
Dashboard.navigate('forgotpasswordpin.html');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -9,13 +9,14 @@ import Dashboard from '../../../scripts/clientUtils';
|
||||||
msg += '<br/>';
|
msg += '<br/>';
|
||||||
msg += '<br/>';
|
msg += '<br/>';
|
||||||
msg += result.UsersReset.join('<br/>');
|
msg += result.UsersReset.join('<br/>');
|
||||||
return Dashboard.alert({
|
Dashboard.alert({
|
||||||
message: msg,
|
message: msg,
|
||||||
title: globalize.translate('HeaderPasswordReset'),
|
title: globalize.translate('HeaderPasswordReset'),
|
||||||
callback: function () {
|
callback: function () {
|
||||||
window.location.href = 'index.html';
|
window.location.href = 'index.html';
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Dashboard.alert({
|
Dashboard.alert({
|
||||||
|
|
|
@ -645,7 +645,8 @@ import Headroom from 'headroom.js';
|
||||||
if (!user) {
|
if (!user) {
|
||||||
showBySelector('.libraryMenuDownloads', false);
|
showBySelector('.libraryMenuDownloads', false);
|
||||||
showBySelector('.lnkSyncToOtherDevices', false);
|
showBySelector('.lnkSyncToOtherDevices', false);
|
||||||
return showBySelector('.userMenuOptions', false);
|
showBySelector('.userMenuOptions', false);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (user.Policy.EnableContentDownloading) {
|
if (user.Policy.EnableContentDownloading) {
|
||||||
|
@ -957,7 +958,8 @@ import Headroom from 'headroom.js';
|
||||||
|
|
||||||
function setTitle (title) {
|
function setTitle (title) {
|
||||||
if (title == null) {
|
if (title == null) {
|
||||||
return LibraryMenu.setDefaultTitle();
|
LibraryMenu.setDefaultTitle();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (title === '-') {
|
if (title === '-') {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue