From 91acfebfea8b95ce2553fd83db83cff0f4112e5d Mon Sep 17 00:00:00 2001 From: Max Krieger Date: Mon, 22 Aug 2022 20:00:05 -0400 Subject: [PATCH] Patch auto remove --- android/Gemfile.lock | 22 +++++++++++----------- ios/Gemfile.lock | 22 +++++++++++----------- lib/repositories/drive_backup.dart | 4 ++-- lib/views/drive_settings_view.dart | 6 ++++++ pubspec.yaml | 2 +- 5 files changed, 31 insertions(+), 25 deletions(-) diff --git a/android/Gemfile.lock b/android/Gemfile.lock index 7546130..339fb0d 100644 --- a/android/Gemfile.lock +++ b/android/Gemfile.lock @@ -3,13 +3,13 @@ GEM specs: CFPropertyList (3.0.5) rexml - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.610.0) - aws-sdk-core (3.131.3) + aws-partitions (1.620.0) + aws-sdk-core (3.132.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) @@ -34,10 +34,10 @@ GEM rake (>= 12.0.0, < 14.0.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - dotenv (2.8.0) + dotenv (2.8.1) emoji_regex (3.2.3) excon (0.92.4) - faraday (1.10.0) + faraday (1.10.1) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -66,7 +66,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.6) - fastlane (2.208.0) + fastlane (2.209.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -121,7 +121,7 @@ GEM google-apis-core (>= 0.7, < 2.a) google-apis-playcustomapp_v1 (0.10.0) google-apis-core (>= 0.7, < 2.a) - google-apis-storage_v1 (0.18.0) + google-apis-storage_v1 (0.17.0) google-apis-core (>= 0.7, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) @@ -129,11 +129,11 @@ GEM google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.2.0) - google-cloud-storage (1.37.0) + google-cloud-storage (1.38.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.17.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) @@ -161,7 +161,7 @@ GEM optparse (0.1.1) os (1.1.4) plist (3.6.0) - public_suffix (4.0.7) + public_suffix (5.0.0) rake (13.0.6) representable (3.2.0) declarative (< 0.1.0) diff --git a/ios/Gemfile.lock b/ios/Gemfile.lock index 7546130..339fb0d 100644 --- a/ios/Gemfile.lock +++ b/ios/Gemfile.lock @@ -3,13 +3,13 @@ GEM specs: CFPropertyList (3.0.5) rexml - addressable (2.8.0) - public_suffix (>= 2.0.2, < 5.0) + addressable (2.8.1) + public_suffix (>= 2.0.2, < 6.0) artifactory (3.0.15) atomos (0.1.3) aws-eventstream (1.2.0) - aws-partitions (1.610.0) - aws-sdk-core (3.131.3) + aws-partitions (1.620.0) + aws-sdk-core (3.132.0) aws-eventstream (~> 1, >= 1.0.2) aws-partitions (~> 1, >= 1.525.0) aws-sigv4 (~> 1.1) @@ -34,10 +34,10 @@ GEM rake (>= 12.0.0, < 14.0.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - dotenv (2.8.0) + dotenv (2.8.1) emoji_regex (3.2.3) excon (0.92.4) - faraday (1.10.0) + faraday (1.10.1) faraday-em_http (~> 1.0) faraday-em_synchrony (~> 1.0) faraday-excon (~> 1.1) @@ -66,7 +66,7 @@ GEM faraday_middleware (1.2.0) faraday (~> 1.0) fastimage (2.2.6) - fastlane (2.208.0) + fastlane (2.209.0) CFPropertyList (>= 2.3, < 4.0.0) addressable (>= 2.8, < 3.0.0) artifactory (~> 3.0) @@ -121,7 +121,7 @@ GEM google-apis-core (>= 0.7, < 2.a) google-apis-playcustomapp_v1 (0.10.0) google-apis-core (>= 0.7, < 2.a) - google-apis-storage_v1 (0.18.0) + google-apis-storage_v1 (0.17.0) google-apis-core (>= 0.7, < 2.a) google-cloud-core (1.6.0) google-cloud-env (~> 1.0) @@ -129,11 +129,11 @@ GEM google-cloud-env (1.6.0) faraday (>= 0.17.3, < 3.0) google-cloud-errors (1.2.0) - google-cloud-storage (1.37.0) + google-cloud-storage (1.38.0) addressable (~> 2.8) digest-crc (~> 0.4) google-apis-iamcredentials_v1 (~> 0.1) - google-apis-storage_v1 (~> 0.1) + google-apis-storage_v1 (~> 0.17.0) google-cloud-core (~> 1.6) googleauth (>= 0.16.2, < 2.a) mini_mime (~> 1.0) @@ -161,7 +161,7 @@ GEM optparse (0.1.1) os (1.1.4) plist (3.6.0) - public_suffix (4.0.7) + public_suffix (5.0.0) rake (13.0.6) representable (3.2.0) declarative (< 0.1.0) diff --git a/lib/repositories/drive_backup.dart b/lib/repositories/drive_backup.dart index a3e1dc0..a213807 100644 --- a/lib/repositories/drive_backup.dart +++ b/lib/repositories/drive_backup.dart @@ -99,10 +99,10 @@ Future removeOldBackups() async { } final existing = await driveApi.files.list( spaces: "appDataFolder", - pageSize: 1000, + pageSize: 50, q: "name = 'voice_outliner.zip'", $fields: "files(modifiedTime, id)", - orderBy: "modifiedTime desc"); + orderBy: "modifiedTime"); if (existing.files != null && existing.files!.isNotEmpty) { for (var file in existing.files!) { if (DateTime.now() diff --git a/lib/views/drive_settings_view.dart b/lib/views/drive_settings_view.dart index ed62ea3..79d553e 100644 --- a/lib/views/drive_settings_view.dart +++ b/lib/views/drive_settings_view.dart @@ -252,6 +252,12 @@ class _DriveSettingsViewState extends State { sharedPreferences! .setBool(autoDeleteOldBackupsKey, val); }); + if (val) { + removeOldBackups(); + ScaffoldMessenger.of(context).showSnackBar(const SnackBar( + content: Text( + "Auto-removing now, reopen this page to refresh"))); + } }), ListTile( leading: const Icon(Icons.backup), diff --git a/pubspec.yaml b/pubspec.yaml index d84e6fe..7bece2a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 1.25.0+99 +version: 1.25.1+100 environment: sdk: ">=2.12.0 <3.0.0"