mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 20:34:37 +03:00
Improve caching, HTTP headers and URL handling (#3594)
* Fix relative URLs * Improve login base URL and redirects * Prevent duplicate customlocales requests * Improve UI base URL handling * Improve UI embedding * Improve CSP header * Add Cache-Control headers to all responses * Improve CORS responses * Improve authentication handler * Add back media timestamp suffixes * Fix default image handling * Add default param to other image URLs
This commit is contained in:
@@ -97,12 +97,6 @@ export const SceneCard: React.FC<ISceneCardProps> = (
|
||||
[props.scene]
|
||||
);
|
||||
|
||||
// studio image is missing if it uses the default
|
||||
const missingStudioImage =
|
||||
props.scene.studio?.image_path?.endsWith("?default=true");
|
||||
const showStudioAsText =
|
||||
missingStudioImage || (configuration?.interface.showStudioAsText ?? false);
|
||||
|
||||
function maybeRenderSceneSpecsOverlay() {
|
||||
let sizeObj = null;
|
||||
if (file?.size) {
|
||||
@@ -146,21 +140,31 @@ export const SceneCard: React.FC<ISceneCardProps> = (
|
||||
);
|
||||
}
|
||||
|
||||
function renderStudioThumbnail() {
|
||||
const studioImage = props.scene.studio?.image_path;
|
||||
const studioName = props.scene.studio?.name;
|
||||
|
||||
if (configuration?.interface.showStudioAsText || !studioImage) {
|
||||
return studioName;
|
||||
}
|
||||
|
||||
const studioImageURL = new URL(studioImage);
|
||||
if (studioImageURL.searchParams.get("default") === "true") {
|
||||
return studioName;
|
||||
}
|
||||
|
||||
return (
|
||||
<img className="image-thumbnail" alt={studioName} src={studioImage} />
|
||||
);
|
||||
}
|
||||
|
||||
function maybeRenderSceneStudioOverlay() {
|
||||
if (!props.scene.studio) return;
|
||||
|
||||
return (
|
||||
<div className="scene-studio-overlay">
|
||||
<Link to={`/studios/${props.scene.studio.id}`}>
|
||||
{showStudioAsText ? (
|
||||
props.scene.studio.name
|
||||
) : (
|
||||
<img
|
||||
className="image-thumbnail"
|
||||
alt={props.scene.studio.name}
|
||||
src={props.scene.studio.image_path ?? ""}
|
||||
/>
|
||||
)}
|
||||
{renderStudioThumbnail()}
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user