Skip to content
Merged
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
2 changes: 1 addition & 1 deletion docker/docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ services:
command: ['./run.sh', '-disable-reporting']
ports:
- 3000:3000
image: grafana/grafana:12.4.7-ubuntu@sha256:d327f509400334fbea74a282d287f20c3187222741ec99e76f253cac16c90129
image: grafana/grafana:12.4.8-ubuntu@sha256:473cfc1712694135a5d9dc012dc573f2a48e51efb9ac0da50418918f3cbd8ad3
volumes:
- grafana-data:/var/lib/grafana

Expand Down
131 changes: 0 additions & 131 deletions e2e/src/specs/server/api/memory.e2e-spec.ts

This file was deleted.

57 changes: 12 additions & 45 deletions mobile/lib/domain/models/config/cleanup_config.dart
Original file line number Diff line number Diff line change
@@ -1,48 +1,15 @@
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:immich_mobile/constants/enums.dart';

class CleanupConfig {
final bool keepFavorites;
final AssetKeepType keepMediaType;
final List<String> keepAlbumIds;
final int cutoffDaysAgo;
final bool defaultsInitialized;

const CleanupConfig({
this.keepFavorites = true,
this.keepMediaType = AssetKeepType.none,
this.keepAlbumIds = const [],
this.cutoffDaysAgo = -1,
this.defaultsInitialized = false,
});

CleanupConfig copyWith({
bool? keepFavorites,
AssetKeepType? keepMediaType,
List<String>? keepAlbumIds,
int? cutoffDaysAgo,
bool? defaultsInitialized,
}) => .new(
keepFavorites: keepFavorites ?? this.keepFavorites,
keepMediaType: keepMediaType ?? this.keepMediaType,
keepAlbumIds: keepAlbumIds ?? this.keepAlbumIds,
cutoffDaysAgo: cutoffDaysAgo ?? this.cutoffDaysAgo,
defaultsInitialized: defaultsInitialized ?? this.defaultsInitialized,
);

@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is CleanupConfig &&
other.keepFavorites == keepFavorites &&
other.keepMediaType == keepMediaType &&
other.keepAlbumIds == keepAlbumIds &&
other.cutoffDaysAgo == cutoffDaysAgo &&
other.defaultsInitialized == defaultsInitialized);

@override
int get hashCode => Object.hash(keepFavorites, keepMediaType, keepAlbumIds, cutoffDaysAgo, defaultsInitialized);

@override
String toString() =>
'CleanupConfig(keepFavorites: $keepFavorites, keepMediaType: $keepMediaType, keepAlbumIds: $keepAlbumIds, cutoffDaysAgo: $cutoffDaysAgo, defaultsInitialized: $defaultsInitialized)';
part 'cleanup_config.freezed.dart';

@freezed
abstract class CleanupConfig with _$CleanupConfig {
const factory CleanupConfig({
@Default(true) bool keepFavorites,
@Default(AssetKeepType.none) AssetKeepType keepMediaType,
@Default([]) List<String> keepAlbumIds,
@Default(-1) int cutoffDaysAgo,
@Default(false) bool defaultsInitialized,
}) = _CleanupConfig;
}
53 changes: 16 additions & 37 deletions mobile/lib/domain/models/config/map_config.dart
Original file line number Diff line number Diff line change
@@ -1,25 +1,24 @@
import 'package:flutter/material.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:immich_mobile/utils/option.dart';

