mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge pull request #5200 from nicknsy/trickplay-new
Add trickplay support
This commit is contained in:
commit
cb98a5cce0
15 changed files with 545 additions and 9 deletions
|
@ -0,0 +1,33 @@
|
|||
import React, { type FunctionComponent } from 'react';
|
||||
import globalize from '../../../../scripts/globalize';
|
||||
|
||||
type IProps = {
|
||||
title?: string;
|
||||
className?: string;
|
||||
href?: string;
|
||||
};
|
||||
|
||||
const createLinkElement = ({ className, title, href }: IProps) => ({
|
||||
__html: `<a
|
||||
is="emby-linkbutton"
|
||||
rel="noopener noreferrer"
|
||||
class="${className}"
|
||||
href="${href}"
|
||||
>
|
||||
${title}
|
||||
</a>`
|
||||
});
|
||||
|
||||
const LinkTrickplayAcceleration: FunctionComponent<IProps> = ({ className, title, href }: IProps) => {
|
||||
return (
|
||||
<div
|
||||
dangerouslySetInnerHTML={createLinkElement({
|
||||
className,
|
||||
title: globalize.translate(title),
|
||||
href
|
||||
})}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default LinkTrickplayAcceleration;
|
|
@ -391,8 +391,10 @@ export function setContentType(parent, contentType) {
|
|||
}
|
||||
|
||||
if (contentType !== 'tvshows' && contentType !== 'movies' && contentType !== 'homevideos' && contentType !== 'musicvideos' && contentType !== 'mixed') {
|
||||
parent.querySelector('.trickplaySettingsSection').classList.add('hide');
|
||||
parent.querySelector('.chapterSettingsSection').classList.add('hide');
|
||||
} else {
|
||||
parent.querySelector('.trickplaySettingsSection').classList.remove('hide');
|
||||
parent.querySelector('.chapterSettingsSection').classList.remove('hide');
|
||||
}
|
||||
|
||||
|
@ -517,6 +519,8 @@ export function getLibraryOptions(parent) {
|
|||
EnablePhotos: parent.querySelector('.chkEnablePhotos').checked,
|
||||
EnableRealtimeMonitor: parent.querySelector('.chkEnableRealtimeMonitor').checked,
|
||||
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,
|
||||
|
@ -580,6 +584,8 @@ export function setLibraryOptions(parent, options) {
|
|||
parent.querySelector('.chkEnablePhotos').checked = options.EnablePhotos;
|
||||
parent.querySelector('.chkEnableRealtimeMonitor').checked = options.EnableRealtimeMonitor;
|
||||
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;
|
||||
|
|
|
@ -112,6 +112,25 @@
|
|||
<div class="fieldDescription checkboxFieldDescription">${OptionAutomaticallyGroupSeriesHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="trickplaySettingsSection hide">
|
||||
<h2>${Trickplay}</h2>
|
||||
<div class="checkboxContainer checkboxContainer-withDescription fldExtractTrickplayImages">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkExtractTrickplayImages" />
|
||||
<span>${OptionExtractTrickplayImage}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${ExtractTrickplayImagesHelp}</div>
|
||||
</div>
|
||||
|
||||
<div class="checkboxContainer checkboxContainer-withDescription fldExtractTrickplayDuringLibraryScan advanced">
|
||||
<label>
|
||||
<input type="checkbox" is="emby-checkbox" class="chkExtractTrickplayDuringLibraryScan" />
|
||||
<span>${LabelExtractTrickplayDuringLibraryScan}</span>
|
||||
</label>
|
||||
<div class="fieldDescription checkboxFieldDescription">${LabelExtractTrickplayDuringLibraryScanHelp}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="chapterSettingsSection hide">
|
||||
<h2>${HeaderChapterImages}</h2>
|
||||
<div class="checkboxContainer checkboxContainer-withDescription fldExtractChapterImages">
|
||||
|
|
|
@ -125,7 +125,7 @@ function getItemsForPlayback(serverId, query) {
|
|||
} else {
|
||||
query.Limit = query.Limit || 300;
|
||||
}
|
||||
query.Fields = 'Chapters';
|
||||
query.Fields = ['Chapters', 'Trickplay'];
|
||||
query.ExcludeLocationTypes = 'Virtual';
|
||||
query.EnableTotalRecordCount = false;
|
||||
query.CollapseBoxSetItems = false;
|
||||
|
@ -1858,7 +1858,7 @@ class PlaybackManager {
|
|||
IsVirtualUnaired: false,
|
||||
IsMissing: false,
|
||||
UserId: apiClient.getCurrentUserId(),
|
||||
Fields: 'Chapters'
|
||||
Fields: ['Chapters', 'Trickplay']
|
||||
}).then(function (episodesResult) {
|
||||
const originalResults = episodesResult.Items;
|
||||
const isSeries = firstItem.Type === 'Series';
|
||||
|
@ -1940,7 +1940,7 @@ class PlaybackManager {
|
|||
IsVirtualUnaired: false,
|
||||
IsMissing: false,
|
||||
UserId: apiClient.getCurrentUserId(),
|
||||
Fields: 'Chapters'
|
||||
Fields: ['Chapters', 'Trickplay']
|
||||
}).then(function (episodesResult) {
|
||||
let foundItem = false;
|
||||
episodesResult.Items = episodesResult.Items.filter(function (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue