Skip to content

Import: Allow directory names with dots #2807

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

Closed
nicktar opened this issue Oct 27, 2022 · 6 comments
Closed

Import: Allow directory names with dots #2807

nicktar opened this issue Oct 27, 2022 · 6 comments
Assignees
Labels
bug Something isn't working tested Changes have been tested successfully

Comments

@nicktar
Copy link

nicktar commented Oct 27, 2022

1. What is not working as documented?

Importing of subdirectories of the import directory fails if the directory name contains one or more dots '.'

2. How can we reproduce it?

Steps to reproduce the behavior:

  1. Go to the import directory and create a subdirectory with a dot in the name (like 'a.b.c' or 'subdirectory.bak'
  2. add a foto to the folder
  3. Go to Library -> Import
  4. Select the sibdirectory containing the dots from the drop down menu
  5. Press the Import button
  6. Error message: Import: /photoprism/import/abc does not exist
  7. Sidenote: The error message in the log shows the directory name in lower case. This isn't really helpful.

The library contains about 25k pictures at the moment.

3. What behavior do you expect?

I would expect the import to import the contents of the folder.

4. What could be the cause of your problem?

From a quick look into the source code, I think the sanitation in internal/api/import.go line 62 removes the '.' from the directory name making it invalid

5. Can you provide us with example files for testing, error logs, or screenshots?

Since the problem is related to a directory structure, I don't think any sample files are helpful here

6. Which software versions do you use?

(a) PhotoPrism Architecture & Build Number: ARM64 Build 220901-f493607b0

(b) Database Type & Version: MariaDB

(c) Operating System Types & Versions: Docker Container running on Ubuntu

(d) Browser Types & Versions: Firefox

(e) Ad Blockers, Browser Plugins, and/or Firewall Software?

7. On what kind of device is PhotoPrism installed?

This is especially important if you are reporting a performance, import, or indexing issue. You can skip this if you're reporting a problem you found in our public demo, or if it's a completely unrelated issue, such as incorrect page layout.

(a) Device / Processor Type: Raspberry Pi 4

(b) Physical Memory & Swap Space in GB 2GB physical, 16 GB swap

(c) Storage Type: RAID

(d) Anything else that might be helpful to know?

Always provide device, memory, and storage details if you have a backend, performance, import, or indexing issue.

8. Do you use a Reverse Proxy, Firewall, VPN, or CDN?

No yet

@nicktar nicktar added the bug Something isn't working label Oct 27, 2022
@lastzero lastzero self-assigned this Oct 27, 2022
@lastzero lastzero changed the title Import from subdirectory of import fails if the directory name contains a dot Import: Allow directory names with dots Oct 27, 2022
lastzero added a commit that referenced this issue Oct 27, 2022
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero
Copy link
Member

I changed it so that it works for me, while still testing for strange characters and removing anything that doesn't seem right.

@lastzero lastzero added the please-test Ready for acceptance test label Oct 27, 2022
@lastzero
Copy link
Member

Please let us know if it works for you as well! A new preview build for testing has been started and should be available within an hour.

@lastzero lastzero added help wanted Help with this would be much appreciated! no-coding-required Great task for non-developers! labels Oct 27, 2022
@nicktar
Copy link
Author

nicktar commented Oct 27, 2022

Thanks for the quick fix. I'll test it as soon as the preview-arm64 image is available.

@lastzero
Copy link
Member

The preview is currently only available as multi-arch image for AMD64 and ARM64. Should make no difference unless you're on a device that is wrongly configured or uses an old Docker version without multi-arch support (not sure if that even exists). So you should be able to use the regular preview tag...

@lastzero
Copy link
Member

We've built an ARM64 preview image for you anyway! 😉

@nicktar
Copy link
Author

nicktar commented Oct 27, 2022

Thanks, I hot the regular preview working in the meantime and the fix looks good for me. Thanks for the great service.

@lastzero lastzero added tested Changes have been tested successfully and removed please-test Ready for acceptance test help wanted Help with this would be much appreciated! no-coding-required Great task for non-developers! labels Oct 27, 2022
@lastzero lastzero closed this as completed Nov 1, 2022
@lastzero lastzero moved this to Released 🌈 in Roadmap 🚀✨ Jun 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tested Changes have been tested successfully
Projects
Status: Release 🌈
Development

No branches or pull requests

2 participants