Cloudbox / autoscan

Autoscan replaces the default Plex and Emby behaviour for picking up changes on the file system.
MIT License
611 stars 53 forks source link

feat: emptying the Plex trash #52

Closed camjac251 closed 3 years ago

camjac251 commented 3 years ago

I have the Empty trash automatically after every scan on my Plex install disabled because my mount often crashes and starts again automatically and if everything is detected as missing then it could wipe my entire library after it's all deleted.

Could a function be added to autoscan for managing the Plex emptyTrash function? Like it could run only if the threshold of missing/unavailable files is below a certain number?

m-rots commented 3 years ago

As I mentioned in this issue, Plex changed its behaviour between the CLI scanner and the API request. The CLI scanner used to immediately scan the given path and provide the results afterwards (great!). However, the API queues our scan request (queuing also means Autoscan will not get the result of the scan itself) and executes the scan whenever it sees fit. Could be a couple of seconds, could be hours, we don't know (absolutely terrible!).

Unfortunately, the only choice Plex gives us in that regard is using its web socket which publishes real-time events on what Plex is doing. However, these events do not include: 1. the library nor 2. the full path. Therefore it's just a wild guess as to what Plex is scanning.

I have discussed this internally with @l3uddz but our conclusion was that such a feature / tool would be too inefficient to be created and integrated into Autoscan. Unless Plex changes its web socket events or its queuing behaviour, this feature will not see the light of day.

Note: we will not offer a Scanner CLI function either as this is slowly becoming deprecated and is barely supporting the new movie agent.