mirror of
https://github.com/stashapp/stash.git
synced 2026-02-08 08:21:32 +01:00
modded-2 with setting
This commit is contained in:
parent
24389590b9
commit
6cdb4c6e3b
6 changed files with 28 additions and 14 deletions
|
|
@ -413,6 +413,9 @@ input ConfigInterfaceInput {
|
|||
noBrowser: Boolean
|
||||
"True if we should send notifications to the desktop"
|
||||
notificationsEnabled: Boolean
|
||||
|
||||
"True if 'Open Org File' in scene details is shown"
|
||||
showOpenExternal: Boolean
|
||||
}
|
||||
|
||||
type ConfigDisableDropdownCreate {
|
||||
|
|
@ -483,6 +486,9 @@ type ConfigInterfaceResult {
|
|||
funscriptOffset: Int
|
||||
"Whether to use Stash Hosted Funscript"
|
||||
useStashHostedFunscript: Boolean
|
||||
|
||||
"Show 'Open Org File' in scene details"
|
||||
showOpenExternal: Boolean
|
||||
}
|
||||
|
||||
input ConfigDLNAInput {
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ fragment ConfigGeneralData on ConfigGeneralResult {
|
|||
liveTranscodeInputArgs
|
||||
liveTranscodeOutputArgs
|
||||
drawFunscriptHeatmapRange
|
||||
|
||||
|
||||
scraperPackageSources {
|
||||
name
|
||||
url
|
||||
|
|
@ -112,6 +112,7 @@ fragment ConfigInterfaceData on ConfigInterfaceResult {
|
|||
handyKey
|
||||
funscriptOffset
|
||||
useStashHostedFunscript
|
||||
showOpenExternal
|
||||
}
|
||||
|
||||
fragment ConfigDLNAData on ConfigDLNAResult {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import { useIntl } from "react-intl";
|
|||
import { Icon } from "src/components/Shared/Icon";
|
||||
import { objectTitle } from "src/core/files";
|
||||
import { SceneDataFragment } from "src/core/generated-graphql";
|
||||
import { useConfigurationContext } from "src/hooks/Config";
|
||||
|
||||
export interface IExternalPlayerButtonProps {
|
||||
scene: SceneDataFragment;
|
||||
|
|
@ -16,18 +17,17 @@ export const ExternalPlayerButton: React.FC<IExternalPlayerButtonProps> = ({
|
|||
const isAndroid = /(android)/i.test(navigator.userAgent);
|
||||
const isAppleDevice = /(ipod|iphone|ipad)/i.test(navigator.userAgent);
|
||||
const intl = useIntl();
|
||||
|
||||
const { configuration } = useConfigurationContext();
|
||||
const interfaceConfig = configuration?.interface;
|
||||
const uiConfig = configuration?.ui;
|
||||
const showOpenExternal = uiConfig?.showOpenExternal??true;
|
||||
const { paths } = scene;
|
||||
|
||||
// Added by Philip
|
||||
const alwaysShow = true;
|
||||
const { files } = scene;
|
||||
const { path } = files[0];
|
||||
const pathStr = path??'';
|
||||
const fileName = pathStr.split('/').pop()?.split('\\').pop()??'';
|
||||
// Added ends.
|
||||
|
||||
if (!paths || !paths.stream || (!isAndroid && !isAppleDevice && !alwaysShow)) // Modded by Philip
|
||||
const fileName = path.split('/').pop()?.split('\\').pop()??'';
|
||||
|
||||
if (!paths || !paths.stream || (!isAndroid && !isAppleDevice && !showOpenExternal))
|
||||
return <span />;
|
||||
|
||||
const { stream } = paths;
|
||||
|
|
@ -55,10 +55,9 @@ export const ExternalPlayerButton: React.FC<IExternalPlayerButtonProps> = ({
|
|||
url = streamURL
|
||||
.toString()
|
||||
.replace(new RegExp(`^${streamURL.protocol}`), "vlc-x-callback:");
|
||||
} else if (alwaysShow) { // Added by Philip
|
||||
} else if (showOpenExternal) { // Added by Philip
|
||||
url = stream + "/org/" + encodeURIComponent(fileName); // like http://192.168.1.10:9999/scene/123/stream/org/file.mp4
|
||||
}
|
||||
// Added ends.
|
||||
|
||||
return (
|
||||
<Button
|
||||
|
|
@ -66,9 +65,9 @@ export const ExternalPlayerButton: React.FC<IExternalPlayerButtonProps> = ({
|
|||
variant="secondary"
|
||||
title={intl.formatMessage({ id: "actions.open_in_external_player" })}
|
||||
>
|
||||
<a href={url}>Open Ext.
|
||||
<a href={url}>
|
||||
<Icon icon={faExternalLinkAlt} color="white" />
|
||||
</a>
|
||||
</a>
|
||||
</Button>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -462,13 +462,18 @@ export const SettingsInterfacePanel: React.FC = PatchComponent(
|
|||
return <span>{TextUtils.secondsToTimestamp(v ?? 0)}</span>;
|
||||
}}
|
||||
/>
|
||||
|
||||
<BooleanSetting
|
||||
id="show-ab-loop"
|
||||
headingID="config.ui.scene_player.options.show_ab_loop_controls"
|
||||
checked={ui.showAbLoopControls ?? undefined}
|
||||
onChange={(v) => saveUI({ showAbLoopControls: v })}
|
||||
/>
|
||||
<BooleanSetting
|
||||
id="show-open-external"
|
||||
headingID="config.ui.scene_player.options.show_open_external"
|
||||
checked={ui.showOpenExternal ?? true}
|
||||
onChange={(v) => saveUI({ showOpenExternal: v })}
|
||||
/>
|
||||
</SettingSection>
|
||||
<SettingSection headingID="config.ui.tag_panel.heading">
|
||||
<BooleanSetting
|
||||
|
|
|
|||
|
|
@ -83,6 +83,8 @@ export interface IUIConfig {
|
|||
|
||||
showAbLoopControls?: boolean;
|
||||
|
||||
showOpenExternal?: boolean;
|
||||
|
||||
// maximum number of items to shown in the dropdown list - defaults to 200
|
||||
// upper limit of 1000
|
||||
maxOptionsShown?: number;
|
||||
|
|
|
|||
|
|
@ -782,6 +782,7 @@
|
|||
"disable_mobile_media_auto_rotate": "Disable auto-rotate of fullscreen media on Mobile",
|
||||
"enable_chromecast": "Enable Chromecast",
|
||||
"show_ab_loop_controls": "Show AB Loop plugin controls",
|
||||
"show_open_original": "Show Open Original button in scene details",
|
||||
"show_scrubber": "Show Scrubber",
|
||||
"show_range_markers": "Show Range Markers",
|
||||
"track_activity": "Enable Scene Play history",
|
||||
|
|
|
|||
Loading…
Reference in a new issue