remove unused variable

master
gitea 2 months ago
parent 84f1712916
commit 5f8d8330f5

@ -93,34 +93,29 @@ class ImmichService {
final fileStat = await imageFile.stat();
final fileCreatedAt = fileStat.changed;
final fileModifiedAt = fileStat.modified;
// Determine MIME type from file extension
String mimeType = 'image/jpeg'; // default
final extension = fileName.split('.').last.toLowerCase();
switch (extension) {
case 'png':
mimeType = 'image/png';
break;
case 'jpg':
case 'jpeg':
mimeType = 'image/jpeg';
break;
case 'gif':
mimeType = 'image/gif';
break;
case 'webp':
mimeType = 'image/webp';
break;
case 'heic':
case 'heif':
mimeType = 'image/heic';
break;
}
// Generate device IDs (required by Immich API)
// Using a consistent device ID based on the app
const deviceId = 'flutter-app-boilerplate';
final deviceAssetId = 'device-asset-${fileCreatedAt.millisecondsSinceEpoch}';
final deviceAssetId =
'device-asset-${fileCreatedAt.millisecondsSinceEpoch}';
// Format dates in ISO 8601 format (UTC)
final fileCreatedAtIso = fileCreatedAt.toUtc().toIso8601String();
@ -211,7 +206,8 @@ class ImmichService {
? (response.data as Map)['message']?.toString() ??
response.statusMessage
: response.statusMessage;
debugPrint('Upload failed with status ${response.statusCode}: $errorMessage');
debugPrint(
'Upload failed with status ${response.statusCode}: $errorMessage');
throw ImmichException(
'Upload failed: $errorMessage',
response.statusCode,
@ -223,7 +219,8 @@ class ImmichService {
debugPrint('Response is Map with keys: ${(response.data as Map).keys}');
debugPrint('Full response map: ${response.data}');
} else if (response.data is List) {
debugPrint('Response is List with ${(response.data as List).length} items');
debugPrint(
'Response is List with ${(response.data as List).length} items');
debugPrint('First item: ${(response.data as List).first}');
} else {
debugPrint('Response type: ${response.data.runtimeType}');

Loading…
Cancel
Save

Powered by TurnKey Linux.