From 08d8bd67a652a4ad17483e64e802e0cd5c4cd047 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhede Date: Wed, 30 Mar 2016 08:33:10 +0200 Subject: [PATCH] Fixed error after merge with latests master --- Duplicati/Library/Main/Operation/RepairHandler.cs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/Duplicati/Library/Main/Operation/RepairHandler.cs b/Duplicati/Library/Main/Operation/RepairHandler.cs index 7feaa6fd7..742ee36c2 100644 --- a/Duplicati/Library/Main/Operation/RepairHandler.cs +++ b/Duplicati/Library/Main/Operation/RepairHandler.cs @@ -202,18 +202,15 @@ namespace Duplicati.Library.Main.Operation { foreach(var rv in ifr.Volumes) { - string cmphash; - long cmpsize; - RemoteVolumeType cmptype; - RemoteVolumeState cmpstate; - if (!db.GetRemoteVolume(rv.Filename, out cmphash, out cmpsize, out cmptype, out cmpstate)) + var entry = db.GetRemoteVolume(rv.Filename); + if (entry.ID < 0) throw new Exception(string.Format("Unknown remote file {0} detected", rv.Filename)); - if (!new [] { RemoteVolumeState.Uploading, RemoteVolumeState.Uploaded, RemoteVolumeState.Verified }.Contains(cmpstate)) - throw new Exception(string.Format("Volume {0} has local state {1}", rv.Filename, cmpstate)); + if (!new [] { RemoteVolumeState.Uploading, RemoteVolumeState.Uploaded, RemoteVolumeState.Verified }.Contains(entry.State)) + throw new Exception(string.Format("Volume {0} has local state {1}", rv.Filename, entry.State)); - if (cmphash != rv.Hash || cmpsize != rv.Length || ! new [] { RemoteVolumeState.Uploading, RemoteVolumeState.Uploaded, RemoteVolumeState.Verified }.Contains(cmpstate)) - throw new Exception(string.Format("Volume {0} hash/size mismatch ({1} - {2}) vs ({3} - {4})", rv.Filename, cmphash, cmpsize, rv.Hash, rv.Length)); + if (entry.Hash != rv.Hash || entry.Size != rv.Length || ! new [] { RemoteVolumeState.Uploading, RemoteVolumeState.Uploaded, RemoteVolumeState.Verified }.Contains(entry.State)) + throw new Exception(string.Format("Volume {0} hash/size mismatch ({1} - {2}) vs ({3} - {4})", rv.Filename, entry.Hash, entry.Size, rv.Hash, rv.Length)); db.CheckAllBlocksAreInVolume(rv.Filename, rv.Blocks); }