Guide: Automatically add new assets within a personal album to a shared album #14075
jansppenrade2
started this conversation in
Community Guides
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Immich’s got this “partner-sharing” feature — a sweet idea, really, for all the lovebirds and tight-knit duos out there. But here’s the thing: My partner and I? We’re into holding onto our own worlds of memories. A little personal kingdom each, where we curate our pasts. Still, when it comes to future snapshots, we want those moments auto-synced into a shared album, sparing us the hassle of manual keeping it up to date.
But then, life’s messy. Some shots? They just don’t belong in the joint space. A little too personal, maybe a little confusing for the other — so we need the freedom to pull ‘em from the shared album. You get the picture.
This setup’s not exactly plug-and-play in Immich, but there’s a little workaround if you’re comfortable tinkering under the hood. With a small trick in Immich’s database, we can have it all: automatic sharing and the flexibility to curate. Here’s where the "magic" happens. A database trigger, paired with a function, handles the heavy lifting.
Disclaimer, kids: Don’t go rogue here without a current backup and a clear idea of what each line’s doing. The script’s commented and, sure, it’s built to help, but screw up the syntax, and you’re may looking at some serious damage.
SQL Script
Alright, let’s break this down a little.
What’s Going Down in the Trigger and Function
So, here’s what this script’s really up to. We’ve got a database trigger and a function, both working together like a tag team. When a new photo or asset gets added to one of our personal albums, the function jumps into action. It checks if that new entry came from one of the personal albums we set up — your “Recently” album, or hers. If it’s a match, the function then checks if the shared album — the one where your lives intersect — actually exists.
If that album’s real and ready, the function copies the new entry into the shared album. All automated, no need to lift a finger. Now both of you get to see the latest and greatest, no manual house keeping necessary.
Variables That Need a Little Personal Touch
You can’t just run this script out of the box. There are three UUIDs that you’ll need to swap out to fit your own setup. Let’s talk about each:
1. source_album_id_1 – This one’s the UUID for your “Recently” album (or whatever album you’re using as the personal stash) on your side. Find it, replace it here.
2. source_album_id_2 – Same deal as above, but this time it’s for your partner’s “Recently” album.
3. target_album_id – This one’s the UUID for your shared album, the central spot where all your joint memories will end up.
Running the Script through PGAdmin Web UI
Mobile App Configuration
Make sure Album Synchronization is switched on in the Immich app settings. Why? Because that’s what keeps your personal “Recently” album stocked with the latest photos.
Now, if you’re rolling with an Android device, this might work the same way — but, full disclosure, I’m not 100% on that. So if you’re in the Android camp, give it a shot and maybe keep a close eye on things at first.
And that’s the setup: a little bit of fine-tuning, and you’ve got yourself an automated memory keeper that respects your individual zones while syncing up the rest for the big-picture stuff. Just remember: back up first, and tweak the UUIDs as needed!
Beta Was this translation helpful? Give feedback.
All reactions