mirror of
https://github.com/immich-app/immich.git
synced 2025-01-27 22:22:45 +01:00
fix(web): download archive for public user (#10877)
This commit is contained in:
parent
3cd187dced
commit
23b3073687
2 changed files with 10 additions and 2 deletions
|
@ -51,6 +51,13 @@ test.describe('Shared Links', () => {
|
||||||
await page.getByText('DOWNLOADING', { exact: true }).waitFor();
|
await page.getByText('DOWNLOADING', { exact: true }).waitFor();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('download all from shared link', async ({ page }) => {
|
||||||
|
await page.goto(`/share/${sharedLink.key}`);
|
||||||
|
await page.getByRole('heading', { name: 'Test Album' }).waitFor();
|
||||||
|
await page.getByRole('button', { name: 'Download' }).click();
|
||||||
|
await page.getByText('DOWNLOADING', { exact: true }).waitFor();
|
||||||
|
});
|
||||||
|
|
||||||
test('enter password for a shared link', async ({ page }) => {
|
test('enter password for a shared link', async ({ page }) => {
|
||||||
await page.goto(`/share/${sharedLinkPassword.key}`);
|
await page.goto(`/share/${sharedLinkPassword.key}`);
|
||||||
await page.getByPlaceholder('Password').fill('test-password');
|
await page.getByPlaceholder('Password').fill('test-password');
|
||||||
|
|
|
@ -21,6 +21,7 @@ import {
|
||||||
type AssetResponseDto,
|
type AssetResponseDto,
|
||||||
type AssetTypeEnum,
|
type AssetTypeEnum,
|
||||||
type DownloadInfoDto,
|
type DownloadInfoDto,
|
||||||
|
type UserPreferencesResponseDto,
|
||||||
type UserResponseDto,
|
type UserResponseDto,
|
||||||
} from '@immich/sdk';
|
} from '@immich/sdk';
|
||||||
import { DateTime } from 'luxon';
|
import { DateTime } from 'luxon';
|
||||||
|
@ -100,8 +101,8 @@ export const downloadBlob = (data: Blob, filename: string) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const downloadArchive = async (fileName: string, options: Omit<DownloadInfoDto, 'archiveSize'>) => {
|
export const downloadArchive = async (fileName: string, options: Omit<DownloadInfoDto, 'archiveSize'>) => {
|
||||||
const $preferences = get(preferences);
|
const $preferences = get<UserPreferencesResponseDto | undefined>(preferences);
|
||||||
const dto = { ...options, archiveSize: $preferences.download.archiveSize };
|
const dto = { ...options, archiveSize: $preferences?.download.archiveSize };
|
||||||
|
|
||||||
const [error, downloadInfo] = await withError(() => getDownloadInfo({ downloadInfoDto: dto, key: getKey() }));
|
const [error, downloadInfo] = await withError(() => getDownloadInfo({ downloadInfoDto: dto, key: getKey() }));
|
||||||
if (error) {
|
if (error) {
|
||||||
|
|
Loading…
Reference in a new issue