use real node id for pending uploads, more camera -> node

This commit is contained in:
stopflock
2025-09-28 20:20:00 -05:00
parent 4ad33d17e0
commit 4053c9b39b
10 changed files with 231 additions and 101 deletions
+7 -3
View File
@@ -10,6 +10,7 @@ class PendingUpload {
final OperatorProfile? operatorProfile;
final UploadMode uploadMode; // Capture upload destination when queued
final int? originalNodeId; // If this is an edit, the ID of the original OSM node
int? submittedNodeId; // The actual node ID returned by OSM after successful submission
int attempts;
bool error;
bool completing; // True when upload succeeded but item is showing checkmark briefly
@@ -21,12 +22,13 @@ class PendingUpload {
this.operatorProfile,
required this.uploadMode,
this.originalNodeId,
this.submittedNodeId,
this.attempts = 0,
this.error = false,
this.completing = false,
});
// True if this is an edit of an existing camera, false if it's a new camera
// True if this is an edit of an existing node, false if it's a new node
bool get isEdit => originalNodeId != null;
// Get display name for the upload destination
@@ -41,11 +43,11 @@ class PendingUpload {
}
}
// Get combined tags from camera profile and operator profile
// Get combined tags from node profile and operator profile
Map<String, String> getCombinedTags() {
final tags = Map<String, String>.from(profile.tags);
// Add operator profile tags (they override camera profile tags if there are conflicts)
// Add operator profile tags (they override node profile tags if there are conflicts)
if (operatorProfile != null) {
tags.addAll(operatorProfile!.tags);
}
@@ -66,6 +68,7 @@ class PendingUpload {
'operatorProfile': operatorProfile?.toJson(),
'uploadMode': uploadMode.index,
'originalNodeId': originalNodeId,
'submittedNodeId': submittedNodeId,
'attempts': attempts,
'error': error,
'completing': completing,
@@ -84,6 +87,7 @@ class PendingUpload {
? UploadMode.values[j['uploadMode']]
: UploadMode.production, // Default for legacy entries
originalNodeId: j['originalNodeId'],
submittedNodeId: j['submittedNodeId'],
attempts: j['attempts'] ?? 0,
error: j['error'] ?? false,
completing: j['completing'] ?? false, // Default to false for legacy entries