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
|
@ -140,7 +140,8 @@ function renderSeriesTimerSchedule(page, apiClient, seriesTimerId) {
|
|||
|
||||
function renderTimerEditor(page, item, apiClient, user) {
|
||||
if (item.Type !== 'Recording' || !user.Policy.EnableLiveTvManagement || !item.TimerId || item.Status !== 'InProgress') {
|
||||
return hideAll(page, 'btnCancelTimer');
|
||||
hideAll(page, 'btnCancelTimer');
|
||||
return;
|
||||
}
|
||||
|
||||
hideAll(page, 'btnCancelTimer', true);
|
||||
|
@ -148,7 +149,8 @@ function renderTimerEditor(page, item, apiClient, user) {
|
|||
|
||||
function renderSeriesTimerEditor(page, item, apiClient, user) {
|
||||
if (item.Type !== 'SeriesTimer') {
|
||||
return hideAll(page, 'btnCancelSeriesTimer');
|
||||
hideAll(page, 'btnCancelSeriesTimer');
|
||||
return;
|
||||
}
|
||||
|
||||
if (user.Policy.EnableLiveTvManagement) {
|
||||
|
@ -160,11 +162,13 @@ function renderSeriesTimerEditor(page, item, apiClient, user) {
|
|||
|
||||
page.querySelector('.seriesTimerScheduleSection').classList.remove('hide');
|
||||
hideAll(page, 'btnCancelSeriesTimer', true);
|
||||
return renderSeriesTimerSchedule(page, apiClient, item.Id);
|
||||
renderSeriesTimerSchedule(page, apiClient, item.Id);
|
||||
return;
|
||||
}
|
||||
|
||||
page.querySelector('.seriesTimerScheduleSection').classList.add('hide');
|
||||
return hideAll(page, 'btnCancelSeriesTimer');
|
||||
hideAll(page, 'btnCancelSeriesTimer');
|
||||
return;
|
||||
}
|
||||
|
||||
function renderTrackSelections(page, instance, item, forceReload) {
|
||||
|
@ -807,7 +811,7 @@ function renderNextUp(page, item, user) {
|
|||
|
||||
if (item.Type != 'Series') {
|
||||
section.classList.add('hide');
|
||||
return undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
ServerConnections.getApiClient(item.ServerId).getNextUpEpisodes({
|
||||
|
@ -1114,7 +1118,8 @@ function renderMoreFromSeason(view, item, apiClient) {
|
|||
|
||||
if (section) {
|
||||
if (item.Type !== 'Episode' || !item.SeasonId || !item.SeriesId) {
|
||||
return section.classList.add('hide');
|
||||
section.classList.add('hide');
|
||||
return;
|
||||
}
|
||||
|
||||
const userId = apiClient.getCurrentUserId();
|
||||
|
@ -1124,7 +1129,8 @@ function renderMoreFromSeason(view, item, apiClient) {
|
|||
Fields: 'ItemCounts,PrimaryImageAspectRatio,BasicSyncInfo,CanDelete,MediaSourceCount'
|
||||
}).then(function (result) {
|
||||
if (result.Items.length < 2) {
|
||||
return section.classList.add('hide');
|
||||
section.classList.add('hide');
|
||||
return;
|
||||
}
|
||||
|
||||
section.classList.remove('hide');
|
||||
|
@ -1159,10 +1165,12 @@ function renderMoreFromArtist(view, item, apiClient) {
|
|||
if (section) {
|
||||
if (item.Type === 'MusicArtist') {
|
||||
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) {
|
||||
return section.classList.add('hide');
|
||||
section.classList.add('hide');
|
||||
return;
|
||||
}
|
||||
|
||||
const query = {
|
||||
|
@ -1181,7 +1189,8 @@ function renderMoreFromArtist(view, item, apiClient) {
|
|||
|
||||
apiClient.getItems(apiClient.getCurrentUserId(), query).then(function (result) {
|
||||
if (!result.Items.length) {
|
||||
return section.classList.add('hide');
|
||||
section.classList.add('hide');
|
||||
return;
|
||||
}
|
||||
|
||||
section.classList.remove('hide');
|
||||
|
@ -1215,7 +1224,8 @@ function renderSimilarItems(page, item, context) {
|
|||
|
||||
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') {
|
||||
return similarCollapsible.classList.add('hide');
|
||||
similarCollapsible.classList.add('hide');
|
||||
return;
|
||||
}
|
||||
|
||||
similarCollapsible.classList.remove('hide');
|
||||
|
@ -1232,7 +1242,8 @@ function renderSimilarItems(page, item, context) {
|
|||
|
||||
apiClient.getSimilarItems(item.Id, options).then(function (result) {
|
||||
if (!result.Items.length) {
|
||||
return similarCollapsible.classList.add('hide');
|
||||
similarCollapsible.classList.add('hide');
|
||||
return;
|
||||
}
|
||||
|
||||
similarCollapsible.classList.remove('hide');
|
||||
|
@ -1820,7 +1831,7 @@ function renderCast(page, item) {
|
|||
|
||||
if (!people.length) {
|
||||
page.querySelector('#castCollapsible').classList.add('hide');
|
||||
return undefined;
|
||||
return;
|
||||
}
|
||||
|
||||
page.querySelector('#castCollapsible').classList.remove('hide');
|
||||
|
@ -1915,11 +1926,12 @@ export default function (view, params) {
|
|||
|
||||
if (item.Type === 'Program') {
|
||||
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({
|
||||
items: [channel]
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
playItem(item, item.UserData && mode === 'resume' ? item.UserData.PlaybackPositionTicks : 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue