better progress tile x/y

This commit is contained in:
stopflock
2025-08-06 23:37:38 -05:00
parent 174ffb3aac
commit fff1096870
2 changed files with 13 additions and 3 deletions

View File

@@ -415,7 +415,11 @@ class _OfflineAreasSectionState extends State<_OfflineAreasSection> {
'Z${area.minZoom}-${area.maxZoom}\n' +
'Lat: ${area.bounds.southWest.latitude.toStringAsFixed(3)}, ${area.bounds.southWest.longitude.toStringAsFixed(3)}\n' +
'Lat: ${area.bounds.northEast.latitude.toStringAsFixed(3)}, ${area.bounds.northEast.longitude.toStringAsFixed(3)}';
subtitle += '\nTiles: ${area.tilesTotal}';
if (area.status == OfflineAreaStatus.downloading) {
subtitle += '\nTiles: ${area.tilesDownloaded} / ${area.tilesTotal}';
} else {
subtitle += '\nTiles: ${area.tilesTotal}';
}
subtitle += ' | Size: $diskStr';
if (area.status == OfflineAreaStatus.complete) {
subtitle += ' | Cameras: ${area.cameras.length}';

View File

@@ -186,10 +186,16 @@ class OfflineAreaService {
}
}
void cancelDownload(String id) {
void cancelDownload(String id) async {
final area = _areas.firstWhere((a) => a.id == id, orElse: () => throw 'Area not found');
area.status = OfflineAreaStatus.cancelled;
saveAreasToDisk();
// Delete partial files as on standard delete
final dir = Directory(area.directory);
if (await dir.exists()) {
await dir.delete(recursive: true);
}
_areas.remove(area);
await saveAreasToDisk();
}
void deleteArea(String id) async {