Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions web/src/lib/components/assets/thumbnail/thumbnail.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
imageClass?: ClassValue;
brokenAssetClass?: ClassValue;
dimmed?: boolean;
ownerName?: string;
onClick?: (asset: TimelineAsset) => void;
onSelect?: (asset: TimelineAsset) => void;
onMouseEvent?: (event: { isMouseOver: boolean; selectedGroupIndex: number }) => void;
Expand All @@ -69,6 +70,7 @@
imageClass = '',
brokenAssetClass = '',
dimmed = false,
ownerName = undefined,
}: Props = $props();

let {
Expand Down Expand Up @@ -260,6 +262,15 @@
<div id="a" class={['absolute h-full w-full bg-gray-700/40', { 'rounded-xl': selected }]}></div>
{/if}

<!-- Asset owner name -->
{#if !authManager.isSharedLink && ownerName}
<div class="absolute bottom-2 end-2 max-w-[50%]">
<p class="text-xs font-medium text-white drop-shadow-lg max-w-[100%] truncate">
{ownerName}
</p>
</div>
{/if}

<!-- Favorite asset star -->
{#if !authManager.isSharedLink && asset.isFavorite}
<div class="absolute bottom-2 start-2">
Expand Down
1 change: 1 addition & 0 deletions web/src/lib/components/timeline/Timeline.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,7 @@
{isSelectionMode}
{singleSelect}
{monthGroup}
{album}
onSelect={({ title, assets }) => handleGroupSelect(timelineManager, title, assets)}
onSelectAssetCandidates={handleSelectAssetCandidates}
onSelectAssets={handleSelectAssets}
Expand Down
14 changes: 14 additions & 0 deletions web/src/lib/components/timeline/TimelineDateGroup.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import { mdiCheckCircle, mdiCircleOutline } from '@mdi/js';

import { fromTimelinePlainDate, getDateLocaleString } from '$lib/utils/timeline-util';
import type { AlbumResponseDto } from '@immich/sdk';
import { Icon } from '@immich/ui';
import { type Snippet } from 'svelte';
import { flip } from 'svelte/animate';
Expand All @@ -29,6 +30,7 @@
timelineManager: TimelineManager;
assetInteraction: AssetInteraction;
customLayout?: Snippet<[TimelineAsset]>;
album?: AlbumResponseDto | null;

onSelect: ({ title, assets }: { title: string; assets: TimelineAsset[] }) => void;
onSelectAssets: (asset: TimelineAsset) => void;
Expand All @@ -55,6 +57,7 @@
assetInteraction,
timelineManager,
customLayout,
album = null,
onSelect,
onSelectAssets,
onSelectAssetCandidates,
Expand Down Expand Up @@ -133,6 +136,16 @@
});
return getDateLocaleString(date);
};

const getSharedAssetOwnerName = (album: AlbumResponseDto | null, asset: TimelineAsset): string | undefined => {
if (!album || !album.albumUsers || album.albumUsers.length === 0) {
return undefined;
}
if (album.owner.id === asset.ownerId) {
return album.owner.name;
}
return album.albumUsers.find((user) => user.user.id === asset.ownerId)?.user.name;
};
</script>

{#each filterIntersecting(monthGroup.dayGroups) as dayGroup, groupIndex (dayGroup.day)}
Expand Down Expand Up @@ -210,6 +223,7 @@
{showArchiveIcon}
{asset}
{groupIndex}
ownerName={getSharedAssetOwnerName(album, asset)}
onClick={(asset) => {
if (typeof onThumbnailClick === 'function') {
onThumbnailClick(asset, timelineManager, dayGroup, _onClick);
Expand Down