Suppress Rhizome add de-duplication for journals

This commit is contained in:
Andrew Bettison 2015-04-13 14:48:34 +09:30
parent 0f8141af95
commit 5120e50dd7

View File

@ -1434,9 +1434,12 @@ enum rhizome_bundle_status rhizome_manifest_finalise(rhizome_manifest *m, rhizom
assert(*mout == NULL); assert(*mout == NULL);
if (!m->finalised && !rhizome_manifest_validate(m)) if (!m->finalised && !rhizome_manifest_validate(m))
RETURN(RHIZOME_BUNDLE_STATUS_INVALID); RETURN(RHIZOME_BUNDLE_STATUS_INVALID);
// if a manifest was supplied with an ID, don't bother to check for a duplicate. // The duplicate detection logic exists to filter out files repeatedly added with no existing
// we only want to filter out added files with no existing manifest. // manifest (ie, "de-bounce" for the "Add File" user interface action).
if (deduplicate && m->haveSecret != EXISTING_BUNDLE_ID) { // 1. If a manifest was supplied with a bundle ID, don't check for a duplicate.
// 2. Never perform duplicate detection on journals (the first append does not supply a bundle ID,
// but all subsequent appends supply a bundle ID, so are caught by case (1)).
if (deduplicate && m->haveSecret != EXISTING_BUNDLE_ID && !m->is_journal) {
enum rhizome_bundle_status status = rhizome_find_duplicate(m, mout); enum rhizome_bundle_status status = rhizome_find_duplicate(m, mout);
switch (status) { switch (status) {
case RHIZOME_BUNDLE_STATUS_DUPLICATE: case RHIZOME_BUNDLE_STATUS_DUPLICATE: