TheLastGimbus / GooglePhotosTakeoutHelper

Script that organizes the Google Takeout archive into one big chronological folder
https://aur.archlinux.org/packages/gpth-bin
Apache License 2.0
3.48k stars 176 forks source link

Albums should use relative symlinks to allow moving the output tree as a whole #232

Closed niklas88 closed 9 months ago

niklas88 commented 10 months ago

Currently the dart version creates albums with the photos replaced by absolute symlinks. This causes the links to break when moving/renaming the cleaned up takeout . If instead the symlinks were relative the whole tree could be moved as long as the relative location of the album versus ALL_PHOTOS/ isn't changed. Not sure if this applies to Windows but I did stumble over this on Linux and then wrote a script to create relative symlinks from the broken links.

Here is an example: Current setup:

My Album/IMG124.jpg -> /mnt/share/my/path/takeout/ALL_PHOTOS/IMG124.jpg

Should become:

My Album/IMG124.jpg -> ../ALL_PHOTOS/IMG124.jpg

Which stays a valid symlink as long as My Album is in the same directory as ALL_PHOTOS

TheLastGimbus commented 10 months ago

Oh, this is a very good idea, I'll definetley try that :eyes:

seriusokhatsky commented 10 months ago

Hello,

As I understand, if I run the script on Windows, then all folders (albums) that contain symlinks will not be identified by Synology photo as albums?

palijn commented 10 months ago

Synology Photos will never understand anything as an album that has not been defined as an album within Synology Photos - sadly. I've not investigated - yet - where the albums are defined, my best guess is that they are in some Postgresql DB on the NAS, so it's not going to be trivial to create them. However, if you select the Folder view in Synology Photos, you'll browse all your albums nicely as folders as created by GPTH. I'm not sure of any way to copy symlinks from one system (Windows) to the other (Linux), maybe a tarball can do it if they are relative. However if you run GPTH on the Synology itself, it will certainly be able to create the symlinks there.

TheLastGimbus commented 9 months ago

Should be fixed in new release - try it out :+1: