Autoscan
Autoscan is an improved method of updating your Plex, Jellyfin, or Emby libraries by the use of webhooks sent from the Connect feature within Sonarr and Radarr. More information can be found here: https://github.com/Cloudbox/autoscan
Prerequisite
Autoscan will use a token to gain access to your media server application to perform its update functions.
Plex Token
- To find your Plex token, please visit this Plex article: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
Jellyfin API Token
- To create your Jellyfin API token for autoscan first navigate to your Jellyfin menu
- Next select the Jellyfin Dashboard menu
- Then select API Keys in the Advanced dashboard menu
- Fom here you will need to click the
+
button to create a new API token
- Name your API Key and save it using the Save button
- Finally, from here you will see your API Key to copy and save so that you may enter it when prompted by the autoscan installer script
Emby API Token
- To create your Emby API token for autoscan first navigate to your Emby admin menu
- Then select API Keys in the Advanced menu section
- From here select the New Api Key button
- Name your API Key and save it using the Save button
- Finally, from here you will see your API Key to copy and save so that you may enter it when prompted by the autoscan installer script
Installation
- Login to your service via SSH
- Execute the following command to install autoscan:
bash <(wget -qO- https://scripts.usbx.me/main/autoscan/autoscan-install.sh)
Adding Webhooks to Sonarr and Radarr
After successfully installing autoscan via the script you will see the two Webhook URLs shown that are needed to add to your Sonarr and Radarr instances
Sonarr Webhook
Radarr Webhook
Disable Media Server Scan Schedules
Autoscan is meant to handle your media center's scanning entirely, so it is recommended to disable your Plex, Jellyfin, or Emby's scanning schedule settings to avoid any conflicts.
Disable Plex Scanning Schedules
Scan my library automatically: DISABLED
Run a partial scan when changes are detected: DISABLED
Scan my library periodically: DISABLED
Disable Jellyfin Scanning Schedules:
- From here you can click the trash icon to delete the Library Scan schedule
Disable Emby Scanning Schedules:
- From here you can click the trash icon to delete the Library Scan schedule
Optional Setup Settings
Anchors for Mounts
Autoscan has the ability check first for anchor files to prevent library updates in the case of a mount being offline. This can allow the use of the Plex library setting Empty trash automatically after every scan
safely to avoid the loss of library metadata in the case of a mount going offline. Use at your own risk
The following assumes you've used our rclone mount guides for your mount locations. If you have custom mount paths and/or multiple mounts, then you will need to modify your anchor file locations accordingly
- To enable the anchor feature, first run the following command to create the anhcor file in the root of your mount.
touch ~/Stuff/Mount/.anchor
- Next edit your autoscan configuration file at
~/.apps/autoscan/config.yml
and uncomment the last 2 lines by removing the#
characters making the last two lines like the following example:
anchors:
- /home/{USERNAME}/MergerFS/.anchor
In .yml and .yaml configurations files, improper use of indendation will prevent the configuration file from working corerectly which in this case will cause autscan to fail. Its important that no blank space be in front of the anchors: line and 2 blank spaces be in front of the - /home/{USERNAME}/MergerFS/.anchor line.
- Finally run the following command to restart your autoscan to apply the changes
systemctl --user restart autoscan
Additional Media Servers
The unofficial autoscan installer is only written for installation with a single media server, however autoscan supports all three Plex, Jellyfin, and Emby.
- If you wish to enable autoscan for additional media servers you can do so by editing your autoscan configuration file at
~/.apps/autoscan/config.yml