mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-08 11:03:25 -08:00
Apply suggestion from @ZeldaZach
Co-authored-by: Zach H <zahalpern+github@gmail.com>
This commit is contained in:
parent
26ffd1cfae
commit
b611e8ea6f
1 changed files with 4 additions and 3 deletions
|
|
@ -460,10 +460,11 @@ void DeckSyncManager::classify(const QMap<int, ServerFile> &serverFiles)
|
||||||
}
|
}
|
||||||
const DeckSyncRecord baseRecord = sidecar.get(it.key());
|
const DeckSyncRecord baseRecord = sidecar.get(it.key());
|
||||||
const bool localChanged = baseRecord.baseHash.isEmpty() || baseRecord.baseHash != it.value().hash;
|
const bool localChanged = baseRecord.baseHash.isEmpty() || baseRecord.baseHash != it.value().hash;
|
||||||
// A server row without a hash predates sync: treat it as unknown rather than changed,
|
// A server row without a hash predates sync: with a base, treat it as unknown
|
||||||
// otherwise every sync re-downloads the deck.
|
// rather than changed (otherwise every sync re-downloads the deck). Without a
|
||||||
|
// base nothing says the server copy is unchanged, so it must not lose silently.
|
||||||
const bool serverChanged =
|
const bool serverChanged =
|
||||||
!server.hash.isEmpty() && (baseRecord.baseHash.isEmpty() || baseRecord.baseHash != server.hash);
|
baseRecord.baseHash.isEmpty() || (!server.hash.isEmpty() && baseRecord.baseHash != server.hash);
|
||||||
if (localChanged && !serverChanged) {
|
if (localChanged && !serverChanged) {
|
||||||
if (syncMode == DeckSyncMode::DownloadOnly) {
|
if (syncMode == DeckSyncMode::DownloadOnly) {
|
||||||
continue;
|
continue;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue