feat(server): do not automatically download android motion videos (#11774)

feat(server): do not automatically download embedded android motion videos
This commit is contained in:
Jason Rasmussen 2024-08-15 16:06:16 -04:00 committed by GitHub
parent ed6971222c
commit 32c05ea950
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 151 additions and 28 deletions

View file

@ -14,13 +14,21 @@
SettingInputFieldType,
} from '$lib/components/shared-components/settings/setting-input-field.svelte';
import { ByteUnit, convertFromBytes, convertToBytes } from '$lib/utils/byte-units';
import SettingSwitch from '$lib/components/shared-components/settings/setting-switch.svelte';
let archiveSize = convertFromBytes($preferences?.download?.archiveSize || 4, ByteUnit.GiB);
let includeEmbeddedVideos = $preferences?.download?.includeEmbeddedVideos || false;
const handleSave = async () => {
try {
const dto = { download: { archiveSize: Math.floor(convertToBytes(archiveSize, ByteUnit.GiB)) } };
const newPreferences = await updateMyPreferences({ userPreferencesUpdateDto: dto });
const newPreferences = await updateMyPreferences({
userPreferencesUpdateDto: {
download: {
archiveSize: Math.floor(convertToBytes(archiveSize, ByteUnit.GiB)),
includeEmbeddedVideos,
},
},
});
$preferences = newPreferences;
notificationController.show({ message: $t('saved_settings'), type: NotificationType.Info });
@ -34,14 +42,17 @@
<div in:fade={{ duration: 500 }}>
<form autocomplete="off" on:submit|preventDefault>
<div class="ml-4 mt-4 flex flex-col gap-4">
<div class="ml-4">
<SettingInputField
inputType={SettingInputFieldType.NUMBER}
label={$t('archive_size')}
desc={$t('archive_size_description')}
bind:value={archiveSize}
/>
</div>
<SettingInputField
inputType={SettingInputFieldType.NUMBER}
label={$t('archive_size')}
desc={$t('archive_size_description')}
bind:value={archiveSize}
/>
<SettingSwitch
title={$t('download_include_embedded_motion_videos')}
subtitle={$t('download_include_embedded_motion_videos_description')}
bind:checked={includeEmbeddedVideos}
></SettingSwitch>
<div class="flex justify-end">
<Button type="submit" size="sm" on:click={() => handleSave()}>{$t('save')}</Button>
</div>