Skip to content
New issue

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

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

Already on GitHub? # to your account

Case-insensitive regex for file extension #4

Open
pbtrung opened this issue Apr 23, 2018 · 2 comments
Open

Case-insensitive regex for file extension #4

pbtrung opened this issue Apr 23, 2018 · 2 comments

Comments

@pbtrung
Copy link

pbtrung commented Apr 23, 2018

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.

@graveljp
Copy link
Owner

The current implementation does case-insensitive matching. See the .lower() here:

extension = os.path.splitext(path)[1].lower()

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?

@pbtrung
Copy link
Author

pbtrung commented Apr 25, 2018

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants