RhetTbull / osxphotos

Python app to work with pictures and associated metadata from Apple Photos on macOS. Also includes a package to provide programmatic access to the Photos library, pictures, and metadata.
MIT License
2.15k stars 99 forks source link

Album and Folder Not Updating Correctly #1420

Closed mikekenyon99 closed 8 months ago

mikekenyon99 commented 8 months ago

I used the option to export into Folders my Photo Albums:

--directory "{folder_album}"

I ran this option and because I'm saving to a OneDrive folder on my Mac it didn't like the fact one of my albums/folder had a / in it. It generates this error, note that it puts. colon (:) not the actual offending character:

image

No problem. I left it to complete and then renamed the folder in Photos and let it sync around iCloud. As you can see here:

Screenshot 2024-02-28 at 07 43 50

I have then re-run osxphotos and it regenerates the old folder name! I.e. it's not looking at Photos and then saying "ah I need to change or rexport that".

Screenshot 2024-02-28 at 07 38 28

Desktop (please complete the following information):

Basically, I am stuck now, whatever I do OSXPhotos fails to update the folder name. Hope someone can help!

Mike

oPromessa commented 8 months ago

Hope it helps.

mikekenyon99 commented 8 months ago

Your first bullet point is correct - that is what is happening.

I did try what you said - I deleted the folder, and then re-exported but it has come back. It's almost like OSXPhotos is caching it. However, your suggestion of the magical template system is a good one. Though that feels like a work-around not a solution.

Much appreciated 👍

RhetTbull commented 8 months ago

I just tried to re-create this and could not. Here's what I did:

Create an album with a "/" in the name: "Test/Album" Export photos Album is created with a "/" in the name and photo exported: "Test/Album" Deleted the folder "Test/Album" in Finder Replaced the "/" with "-" in Photos: "Test-Photo" Exported again with --update Photos in the album were now exported to "Test-Album". The original album was not re-created.

It's almost like OSXPhotos is caching it.

osxphotos does not cache the album name. It does keep a record of every file exported in the export database (.osxphotos_export.db in the export folder) but this is used to match exported photos to the correct photo in Photos. Information such as the correct folder name is created at the time of export from the data in Photos, not the export database.

Are you sure there isn't a second album with the uncorrected name in Photos?

It generates this error, note that it puts. colon (:) not the actual offending character:

Note that it's actually osxphotos not OneDrive that put a colon in instead of a slash. In the macOS filesystem "/" is used to separate folders and while it's possible to create a file with a "/" in it, this is ill-advised and will make the file very difficult to work with using normal command line tools. osxphotos instead changes all "/" in a file name to ":". The Finder will automatically display these as "/" even though on disk, they're actually stored as ":" (this is a throwback to macOS Classic which used ":" to separate folders).

mikekenyon99 commented 8 months ago

Hi - thanks for update. In that case I'm not sure what to do then. I'll double check my iCloud photo albums.

mikekenyon99 commented 8 months ago

I have fixed it... I found an album that was under the Shared Album section.... All good now apologies for logging ticket.

RhetTbull commented 8 months ago

If you want to exclude shared albums from the export you can use --not-shared