class MapConfig {
final int relativeDays;
final bool favoritesOnly;
final bool includeArchived;
final ThemeMode themeMode;
final bool withPartners;
final DateTime? customFrom;
final DateTime? customTo;
part 'map_config.freezed.dart';

const MapConfig({
this.relativeDays = 0,
this.favoritesOnly = false,
this.includeArchived = false,
this.themeMode = .system,
this.withPartners = false,
this.customFrom,
this.customTo,
});
@Freezed(copyWith: false)
abstract class MapConfig with _$MapConfig {
const MapConfig._();

const factory MapConfig({
@Default(0) int relativeDays,
@Default(false) bool favoritesOnly,
@Default(false) bool includeArchived,
@Default(ThemeMode.system) ThemeMode themeMode,
@Default(false) bool withPartners,
DateTime? customFrom,
DateTime? customTo,
}) = _MapConfig;

// We patch `customFrom` and `customTo`, which prevents us from using Freezed `copyWith`
MapConfig copyWith({
int? relativeDays,
bool? favoritesOnly,
Expand All @@ -37,24 +36,4 @@ class MapConfig {
customFrom: customFrom.patch(this.customFrom),
customTo: customTo.patch(this.customTo),
);

@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is MapConfig &&
other.relativeDays == relativeDays &&
other.favoritesOnly == favoritesOnly &&
other.includeArchived == includeArchived &&
other.themeMode == themeMode &&
other.withPartners == withPartners &&
other.customFrom == customFrom &&
other.customTo == customTo);

@override
int get hashCode =>
Object.hash(relativeDays, favoritesOnly, includeArchived, themeMode, withPartners, customFrom, customTo);

@override
String toString() =>
'MapConfig(relativeDays: $relativeDays, favoritesOnly: $favoritesOnly, includeArchived: $includeArchived, themeMode: $themeMode, withPartners: $withPartners, customFrom: $customFrom, customTo: $customTo)';
}
51 changes: 14 additions & 37 deletions mobile/lib/domain/models/config/network_config.dart
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import 'package:flutter/foundation.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
import 'package:immich_mobile/utils/option.dart';

class NetworkConfig {
final bool autoEndpointSwitching;
final String? preferredWifiName;
final String? localEndpoint;
final List<String> externalEndpointList;
final Map<String, String> customHeaders;
part 'network_config.freezed.dart';

const NetworkConfig({
this.autoEndpointSwitching = false,
this.preferredWifiName,
this.localEndpoint,
this.externalEndpointList = const [],
this.customHeaders = const {},
});
@Freezed(copyWith: false)
abstract class NetworkConfig with _$NetworkConfig {
const NetworkConfig._();

const factory NetworkConfig({
@Default(false) bool autoEndpointSwitching,
String? preferredWifiName,
String? localEndpoint,
@Default([]) List<String> externalEndpointList,
@Default({}) Map<String, String> customHeaders,
}) = _NetworkConfig;

// We patch `preferredWifiName` and `localEndpoint`, which prevents us from using Freezed `copyWith`
NetworkConfig copyWith({
bool? autoEndpointSwitching,
Option<String>? preferredWifiName,
Expand All @@ -29,27 +29,4 @@ class NetworkConfig {
externalEndpointList: externalEndpointList ?? this.externalEndpointList,
customHeaders: customHeaders ?? this.customHeaders,
);

@override
bool operator ==(Object other) =>
identical(this, other) ||
(other is NetworkConfig &&
other.autoEndpointSwitching == autoEndpointSwitching &&
other.preferredWifiName == preferredWifiName &&
other.localEndpoint == localEndpoint &&
listEquals(other.externalEndpointList, externalEndpointList) &&
mapEquals(other.customHeaders, customHeaders));

@override
int get hashCode => Object.hash(
autoEndpointSwitching,
preferredWifiName,
localEndpoint,
Object.hashAll(externalEndpointList),
Object.hashAllUnordered(customHeaders.entries.map((e) => Object.hash(e.key, e.value))),
);

@override
String toString() =>
'NetworkConfig(autoEndpointSwitching: $autoEndpointSwitching, preferredWifiName: $preferredWifiName, localEndpoint: $localEndpoint, externalEndpointList: $externalEndpointList, customHeaders: $customHeaders)';
}
22 changes: 4 additions & 18 deletions mobile/lib/domain/models/stack.model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,8 @@ abstract class Stack with _$Stack {
}) = _Stack;
}

class StackResponse {
final String id;
final String primaryAssetId;
final List<String> assetIds;

const StackResponse({required this.id, required this.primaryAssetId, required this.assetIds});

@override
bool operator ==(covariant StackResponse other) {
if (identical(this, other)) {
return true;
}

return other.id == id && other.primaryAssetId == primaryAssetId && other.assetIds == assetIds;
}

@override
int get hashCode => id.hashCode ^ primaryAssetId.hashCode ^ assetIds.hashCode;
@freezed
abstract class StackResponse with _$StackResponse {
const factory StackResponse({required String id, required String primaryAssetId, required List<String> assetIds}) =
_StackResponse;
}
Loading
Loading