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

Photos are not added to Albums #9

Open
xmatthewx opened this issue Jan 27, 2024 · 4 comments
Open

Photos are not added to Albums #9

xmatthewx opened this issue Jan 27, 2024 · 4 comments

Comments

@xmatthewx
Copy link

xmatthewx commented Jan 27, 2024

When I run the script, albums are created, but no images are added to the albums.

  • I've tried both match options, for hash and name
  • I'm running this from the original files
  • All photos are indexed and showing in photoprism (~6K photos)

For every album, the log shows this (~150 albums). There are no other warnings or errors in the log.

Creating album "2015-07-lake-george"...
Album UID: as7wf9o19khskc6y
Searching jsons...
awk: can't open file /Volumes/RedDrive/PhotoPrism2/originals/GooglePhotos/2015-07-lake-george/**/*.json
 source line number 1
Search complete.

The volume is an attached SSD drive on MacOS 13.2. There's nothing unique about its setup.

After installing md5sha1sum with homebrew, I ran match on hash. I get:

Creating album "2015-07-lake-george"...
Album UID: as7wf9o19khskc6y
Searching for photos...
1: Trying to match *.*...
sha1sum: stat '/Volumes/RedDrive/PhotoPrism2/originals/GooglePhotos/2015-07-lake-george/**/*.*': No such file or directory
WARN: Couldn't find file /Volumes/RedDrive/PhotoPrism2/originals/GooglePhotos/2015-07-lake-george/**/*.* with hash  in database, skipping!
Search complete.

Any suggestions?

@xmatthewx xmatthewx changed the title Searching jsons... awk: can't open file Can't match Jan 27, 2024
@xmatthewx xmatthewx changed the title Can't match Photos are not added to Albums Jan 27, 2024
@inthreedee
Copy link
Owner

It sounds like it isn’t finding the expected Google takeout files. You can specify where the takeout directory is using the command line arguments described in the readme.

Note this line from the readme:

the script can be run either in a single album directory, or in the base Google Photos directory

Be sure you’re running the script from the right Takeout directory, or that you’re feeding it the correct Takeout directory using the —takeout-dir switch. If it can’t find the Takeout’s json and photo files, it can’t do its work. Double check that the expected files exist.

To clarify the difference between hash matching and name matching:

  • If you uploaded the photos directly from your Google takeout, hash matching is what you want.
  • If you uploaded originals from another source and only want to reproduce your Google albums in Photoprism, then name matching and a copy of photoprism’s sidecar files are required.

@inthreedee
Copy link
Owner

I also noticed you’re on a Mac. If everything else I mentioned above is being run correctly, you may need to try installing an updated version of Bash for that globstar to work properly. I’m not certain which version MacOS ships with these days, but it used to be quite out of date.

@xmatthewx
Copy link
Author

I'm running the script from within the takeout directory. Since it's able to make the albums, I assume it's finding the files and connecting to photoprism ok. I'm using the standar locations for originals and storage within the primary photoprism directory.

I'll try an updated Bash.

@inthreedee
Copy link
Owner

Okay, I've had a chance to sit down, read your logs more carefully, and compare them against what the script is doing and expecting. What jumps out at me is this line:

1: Trying to match *.*...

I should have noticed that before, but it's been a while since I've looked at the code of the script. That's happening in line 229, and it should say a file name there instead of *.*.

If using an updated bash didn't work, try editing that line and changing *.* to just *. It's also possible that the globstar may not work on Macs. In that case, you can edit that line to remove the **. It can probably be changed to:

for albumFile in "$albumDir"/*; do

as long as you specify one album at a time using the --album-name switch. That should be much more portable.

Whatever your findings, I'd appreciate you reporting back so I can add some notes about compatibility with Macs in the readme.

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

No branches or pull requests

2 participants