mirror of
https://github.com/immich-app/immich.git
synced 2026-07-25 05:50:40 +03:00
Compare commits
6 Commits
refactor/a
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
409734e1db | ||
|
|
b08f6b9c50 | ||
|
|
7b023d9a71 | ||
|
|
9abe72aced | ||
|
|
829b4e748e | ||
|
|
4a5f13d0e5 |
@@ -17,50 +17,67 @@ struct ImmichWidgetView: View {
|
||||
var entry: ImageEntry
|
||||
|
||||
var body: some View {
|
||||
if entry.image == nil {
|
||||
Image("LaunchImage")
|
||||
.tintedWidgetImageModifier()
|
||||
.overlay(alignment: .bottom) {
|
||||
if let error = entry.metadata.error?.errorDescription {
|
||||
Text(error)
|
||||
.minimumScaleFactor(0.25)
|
||||
.multilineTextAlignment(.center)
|
||||
.foregroundStyle(.secondary)
|
||||
.fixedSize()
|
||||
.alignmentGuide(.bottom) { dimensions in
|
||||
// Place the text below the bottom of the image
|
||||
dimensions[.top] - 8
|
||||
}
|
||||
}
|
||||
}
|
||||
if let image = entry.image {
|
||||
ImmichWidgetContentView(image: image, subtitle: entry.metadata.subtitle, deepLink: entry.metadata.deepLink)
|
||||
} else {
|
||||
ZStack(alignment: .leading) {
|
||||
Color.clear.overlay(
|
||||
Image(uiImage: entry.image!)
|
||||
.resizable()
|
||||
.tintedWidgetImageModifier()
|
||||
.scaledToFill()
|
||||
|
||||
)
|
||||
VStack {
|
||||
Spacer()
|
||||
if let subtitle = entry.metadata.subtitle {
|
||||
Text(subtitle)
|
||||
.foregroundColor(.white)
|
||||
.padding(8)
|
||||
.background(Color.black.opacity(0.6))
|
||||
.cornerRadius(8)
|
||||
.font(.system(size: 16))
|
||||
}
|
||||
}
|
||||
.padding(16)
|
||||
}
|
||||
.widgetURL(entry.metadata.deepLink)
|
||||
ImmichWidgetLoadingView(message: entry.metadata.error?.errorDescription)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct ImmichWidgetLoadingView: View {
|
||||
let message: String?
|
||||
|
||||
var body: some View {
|
||||
let messageText = Text(message ?? "")
|
||||
.minimumScaleFactor(0.25)
|
||||
.multilineTextAlignment(.center)
|
||||
.foregroundStyle(.secondary)
|
||||
|
||||
VStack(spacing: 8) {
|
||||
// This is used as a nicer way to center the image, rather than using offsets
|
||||
messageText.hidden()
|
||||
|
||||
Image("LaunchImage")
|
||||
.tintedWidgetImageModifier()
|
||||
|
||||
messageText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private struct ImmichWidgetContentView: View {
|
||||
let image: UIImage
|
||||
let subtitle: String?
|
||||
let deepLink: URL?
|
||||
|
||||
var body: some View {
|
||||
ZStack(alignment: .leading) {
|
||||
Color.clear.overlay(
|
||||
Image(uiImage: image)
|
||||
.resizable()
|
||||
.tintedWidgetImageModifier()
|
||||
.scaledToFill()
|
||||
)
|
||||
|
||||
VStack {
|
||||
Spacer()
|
||||
if let subtitle {
|
||||
Text(subtitle)
|
||||
.foregroundColor(.white)
|
||||
.padding(6)
|
||||
.background(ContainerRelativeShape().fill(Color.black.opacity(0.6)))
|
||||
.font(.system(size: 16))
|
||||
}
|
||||
}
|
||||
.padding(16)
|
||||
}
|
||||
.widgetURL(deepLink)
|
||||
}
|
||||
}
|
||||
|
||||
#Preview(
|
||||
"Medium",
|
||||
as: .systemMedium,
|
||||
widget: {
|
||||
ImmichRandomWidget()
|
||||
@@ -69,10 +86,93 @@ struct ImmichWidgetView: View {
|
||||
let date = Date()
|
||||
ImageEntry(
|
||||
date: date,
|
||||
image: UIImage(named: "ImmichLogo"),
|
||||
image: UIImage(named: "LaunchImage"),
|
||||
metadata: EntryMetadata(
|
||||
subtitle: "1 year ago"
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
#Preview(
|
||||
"Medium No Data",
|
||||
as: .systemMedium,
|
||||
widget: {
|
||||
ImmichRandomWidget()
|
||||
},
|
||||
timeline: {
|
||||
let date = Date()
|
||||
ImageEntry(
|
||||
date: date,
|
||||
image: nil
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
#Preview(
|
||||
"Medium No Data Error",
|
||||
as: .systemMedium,
|
||||
widget: {
|
||||
ImmichRandomWidget()
|
||||
},
|
||||
timeline: {
|
||||
let date = Date()
|
||||
ImageEntry(
|
||||
date: date,
|
||||
image: nil,
|
||||
metadata: EntryMetadata(error: WidgetError.fetchFailed)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
#Preview(
|
||||
"Small",
|
||||
as: .systemSmall,
|
||||
widget: {
|
||||
ImmichRandomWidget()
|
||||
},
|
||||
timeline: {
|
||||
let date = Date()
|
||||
ImageEntry(
|
||||
date: date,
|
||||
image: UIImage(named: "LaunchImage"),
|
||||
metadata: EntryMetadata(
|
||||
subtitle: "Yesterday"
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
#Preview(
|
||||
"Small No Data Error",
|
||||
as: .systemSmall,
|
||||
widget: {
|
||||
ImmichRandomWidget()
|
||||
},
|
||||
timeline: {
|
||||
let date = Date()
|
||||
ImageEntry(
|
||||
date: date,
|
||||
image: nil,
|
||||
metadata: EntryMetadata(error: WidgetError.fetchFailed)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
#Preview(
|
||||
"Large",
|
||||
as: .systemLarge,
|
||||
widget: {
|
||||
ImmichRandomWidget()
|
||||
},
|
||||
timeline: {
|
||||
let date = Date()
|
||||
ImageEntry(
|
||||
date: date,
|
||||
image: UIImage(named: "LaunchImage"),
|
||||
metadata: EntryMetadata(
|
||||
subtitle: "2000 seconds ago"
|
||||
)
|
||||
)
|
||||
}
|
||||
)
|
||||
|
||||
@@ -25,7 +25,7 @@ extension WidgetError: LocalizedError {
|
||||
return "Login to Immich"
|
||||
|
||||
case .fetchFailed:
|
||||
return "Unable to connect to your Immich instance"
|
||||
return "Unable to connect to Immich"
|
||||
|
||||
case .albumNotFound:
|
||||
return "Album not found"
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
# @generated - this file is auto-generated by `mise lock` https://mise.en.dev/dev-tools/mise-lock.html
|
||||
|
||||
[[tools."aqua:flutter/flutter"]]
|
||||
version = "3.44.6"
|
||||
version = "3.44.8"
|
||||
backend = "aqua:flutter/flutter"
|
||||
|
||||
[tools."aqua:flutter/flutter"."platforms.linux-arm64"]
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.6-stable.tar.xz"
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.8-stable.tar.xz"
|
||||
|
||||
[tools."aqua:flutter/flutter"."platforms.linux-arm64-musl"]
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.6-stable.tar.xz"
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.8-stable.tar.xz"
|
||||
|
||||
[tools."aqua:flutter/flutter"."platforms.linux-x64"]
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.6-stable.tar.xz"
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.8-stable.tar.xz"
|
||||
|
||||
[tools."aqua:flutter/flutter"."platforms.linux-x64-musl"]
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.6-stable.tar.xz"
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.44.8-stable.tar.xz"
|
||||
|
||||
[tools."aqua:flutter/flutter"."platforms.macos-arm64"]
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_3.44.6-stable.zip"
|
||||
checksum = "blake3:79c780876c64f5a66c015845f544bdb20275f7f3bf819e6c831f23df3e96b8db"
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_arm64_3.44.8-stable.zip"
|
||||
|
||||
[tools."aqua:flutter/flutter"."platforms.macos-x64"]
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.44.6-stable.zip"
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/macos/flutter_macos_3.44.8-stable.zip"
|
||||
|
||||
[tools."aqua:flutter/flutter"."platforms.windows-x64"]
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.44.6-stable.zip"
|
||||
url = "https://storage.googleapis.com/flutter_infra_release/releases/stable/windows/flutter_windows_3.44.8-stable.zip"
|
||||
|
||||
[[tools."github:CQLabs/homebrew-dcm"]]
|
||||
version = "1.37.0"
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[tools]
|
||||
"aqua:flutter/flutter" = "3.44.6"
|
||||
"aqua:flutter/flutter" = "3.44.8"
|
||||
java = "21.0.2"
|
||||
|
||||
[tools."github:CQLabs/homebrew-dcm"]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import 'dart:async';
|
||||
import 'dart:core';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:immich_ui/src/constants.dart';
|
||||
@@ -8,6 +9,7 @@ class ImmichColumnButton extends StatefulWidget {
|
||||
final IconData icon;
|
||||
final String label;
|
||||
final FutureOr<void> Function() onPressed;
|
||||
final FutureOr<void> Function()? onLongPress;
|
||||
final bool disabled;
|
||||
final bool? loading;
|
||||
|
||||
@@ -16,6 +18,7 @@ class ImmichColumnButton extends StatefulWidget {
|
||||
required this.icon,
|
||||
required this.label,
|
||||
required this.onPressed,
|
||||
this.onLongPress,
|
||||
this.disabled = false,
|
||||
this.loading,
|
||||
});
|
||||
@@ -25,26 +28,44 @@ class ImmichColumnButton extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ImmichColumnButtonState extends State<ImmichColumnButton> {
|
||||
bool _loading = false;
|
||||
bool get _isLoading => widget.loading ?? _loading;
|
||||
bool _running = false;
|
||||
bool get _isLoading => widget.loading ?? _running;
|
||||
bool get _isDisabled => widget.disabled || _isLoading;
|
||||
|
||||
Future<void> _onPressed() async {
|
||||
setState(() => _loading = true);
|
||||
Future<void> _runAction(FutureOr<void> Function() action) async {
|
||||
setState(() => _running = true);
|
||||
try {
|
||||
await widget.onPressed();
|
||||
await action();
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() => _loading = false);
|
||||
setState(() => _running = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void>? _onPressed() {
|
||||
if (_isDisabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _runAction(widget.onPressed);
|
||||
}
|
||||
|
||||
Future<void>? _onLongPress() {
|
||||
if (_isDisabled || widget.onLongPress == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _runAction(widget.onLongPress!);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final foreground = context.colorOverride ?? Theme.of(context).colorScheme.onSurface;
|
||||
|
||||
return TextButton(
|
||||
onPressed: widget.disabled || _isLoading ? null : _onPressed,
|
||||
onPressed: _onPressed,
|
||||
onLongPress: _onLongPress,
|
||||
style: TextButton.styleFrom(
|
||||
foregroundColor: foreground,
|
||||
padding: const .symmetric(horizontal: ImmichSpacing.sm, vertical: ImmichSpacing.md),
|
||||
|
||||
@@ -7,6 +7,7 @@ import 'package:immich_ui/src/internal.dart';
|
||||
class ImmichIconButton extends StatefulWidget {
|
||||
final IconData icon;
|
||||
final FutureOr<void> Function() onPressed;
|
||||
final FutureOr<void> Function()? onLongPress;
|
||||
final ImmichVariant variant;
|
||||
final ImmichColor color;
|
||||
final bool disabled;
|
||||
@@ -16,6 +17,7 @@ class ImmichIconButton extends StatefulWidget {
|
||||
super.key,
|
||||
required this.icon,
|
||||
required this.onPressed,
|
||||
this.onLongPress,
|
||||
this.color = .primary,
|
||||
this.variant = .filled,
|
||||
this.disabled = false,
|
||||
@@ -27,20 +29,37 @@ class ImmichIconButton extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ImmichIconButtonState extends State<ImmichIconButton> {
|
||||
bool _loading = false;
|
||||
bool get _isLoading => widget.loading ?? _loading;
|
||||
bool _running = false;
|
||||
bool get _isLoading => widget.loading ?? _running;
|
||||
bool get _isDisabled => widget.disabled || _isLoading;
|
||||
|
||||
Future<void> _onPressed() async {
|
||||
setState(() => _loading = true);
|
||||
Future<void> _runAction(FutureOr<void> Function() action) async {
|
||||
setState(() => _running = true);
|
||||
try {
|
||||
await widget.onPressed();
|
||||
await action();
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() => _loading = false);
|
||||
setState(() => _running = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void>? _onPressed() {
|
||||
if (_isDisabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _runAction(widget.onPressed);
|
||||
}
|
||||
|
||||
Future<void>? _onLongPress() {
|
||||
if (_isDisabled || widget.onLongPress == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _runAction(widget.onLongPress!);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final colorScheme = Theme.of(context).colorScheme;
|
||||
@@ -73,7 +92,8 @@ class _ImmichIconButtonState extends State<ImmichIconButton> {
|
||||
child: CircularProgressIndicator(strokeWidth: ImmichBorderWidth.md),
|
||||
)
|
||||
: Icon(widget.icon),
|
||||
onPressed: widget.disabled || _isLoading ? null : _onPressed,
|
||||
onPressed: _onPressed,
|
||||
onLongPress: _onLongPress,
|
||||
style: IconButton.styleFrom(backgroundColor: background, foregroundColor: foreground),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ class ImmichTextButton extends StatefulWidget {
|
||||
final String labelText;
|
||||
final IconData? icon;
|
||||
final FutureOr<void> Function() onPressed;
|
||||
final FutureOr<void> Function()? onLongPress;
|
||||
final ImmichVariant variant;
|
||||
final bool expanded;
|
||||
final bool disabled;
|
||||
@@ -17,6 +18,7 @@ class ImmichTextButton extends StatefulWidget {
|
||||
required this.labelText,
|
||||
this.icon,
|
||||
required this.onPressed,
|
||||
this.onLongPress,
|
||||
this.variant = .filled,
|
||||
this.expanded = true,
|
||||
|
||||
@@ -29,20 +31,37 @@ class ImmichTextButton extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _ImmichTextButtonState extends State<ImmichTextButton> {
|
||||
bool _loading = false;
|
||||
bool get _isLoading => widget.loading ?? _loading;
|
||||
bool _running = false;
|
||||
bool get _isLoading => widget.loading ?? _running;
|
||||
bool get _isDisabled => widget.disabled || _isLoading;
|
||||
|
||||
Future<void> _onPressed() async {
|
||||
setState(() => _loading = true);
|
||||
Future<void> _runAction(FutureOr<void> Function() action) async {
|
||||
setState(() => _running = true);
|
||||
try {
|
||||
await widget.onPressed();
|
||||
await action();
|
||||
} finally {
|
||||
if (mounted) {
|
||||
setState(() => _loading = false);
|
||||
setState(() => _running = false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Future<void>? _onPressed() {
|
||||
if (_isDisabled) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _runAction(widget.onPressed);
|
||||
}
|
||||
|
||||
Future<void>? _onLongPress() {
|
||||
if (_isDisabled || widget.onLongPress == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return _runAction(widget.onLongPress!);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final Widget? icon = _isLoading
|
||||
@@ -59,11 +78,22 @@ class _ImmichTextButtonState extends State<ImmichTextButton> {
|
||||
style: const .new(fontSize: ImmichTextSize.body, fontWeight: .bold),
|
||||
);
|
||||
final style = ElevatedButton.styleFrom(padding: const .symmetric(vertical: ImmichSpacing.md));
|
||||
final onPressed = widget.disabled || _isLoading ? null : _onPressed;
|
||||
|
||||
final button = switch (widget.variant) {
|
||||
ImmichVariant.filled => ElevatedButton.icon(style: style, onPressed: onPressed, icon: icon, label: label),
|
||||
ImmichVariant.ghost => TextButton.icon(style: style, onPressed: onPressed, icon: icon, label: label),
|
||||
ImmichVariant.filled => ElevatedButton.icon(
|
||||
style: style,
|
||||
onPressed: _onPressed,
|
||||
onLongPress: _onLongPress,
|
||||
icon: icon,
|
||||
label: label,
|
||||
),
|
||||
ImmichVariant.ghost => TextButton.icon(
|
||||
style: style,
|
||||
onPressed: _onPressed,
|
||||
onLongPress: _onLongPress,
|
||||
icon: icon,
|
||||
label: label,
|
||||
),
|
||||
};
|
||||
|
||||
if (widget.expanded) {
|
||||
|
||||
@@ -2014,4 +2014,4 @@ packages:
|
||||
version: "3.1.3"
|
||||
sdks:
|
||||
dart: ">=3.12.0 <4.0.0"
|
||||
flutter: "3.44.6"
|
||||
flutter: "3.44.8"
|
||||
|
||||
@@ -6,7 +6,7 @@ version: 3.0.3+3056
|
||||
|
||||
environment:
|
||||
sdk: '>=3.12.0 <4.0.0'
|
||||
flutter: 3.44.6
|
||||
flutter: 3.44.8
|
||||
|
||||
dependencies:
|
||||
async: ^2.13.1
|
||||
|
||||
@@ -1507,12 +1507,17 @@ describe(MediaService.name, () => {
|
||||
});
|
||||
|
||||
describe('handleGeneratePersonThumbnail', () => {
|
||||
it('should skip if machine learning is disabled', async () => {
|
||||
it('should generate a thumbnail even if machine learning is disabled', async () => {
|
||||
mocks.systemMetadata.get.mockResolvedValue(systemConfigStub.machineLearningDisabled);
|
||||
mocks.person.getDataForThumbnailGenerationJob.mockResolvedValue(personThumbnailStub.newThumbnailMiddle);
|
||||
mocks.media.generateThumbnail.mockResolvedValue();
|
||||
mocks.media.decodeImage.mockResolvedValue({
|
||||
data: Buffer.from(''),
|
||||
info: { width: 1000, height: 1000 } as OutputInfo,
|
||||
});
|
||||
|
||||
await expect(sut.handleGeneratePersonThumbnail({ id: 'person-1' })).resolves.toBe(JobStatus.Skipped);
|
||||
expect(mocks.asset.getByIds).not.toHaveBeenCalled();
|
||||
expect(mocks.systemMetadata.get).toHaveBeenCalled();
|
||||
await expect(sut.handleGeneratePersonThumbnail({ id: 'person-1' })).resolves.toBe(JobStatus.Success);
|
||||
expect(mocks.media.generateThumbnail).toHaveBeenCalled();
|
||||
});
|
||||
|
||||
it('should skip a person not found', async () => {
|
||||
|
||||
@@ -43,7 +43,7 @@ import { getAssetFile, getDimensions } from 'src/utils/asset.util';
|
||||
import { checkFaceVisibility, checkOcrVisibility } from 'src/utils/editor';
|
||||
import { BaseConfig, ThumbnailConfig } from 'src/utils/media';
|
||||
import { mimeTypes } from 'src/utils/mime-types';
|
||||
import { clamp, isFaceImportEnabled, isFacialRecognitionEnabled } from 'src/utils/misc';
|
||||
import { clamp } from 'src/utils/misc';
|
||||
import { getOutputDimensions } from 'src/utils/transform';
|
||||
|
||||
interface UpsertFileOptions {
|
||||
@@ -410,11 +410,7 @@ export class MediaService extends BaseService {
|
||||
|
||||
@OnJob({ name: JobName.PersonGenerateThumbnail, queue: QueueName.ThumbnailGeneration })
|
||||
async handleGeneratePersonThumbnail({ id }: JobOf<JobName.PersonGenerateThumbnail>): Promise<JobStatus> {
|
||||
const { machineLearning, metadata, image } = await this.getConfig({ withCache: true });
|
||||
if (!isFacialRecognitionEnabled(machineLearning) && !isFaceImportEnabled(metadata)) {
|
||||
return JobStatus.Skipped;
|
||||
}
|
||||
|
||||
const { image } = await this.getConfig({ withCache: true });
|
||||
const data = await this.personRepository.getDataForThumbnailGenerationJob(id);
|
||||
if (!data) {
|
||||
this.logger.error(`Could not generate person thumbnail for ${id}: missing data`);
|
||||
|
||||
@@ -4,6 +4,7 @@ import { createHash, randomBytes } from 'node:crypto';
|
||||
import { Stats } from 'node:fs';
|
||||
import { resolve } from 'node:path';
|
||||
import { Writable } from 'node:stream';
|
||||
import { SystemConfig } from 'src/config';
|
||||
import { AssetFace } from 'src/database';
|
||||
import { AuthDto, LoginResponseDto } from 'src/dtos/auth.dto';
|
||||
import { AssetEditActionItem, AssetEditsCreateDto } from 'src/dtos/editing.dto';
|
||||
@@ -76,6 +77,7 @@ import { BASE_SERVICE_DEPENDENCIES, BaseService } from 'src/services/base.servic
|
||||
import { MetadataService } from 'src/services/metadata.service';
|
||||
import { SyncService } from 'src/services/sync.service';
|
||||
import { ClassConstructor, UploadFile } from 'src/types';
|
||||
import { getConfig, updateConfig } from 'src/utils/config';
|
||||
import { mockEnvData } from 'test/repositories/config.repository.mock';
|
||||
import { newTelemetryRepositoryMock } from 'test/repositories/telemetry.repository.mock';
|
||||
import { factory, newDate, newEmbedding, newUuid } from 'test/small.factory';
|
||||
@@ -302,6 +304,28 @@ export class MediumTestContext<S extends BaseService = BaseService> {
|
||||
const edits = await this.get(AssetEditRepository).replaceAll(assetId, dto.edits as AssetEditActionItem[]);
|
||||
return { edits };
|
||||
}
|
||||
|
||||
async getConfig({ withCache = true }: { withCache?: boolean } = {}) {
|
||||
return getConfig(
|
||||
{
|
||||
configRepo: this.get(ConfigRepository),
|
||||
metadataRepo: this.get(SystemMetadataRepository),
|
||||
logger: this.get(LoggingRepository),
|
||||
},
|
||||
{ withCache },
|
||||
);
|
||||
}
|
||||
|
||||
async updateConfig(config: SystemConfig) {
|
||||
return updateConfig(
|
||||
{
|
||||
configRepo: this.get(ConfigRepository),
|
||||
metadataRepo: this.get(SystemMetadataRepository),
|
||||
logger: this.get(LoggingRepository),
|
||||
},
|
||||
config,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export class SyncTestContext extends MediumTestContext<SyncService> {
|
||||
|
||||
@@ -324,7 +324,7 @@
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{#if currentAlbum && currentAlbum.albumUsers.length > 0 && asset.owner}
|
||||
{#if currentAlbum && currentAlbum.albumUsers.length > 1 && asset.owner}
|
||||
<section class="mt-4 px-6 dark:text-immich-dark-fg">
|
||||
<Text size="small" color="muted">{$t('shared_by')}</Text>
|
||||
<div class="flex gap-4 pt-4">
|
||||
|
||||
Reference in New Issue
Block a user