Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore extension when deduplicating option #192

Merged
merged 3 commits into from
Mar 22, 2024

Conversation

matthewkeller36
Copy link
Contributor

Implements duplication checking while ignoring file extensions. Addresses feature request I had mentioned in #191. Uses a.Type to add an extra layer of security when determining if files are duplicates. Feature can be invoked using -ignore-extension in the command line

@simulot simulot merged commit c70d665 into simulot:main Mar 22, 2024
1 check passed
@matthewkeller36
Copy link
Contributor Author

One issue I am seeing with using strings.TrimSuffix is the OriginalFileName already contains the extension and the duplicateKey is appending a second extension. Example:
a.OriginalFileName: IMG_0394.HEIC
a.OriginalFileName + path.Ext(a.OriginalPath): IMG_0394.HEIC.HEIC

This was why I was originally using strings.Cut as TrimSuffix will only remove one of the extensions. I believe this issue could be avoided by not appending path.Ext(a.OriginalPath) to the duplicateKey.

@matthewkeller36 matthewkeller36 deleted the dedupe-no-ext branch March 22, 2024 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants