Skip to content

Feature request: check for uniqueness #6

Description

@axcro7

It seems Duplicate Detection is only used when creating a new ID.

But when coping files one might forget to generate a new ID, this would lead to IDs being used more than once, which kind of defeats the whole purpose of having one.

Current workaround:
use dataviewjs to identify files with duplicate ids and resolve manualy:

const pages = dv.pages().where(p => p.id);

const groups = {};
for (let p of pages) {
    if (!groups[p.id]) groups[p.id] = [];
    groups[p.id].push(p);
}

for (let id in groups) {
    if (groups[id].length > 1) {
        dv.header(3, `Duplicate ID: ${id}`);
        dv.table(
            ["Name", "Created", "Modified"],
            groups[id].map(p => [
                p.file.link,
                p.file.ctime,
                p.file.mtime
            ])
        );
    }
}

Not sure how tackle this, but some kind of integrated check would be great.

Thank you for sharing this great little perl with us! Keep it up! 👍

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions