#Automatic library watching

1 messages · Page 1 of 1 (latest)

bleak flare
#

Wanted to share my positive experience so far with this. I changed the dates on a recently imported library of scanned fotos. They obviously got the date of the scan. I backdated them with digikam and when saved, Immich immediately picked it up and moved the images down in my timeline.

#

I have 193k foto’s and 6 users

#

Each user has an external library some have more.

dusk locust
#

Awesome, thanks for the feedback! It was a hard feature to implement and I'm happy it works well. Did you require polling?

bleak flare
#

No, it works like a charm without. And even when just changing metadata it picked it up and processed just fine.

#

Is it using inotify?

dusk locust
#

Yes, you likely have local files which means it can use inotify natively

bleak flare
#

I use icloudpd to get my images from Apple. This is on de hosted dedicated server. I use sync thing to sync it to my NAS at home where I make (multiple) backups. So the local indeed is mounted inside the container and it is the same for icloudpd and sync thing container. With this it’s a fully automated media management system 😅🙏🏻

unreal wren
#

@bleak flare i want to setup something similar, when using icloudpd do you need need to pay for more storage on iCloud? If not how does it work when your device has more photos than iCloud allows?

bleak flare
#

To be able to get all your media on iCloud you need an adequate subscription. Right now I have the 2Tb as the whole family including my in-laws store their stuff there. My wife and mother in law have a massive amount of pictures on their phones dating back two the beginning of iPhones.

#

That’s the reason I want to get away from that and so using icloudpd and (at some point) delete the majority of the images on in cloud.

#

For myself I already have almost no images on my camera roll as I delete them when they are downloaded

#

At some point I hope to reduce my subscription to just the amount of space I need to get my stuff through iCloud to my own setup

unreal wren
#

Ah okay that makes sense. I was thinking to just sign up to iCloud for a few months to start the workflow and go back to free tier.

bleak flare
#

that should work if the offloading is quick enough not to fill up all the space. That is my goal as well. You can even let icloudpd delete a photo when it is downloaded. That way you can use icloud as a buffer

bleak flare
#

If not then I’ll do it on a schedule with the API which I was already doing, but disabled it.

dusk locust
#

No, it marks them as offline

unreal wren
bleak flare
#

Sure. I’ll just call the library scan API endpoint. But happy to share. Will be tomorrow as I can’t do it tonight

bleak flare
#

`import requests

api_keys = {"user1":"hfjkwegfjhwgejhfgwejrgwjekhrjkew",
"user2":"dffegegert43543534rererertr"}

def main():
for api_key, api_value in api_keys.items():
url = "https://immich.domain.com/api/library"
libraries = callimmich(url, api_value, "GET")
for library in libraries:
if library['type'] == "EXTERNAL":
id = library['id']
url = f"https://immich.domain.com/api/library/{id}/removeOffline"
rem_offline = callimmich(url,api_value, "POST")
print(api_value,rem_offline)

def callimmich(url,api_value, method):
payload={}
headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'x-api-key': api_value
}

response = requests.request(method, url, headers=headers, data=payload)
if method == "GET":
    return response.json()
else:
    return response.status_code

if name == 'main':
main()`

#

This is the python script I created. It is a wuick & dirty one, but does the job 🙂

dusk locust
#

Is there interest for an option to auto-delete offline files?

wind sail
#

I feel like there would be but just from how many support tickets I've seen with bad mounts causing external library issues it feels like it could be a dangerous slope.

bleak flare
#

It could be a setting, which could be chosen to enable/ disable.

#

For now I’m fine with the remove offline option, but it it would be included I would use it 🙂

dusk locust
#

Plex has an option to auto-remove files, but it's off by default