Closed matthewkeller36 closed 1 month ago
I remember some issues around this. We may have file names with dots liker '2023.04.23.original.jpg' and '2023.04.23.modified.jpg' which aren't real duplicates too.
From my understanding, path.Base
should still return the full filename with extension (2023.04.23.original.jpg
), correct? Then, if we are using the -ignore-extension
tag, we could remove the extension from the Name field using TrimSuffix. This would not cause issues with files containing multiple dots since only the extension suffix is trimmed, not the rest of the name.
Trimming the result of path.Ext() isn't safe: https://go.dev/play/p/QnxJjl8x3iu
Maybe only trim extension recognized by the server... several time to check cases like image.cr3.jpg
I do not see the issue being shown in that example. It is outputting the full extension which the code should be doing correctly. The only case I can see using path.Base and then TrimSuffix would cause an issue would be for files whose name is only the extension (.jpg
, .png
, etc.) but this would be horrible naming convention to use already.
https://go.dev/play/p/VJJBa8YRRqK
I'm working on the TUI for the duplicate command...
The are plenty of changes for TUI I'll fix that
Packs the filename to include both name and extension. Removes issues with duplicate extensions being listed when
a.OriginalFileName
already contains the extension.Example file: IMG_1011.JPG
Original: Name =
IMG_1011.JPG.JPG
New: Name =IMG_1011.JPG
This was causing issues with
--ignore-extension
only removing one extension when comparing names rather than both.