mirror of
https://github.com/immich-app/immich.git
synced 2025-12-22 09:15:34 +03:00
Compare commits
1 Commits
fix/ios-ha
...
feat/faste
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
42e1e0c66a |
1
mobile/openapi/README.md
generated
1
mobile/openapi/README.md
generated
@@ -297,6 +297,7 @@ Class | Method | HTTP request | Description
|
|||||||
- [APIKeyCreateResponseDto](doc//APIKeyCreateResponseDto.md)
|
- [APIKeyCreateResponseDto](doc//APIKeyCreateResponseDto.md)
|
||||||
- [APIKeyResponseDto](doc//APIKeyResponseDto.md)
|
- [APIKeyResponseDto](doc//APIKeyResponseDto.md)
|
||||||
- [APIKeyUpdateDto](doc//APIKeyUpdateDto.md)
|
- [APIKeyUpdateDto](doc//APIKeyUpdateDto.md)
|
||||||
|
- [AccessHint](doc//AccessHint.md)
|
||||||
- [ActivityCreateDto](doc//ActivityCreateDto.md)
|
- [ActivityCreateDto](doc//ActivityCreateDto.md)
|
||||||
- [ActivityResponseDto](doc//ActivityResponseDto.md)
|
- [ActivityResponseDto](doc//ActivityResponseDto.md)
|
||||||
- [ActivityStatisticsResponseDto](doc//ActivityStatisticsResponseDto.md)
|
- [ActivityStatisticsResponseDto](doc//ActivityStatisticsResponseDto.md)
|
||||||
|
|||||||
1
mobile/openapi/lib/api.dart
generated
1
mobile/openapi/lib/api.dart
generated
@@ -68,6 +68,7 @@ part 'model/api_key_create_dto.dart';
|
|||||||
part 'model/api_key_create_response_dto.dart';
|
part 'model/api_key_create_response_dto.dart';
|
||||||
part 'model/api_key_response_dto.dart';
|
part 'model/api_key_response_dto.dart';
|
||||||
part 'model/api_key_update_dto.dart';
|
part 'model/api_key_update_dto.dart';
|
||||||
|
part 'model/access_hint.dart';
|
||||||
part 'model/activity_create_dto.dart';
|
part 'model/activity_create_dto.dart';
|
||||||
part 'model/activity_response_dto.dart';
|
part 'model/activity_response_dto.dart';
|
||||||
part 'model/activity_statistics_response_dto.dart';
|
part 'model/activity_statistics_response_dto.dart';
|
||||||
|
|||||||
13
mobile/openapi/lib/api/assets_api.dart
generated
13
mobile/openapi/lib/api/assets_api.dart
generated
@@ -1247,12 +1247,14 @@ class AssetsApi {
|
|||||||
///
|
///
|
||||||
/// * [String] id (required):
|
/// * [String] id (required):
|
||||||
///
|
///
|
||||||
|
/// * [AccessHint] hint:
|
||||||
|
///
|
||||||
/// * [String] key:
|
/// * [String] key:
|
||||||
///
|
///
|
||||||
/// * [AssetMediaSize] size:
|
/// * [AssetMediaSize] size:
|
||||||
///
|
///
|
||||||
/// * [String] slug:
|
/// * [String] slug:
|
||||||
Future<Response> viewAssetWithHttpInfo(String id, { String? key, AssetMediaSize? size, String? slug, }) async {
|
Future<Response> viewAssetWithHttpInfo(String id, { AccessHint? hint, String? key, AssetMediaSize? size, String? slug, }) async {
|
||||||
// ignore: prefer_const_declarations
|
// ignore: prefer_const_declarations
|
||||||
final apiPath = r'/assets/{id}/thumbnail'
|
final apiPath = r'/assets/{id}/thumbnail'
|
||||||
.replaceAll('{id}', id);
|
.replaceAll('{id}', id);
|
||||||
@@ -1264,6 +1266,9 @@ class AssetsApi {
|
|||||||
final headerParams = <String, String>{};
|
final headerParams = <String, String>{};
|
||||||
final formParams = <String, String>{};
|
final formParams = <String, String>{};
|
||||||
|
|
||||||
|
if (hint != null) {
|
||||||
|
queryParams.addAll(_queryParams('', 'hint', hint));
|
||||||
|
}
|
||||||
if (key != null) {
|
if (key != null) {
|
||||||
queryParams.addAll(_queryParams('', 'key', key));
|
queryParams.addAll(_queryParams('', 'key', key));
|
||||||
}
|
}
|
||||||
@@ -1294,13 +1299,15 @@ class AssetsApi {
|
|||||||
///
|
///
|
||||||
/// * [String] id (required):
|
/// * [String] id (required):
|
||||||
///
|
///
|
||||||
|
/// * [AccessHint] hint:
|
||||||
|
///
|
||||||
/// * [String] key:
|
/// * [String] key:
|
||||||
///
|
///
|
||||||
/// * [AssetMediaSize] size:
|
/// * [AssetMediaSize] size:
|
||||||
///
|
///
|
||||||
/// * [String] slug:
|
/// * [String] slug:
|
||||||
Future<MultipartFile?> viewAsset(String id, { String? key, AssetMediaSize? size, String? slug, }) async {
|
Future<MultipartFile?> viewAsset(String id, { AccessHint? hint, String? key, AssetMediaSize? size, String? slug, }) async {
|
||||||
final response = await viewAssetWithHttpInfo(id, key: key, size: size, slug: slug, );
|
final response = await viewAssetWithHttpInfo(id, hint: hint, key: key, size: size, slug: slug, );
|
||||||
if (response.statusCode >= HttpStatus.badRequest) {
|
if (response.statusCode >= HttpStatus.badRequest) {
|
||||||
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
|
||||||
}
|
}
|
||||||
|
|||||||
2
mobile/openapi/lib/api_client.dart
generated
2
mobile/openapi/lib/api_client.dart
generated
@@ -190,6 +190,8 @@ class ApiClient {
|
|||||||
return APIKeyResponseDto.fromJson(value);
|
return APIKeyResponseDto.fromJson(value);
|
||||||
case 'APIKeyUpdateDto':
|
case 'APIKeyUpdateDto':
|
||||||
return APIKeyUpdateDto.fromJson(value);
|
return APIKeyUpdateDto.fromJson(value);
|
||||||
|
case 'AccessHint':
|
||||||
|
return AccessHintTypeTransformer().decode(value);
|
||||||
case 'ActivityCreateDto':
|
case 'ActivityCreateDto':
|
||||||
return ActivityCreateDto.fromJson(value);
|
return ActivityCreateDto.fromJson(value);
|
||||||
case 'ActivityResponseDto':
|
case 'ActivityResponseDto':
|
||||||
|
|||||||
3
mobile/openapi/lib/api_helper.dart
generated
3
mobile/openapi/lib/api_helper.dart
generated
@@ -55,6 +55,9 @@ String parameterToString(dynamic value) {
|
|||||||
if (value is DateTime) {
|
if (value is DateTime) {
|
||||||
return value.toUtc().toIso8601String();
|
return value.toUtc().toIso8601String();
|
||||||
}
|
}
|
||||||
|
if (value is AccessHint) {
|
||||||
|
return AccessHintTypeTransformer().encode(value).toString();
|
||||||
|
}
|
||||||
if (value is AlbumUserRole) {
|
if (value is AlbumUserRole) {
|
||||||
return AlbumUserRoleTypeTransformer().encode(value).toString();
|
return AlbumUserRoleTypeTransformer().encode(value).toString();
|
||||||
}
|
}
|
||||||
|
|||||||
91
mobile/openapi/lib/model/access_hint.dart
generated
Normal file
91
mobile/openapi/lib/model/access_hint.dart
generated
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
//
|
||||||
|
// AUTO-GENERATED FILE, DO NOT MODIFY!
|
||||||
|
//
|
||||||
|
// @dart=2.18
|
||||||
|
|
||||||
|
// ignore_for_file: unused_element, unused_import
|
||||||
|
// ignore_for_file: always_put_required_named_parameters_first
|
||||||
|
// ignore_for_file: constant_identifier_names
|
||||||
|
// ignore_for_file: lines_longer_than_80_chars
|
||||||
|
|
||||||
|
part of openapi.api;
|
||||||
|
|
||||||
|
|
||||||
|
class AccessHint {
|
||||||
|
/// Instantiate a new enum with the provided [value].
|
||||||
|
const AccessHint._(this.value);
|
||||||
|
|
||||||
|
/// The underlying value of this enum member.
|
||||||
|
final String value;
|
||||||
|
|
||||||
|
@override
|
||||||
|
String toString() => value;
|
||||||
|
|
||||||
|
String toJson() => value;
|
||||||
|
|
||||||
|
static const owner = AccessHint._(r'owner');
|
||||||
|
static const album = AccessHint._(r'album');
|
||||||
|
static const partner = AccessHint._(r'partner');
|
||||||
|
static const sharedLink = AccessHint._(r'sharedLink');
|
||||||
|
|
||||||
|
/// List of all possible values in this [enum][AccessHint].
|
||||||
|
static const values = <AccessHint>[
|
||||||
|
owner,
|
||||||
|
album,
|
||||||
|
partner,
|
||||||
|
sharedLink,
|
||||||
|
];
|
||||||
|
|
||||||
|
static AccessHint? fromJson(dynamic value) => AccessHintTypeTransformer().decode(value);
|
||||||
|
|
||||||
|
static List<AccessHint> listFromJson(dynamic json, {bool growable = false,}) {
|
||||||
|
final result = <AccessHint>[];
|
||||||
|
if (json is List && json.isNotEmpty) {
|
||||||
|
for (final row in json) {
|
||||||
|
final value = AccessHint.fromJson(row);
|
||||||
|
if (value != null) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result.toList(growable: growable);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Transformation class that can [encode] an instance of [AccessHint] to String,
|
||||||
|
/// and [decode] dynamic data back to [AccessHint].
|
||||||
|
class AccessHintTypeTransformer {
|
||||||
|
factory AccessHintTypeTransformer() => _instance ??= const AccessHintTypeTransformer._();
|
||||||
|
|
||||||
|
const AccessHintTypeTransformer._();
|
||||||
|
|
||||||
|
String encode(AccessHint data) => data.value;
|
||||||
|
|
||||||
|
/// Decodes a [dynamic value][data] to a AccessHint.
|
||||||
|
///
|
||||||
|
/// If [allowNull] is true and the [dynamic value][data] cannot be decoded successfully,
|
||||||
|
/// then null is returned. However, if [allowNull] is false and the [dynamic value][data]
|
||||||
|
/// cannot be decoded successfully, then an [UnimplementedError] is thrown.
|
||||||
|
///
|
||||||
|
/// The [allowNull] is very handy when an API changes and a new enum value is added or removed,
|
||||||
|
/// and users are still using an old app with the old code.
|
||||||
|
AccessHint? decode(dynamic data, {bool allowNull = true}) {
|
||||||
|
if (data != null) {
|
||||||
|
switch (data) {
|
||||||
|
case r'owner': return AccessHint.owner;
|
||||||
|
case r'album': return AccessHint.album;
|
||||||
|
case r'partner': return AccessHint.partner;
|
||||||
|
case r'sharedLink': return AccessHint.sharedLink;
|
||||||
|
default:
|
||||||
|
if (!allowNull) {
|
||||||
|
throw ArgumentError('Unknown enum value to decode: $data');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Singleton [AccessHintTypeTransformer] instance.
|
||||||
|
static AccessHintTypeTransformer? _instance;
|
||||||
|
}
|
||||||
|
|
||||||
@@ -2583,6 +2583,14 @@
|
|||||||
"get": {
|
"get": {
|
||||||
"operationId": "viewAsset",
|
"operationId": "viewAsset",
|
||||||
"parameters": [
|
"parameters": [
|
||||||
|
{
|
||||||
|
"name": "hint",
|
||||||
|
"required": false,
|
||||||
|
"in": "query",
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/AccessHint"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "id",
|
"name": "id",
|
||||||
"required": true,
|
"required": true,
|
||||||
@@ -9967,6 +9975,15 @@
|
|||||||
},
|
},
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"AccessHint": {
|
||||||
|
"enum": [
|
||||||
|
"owner",
|
||||||
|
"album",
|
||||||
|
"partner",
|
||||||
|
"sharedLink"
|
||||||
|
],
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
"ActivityCreateDto": {
|
"ActivityCreateDto": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"albumId": {
|
"albumId": {
|
||||||
|
|||||||
@@ -2391,7 +2391,8 @@ export function replaceAsset({ id, key, slug, assetMediaReplaceDto }: {
|
|||||||
/**
|
/**
|
||||||
* This endpoint requires the `asset.view` permission.
|
* This endpoint requires the `asset.view` permission.
|
||||||
*/
|
*/
|
||||||
export function viewAsset({ id, key, size, slug }: {
|
export function viewAsset({ hint, id, key, size, slug }: {
|
||||||
|
hint?: AccessHint;
|
||||||
id: string;
|
id: string;
|
||||||
key?: string;
|
key?: string;
|
||||||
size?: AssetMediaSize;
|
size?: AssetMediaSize;
|
||||||
@@ -2401,6 +2402,7 @@ export function viewAsset({ id, key, size, slug }: {
|
|||||||
status: 200;
|
status: 200;
|
||||||
data: Blob;
|
data: Blob;
|
||||||
}>(`/assets/${encodeURIComponent(id)}/thumbnail${QS.query(QS.explode({
|
}>(`/assets/${encodeURIComponent(id)}/thumbnail${QS.query(QS.explode({
|
||||||
|
hint,
|
||||||
key,
|
key,
|
||||||
size,
|
size,
|
||||||
slug
|
slug
|
||||||
@@ -4842,6 +4844,12 @@ export enum AssetJobName {
|
|||||||
RegenerateThumbnail = "regenerate-thumbnail",
|
RegenerateThumbnail = "regenerate-thumbnail",
|
||||||
TranscodeVideo = "transcode-video"
|
TranscodeVideo = "transcode-video"
|
||||||
}
|
}
|
||||||
|
export enum AccessHint {
|
||||||
|
Owner = "owner",
|
||||||
|
Album = "album",
|
||||||
|
Partner = "partner",
|
||||||
|
SharedLink = "sharedLink"
|
||||||
|
}
|
||||||
export enum AssetMediaSize {
|
export enum AssetMediaSize {
|
||||||
Fullsize = "fullsize",
|
Fullsize = "fullsize",
|
||||||
Preview = "preview",
|
Preview = "preview",
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { ApiProperty } from '@nestjs/swagger';
|
|||||||
import { plainToInstance, Transform, Type } from 'class-transformer';
|
import { plainToInstance, Transform, Type } from 'class-transformer';
|
||||||
import { ArrayNotEmpty, IsArray, IsNotEmpty, IsString, ValidateNested } from 'class-validator';
|
import { ArrayNotEmpty, IsArray, IsNotEmpty, IsString, ValidateNested } from 'class-validator';
|
||||||
import { AssetMetadataUpsertItemDto } from 'src/dtos/asset.dto';
|
import { AssetMetadataUpsertItemDto } from 'src/dtos/asset.dto';
|
||||||
import { AssetVisibility } from 'src/enum';
|
import { AccessHint, AssetVisibility } from 'src/enum';
|
||||||
import { Optional, ValidateBoolean, ValidateDate, ValidateEnum, ValidateUUID } from 'src/validation';
|
import { Optional, ValidateBoolean, ValidateDate, ValidateEnum, ValidateUUID } from 'src/validation';
|
||||||
|
|
||||||
export enum AssetMediaSize {
|
export enum AssetMediaSize {
|
||||||
@@ -19,6 +19,9 @@ export enum AssetMediaSize {
|
|||||||
export class AssetMediaOptionsDto {
|
export class AssetMediaOptionsDto {
|
||||||
@ValidateEnum({ enum: AssetMediaSize, name: 'AssetMediaSize', optional: true })
|
@ValidateEnum({ enum: AssetMediaSize, name: 'AssetMediaSize', optional: true })
|
||||||
size?: AssetMediaSize;
|
size?: AssetMediaSize;
|
||||||
|
|
||||||
|
@ValidateEnum({ enum: AccessHint, name: 'AccessHint', optional: true })
|
||||||
|
hint?: AccessHint;
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum UploadFieldName {
|
export enum UploadFieldName {
|
||||||
|
|||||||
@@ -753,3 +753,10 @@ export enum CronJob {
|
|||||||
LibraryScan = 'LibraryScan',
|
LibraryScan = 'LibraryScan',
|
||||||
NightlyJobs = 'NightlyJobs',
|
NightlyJobs = 'NightlyJobs',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export enum AccessHint {
|
||||||
|
Owner = 'owner',
|
||||||
|
Album = 'album',
|
||||||
|
Partner = 'partner',
|
||||||
|
SharedLink = 'sharedLink',
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { BadRequestException, UnauthorizedException } from '@nestjs/common';
|
import { BadRequestException, UnauthorizedException } from '@nestjs/common';
|
||||||
import { AuthSharedLink } from 'src/database';
|
import { AuthSharedLink } from 'src/database';
|
||||||
import { AuthDto } from 'src/dtos/auth.dto';
|
import { AuthDto } from 'src/dtos/auth.dto';
|
||||||
import { AlbumUserRole, Permission } from 'src/enum';
|
import { AccessHint, AlbumUserRole, Permission } from 'src/enum';
|
||||||
import { AccessRepository } from 'src/repositories/access.repository';
|
import { AccessRepository } from 'src/repositories/access.repository';
|
||||||
import { setDifference, setIsEqual, setIsSuperset, setUnion } from 'src/utils/set';
|
import { setDifference, setIsEqual, setIsSuperset, setUnion } from 'src/utils/set';
|
||||||
|
|
||||||
@@ -22,10 +22,11 @@ export type AccessRequest = {
|
|||||||
auth: AuthDto;
|
auth: AuthDto;
|
||||||
permission: Permission;
|
permission: Permission;
|
||||||
ids: Set<string> | string[];
|
ids: Set<string> | string[];
|
||||||
|
hint?: AccessHint;
|
||||||
};
|
};
|
||||||
|
|
||||||
type SharedLinkAccessRequest = { sharedLink: AuthSharedLink; permission: Permission; ids: Set<string> };
|
type SharedLinkAccessRequest = { sharedLink: AuthSharedLink; permission: Permission; ids: Set<string> };
|
||||||
type OtherAccessRequest = { auth: AuthDto; permission: Permission; ids: Set<string> };
|
type OtherAccessRequest = { auth: AuthDto; permission: Permission; ids: Set<string>; hint?: AccessHint };
|
||||||
|
|
||||||
export const requireUploadAccess = (auth: AuthDto | null): AuthDto => {
|
export const requireUploadAccess = (auth: AuthDto | null): AuthDto => {
|
||||||
if (!auth || (auth.sharedLink && !auth.sharedLink.allowUpload)) {
|
if (!auth || (auth.sharedLink && !auth.sharedLink.allowUpload)) {
|
||||||
@@ -43,7 +44,7 @@ export const requireAccess = async (access: AccessRepository, request: AccessReq
|
|||||||
|
|
||||||
export const checkAccess = async (
|
export const checkAccess = async (
|
||||||
access: AccessRepository,
|
access: AccessRepository,
|
||||||
{ ids, auth, permission }: AccessRequest,
|
{ ids, auth, permission, hint }: AccessRequest,
|
||||||
): Promise<Set<string>> => {
|
): Promise<Set<string>> => {
|
||||||
const idSet = Array.isArray(ids) ? new Set(ids) : ids;
|
const idSet = Array.isArray(ids) ? new Set(ids) : ids;
|
||||||
if (idSet.size === 0) {
|
if (idSet.size === 0) {
|
||||||
@@ -52,7 +53,7 @@ export const checkAccess = async (
|
|||||||
|
|
||||||
return auth.sharedLink
|
return auth.sharedLink
|
||||||
? checkSharedLinkAccess(access, { sharedLink: auth.sharedLink, permission, ids: idSet })
|
? checkSharedLinkAccess(access, { sharedLink: auth.sharedLink, permission, ids: idSet })
|
||||||
: checkOtherAccess(access, { auth, permission, ids: idSet });
|
: checkOtherAccess(access, { auth, permission, ids: idSet, hint });
|
||||||
};
|
};
|
||||||
|
|
||||||
const checkSharedLinkAccess = async (
|
const checkSharedLinkAccess = async (
|
||||||
@@ -102,8 +103,38 @@ const checkSharedLinkAccess = async (
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const safeMoveToFront = <T>(array: T[], index: number) => {
|
||||||
|
if (index <= 0 || index >= array.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const [item] = array.splice(index, 1);
|
||||||
|
array.unshift(item);
|
||||||
|
};
|
||||||
|
|
||||||
|
type CheckFn = (ids: Set<string>) => Promise<Set<string>>;
|
||||||
|
const checkAll = async (ids: Set<string>, checks: Partial<Record<AccessHint, CheckFn>>, hint?: AccessHint) => {
|
||||||
|
let grantedIds = new Set<string>();
|
||||||
|
|
||||||
|
const items = Object.values(checks);
|
||||||
|
if (hint && checks[hint]) {
|
||||||
|
safeMoveToFront(items, items.indexOf(checks[hint]));
|
||||||
|
}
|
||||||
|
|
||||||
|
for (const check of items) {
|
||||||
|
if (ids.size === 0) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
const approvedIds = await check(ids);
|
||||||
|
grantedIds = setUnion(grantedIds, approvedIds);
|
||||||
|
ids = setDifference(ids, approvedIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
return grantedIds;
|
||||||
|
};
|
||||||
|
|
||||||
const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRequest): Promise<Set<string>> => {
|
const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRequest): Promise<Set<string>> => {
|
||||||
const { auth, permission, ids } = request;
|
const { auth, permission, ids, hint } = request;
|
||||||
|
|
||||||
switch (permission) {
|
switch (permission) {
|
||||||
// uses album id
|
// uses album id
|
||||||
@@ -113,96 +144,118 @@ const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRe
|
|||||||
|
|
||||||
// uses activity id
|
// uses activity id
|
||||||
case Permission.ActivityDelete: {
|
case Permission.ActivityDelete: {
|
||||||
const isOwner = await access.activity.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(
|
||||||
const isAlbumOwner = await access.activity.checkAlbumOwnerAccess(auth.user.id, setDifference(ids, isOwner));
|
ids,
|
||||||
return setUnion(isOwner, isAlbumOwner);
|
{
|
||||||
|
[AccessHint.Owner]: (ids) => access.activity.checkOwnerAccess(auth.user.id, ids),
|
||||||
|
[AccessHint.Album]: (ids) => access.activity.checkAlbumOwnerAccess(auth.user.id, ids),
|
||||||
|
},
|
||||||
|
hint,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AssetRead: {
|
case Permission.AssetRead: {
|
||||||
const isOwner = await access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission);
|
return checkAll(
|
||||||
const isAlbum = await access.asset.checkAlbumAccess(auth.user.id, setDifference(ids, isOwner));
|
ids,
|
||||||
const isPartner = await access.asset.checkPartnerAccess(auth.user.id, setDifference(ids, isOwner, isAlbum));
|
{
|
||||||
return setUnion(isOwner, isAlbum, isPartner);
|
[AccessHint.Owner]: (ids) =>
|
||||||
|
access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission),
|
||||||
|
[AccessHint.Album]: (ids) => access.asset.checkAlbumAccess(auth.user.id, ids),
|
||||||
|
[AccessHint.Partner]: (ids) => access.asset.checkPartnerAccess(auth.user.id, ids),
|
||||||
|
},
|
||||||
|
hint,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AssetShare: {
|
case Permission.AssetShare: {
|
||||||
const isOwner = await access.asset.checkOwnerAccess(auth.user.id, ids, false);
|
return checkAll(ids, {
|
||||||
const isPartner = await access.asset.checkPartnerAccess(auth.user.id, setDifference(ids, isOwner));
|
[AccessHint.Owner]: (ids) => access.asset.checkOwnerAccess(auth.user.id, ids, false),
|
||||||
return setUnion(isOwner, isPartner);
|
[AccessHint.Partner]: (ids) => access.asset.checkPartnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AssetView: {
|
case Permission.AssetView: {
|
||||||
const isOwner = await access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission);
|
return checkAll(ids, {
|
||||||
const isAlbum = await access.asset.checkAlbumAccess(auth.user.id, setDifference(ids, isOwner));
|
[AccessHint.Owner]: (ids) =>
|
||||||
const isPartner = await access.asset.checkPartnerAccess(auth.user.id, setDifference(ids, isOwner, isAlbum));
|
access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission),
|
||||||
return setUnion(isOwner, isAlbum, isPartner);
|
[AccessHint.Album]: (ids) => access.asset.checkAlbumAccess(auth.user.id, ids),
|
||||||
|
[AccessHint.Partner]: (ids) => access.asset.checkPartnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AssetDownload: {
|
case Permission.AssetDownload: {
|
||||||
const isOwner = await access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission);
|
return checkAll(ids, {
|
||||||
const isAlbum = await access.asset.checkAlbumAccess(auth.user.id, setDifference(ids, isOwner));
|
[AccessHint.Owner]: (ids) =>
|
||||||
const isPartner = await access.asset.checkPartnerAccess(auth.user.id, setDifference(ids, isOwner, isAlbum));
|
access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission),
|
||||||
return setUnion(isOwner, isAlbum, isPartner);
|
[AccessHint.Album]: (ids) => access.asset.checkAlbumAccess(auth.user.id, ids),
|
||||||
|
[AccessHint.Partner]: (ids) => access.asset.checkPartnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AssetUpdate: {
|
case Permission.AssetUpdate: {
|
||||||
return await access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) =>
|
||||||
|
access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AssetDelete: {
|
case Permission.AssetDelete: {
|
||||||
return await access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) =>
|
||||||
|
access.asset.checkOwnerAccess(auth.user.id, ids, auth.session?.hasElevatedPermission),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AlbumRead: {
|
case Permission.AlbumRead: {
|
||||||
const isOwner = await access.album.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(
|
||||||
const isShared = await access.album.checkSharedAlbumAccess(
|
ids,
|
||||||
auth.user.id,
|
{
|
||||||
setDifference(ids, isOwner),
|
[AccessHint.Owner]: (ids) => access.album.checkOwnerAccess(auth.user.id, ids),
|
||||||
AlbumUserRole.Viewer,
|
[AccessHint.Album]: (ids) => access.album.checkSharedAlbumAccess(auth.user.id, ids, AlbumUserRole.Viewer),
|
||||||
|
},
|
||||||
|
hint,
|
||||||
);
|
);
|
||||||
return setUnion(isOwner, isShared);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AlbumAssetCreate: {
|
case Permission.AlbumAssetCreate: {
|
||||||
const isOwner = await access.album.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
const isShared = await access.album.checkSharedAlbumAccess(
|
[AccessHint.Owner]: (ids) => access.album.checkOwnerAccess(auth.user.id, ids),
|
||||||
auth.user.id,
|
[AccessHint.Album]: (ids) => access.album.checkSharedAlbumAccess(auth.user.id, ids, AlbumUserRole.Editor),
|
||||||
setDifference(ids, isOwner),
|
});
|
||||||
AlbumUserRole.Editor,
|
|
||||||
);
|
|
||||||
return setUnion(isOwner, isShared);
|
|
||||||
}
|
|
||||||
|
|
||||||
case Permission.AlbumUpdate: {
|
|
||||||
return await access.album.checkOwnerAccess(auth.user.id, ids);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case Permission.AlbumShare:
|
||||||
|
case Permission.AlbumUpdate:
|
||||||
case Permission.AlbumDelete: {
|
case Permission.AlbumDelete: {
|
||||||
return await access.album.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(
|
||||||
}
|
ids,
|
||||||
|
{
|
||||||
case Permission.AlbumShare: {
|
[AccessHint.Owner]: (ids) => access.album.checkOwnerAccess(auth.user.id, ids),
|
||||||
return await access.album.checkOwnerAccess(auth.user.id, ids);
|
},
|
||||||
|
hint,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AlbumDownload: {
|
case Permission.AlbumDownload: {
|
||||||
const isOwner = await access.album.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(
|
||||||
const isShared = await access.album.checkSharedAlbumAccess(
|
ids,
|
||||||
auth.user.id,
|
{
|
||||||
setDifference(ids, isOwner),
|
[AccessHint.Owner]: (ids) => access.album.checkOwnerAccess(auth.user.id, ids),
|
||||||
AlbumUserRole.Viewer,
|
[AccessHint.Album]: (ids) => access.album.checkSharedAlbumAccess(auth.user.id, ids, AlbumUserRole.Viewer),
|
||||||
|
},
|
||||||
|
hint,
|
||||||
);
|
);
|
||||||
return setUnion(isOwner, isShared);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AlbumAssetDelete: {
|
case Permission.AlbumAssetDelete: {
|
||||||
const isOwner = await access.album.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(
|
||||||
const isShared = await access.album.checkSharedAlbumAccess(
|
ids,
|
||||||
auth.user.id,
|
{
|
||||||
setDifference(ids, isOwner),
|
[AccessHint.Owner]: (ids) => access.album.checkOwnerAccess(auth.user.id, ids),
|
||||||
AlbumUserRole.Editor,
|
[AccessHint.Album]: (ids) => access.album.checkSharedAlbumAccess(auth.user.id, ids, AlbumUserRole.Editor),
|
||||||
|
},
|
||||||
|
hint,
|
||||||
);
|
);
|
||||||
return setUnion(isOwner, isShared);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AssetUpload: {
|
case Permission.AssetUpload: {
|
||||||
@@ -214,24 +267,36 @@ const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRe
|
|||||||
}
|
}
|
||||||
|
|
||||||
case Permission.AuthDeviceDelete: {
|
case Permission.AuthDeviceDelete: {
|
||||||
return await access.authDevice.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(
|
||||||
|
ids,
|
||||||
|
{
|
||||||
|
[AccessHint.Owner]: (ids) => access.authDevice.checkOwnerAccess(auth.user.id, ids),
|
||||||
|
},
|
||||||
|
hint,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.FaceDelete: {
|
case Permission.FaceDelete: {
|
||||||
return access.person.checkFaceOwnerAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) => access.person.checkFaceOwnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.NotificationRead:
|
case Permission.NotificationRead:
|
||||||
case Permission.NotificationUpdate:
|
case Permission.NotificationUpdate:
|
||||||
case Permission.NotificationDelete: {
|
case Permission.NotificationDelete: {
|
||||||
return access.notification.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) => access.notification.checkOwnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.TagAsset:
|
case Permission.TagAsset:
|
||||||
case Permission.TagRead:
|
case Permission.TagRead:
|
||||||
case Permission.TagUpdate:
|
case Permission.TagUpdate:
|
||||||
case Permission.TagDelete: {
|
case Permission.TagDelete: {
|
||||||
return await access.tag.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) => access.tag.checkOwnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.TimelineRead: {
|
case Permission.TimelineRead: {
|
||||||
@@ -244,54 +309,56 @@ const checkOtherAccess = async (access: AccessRepository, request: OtherAccessRe
|
|||||||
return ids.has(auth.user.id) ? new Set([auth.user.id]) : new Set();
|
return ids.has(auth.user.id) ? new Set([auth.user.id]) : new Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.MemoryRead: {
|
case Permission.MemoryRead:
|
||||||
return access.memory.checkOwnerAccess(auth.user.id, ids);
|
case Permission.MemoryUpdate:
|
||||||
}
|
|
||||||
|
|
||||||
case Permission.MemoryUpdate: {
|
|
||||||
return access.memory.checkOwnerAccess(auth.user.id, ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
case Permission.MemoryDelete: {
|
case Permission.MemoryDelete: {
|
||||||
return access.memory.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) => access.memory.checkOwnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.PersonCreate: {
|
case Permission.PersonCreate: {
|
||||||
return access.person.checkFaceOwnerAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) => access.person.checkFaceOwnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.PersonRead:
|
case Permission.PersonRead:
|
||||||
case Permission.PersonUpdate:
|
case Permission.PersonUpdate:
|
||||||
case Permission.PersonDelete:
|
case Permission.PersonDelete:
|
||||||
case Permission.PersonMerge: {
|
case Permission.PersonMerge: {
|
||||||
return await access.person.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) => access.person.checkOwnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.PersonReassign: {
|
case Permission.PersonReassign: {
|
||||||
return access.person.checkFaceOwnerAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) => access.person.checkFaceOwnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.PartnerUpdate: {
|
case Permission.PartnerUpdate: {
|
||||||
return await access.partner.checkUpdateAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) => access.partner.checkUpdateAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
case Permission.SessionRead:
|
case Permission.SessionRead:
|
||||||
case Permission.SessionUpdate:
|
case Permission.SessionUpdate:
|
||||||
case Permission.SessionDelete:
|
case Permission.SessionDelete:
|
||||||
case Permission.SessionLock: {
|
case Permission.SessionLock: {
|
||||||
return access.session.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
}
|
[AccessHint.Owner]: (ids) => access.session.checkOwnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
case Permission.StackRead: {
|
|
||||||
return access.stack.checkOwnerAccess(auth.user.id, ids);
|
|
||||||
}
|
|
||||||
|
|
||||||
case Permission.StackUpdate: {
|
|
||||||
return access.stack.checkOwnerAccess(auth.user.id, ids);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case Permission.StackRead:
|
||||||
|
case Permission.StackUpdate:
|
||||||
case Permission.StackDelete: {
|
case Permission.StackDelete: {
|
||||||
return access.stack.checkOwnerAccess(auth.user.id, ids);
|
return checkAll(ids, {
|
||||||
|
[AccessHint.Owner]: (ids) => access.stack.checkOwnerAccess(auth.user.id, ids),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
import { getAssetPlaybackUrl, getAssetThumbnailUrl } from '$lib/utils';
|
import { getAssetPlaybackUrl, getAssetThumbnailUrl } from '$lib/utils';
|
||||||
import { timeToSeconds } from '$lib/utils/date-time';
|
import { timeToSeconds } from '$lib/utils/date-time';
|
||||||
import { getAltText } from '$lib/utils/thumbnail-util';
|
import { getAltText } from '$lib/utils/thumbnail-util';
|
||||||
import { AssetMediaSize, AssetVisibility } from '@immich/sdk';
|
import { AccessHint, AssetMediaSize, AssetVisibility } from '@immich/sdk';
|
||||||
import {
|
import {
|
||||||
mdiArchiveArrowDownOutline,
|
mdiArchiveArrowDownOutline,
|
||||||
mdiCameraBurst,
|
mdiCameraBurst,
|
||||||
@@ -20,6 +20,7 @@
|
|||||||
import { authManager } from '$lib/managers/auth-manager.svelte';
|
import { authManager } from '$lib/managers/auth-manager.svelte';
|
||||||
import type { TimelineAsset } from '$lib/managers/timeline-manager/types';
|
import type { TimelineAsset } from '$lib/managers/timeline-manager/types';
|
||||||
import { mobileDevice } from '$lib/stores/mobile-device.svelte';
|
import { mobileDevice } from '$lib/stores/mobile-device.svelte';
|
||||||
|
import { user } from '$lib/stores/user.store';
|
||||||
import { moveFocus } from '$lib/utils/focus-util';
|
import { moveFocus } from '$lib/utils/focus-util';
|
||||||
import { currentUrlReplaceAssetId } from '$lib/utils/navigation';
|
import { currentUrlReplaceAssetId } from '$lib/utils/navigation';
|
||||||
import { TUNABLES } from '$lib/utils/tunables';
|
import { TUNABLES } from '$lib/utils/tunables';
|
||||||
@@ -45,6 +46,7 @@
|
|||||||
imageClass?: ClassValue;
|
imageClass?: ClassValue;
|
||||||
brokenAssetClass?: ClassValue;
|
brokenAssetClass?: ClassValue;
|
||||||
dimmed?: boolean;
|
dimmed?: boolean;
|
||||||
|
hint?: AccessHint;
|
||||||
onClick?: (asset: TimelineAsset) => void;
|
onClick?: (asset: TimelineAsset) => void;
|
||||||
onSelect?: (asset: TimelineAsset) => void;
|
onSelect?: (asset: TimelineAsset) => void;
|
||||||
onMouseEvent?: (event: { isMouseOver: boolean; selectedGroupIndex: number }) => void;
|
onMouseEvent?: (event: { isMouseOver: boolean; selectedGroupIndex: number }) => void;
|
||||||
@@ -69,6 +71,7 @@
|
|||||||
imageClass = '',
|
imageClass = '',
|
||||||
brokenAssetClass = '',
|
brokenAssetClass = '',
|
||||||
dimmed = false,
|
dimmed = false,
|
||||||
|
hint,
|
||||||
}: Props = $props();
|
}: Props = $props();
|
||||||
|
|
||||||
let {
|
let {
|
||||||
@@ -313,7 +316,12 @@
|
|||||||
<ImageThumbnail
|
<ImageThumbnail
|
||||||
class={imageClass}
|
class={imageClass}
|
||||||
{brokenAssetClass}
|
{brokenAssetClass}
|
||||||
url={getAssetThumbnailUrl({ id: asset.id, size: AssetMediaSize.Thumbnail, cacheKey: asset.thumbhash })}
|
url={getAssetThumbnailUrl({
|
||||||
|
id: asset.id,
|
||||||
|
size: AssetMediaSize.Thumbnail,
|
||||||
|
cacheKey: asset.thumbhash,
|
||||||
|
hint: asset.ownerId === $user.id ? undefined : hint,
|
||||||
|
})}
|
||||||
altText={$getAltText(asset)}
|
altText={$getAltText(asset)}
|
||||||
widthStyle="{width}px"
|
widthStyle="{width}px"
|
||||||
heightStyle="{height}px"
|
heightStyle="{height}px"
|
||||||
|
|||||||
@@ -232,6 +232,7 @@
|
|||||||
disabled={dayGroup.monthGroup.timelineManager.albumAssets.has(asset.id)}
|
disabled={dayGroup.monthGroup.timelineManager.albumAssets.has(asset.id)}
|
||||||
thumbnailWidth={position.width}
|
thumbnailWidth={position.width}
|
||||||
thumbnailHeight={position.height}
|
thumbnailHeight={position.height}
|
||||||
|
hint={timelineManager.hint}
|
||||||
/>
|
/>
|
||||||
{#if customLayout}
|
{#if customLayout}
|
||||||
{@render customLayout(asset)}
|
{@render customLayout(asset)}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AssetOrder, getAssetInfo, getTimeBuckets } from '@immich/sdk';
|
import { AccessHint, AssetOrder, getAssetInfo, getTimeBuckets } from '@immich/sdk';
|
||||||
|
|
||||||
import { authManager } from '$lib/managers/auth-manager.svelte';
|
import { authManager } from '$lib/managers/auth-manager.svelte';
|
||||||
|
|
||||||
@@ -38,6 +38,7 @@ import type {
|
|||||||
} from './types';
|
} from './types';
|
||||||
|
|
||||||
export class TimelineManager {
|
export class TimelineManager {
|
||||||
|
hint?: AccessHint;
|
||||||
isInitialized = $state(false);
|
isInitialized = $state(false);
|
||||||
months: MonthGroup[] = $state([]);
|
months: MonthGroup[] = $state([]);
|
||||||
topSectionHeight = $state(0);
|
topSectionHeight = $state(0);
|
||||||
@@ -97,7 +98,9 @@ export class TimelineManager {
|
|||||||
monthGroup: undefined,
|
monthGroup: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
constructor() {}
|
constructor(options?: { hint?: AccessHint }) {
|
||||||
|
this.hint = options?.hint;
|
||||||
|
}
|
||||||
|
|
||||||
setLayoutOptions({ headerHeight = 48, rowHeight = 235, gap = 12 }: TimelineManagerLayoutOptions) {
|
setLayoutOptions({ headerHeight = 48, rowHeight = 235, gap = 12 }: TimelineManagerLayoutOptions) {
|
||||||
let changed = false;
|
let changed = false;
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { lang } from '$lib/stores/preferences.store';
|
|||||||
import { serverConfig } from '$lib/stores/server-config.store';
|
import { serverConfig } from '$lib/stores/server-config.store';
|
||||||
import { handleError } from '$lib/utils/handle-error';
|
import { handleError } from '$lib/utils/handle-error';
|
||||||
import {
|
import {
|
||||||
|
AccessHint,
|
||||||
AssetJobName,
|
AssetJobName,
|
||||||
AssetMediaSize,
|
AssetMediaSize,
|
||||||
JobName,
|
JobName,
|
||||||
@@ -197,12 +198,14 @@ export const getAssetOriginalUrl = (options: string | AssetUrlOptions) => {
|
|||||||
return createUrl(getAssetOriginalPath(id), { ...authManager.params, c: cacheKey });
|
return createUrl(getAssetOriginalPath(id), { ...authManager.params, c: cacheKey });
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAssetThumbnailUrl = (options: string | (AssetUrlOptions & { size?: AssetMediaSize })) => {
|
export const getAssetThumbnailUrl = (
|
||||||
|
options: string | (AssetUrlOptions & { size?: AssetMediaSize; hint?: AccessHint }),
|
||||||
|
) => {
|
||||||
if (typeof options === 'string') {
|
if (typeof options === 'string') {
|
||||||
options = { id: options };
|
options = { id: options };
|
||||||
}
|
}
|
||||||
const { id, size, cacheKey } = options;
|
const { id, size, cacheKey, hint } = options;
|
||||||
return createUrl(getAssetThumbnailPath(id), { ...authManager.params, size, c: cacheKey });
|
return createUrl(getAssetThumbnailPath(id), { ...authManager.params, size, c: cacheKey, hint });
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAssetPlaybackUrl = (options: string | AssetUrlOptions) => {
|
export const getAssetPlaybackUrl = (options: string | AssetUrlOptions) => {
|
||||||
|
|||||||
@@ -59,6 +59,7 @@
|
|||||||
type AssetGridRouteSearchParams,
|
type AssetGridRouteSearchParams,
|
||||||
} from '$lib/utils/navigation';
|
} from '$lib/utils/navigation';
|
||||||
import {
|
import {
|
||||||
|
AccessHint,
|
||||||
AlbumUserRole,
|
AlbumUserRole,
|
||||||
AssetOrder,
|
AssetOrder,
|
||||||
AssetVisibility,
|
AssetVisibility,
|
||||||
@@ -328,7 +329,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let timelineManager = new TimelineManager();
|
let timelineManager = new TimelineManager({ hint: AccessHint.Album });
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
if (viewMode === AlbumPageViewMode.VIEW) {
|
if (viewMode === AlbumPageViewMode.VIEW) {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
import { AppRoute } from '$lib/constants';
|
import { AppRoute } from '$lib/constants';
|
||||||
import { TimelineManager } from '$lib/managers/timeline-manager/timeline-manager.svelte';
|
import { TimelineManager } from '$lib/managers/timeline-manager/timeline-manager.svelte';
|
||||||
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
|
import { AssetInteraction } from '$lib/stores/asset-interaction.svelte';
|
||||||
import { AssetVisibility } from '@immich/sdk';
|
import { AccessHint, AssetVisibility } from '@immich/sdk';
|
||||||
import { mdiArrowLeft, mdiPlus } from '@mdi/js';
|
import { mdiArrowLeft, mdiPlus } from '@mdi/js';
|
||||||
import { onDestroy } from 'svelte';
|
import { onDestroy } from 'svelte';
|
||||||
import { t } from 'svelte-i18n';
|
import { t } from 'svelte-i18n';
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
let { data }: Props = $props();
|
let { data }: Props = $props();
|
||||||
|
|
||||||
const timelineManager = new TimelineManager();
|
const timelineManager = new TimelineManager({ hint: AccessHint.Partner });
|
||||||
$effect(
|
$effect(
|
||||||
() =>
|
() =>
|
||||||
void timelineManager.updateOptions({
|
void timelineManager.updateOptions({
|
||||||
|
|||||||
Reference in New Issue
Block a user