mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
feat: shared links custom URL (#19999)
* feat: custom url for shared links * feat: use a separate route and query param --------- Co-authored-by: Jason Rasmussen <jason@rasm.me>
This commit is contained in:
parent
16b14b390f
commit
9b3718120b
65 changed files with 947 additions and 432 deletions
|
|
@ -6,7 +6,8 @@ import { isSharedLinkRoute } from '$lib/utils/navigation';
|
|||
import { logout } from '@immich/sdk';
|
||||
|
||||
class AuthManager {
|
||||
key = $derived(isSharedLinkRoute(page.route?.id) ? page.params.key : undefined);
|
||||
isSharedLink = $derived(isSharedLinkRoute(page.route?.id));
|
||||
params = $derived(this.isSharedLink ? { key: page.params.key, slug: page.params.slug } : {});
|
||||
|
||||
async logout() {
|
||||
let redirectUri;
|
||||
|
|
|
|||
|
|
@ -18,12 +18,11 @@ export async function loadFromTimeBuckets(
|
|||
}
|
||||
|
||||
const timeBucket = toISOYearMonthUTC(monthGroup.yearMonth);
|
||||
const key = authManager.key;
|
||||
const bucketResponse = await getTimeBucket(
|
||||
{
|
||||
...authManager.params,
|
||||
...options,
|
||||
timeBucket,
|
||||
key,
|
||||
},
|
||||
{ signal },
|
||||
);
|
||||
|
|
@ -35,9 +34,9 @@ export async function loadFromTimeBuckets(
|
|||
if (options.timelineAlbumId) {
|
||||
const albumAssets = await getTimeBucket(
|
||||
{
|
||||
...authManager.params,
|
||||
albumId: options.timelineAlbumId,
|
||||
timeBucket,
|
||||
key,
|
||||
},
|
||||
{ signal },
|
||||
);
|
||||
|
|
|
|||
|
|
@ -288,8 +288,8 @@ export class TimelineManager {
|
|||
|
||||
async #initializeMonthGroups() {
|
||||
const timebuckets = await getTimeBuckets({
|
||||
...authManager.params,
|
||||
...this.#options,
|
||||
key: authManager.key,
|
||||
});
|
||||
|
||||
this.months = timebuckets.map((timeBucket) => {
|
||||
|
|
@ -423,7 +423,7 @@ export class TimelineManager {
|
|||
if (monthGroup) {
|
||||
return monthGroup;
|
||||
}
|
||||
const asset = toTimelineAsset(await getAssetInfo({ id, key: authManager.key }));
|
||||
const asset = toTimelineAsset(await getAssetInfo({ ...authManager.params, id }));
|
||||
if (!asset || this.isExcluded(asset)) {
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue