Closed matthewkeller36 closed 3 months ago
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.
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