mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
fix Clip Gif Support (#3765)
This commit is contained in:
@@ -25,6 +25,7 @@ import { ImageDetailPanel } from "./ImageDetailPanel";
|
|||||||
import { DeleteImagesDialog } from "../DeleteImagesDialog";
|
import { DeleteImagesDialog } from "../DeleteImagesDialog";
|
||||||
import { faEllipsisV } from "@fortawesome/free-solid-svg-icons";
|
import { faEllipsisV } from "@fortawesome/free-solid-svg-icons";
|
||||||
import { objectPath, objectTitle } from "src/core/files";
|
import { objectPath, objectTitle } from "src/core/files";
|
||||||
|
import { isVideo } from "src/utils/visualFile";
|
||||||
|
|
||||||
interface IImageParams {
|
interface IImageParams {
|
||||||
id?: string;
|
id?: string;
|
||||||
@@ -260,8 +261,7 @@ export const Image: React.FC = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const title = objectTitle(image);
|
const title = objectTitle(image);
|
||||||
const ImageView =
|
const ImageView = isVideo(image.visual_files[0]) ? "video" : "img";
|
||||||
image.visual_files[0].__typename == "VideoFile" ? "video" : "img";
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="row">
|
<div className="row">
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ import {
|
|||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { RatingSystem } from "src/components/Shared/Rating/RatingSystem";
|
import { RatingSystem } from "src/components/Shared/Rating/RatingSystem";
|
||||||
import { useDebounce } from "../debounce";
|
import { useDebounce } from "../debounce";
|
||||||
|
import { isVideo } from "src/utils/visualFile";
|
||||||
|
|
||||||
const CLASSNAME = "Lightbox";
|
const CLASSNAME = "Lightbox";
|
||||||
const CLASSNAME_HEADER = `${CLASSNAME}-header`;
|
const CLASSNAME_HEADER = `${CLASSNAME}-header`;
|
||||||
@@ -850,7 +851,7 @@ export const LightboxComponent: React.FC<IProps> = ({
|
|||||||
scrollAttemptsBeforeChange={scrollAttemptsBeforeChange}
|
scrollAttemptsBeforeChange={scrollAttemptsBeforeChange}
|
||||||
setZoom={(v) => setZoom(v)}
|
setZoom={(v) => setZoom(v)}
|
||||||
resetPosition={resetPosition}
|
resetPosition={resetPosition}
|
||||||
isVideo={image.visual_files?.[0]?.__typename == "VideoFile"}
|
isVideo={isVideo(image.visual_files?.[0] ?? {})}
|
||||||
/>
|
/>
|
||||||
) : undefined}
|
) : undefined}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ interface IFiles {
|
|||||||
__typename?: string;
|
__typename?: string;
|
||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
|
video_codec?: GQL.Maybe<string>;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface ILightboxImage {
|
export interface ILightboxImage {
|
||||||
|
|||||||
9
ui/v2.5/src/utils/visualFile.ts
Normal file
9
ui/v2.5/src/utils/visualFile.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
import { Maybe } from "src/core/generated-graphql";
|
||||||
|
|
||||||
|
// returns true if the file should be treated as a video in the UI
|
||||||
|
export function isVideo(o: {
|
||||||
|
__typename?: string;
|
||||||
|
video_codec?: Maybe<string>;
|
||||||
|
}) {
|
||||||
|
return o.__typename == "VideoFile" && o.video_codec != "gif";
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user