Way to empty trash for certain path only?

Hi there,

is there a way to empty the trash via commandline only for a certain path?

I tried:

curl -X PUT --insecure “https://localhost:32400/library/sections/1/emptyTrash?path=/path/to/files&X-Plex-Token=TOKENHERE” but path seems to be ignored.

Regards

In the Web UI, you can go to the ellipsis (for the specific section) → Manage → Empty Trash.

This will empty the trash for that specific section.

Yes i know, but i want to this via cronjob right after a library update, but for a certain path only. I use several paths for Movies.

Library setting → Empty Trash after every scan

will do that.

Controlling Plex via the curl API is changing.
This is because the last remnants of python are being removed.

I will ask in Monday’s staff meeting how the API should work and if what you’re trying to do should still be valid.

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.

My archive is on an external storage and i dont want Plex to empty the trash if the remote is not available after a total scan.

Ah, I see. I assumed from your descriptions that you were always performing targeted scans.

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.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.