mirror of
https://github.com/immich-app/immich.git
synced 2025-12-16 01:10:57 +03:00
Compare commits
3 Commits
chore/log-
...
fix-shared
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3582e00ceb | ||
|
|
e2ec79dbf0 | ||
|
|
33cdea88aa |
@@ -17,8 +17,10 @@ class PersonApiRepository extends ApiRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<PersonDto> update(String id, {String? name, DateTime? birthday}) async {
|
Future<PersonDto> update(String id, {String? name, DateTime? birthday}) async {
|
||||||
final dto = await checkNull(_api.updatePerson(id, PersonUpdateDto(name: name, birthDate: birthday)));
|
final birthdayUtc = birthday == null ? null : DateTime.utc(birthday.year, birthday.month, birthday.day);
|
||||||
return _toPerson(dto);
|
final dto = PersonUpdateDto(name: name, birthDate: birthdayUtc);
|
||||||
|
final response = await checkNull(_api.updatePerson(id, dto));
|
||||||
|
return _toPerson(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
static PersonDto _toPerson(PersonResponseDto dto) => PersonDto(
|
static PersonDto _toPerson(PersonResponseDto dto) => PersonDto(
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import { getSharedLinkActions } from '$lib/services/shared-link.service';
|
import { getSharedLinkActions } from '$lib/services/shared-link.service';
|
||||||
import { locale } from '$lib/stores/preferences.store';
|
import { locale } from '$lib/stores/preferences.store';
|
||||||
import { SharedLinkType, type SharedLinkResponseDto } from '@immich/sdk';
|
import { SharedLinkType, type SharedLinkResponseDto } from '@immich/sdk';
|
||||||
import { Badge, ContextMenuButton, MenuItemType, Text } from '@immich/ui';
|
import { ContextMenuButton, MenuItemType, Text } from '@immich/ui';
|
||||||
import { DateTime, type ToRelativeUnit } from 'luxon';
|
import { DateTime, type ToRelativeUnit } from 'luxon';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
|
|
||||||
@@ -44,50 +44,64 @@
|
|||||||
>
|
>
|
||||||
<ShareCover class="transition-all duration-300 hover:shadow-lg" {sharedLink} />
|
<ShareCover class="transition-all duration-300 hover:shadow-lg" {sharedLink} />
|
||||||
|
|
||||||
<div class="flex flex-col gap-2">
|
<div class="flex flex-col gap-4 justify-between">
|
||||||
<Text size="large" color="primary" class="flex place-items-center gap-2 break-all">
|
<div class="flex flex-col">
|
||||||
{#if sharedLink.type === SharedLinkType.Album}
|
<Text size="tiny" color={isExpired ? 'danger' : 'muted'} class="font-medium">
|
||||||
{sharedLink.album?.albumName}
|
{#if isExpired}
|
||||||
{:else if sharedLink.type === SharedLinkType.Individual}
|
{$t('expired')}
|
||||||
{$t('individual_share')}
|
{:else if expiresAt}
|
||||||
{/if}
|
|
||||||
</Text>
|
|
||||||
|
|
||||||
<div class="flex flex-wrap gap-1">
|
|
||||||
{#if isExpired}
|
|
||||||
<Badge size="small" color="danger">{$t('expired')}</Badge>
|
|
||||||
{:else if expiresAt}
|
|
||||||
<Badge size="small" color="secondary">
|
|
||||||
{$t('expires_date', { values: { date: getCountDownExpirationDate(expiresAt, now) } })}
|
{$t('expires_date', { values: { date: getCountDownExpirationDate(expiresAt, now) } })}
|
||||||
</Badge>
|
{:else}
|
||||||
{:else}
|
{$t('expires_date', { values: { date: '∞' } })}
|
||||||
<Badge size="small" color="secondary">{$t('expires_date', { values: { date: '∞' } })}</Badge>
|
{/if}
|
||||||
{/if}
|
</Text>
|
||||||
|
|
||||||
{#if sharedLink.slug}
|
<Text size="large" color="primary" class="flex place-items-center gap-2 break-all font-medium">
|
||||||
<Badge size="small" color="secondary">{$t('custom_url')}</Badge>
|
{#if sharedLink.type === SharedLinkType.Album}
|
||||||
{/if}
|
{sharedLink.album?.albumName}
|
||||||
|
{:else if sharedLink.type === SharedLinkType.Individual}
|
||||||
|
{$t('individual_share')}
|
||||||
|
{/if}
|
||||||
|
</Text>
|
||||||
|
|
||||||
{#if sharedLink.allowUpload}
|
{#if sharedLink.description}
|
||||||
<Badge size="small" color="secondary">{$t('upload')}</Badge>
|
<Text size="small" class="line-clamp-1">{sharedLink.description}</Text>
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if sharedLink.showMetadata && sharedLink.allowDownload}
|
|
||||||
<Badge size="small" color="secondary">{$t('download')}</Badge>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if sharedLink.showMetadata}
|
|
||||||
<Badge size="small" color="secondary">{$t('exif')}</Badge>
|
|
||||||
{/if}
|
|
||||||
|
|
||||||
{#if sharedLink.password}
|
|
||||||
<Badge size="small" color="secondary">{$t('password')}</Badge>
|
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{#if sharedLink.description}
|
<div class="flex flex-wrap items-center gap-2">
|
||||||
<Text size="small" class="line-clamp-1">{sharedLink.description}</Text>
|
<Text
|
||||||
{/if}
|
size="small"
|
||||||
|
color={sharedLink.allowUpload ? 'primary' : 'muted'}
|
||||||
|
class={sharedLink.allowUpload ? 'font-medium' : 'opacity-50'}
|
||||||
|
>
|
||||||
|
{$t('upload')}
|
||||||
|
</Text>
|
||||||
|
<Text size="small" color="muted">•</Text>
|
||||||
|
<Text
|
||||||
|
size="small"
|
||||||
|
color={sharedLink.allowDownload ? 'primary' : 'muted'}
|
||||||
|
class={sharedLink.allowDownload ? 'font-medium' : 'opacity-50'}
|
||||||
|
>
|
||||||
|
{$t('download')}
|
||||||
|
</Text>
|
||||||
|
<Text size="small" color="muted">•</Text>
|
||||||
|
<Text
|
||||||
|
size="small"
|
||||||
|
color={sharedLink.showMetadata ? 'primary' : 'muted'}
|
||||||
|
class={sharedLink.showMetadata ? 'font-medium' : 'opacity-50'}
|
||||||
|
>
|
||||||
|
{$t('exif')}
|
||||||
|
</Text>
|
||||||
|
<Text size="small" color="muted">•</Text>
|
||||||
|
<Text
|
||||||
|
size="small"
|
||||||
|
color={sharedLink.password ? 'primary' : 'muted'}
|
||||||
|
class={sharedLink.password ? 'font-medium' : 'opacity-50'}
|
||||||
|
>
|
||||||
|
{$t('password')}
|
||||||
|
</Text>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</svelte:element>
|
</svelte:element>
|
||||||
<div class="flex flex-auto flex-col place-content-center place-items-end text-end ms-4">
|
<div class="flex flex-auto flex-col place-content-center place-items-end text-end ms-4">
|
||||||
@@ -3,7 +3,7 @@
|
|||||||
import { page } from '$app/state';
|
import { page } from '$app/state';
|
||||||
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
import UserPageLayout from '$lib/components/layouts/user-page-layout.svelte';
|
||||||
import OnEvents from '$lib/components/OnEvents.svelte';
|
import OnEvents from '$lib/components/OnEvents.svelte';
|
||||||
import SharedLinkCard from '$lib/components/sharedlinks-page/shared-link-card.svelte';
|
import SharedLinkCard from '$lib/components/sharedlinks-page/SharedLinkCard.svelte';
|
||||||
import { AppRoute } from '$lib/constants';
|
import { AppRoute } from '$lib/constants';
|
||||||
import GroupTab from '$lib/elements/GroupTab.svelte';
|
import GroupTab from '$lib/elements/GroupTab.svelte';
|
||||||
import SharedLinkUpdateModal from '$lib/modals/SharedLinkUpdateModal.svelte';
|
import SharedLinkUpdateModal from '$lib/modals/SharedLinkUpdateModal.svelte';
|
||||||
|
|||||||
Reference in New Issue
Block a user