mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
chore: bump dart sdk to 3.8 (#20355)
* chore: bump dart sdk to 3.8 * chore: make build * make pigeon * chore: format files --------- Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
9b3718120b
commit
e52b9d15b5
643 changed files with 32561 additions and 35292 deletions
|
|
@ -11,42 +11,24 @@ import 'package:package_info_plus/package_info_plus.dart';
|
|||
|
||||
class ServerInfoNotifier extends StateNotifier<ServerInfo> {
|
||||
ServerInfoNotifier(this._serverInfoService)
|
||||
: super(
|
||||
const ServerInfo(
|
||||
serverVersion: ServerVersion(
|
||||
major: 0,
|
||||
minor: 0,
|
||||
patch: 0,
|
||||
),
|
||||
latestVersion: ServerVersion(
|
||||
major: 0,
|
||||
minor: 0,
|
||||
patch: 0,
|
||||
),
|
||||
serverFeatures: ServerFeatures(
|
||||
map: true,
|
||||
trash: true,
|
||||
oauthEnabled: false,
|
||||
passwordLogin: true,
|
||||
),
|
||||
serverConfig: ServerConfig(
|
||||
trashDays: 30,
|
||||
oauthButtonText: '',
|
||||
externalDomain: '',
|
||||
mapLightStyleUrl: 'https://tiles.immich.cloud/v1/style/light.json',
|
||||
mapDarkStyleUrl: 'https://tiles.immich.cloud/v1/style/dark.json',
|
||||
),
|
||||
serverDiskInfo: ServerDiskInfo(
|
||||
diskAvailable: "0",
|
||||
diskSize: "0",
|
||||
diskUse: "0",
|
||||
diskUsagePercentage: 0,
|
||||
),
|
||||
isVersionMismatch: false,
|
||||
isNewReleaseAvailable: false,
|
||||
versionMismatchErrorMessage: "",
|
||||
: super(
|
||||
const ServerInfo(
|
||||
serverVersion: ServerVersion(major: 0, minor: 0, patch: 0),
|
||||
latestVersion: ServerVersion(major: 0, minor: 0, patch: 0),
|
||||
serverFeatures: ServerFeatures(map: true, trash: true, oauthEnabled: false, passwordLogin: true),
|
||||
serverConfig: ServerConfig(
|
||||
trashDays: 30,
|
||||
oauthButtonText: '',
|
||||
externalDomain: '',
|
||||
mapLightStyleUrl: 'https://tiles.immich.cloud/v1/style/light.json',
|
||||
mapDarkStyleUrl: 'https://tiles.immich.cloud/v1/style/dark.json',
|
||||
),
|
||||
);
|
||||
serverDiskInfo: ServerDiskInfo(diskAvailable: "0", diskSize: "0", diskUse: "0", diskUsagePercentage: 0),
|
||||
isVersionMismatch: false,
|
||||
isNewReleaseAvailable: false,
|
||||
versionMismatchErrorMessage: "",
|
||||
),
|
||||
);
|
||||
|
||||
final ServerInfoService _serverInfoService;
|
||||
final _log = Logger("ServerInfoNotifier");
|
||||
|
|
@ -62,19 +44,14 @@ class ServerInfoNotifier extends StateNotifier<ServerInfo> {
|
|||
final serverVersion = await _serverInfoService.getServerVersion();
|
||||
|
||||
if (serverVersion == null) {
|
||||
state = state.copyWith(
|
||||
isVersionMismatch: true,
|
||||
versionMismatchErrorMessage: "common_server_error".tr(),
|
||||
);
|
||||
state = state.copyWith(isVersionMismatch: true, versionMismatchErrorMessage: "common_server_error".tr());
|
||||
return;
|
||||
}
|
||||
|
||||
await _checkServerVersionMismatch(serverVersion);
|
||||
} catch (e, stackTrace) {
|
||||
_log.severe("Failed to get server version", e, stackTrace);
|
||||
state = state.copyWith(
|
||||
isVersionMismatch: true,
|
||||
);
|
||||
state = state.copyWith(isVersionMismatch: true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
@ -118,29 +95,21 @@ class ServerInfoNotifier extends StateNotifier<ServerInfo> {
|
|||
return;
|
||||
}
|
||||
|
||||
state = state.copyWith(
|
||||
isVersionMismatch: false,
|
||||
versionMismatchErrorMessage: "",
|
||||
);
|
||||
state = state.copyWith(isVersionMismatch: false, versionMismatchErrorMessage: "");
|
||||
}
|
||||
|
||||
handleNewRelease(
|
||||
ServerVersion serverVersion,
|
||||
ServerVersion latestVersion,
|
||||
) {
|
||||
handleNewRelease(ServerVersion serverVersion, ServerVersion latestVersion) {
|
||||
// Update local server version
|
||||
_checkServerVersionMismatch(serverVersion);
|
||||
|
||||
final majorEqual = latestVersion.major == serverVersion.major;
|
||||
final minorEqual = majorEqual && latestVersion.minor == serverVersion.minor;
|
||||
final newVersionAvailable = latestVersion.major > serverVersion.major ||
|
||||
final newVersionAvailable =
|
||||
latestVersion.major > serverVersion.major ||
|
||||
(majorEqual && latestVersion.minor > serverVersion.minor) ||
|
||||
(minorEqual && latestVersion.patch > serverVersion.patch);
|
||||
|
||||
state = state.copyWith(
|
||||
latestVersion: latestVersion,
|
||||
isNewReleaseAvailable: newVersionAvailable,
|
||||
);
|
||||
state = state.copyWith(latestVersion: latestVersion, isNewReleaseAvailable: newVersionAvailable);
|
||||
}
|
||||
|
||||
getServerFeatures() async {
|
||||
|
|
@ -166,11 +135,7 @@ class ServerInfoNotifier extends StateNotifier<ServerInfo> {
|
|||
var minor = detail[1];
|
||||
var patch = detail[2];
|
||||
|
||||
return {
|
||||
"major": int.parse(major),
|
||||
"minor": int.parse(minor),
|
||||
"patch": int.parse(patch.replaceAll("-DEBUG", "")),
|
||||
};
|
||||
return {"major": int.parse(major), "minor": int.parse(minor), "patch": int.parse(patch.replaceAll("-DEBUG", ""))};
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue