As i stated: I dont wont to do this in common, but just for a certain path only. As i use serveral paths for a single Library, your solution is not what i want/need to do.
I update single paths via commandline at the moment, it would be a mess if that changes in upcoming Plex updates. There is no need to update/scan an “archive” path where changes happen once a week while a tmp path is updated every x hours.
I don’t have a solution to offer but, out of curiosity, under what circumstances would this be necessary? Emptying the trash for a library is a pure database/metadata operation. It doesn’t perform a scan itself. Or make any changes to the files/directories in the paths themselves.
So if, for example, you have a library with two paths:
/mnt/media/movies/
/mnt/media/tmp_movies/
If you move media from ./tmp_movies to movies and perform a scan, only it will have “trash” and an “empty trash” operation will only affect it. Or, if you have removed media from ./movies at the same time and performed a scan for both paths, both will have trash and it would be more efficient to empty it all in one go.
This assumes that, as you stated, you are scanning for changes by path.
What is the value of emptying trash by path? Trash is a library concept. If you’ve only made changes to a single path in a library, only that path will be affected by a trash emptying.
I do an update for my tmp folder every x hours and update the whole library on saturday and sunday. I will skip the empty trash curl command on saturday and sundays for now per cron.