smugcli icon indicating copy to clipboard operation
smugcli copied to clipboard

Case-insensitive regex for file extension

Open pbtrung opened this issue 7 years ago • 2 comments

The file extensions are hard-coded and case-sensitive (e.g., Jpg and jpG do not work). A simple case-insensitive regex would do the job.

pbtrung avatar Apr 23 '18 07:04 pbtrung

The current implementation does case-insensitive matching. See the .lower() here: https://github.com/graveljp/smugcli/blob/cdf0107fc977040964e96b2563573a796832d12a/smugmug_fs.py#L256

Files will be uploaded regardless of their file extension case. Now, there might be a problem around files with same names but mismatching cases. On Linux, I would expect two files to be uploaded (this should work correctly). On Windows and MacOS (case-insensitive APFS), two such files cannot exists side by side. There is a corner case however: if a lower-case file is uploaded to SmugMug and is subsequently renamed to uppercase, a sync operation would re-upload the file. I suppose that in this case, we could either detect that the files are the same and skip the re-upload, or rename the SmugMug file to match the new case.

What do you think?

graveljp avatar Apr 25 '18 02:04 graveljp

If we could detect that the files are the same, I would prefer to rename the SmugMug file to match the new case. Synchronization is supposed to make local and remote storage exactly the same, right? Anyway, either way is fine. Please pick up your preference.

pbtrung avatar Apr 25 '18 06:04 pbtrung