Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove generate preview options from tasks page #2342

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion ui/v2.5/src/components/Settings/Inputs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ export const ChangeButtonSetting = <T extends {}>(props: IDialogSetting<T>) => {
id,
className,
headingID,
tooltipID,
subHeadingID,
subHeading,
value,
Expand All @@ -203,12 +204,15 @@ export const ChangeButtonSetting = <T extends {}>(props: IDialogSetting<T>) => {
} = props;
const intl = useIntl();

const tooltip = tooltipID ? intl.formatMessage({ id: tooltipID }) : undefined;
const disabledClassName = disabled ? "disabled" : "";

return (
<div className={`setting ${className ?? ""} ${disabledClassName}`} id={id}>
<div>
<h3>{headingID ? intl.formatMessage({ id: headingID }) : undefined}</h3>
<h3 title={tooltip}>
{headingID ? intl.formatMessage({ id: headingID }) : undefined}
</h3>

<div className="value">
{renderValue ? renderValue(value) : undefined}
Expand Down Expand Up @@ -320,6 +324,7 @@ export const ModalSetting = <T extends {}>(props: IModalSetting<T>) => {
onChange,
renderField,
renderValue,
tooltipID,
buttonText,
buttonTextID,
modalProps,
Expand Down Expand Up @@ -351,6 +356,7 @@ export const ModalSetting = <T extends {}>(props: IModalSetting<T>) => {
buttonText={buttonText}
buttonTextID={buttonTextID}
headingID={headingID}
tooltipID={tooltipID}
subHeadingID={subHeadingID}
subHeading={subHeading}
value={value}
Expand Down
47 changes: 23 additions & 24 deletions ui/v2.5/src/components/Settings/Tasks/GenerateOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import {
VideoPreviewInput,
VideoPreviewSettingsInput,
} from "../GeneratePreviewOptions";
import { useIntl } from "react-intl";

interface IGenerateOptions {
selection?: boolean;
Expand All @@ -18,8 +17,6 @@ export const GenerateOptions: React.FC<IGenerateOptions> = ({
options,
setOptions: setOptionsState,
}) => {
const intl = useIntl();

const previewOptions: GQL.GeneratePreviewOptionsInput =
options.previewOptions ?? {};

Expand All @@ -46,27 +43,29 @@ export const GenerateOptions: React.FC<IGenerateOptions> = ({
onChange={(v) => setOptions({ imagePreviews: v })}
/>

<ModalSetting<VideoPreviewSettingsInput>
id="video-preview-settings"
className="sub-setting"
disabled={!options.previews}
buttonText={`${intl.formatMessage({
id: "dialogs.scene_gen.preview_generation_options",
})}…`}
value={{
previewExcludeEnd: previewOptions.previewExcludeEnd,
previewExcludeStart: previewOptions.previewExcludeStart,
previewSegmentDuration: previewOptions.previewSegmentDuration,
previewSegments: previewOptions.previewSegments,
}}
onChange={(v) => setOptions({ previewOptions: v })}
renderField={(value, setValue) => (
<VideoPreviewInput value={value ?? {}} setValue={setValue} />
)}
renderValue={() => {
return <></>;
}}
/>
{/* #2251 - only allow preview generation options to be overridden when generating from a selection */}
{selection ? (
<ModalSetting<VideoPreviewSettingsInput>
id="video-preview-settings"
className="sub-setting"
disabled={!options.previews}
headingID="dialogs.scene_gen.override_preview_generation_options"
tooltipID="dialogs.scene_gen.override_preview_generation_options_desc"
value={{
previewExcludeEnd: previewOptions.previewExcludeEnd,
previewExcludeStart: previewOptions.previewExcludeStart,
previewSegmentDuration: previewOptions.previewSegmentDuration,
previewSegments: previewOptions.previewSegments,
}}
onChange={(v) => setOptions({ previewOptions: v })}
renderField={(value, setValue) => (
<VideoPreviewInput value={value ?? {}} setValue={setValue} />
)}
renderValue={() => {
return <></>;
}}
/>
) : undefined}

<BooleanSetting
id="sprite-task"
Expand Down
2 changes: 2 additions & 0 deletions ui/v2.5/src/locales/en-GB.json
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,8 @@
"marker_screenshots_tooltip": "Marker static JPG images, only required if Preview Type is set to Static Image.",
"markers": "Marker Previews",
"markers_tooltip": "20 second videos which begin at the given timecode.",
"override_preview_generation_options": "Override Preview Generation Options",
"override_preview_generation_options_desc": "Override Preview Generation Options for this operation. Defaults are set in System -> Preview Generation.",
"overwrite": "Overwrite existing generated files",
"phash": "Perceptual hashes (for deduplication)",
"preview_exclude_end_time_desc": "Exclude the last x seconds from scene previews. This can be a value in seconds, or a percentage (eg 2%) of the total scene duration.",
Expand Down