Skip to content

High performance self-hosted photo and video management solution.

fix(web): shared link return 404 (#3791)

Alexd7f52739e849
diff --git a/web/src/lib/components/asset-viewer/asset-viewer.svelte b/web/src/lib/components/asset-viewer/asset-viewer.svelte
index 8ac5cbd940..042c68f4e9 100644
--- a/web/src/lib/components/asset-viewer/asset-viewer.svelte
+++ b/web/src/lib/components/asset-viewer/asset-viewer.svelte
@@ -53,7 +53,9 @@
onMount(async () => {
document.addEventListener('keydown', onKeyboardPress);
- getAllAlbums();
+ if (!sharedLink) {
+ getAllAlbums();
+ }
// Import hack :( see https://github.com/vadimkorr/svelte-carousel/issues/27#issuecomment-851022295
// TODO: Move to regular import once the package correctly supports ESM.
@@ -67,7 +69,7 @@
}
});
- $: asset.id && getAllAlbums(); // Update the album information when the asset ID changes
+ $: asset.id && !sharedLink && getAllAlbums(); // Update the album information when the asset ID changes
const getAllAlbums = async () => {
try {
@@ -336,6 +338,7 @@
<DetailPanel
{asset}
albums={appearsInAlbums}
+ {sharedLink}
on:close={() => ($isShowDetail = false)}
on:close-viewer={handleCloseViewer}
on:description-focus-in={disableKeyDownEvent}
diff --git a/web/src/lib/components/asset-viewer/detail-panel.svelte b/web/src/lib/components/asset-viewer/detail-panel.svelte
index 2c77cd8af7..f4b9565e9d 100644
--- a/web/src/lib/components/asset-viewer/detail-panel.svelte
+++ b/web/src/lib/components/asset-viewer/detail-panel.svelte
@@ -9,19 +9,21 @@
import ImageOutline from 'svelte-material-icons/ImageOutline.svelte';
import MapMarkerOutline from 'svelte-material-icons/MapMarkerOutline.svelte';
import { createEventDispatcher } from 'svelte';
- import { AssetResponseDto, AlbumResponseDto, api, ThumbnailFormat } from '@api';
+ import { AssetResponseDto, AlbumResponseDto, api, ThumbnailFormat, SharedLinkResponseDto } from '@api';
import { asByteUnitString } from '../../utils/byte-units';
import ImageThumbnail from '../assets/thumbnail/image-thumbnail.svelte';
import { getAssetFilename } from '$lib/utils/asset-utils';
export let asset: AssetResponseDto;
export let albums: AlbumResponseDto[] = [];
+ export let sharedLink: SharedLinkResponseDto | undefined = undefined;
+
let textarea: HTMLTextAreaElement;
let description: string;
$: {
// Get latest description from server
- if (asset.id) {
+ if (asset.id && !sharedLink) {
api.assetApi.getAssetById({ id: asset.id }).then((res) => {
people = res.data?.people || [];
textarea.value = res.data?.exifInfo?.description || '';