madslundt / docker-cloud-media-scripts

Upload and stream media from the cloud with or without encryption. Cache all new and recently streamed media locally to access quickly and reduce API calls
MIT License
100 stars 34 forks source link

Enhancement: Media Deletion #12

Closed Dulanic closed 7 years ago

Dulanic commented 7 years ago

So sometimes delete items from my cloud, especially since I use the DVR part of plex also. However, if I delete them from local-media they will remain on the cloud. Maybe I can already do this, but I just haven't figured it out yet.

Would it be possible to script it out to delete the files if deleted from local-media? Maybe an additional function or something along that line? Was thinking maybe using a if or diff to compare 2 mounts and then if deleted from local-media remove from the rclone mount?

This one might be a tad slow and I'm sure it could be improved on... but this is a start for me at least. I manually mounted the encrypted dir to /test to test this. Downside is since I don't know how the delete from local-media works since I know it doesn't delete from the cloud, I figure the file eventually needs to show back up? I'm new to Plexdrive and rclone so this is just a guess as to a starting point....

or i in "$(comm -23 <(cd /test; find . -type f |sort) <(cd /local-media; find . -type f |sort))"; do cd /test; rm "$i" done

madslundt commented 7 years ago

Yes that is correct. If you delete it from local-media it will just remove it from your local disk. It will still occur on Google drive.

You can use rclone to remove your data by either mounting directly with Rclone (just for deletion) or use the rclone delete command. This is not implemented in the docker image and can only be done outside the docker image, for now

Does that help?

Dulanic commented 7 years ago

OK, thanks. That will help, wasn't sure if you had any plans to implement.

I'll work on maybe setting up a inotifywait to monitor for deleted events.