Skip to content

Commit

Permalink
#346 zip clean up and db version update automatic quick backup zip pr…
Browse files Browse the repository at this point in the history
…evention
  • Loading branch information
ghuotvez committed Jun 10, 2024
1 parent f6e0d16 commit e15d5be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions GSCFieldApp/Services/FileServices/FileServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ public async Task<string> SaveArchiveCopy(string fieldbookpath = "", string curr
}

}

//Clean up
if (File.Exists(tempZip))
{
File.Delete(tempZip);
}
}

return outputZipPhotoFilePath;
Expand Down
1 change: 0 additions & 1 deletion GSCFieldApp/ViewModels/FieldBooksPageViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,6 @@ public async Task BackupFieldBook()
//Zip and Copy
string outputZipFilePath = await fs.SaveArchiveCopy(selectedBook.ProjectPath,
selectedBook.metadataForProject.UserCode);

}
}

Expand Down
3 changes: 2 additions & 1 deletion GSCFieldApp/ViewModels/ShellViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using Template10.Mvvm;
using Windows.Storage;
using Windows.UI.Xaml;
Expand Down Expand Up @@ -148,7 +149,7 @@ public async void QuickBackupAsync()
}

//If any photos needs to be copied, else show warning
if (FilesToBackup.Count > 1)
if (FilesToBackup.Count > 1 && FilesToBackup.Where(x=>x.FileType != DatabaseLiterals.DBTypeSqlite).Count() > 0)
{
//Copy database and rename it
List<StorageFile> newList = new List<StorageFile>();
Expand Down

0 comments on commit e15d5be

Please sign in to comment.