#Automatic library watching
1 messages · Page 1 of 1 (latest)
Awesome, thanks for the feedback! It was a hard feature to implement and I'm happy it works well. Did you require polling?
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?
Yes, you likely have local files which means it can use inotify natively
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 😅🙏🏻
@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?
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
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.
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
@dusk locust should it also delete files when removed from the external library?
If not then I’ll do it on a schedule with the API which I was already doing, but disabled it.
No, it marks them as offline
would you mind sharing your script that you use to do this? I want to re-create the same thing.
Sure. I’ll just call the library scan API endpoint. But happy to share. Will be tomorrow as I can’t do it tonight
`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 🙂
Is there interest for an option to auto-delete offline files?
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.
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 🙂
Plex has an option to auto-remove files, but it's off by default