Cloudbox / autoscan

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

adding an option to refresh metadata #146

Closed ajmandourah closed 2 years ago

ajmandourah commented 2 years ago

adding the option to auto refresh metadata for certain movie would be great. I am using rclone mount and bazarr for subs but plex wont recognize them unless I manually do a refresh metadata. It would be great if this could be automated also

m-rots commented 2 years ago

Unfortunately Plex offers no way for us to refresh a path's metadata through the Plex API. Once Plex adds this option to their API, we can have a look at it!

SamTRZ commented 1 year ago

Just a quick fyi @ajmandourah. This does the trick for me: https://github.com/dantebarba/autoscan-adapter

At @m-rots has something changed because putting this adapter in between autoscan and plex works for me.

m-rots commented 1 year ago

Just a quick fyi @ajmandourah. This does the trick for me: https://github.com/dantebarba/autoscan-adapter

At @m-rots has something changed because putting this adapter in between autoscan and plex works for me.

In a nutshell, the adapter iterates through the Plex library (through the API) searching for the metadata item that matches the path scanned by Autoscan. We've considered similar methods. However, these broke down when Autoscan sent multiple scan requests to Plex. Instead of replying to Autoscan that a scan was successful, Plex merely indicates that the scan was added to its internal queue. Thus, if Autoscan were to search for a matching metadata item immediately, it could fail when the scan is still in Plex's queue. We've looked at using Plex's events endpoint (which is a web socket stream) to receive a notification when a path has been scanned, though we deemed the added complexity not to be worth it. It's great that the adapter works for you, but with this edge case in mind we decided not to include such functionality into Autoscan itself.