Skip to content

Commit

Permalink
include files without blockset in broken files (issue #4988)
Browse files Browse the repository at this point in the history
also change the message in purge-broken-files about last fileset to a warning.
  • Loading branch information
gpatel-fr committed Jul 11, 2023
1 parent d0f1498 commit 3daa880
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal class LocalListBrokenFilesDatabase : LocalDatabase
private const string BROKEN_FILE_SETS = @"SELECT DISTINCT ""B"".""Timestamp"", ""A"".""FilesetID"", COUNT(""A"".""FileID"") AS ""FileCount"" FROM ""FilesetEntry"" A, ""Fileset"" B WHERE ""A"".""FilesetID"" = ""B"".""ID"" AND ""A"".""FileID"" IN (" + BROKEN_FILE_IDS + @")";

private const string BROKEN_FILE_NAMES = @"
SELECT ""A"".""Path"", ""B"".""Length"" FROM ""File"" A, ""Blockset"" B WHERE ""A"".""BlocksetID"" = ""B"".""ID"" AND ""A"".""ID"" IN ("
SELECT ""A"".""Path"", ""B"".""Length"" FROM ""File"" A LEFT JOIN ""Blockset"" B ON (""A"".""BlocksetID"" = ""B"".""ID"") WHERE ""A"".""ID"" IN ("
+ BROKEN_FILE_IDS +
@") AND ""A"".""ID"" IN (SELECT ""FileID"" FROM ""FilesetEntry"" WHERE ""FilesetID"" = ?)";

Expand Down
2 changes: 1 addition & 1 deletion Duplicati/Library/Main/Operation/DeleteHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void DoRun(Database.LocalDeleteDatabase db, ref System.Data.IDbTransactio

if (!m_options.AllowFullRemoval && filesets.Length == versionsToDelete.Count)
{
Logging.Log.WriteInformationMessage(LOGTAG, "PreventingLastFilesetRemoval", "Preventing removal of last fileset, use --{0} to allow removal ...", "allow-full-removal");
Logging.Log.WriteWarningMessage(LOGTAG, "PreventingLastFilesetRemoval", null, "Preventing removal of last fileset, use --{0} to allow removal ...", "allow-full-removal");
versionsToDelete = versionsToDelete.OrderBy(x => x.Version).Skip(1).ToList();
}

Expand Down

0 comments on commit 3daa880

Please sign in to comment.