Skip to content
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

CLI: The --dest flag of the import command is wrongly typed as bool #3473

Closed
lastzero opened this issue Jun 13, 2023 Discussed in #3467 · 1 comment
Closed

CLI: The --dest flag of the import command is wrongly typed as bool #3473

lastzero opened this issue Jun 13, 2023 Discussed in #3467 · 1 comment
Assignees
Labels
bug Something isn't working cli Command-Line Interface (CLI) released Available in the stable release

Comments

@lastzero
Copy link
Member

Discussed in #3467

Originally posted by ricardopaiva June 13, 2023
I'm using docker-compose to setup Photoprism.
I have my photos and videos in a structured folder following the pattern:
YYYY\YYYY-MM-DD - <Event title>
like:
2001\2001-06-02 - Trip to London
2023\2023-01-01 - Jeremy's Birthday

Therefore I want to have these folders indexed and for that reason I'm using these volumes in my docker-compose file:

volumes:
  - multimedia_photos:/photoprism/originals/Photos:ro
  - multimedia_videos:/photoprism/originals/Videos:ro

Multimedia_photos and Multimedia_videos are two shared folders I have on my NAS.

Now I'm trying to set up a workflow to import the photos from my mobile phone to this multimedia_photos folder.
My idea would be to use PhotoSync to move the photos from the mobile into the Photoprism import folder. Then I would run the following command (I'm going to run this in cron but I'm testing it manually for now) to import the photos:

docker exec -ti photoprism photoprism import '/photoprism/import' --dest '/photoprism/originals/Organizar'

Imported photos would be, by default, organised into Year/Month/Filename, which sounds reasonable to me and on top I would need to make some extra effort to split the photos by event. I might find a better way to deal with this but for now that should work for me.
So I also have these volumes in docker-compose:

volumes:
  - multimedia_organizar:/photoprism/originals/Organizar:rw
  - multimedia_import:/photoprism/import

So I will use PhotoSync to copy the photos to the Import folder. Then run the docker exec -ti photoprism photoprism import command, so all the photos will be moved to the Organizar folder, splitted into Year/Month and then I will run some additional organisation scripts to split the photos by event and finally move it to the Photos folder.

But when I run the docker exec -ti photoprism photoprism import '/photoprism/import' --dest '/photoprism/originals/Organizar' command, the output is the following:

INFO[2023-06-12T22:11:58Z] config: case-insensitive file system detected 
INFO[2023-06-12T22:11:58Z] Become a member today, support our mission and enjoy our member benefits! 💎 
INFO[2023-06-12T22:11:58Z] Visit https://www.photoprism.app/membership to learn more. 
INFO[2023-06-12T22:11:58Z] migrate: running database migrations         
INFO[2023-06-12T22:11:59Z] moving media files from /photoprism/originals/Organizar/photoprism/originals/true 
INFO[2023-06-12T22:12:00Z] classify: loading nasnet                     
INFO[2023-06-12T22:12:02Z] classify: loading labels from labels.txt     
INFO[2023-06-12T22:12:02Z] import: found no .ppignore file              
INFO[2023-06-12T22:12:02Z] completed in 4.28038526s      

I would expect the files to be moved to folder /photoprism/originals/Organizar/2023/06/ but it seems like the --dest parameter is not working properly.
The folder I'm getting on the output is /photoprism/originals/true, which is also weird because this "true" folder doesn't make any sense and seems to be coming from a boolean variable, probably.

I also tried to run this instead:
docker exec -ti photoprism photoprism import '/photoprism/import' --dest 'originals/Organizar'
Because according to the documentation --dest is a path relative to the Originals path, but the output seems to be the same.

If I skip the parameter, then the import works fine but the folder is created under the /photoprism/originals folder like /photoprism/originals/2023/06 but that's not what I want because it's not importing inside folder Organizar.

docker exec -ti photoprism photoprism import '/photoprism/import'

Here's the output:

INFO[2023-06-12T22:23:27Z] config: case-insensitive file system detected 
INFO[2023-06-12T22:23:27Z] Become a member today, support our mission and enjoy our member benefits! 💎 
INFO[2023-06-12T22:23:27Z] Visit https://www.photoprism.app/membership to learn more. 
INFO[2023-06-12T22:23:27Z] migrate: running database migrations         
INFO[2023-06-12T22:23:27Z] **moving media files from /photoprism/import to /photoprism/originals/Organizar** 
INFO[2023-06-12T22:23:27Z] classify: loading nasnet                     
INFO[2023-06-12T22:23:29Z] classify: loading labels from labels.txt     
INFO[2023-06-12T22:23:29Z] import: found no .ppignore file              
INFO[2023-06-12T22:23:29Z] media: 994E28F2-CE74-4010-AD9C-EA567C130793.JPG was taken at 2023-06-09 12:09:21.515 +0000 UTC (meta) 
**INFO[2023-06-12T22:23:30Z] import: moving main jpg file 994E28F2-CE74-4010-AD9C-EA567C130793.JPG to 2023/06/20230609_120921_A72C0CD8.jpg**
**INFO[2023-06-12T22:23:32Z] import: updated main jpg file 2023/06/20230609_120921_A72C0CD8.jpg** 
INFO[2023-06-12T22:24:36Z] completed in 1m9.515612866s  

Do you feel like this is a bug? Or am I missing the point of this --dest parameter when importing?

@lastzero lastzero added bug Something isn't working cli Command-Line Interface (CLI) labels Jun 13, 2023
@lastzero lastzero self-assigned this Jun 13, 2023
lastzero added a commit that referenced this issue Jun 13, 2023
Signed-off-by: Michael Mayer <michael@photoprism.app>
@lastzero lastzero added the please-test Ready for acceptance test label Jun 13, 2023
@lastzero
Copy link
Member Author

@ricardopaiva Thanks for reporting this! An updated development preview build will be available for testing soon.

@lastzero lastzero added released Available in the stable release and removed please-test Ready for acceptance test labels Jun 15, 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 cli Command-Line Interface (CLI) released Available in the stable release
Projects
Status: Release 🌈
Development

No branches or pull requests

1 participant