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: Improve index command docs, path must be relative #1735

Closed
rickysarraf opened this issue Nov 17, 2021 · 3 comments
Closed

CLI: Improve index command docs, path must be relative #1735

rickysarraf opened this issue Nov 17, 2021 · 3 comments
Assignees
Labels
docs 📚 Write, improve, or review documentation enhancement Refactoring, improvement or maintenance task released Available in the stable release

Comments

@rickysarraf
Copy link
Contributor

What does not work as expected?

Consider the following:

photoprism@f93a3e7679df:~$ photoprism index -c /photoprism/originals/Imgs/
INFO[2021-11-17T07:28:27Z] indexing originals in /photoprism/originals/photoprism/originals/Imgs 
ERRO[2021-11-17T07:28:27Z] index: /photoprism/originals/photoprism/originals/imgs does not exist 
INFO[2021-11-17T07:28:28Z] purge: flagged photo PXL_20211116_104024131 as deleted 
INFO[2021-11-17T07:28:29Z] index: found no orphan files [163.635032ms]  
INFO[2021-11-17T07:28:31Z] index: updating counts                       
INFO[2021-11-17T07:28:33Z] index: updating covers                       
INFO[2021-11-17T07:28:35Z] purge: removed 0 files and 1 photo [7.93268822s] 
INFO[2021-11-17T07:29:43Z] index: found no orphan files [42.628513ms]   
INFO[2021-11-17T07:29:43Z] index: updating counts                       
INFO[2021-11-17T07:29:44Z] index: updating covers                       
INFO[2021-11-17T07:29:44Z] cleanup: removed 1 index entry and 166 thumbnails [1m9.055006357s] 
INFO[2021-11-17T07:29:44Z] indexed 0 files in 1m26.977614051s           
INFO[2021-11-17T07:29:44Z] closed database connection                   
photoprism@f93a3e7679df:~$ 
photoprism@f93a3e7679df:~$ 
photoprism@f93a3e7679df:~$ 
photoprism@f93a3e7679df:~$ 
photoprism@f93a3e7679df:~$ ls /photoprism/originals/Imgs/
photo.backup.tablet  photos-backup-kiran  photos-backup-priya  photos-backup-rmi9  rmi-note-6  takeout

I think this is a bug because:

  • External index triggers (through systemd timers or ofelia) are failing with the above error, where folder name normalization is wrong.
  • I think internal index of PP is working. Not sure of the difference. Ideally, both should call the same sub-routines to uncover such bugs.

How can we reproduce it?

Steps to reproduce the behavior:

  • Trigger an index run from an external command

What behavior do you expect?

Folders should get indexed, especially the ones passed as a command-line argument.

What version you are using?

Latest changes from the preview branch.

@rickysarraf rickysarraf added the bug Something isn't working label Nov 17, 2021
@lastzero
Copy link
Member

The argument must be a RELATIVE path, not including the absolute path to your originals folders.

@rickysarraf
Copy link
Contributor Author

Thank you for the quick reply. Indeed. That was the case. Sorry for the noise. But maybe it could be mentioned out in the CLI help ? Right now, it just says: [path]

photoprism@f93a3e7679df:~$ photoprism index -h
NAME:
   photoprism index - Indexes original media files

USAGE:
   photoprism index [command options] [path]

OPTIONS:
   --force, -f    re-index all originals, including unchanged files
   --cleanup, -c  remove orphan index entries and thumbnails
   

On similar note, I think when passing the -c option to index along with a relative path, it does a cleanup scan for the entire originals folder. This is just a gut feel because with and without -c, the runtime is substantially different.

photoprism@f93a3e7679df:~$ photoprism index -c Imgs/                                                            
INFO[2021-11-17T08:03:08Z] indexing originals in /photoprism/originals/Imgs 
INFO[2021-11-17T08:03:08Z] classify: loading nasnet                     
2021-11-17 08:03:08.580621: I tensorflow/cc/saved_model/reader.cc:31] Reading SavedModel from: /photoprism/assets/nasnet
2021-11-17 08:03:09.109449: I tensorflow/cc/saved_model/reader.cc:54] Reading meta graph with tags { photoprism }
2021-11-17 08:03:11.171216: I tensorflow/cc/saved_model/loader.cc:202] Restoring SavedModel bundle.
2021-11-17 08:03:17.910361: I tensorflow/cc/saved_model/loader.cc:311] SavedModel load for tags { photoprism }; Status: success. Took 9331390 micros
econds.
INFO[2021-11-17T08:03:19Z] classify: loading labels from labels.txt     
INFO[2021-11-17T08:03:22Z] ffmpeg: converting Imgs/photos-backup-rmi9/Camera/PXL_20211117_080409695.mp4 to jpg 
INFO[2021-11-17T08:03:24Z] ffmpeg: created PXL_20211117_080409695.mp4.jpg [2.265457374s] 
INFO[2021-11-17T08:03:24Z] ffmpeg: converting Imgs/photos-backup-rmi9/Camera/PXL_20211117_080208323.mp4 to jpg 
INFO[2021-11-17T08:03:25Z] media: PXL_20211117_080650003.jpg was taken at 2021-11-17 02:36:50 +0000 UTC (meta) 
INFO[2021-11-17T08:03:26Z] media: PXL_20211117_080657881.jpg was taken at 2021-11-17 02:36:57 +0000 UTC (meta) 

@graciousgrey graciousgrey added docs 📚 Write, improve, or review documentation and removed bug Something isn't working labels Nov 22, 2021
@graciousgrey graciousgrey changed the title Bug: Folder name normalizaiton is wrong Docs: Folder name normalizaiton is wrong Dec 1, 2021
@lastzero lastzero changed the title Docs: Folder name normalizaiton is wrong CLI: Improve index command docs, path must be relative Dec 1, 2021
@lastzero lastzero added the enhancement Refactoring, improvement or maintenance task label Dec 1, 2021
@lastzero lastzero self-assigned this Dec 2, 2021
@lastzero
Copy link
Member

lastzero commented Dec 2, 2021

Updated the command help to make clear the argument can be an originals subfolder:

$ photoprism index --help
NAME:
   photoprism index - Indexes original media files

USAGE:
   photoprism index [command options] [originals subfolder]

OPTIONS:
   --force, -f    re-index all originals, including unchanged files
   --cleanup, -c  remove orphan index entries and thumbnails
   
$ photoprism convert --help
NAME:
   photoprism convert - Converts files in other formats to JPEG and AVC

USAGE:
   photoprism convert [originals subfolder]

$ photoprism faces index --help
NAME:
   PhotoPrism faces index - Searches originals for faces

USAGE:
   PhotoPrism faces index [originals subfolder]

@lastzero lastzero added the please-test Ready for acceptance test label Dec 2, 2021
lastzero added a commit that referenced this issue Dec 2, 2021
@graciousgrey graciousgrey added released Available in the stable release and removed please-test Ready for acceptance test labels Dec 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs 📚 Write, improve, or review documentation enhancement Refactoring, improvement or maintenance task released Available in the stable release
Projects
Status: Release 🌈
Development

No branches or pull requests

3 participants