#254 #257 add config option to allow single image downloads but deny zip downloads

Co-authored-by: Tim Orme <TimothyOrme@gmail.com>
This commit is contained in:
Alan Grainger
2026-07-24 10:27:46 +12:00
parent 862ff269b7
commit af1a7d64c3
4 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -140,7 +140,7 @@ export async function gallery (res: Response, share: SharedLink, openItem?: numb
description: getConfigOption('ipp.gallery.showDescription', false) ? description(share) : '',
publicBaseUrl: toString(publicBaseUrl),
path: '/share/' + share.key,
showDownload: downloadAllowed,
showDownloadZip: downloadAllowed && !!getConfigOption('ipp.gallery.showDownloadZip', true),
showTitle: !!getConfigOption('ipp.gallery.showTitle', true),
expiryDate: expiryDate(share),
openItem,
+4 -4
View File
@@ -11,7 +11,7 @@ export interface GalleryProps {
description: string
publicBaseUrl: string
path: string
showDownload: boolean
showDownloadZip: boolean
showTitle: boolean
// Formatted "available until" date shown in the subtitle, or undefined when
// ipp.gallery.showExpiryDate is off or the share never expires.
@@ -69,7 +69,7 @@ export function Gallery (props: GalleryProps) {
<link type="text/css" rel="stylesheet" href={`/share/static/${ASSET_VERSION}/photoswipe-overrides.css`}/>
</head>
<body>
{(showHeaderText || props.showDownload) && (
{(showHeaderText || props.showDownloadZip) && (
<header id="header">
{showHeaderText && (
<div class="header-text">
@@ -83,7 +83,7 @@ export function Gallery (props: GalleryProps) {
</p>
</div>
)}
{props.showDownload && (
{props.showDownloadZip && (
<a id="download-all" href={props.path + '/download'} title="Download all" aria-label="Download all">
<svg viewBox="0 0 24 24" aria-hidden="true">
<path fill="currentColor" d="M5,20H19V18H5M19,9H15V3H9V9H5L12,16L19,9Z"/>
@@ -98,7 +98,7 @@ export function Gallery (props: GalleryProps) {
{/* Container is intentionally empty - web.js's virtualisation manager
populates it with only the tiles within the viewport buffer. */}
<div id="gallery"></div>
{props.showDownload && (
{props.showDownloadZip && (
<div id="select-toolbar" hidden>
<button id="select-cancel" class="toolbar-btn" type="button" aria-label="Exit selection mode">
<svg viewBox="0 0 24 24" aria-hidden="true">