mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge branch 'master' into trickplay-new
This commit is contained in:
commit
fc664090cc
29 changed files with 326 additions and 153 deletions
|
@ -61,7 +61,7 @@ const UserCardBox: FunctionComponent<IProps> = ({ user = {} }: IProps) => {
|
|||
</div>`;
|
||||
|
||||
return (
|
||||
<div data-userid={user.Id} className={cssClass}>
|
||||
<div data-userid={user.Id} data-username={user.Name} className={cssClass}>
|
||||
<div className='cardBox visualCardBox'>
|
||||
<div className='cardScalable visualCardBox-cardScalable'>
|
||||
<div className='cardPadder cardPadder-square'></div>
|
||||
|
|
|
@ -214,11 +214,7 @@ export function getCommands(options) {
|
|||
});
|
||||
}
|
||||
|
||||
if (canEdit && item.MediaType === 'Video' && item.Type !== 'TvChannel' && item.Type !== 'Program'
|
||||
&& item.LocationType !== 'Virtual'
|
||||
&& !(item.Type === 'Recording' && item.Status !== 'Completed')
|
||||
&& options.editSubtitles !== false
|
||||
) {
|
||||
if (itemHelper.canEditSubtitles(user, item) && options.editSubtitles !== false) {
|
||||
commands.push({
|
||||
name: globalize.translate('EditSubtitles'),
|
||||
id: 'editsubtitles',
|
||||
|
|
|
@ -1,6 +1,10 @@
|
|||
import { appHost } from './apphost';
|
||||
import globalize from '../scripts/globalize';
|
||||
import { CollectionType } from '@jellyfin/sdk/lib/generated-client/models/collection-type';
|
||||
import { BaseItemKind } from '@jellyfin/sdk/lib/generated-client/models/base-item-kind';
|
||||
import { LocationType } from '@jellyfin/sdk/lib/generated-client/models/location-type';
|
||||
import { RecordingStatus } from '@jellyfin/sdk/lib/generated-client/models/recording-status';
|
||||
import { MediaType } from '@jellyfin/sdk/lib/generated-client/models/media-type';
|
||||
|
||||
export function getDisplayName(item, options = {}) {
|
||||
if (!item) {
|
||||
|
@ -155,6 +159,33 @@ export function canEditImages (user, item) {
|
|||
return itemType !== 'Timer' && itemType !== 'SeriesTimer' && canEdit(user, item) && !isLocalItem(item);
|
||||
}
|
||||
|
||||
export function canEditSubtitles (user, item) {
|
||||
if (item.MediaType !== MediaType.Video) {
|
||||
return false;
|
||||
}
|
||||
const itemType = item.Type;
|
||||
if (itemType === BaseItemKind.Recording && item.Status !== RecordingStatus.Completed) {
|
||||
return false;
|
||||
}
|
||||
if (itemType === BaseItemKind.TvChannel
|
||||
|| itemType === BaseItemKind.Program
|
||||
|| itemType === 'Timer'
|
||||
|| itemType === 'SeriesTimer'
|
||||
|| itemType === BaseItemKind.UserRootFolder
|
||||
|| itemType === BaseItemKind.UserView
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
if (isLocalItem(item)) {
|
||||
return false;
|
||||
}
|
||||
if (item.LocationType === LocationType.Virtual) {
|
||||
return false;
|
||||
}
|
||||
return user.Policy.EnableSubtitleManagement
|
||||
|| user.Policy.IsAdministrator;
|
||||
}
|
||||
|
||||
export function canShare (item, user) {
|
||||
if (item.Type === 'Program') {
|
||||
return false;
|
||||
|
@ -300,6 +331,7 @@ export default {
|
|||
canIdentify: canIdentify,
|
||||
canEdit: canEdit,
|
||||
canEditImages: canEditImages,
|
||||
canEditSubtitles,
|
||||
canShare: canShare,
|
||||
enableDateAddedDisplay: enableDateAddedDisplay,
|
||||
canMarkPlayed: canMarkPlayed,
|
||||
|
|
|
@ -418,6 +418,8 @@ export function setContentType(parent, contentType) {
|
|||
}
|
||||
}
|
||||
|
||||
parent.querySelector('.chkUseReplayGainTagsContainer').classList.toggle('hide', contentType !== 'music');
|
||||
|
||||
parent.querySelector('.chkEnableLUFSScanContainer').classList.toggle('hide', contentType !== 'music');
|
||||
|
||||
if (contentType === 'tvshows') {
|
||||
|
@ -519,6 +521,7 @@ export function getLibraryOptions(parent) {
|
|||
EnableLUFSScan: parent.querySelector('.chkEnableLUFSScan').checked,
|
||||
ExtractTrickplayImagesDuringLibraryScan: parent.querySelector('.chkExtractTrickplayDuringLibraryScan').checked,
|
||||
EnableTrickplayImageExtraction: parent.querySelector('.chkExtractTrickplayImages').checked,
|
||||
UseReplayGainTags: parent.querySelector('.chkUseReplayGainTags').checked,
|
||||
ExtractChapterImagesDuringLibraryScan: parent.querySelector('.chkExtractChaptersDuringLibraryScan').checked,
|
||||
EnableChapterImageExtraction: parent.querySelector('.chkExtractChapterImages').checked,
|
||||
EnableInternetProviders: true,
|
||||
|
@ -583,6 +586,7 @@ export function setLibraryOptions(parent, options) {
|
|||
parent.querySelector('.chkEnableLUFSScan').checked = options.EnableLUFSScan;
|
||||
parent.querySelector('.chkExtractTrickplayDuringLibraryScan').checked = options.ExtractTrickplayImagesDuringLibraryScan;
|
||||
parent.querySelector('.chkExtractTrickplayImages').checked = options.EnableTrickplayImageExtraction;
|
||||
parent.querySelector('.chkUseReplayGainTags').checked = options.UseReplayGainTags;
|
||||
parent.querySelector('.chkExtractChaptersDuringLibraryScan').checked = options.ExtractChapterImagesDuringLibraryScan;
|
||||
parent.querySelector('.chkExtractChapterImages').checked = options.EnableChapterImageExtraction;
|
||||
parent.querySelector('#chkSaveLocal').checked = options.SaveLocalMetadata;
|
||||
|
|
|
@ -55,6 +55,14 @@
|
|||
<div class="fieldDescription checkboxFieldDescription">${LabelEnableRealtimeMonitorHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription chkUseReplayGainTagsContainer advanced">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkUseReplayGainTags" checked />
|
||||
<span>${LabelUseReplayGainTags}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${LabelUseReplayGainTagsHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription chkEnableLUFSScanContainer advanced">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkEnableLUFSScan" checked />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue