mirror of
https://github.com/FoggedLens/deflock-app.git
synced 2026-02-13 09:12:56 +00:00
better progress tile x/y
This commit is contained in:
@@ -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}';
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user