Skip to content

Features

I-am-PUID-0 edited this page Jan 20, 2024 · 4 revisions

Automatic Updates

To enable automatic updates for plex_debrid, utilize the PD_UPDATE environment variable. This will automatically update plex_debrid to the latest version on startup and at the interval specified by AUTO_UPDATE_INTERVAL.

To enable automatic updates for Zurg, utilize the ZURG_UPDATE environment variable. This will automatically update Zurg to the latest version on startup and at the interval specified by AUTO_UPDATE_INTERVAL.

The default value for AUTO_UPDATE_INTERVAL is 24 hours. If you would like to change this, you can do so by setting the AUTO_UPDATE_INTERVAL variable value to the number of hours you would like to wait between updates in your docker-compose.yml file. It is not recommended to set the update interval to less than one (1) hour.

The automatic update is performed by comparing the installed version with the version available on GitHub. If a delta exists, it continues by pulling the latest version from GitHub. This will not affect any of your settings or configuration.

The updated service will be restarted automatically after the update is complete.

The benefit of this automatic update feature is that you will always be running the latest version of the underlying service (plex_debrid and/or Zurg). This will ensure you always take advantage of the latest features and bug fixes. It also means that the container will not need to be rebuilt or restarted by pulling a new image when a new version of plex_debrid or Zurg is released. This will save you time and bandwidth, but most importantly, it will prevent the rclone mount from being reset and severing the connection to your Plex server. So, the Plex server won't need to be restarted because of applying updates for the inbuilt applications.

Healthchecks

pd_zurg has a built-in healthcheck function for monitoring through docker and with the standard output (stdout).

The helathcheck will monitor the state of plex_debrid, Zurg, and rclone in any of the deployment states.

Deployment plex_debrid healthcheck Zurg w/ rclone healthcheck Indicators
Zurg w/ rclone Standalone ✔️ If the rclone process is not running, a message will appear in the CLI, and the docker status will change to unhealthy
plex_debrid Standalone ✔️ If the plex_debrid process is not running, a message will appear in the CLI, and the docker status will change to unhealthy
plex_debrid and Zurg w/ rclone ✔️ ✔️ A combination of the above indicators dependent upon the type of failure

Use of .env file for setting Environment Variables

If you would like to utilize a .env file to set the environment variables, you can do so by following the format below and saving the file in your config directory. Please see the Environment Variables section of the repository for a comprehensive list of variables. NOTE: Be sure to remove any unused environment variables from the .env file before deploying.

TZ=
RD_API_KEY=
RCLONE_MOUNT_NAME=
RCLONE_LOG_LEVEL=
RCLONE_LOG_FILE=
RCLONE_DIR_CACHE_TIME=
RCLONE_CACHE_DIR=
RCLONE_VFS_CACHE_MODE=
RCLONE_VFS_CACHE_MAX_SIZE=
RCLONE_VFS_CACHE_MAX_AGE=
PLEX_USER=
PLEX_TOKEN=
PLEX_ADDRESS=
SHOW_MENU=
PD_LOGFILE=
AUTO_UPDATE=
AUTO_UPDATE_INTERVAL=

Duplicate Cleanup

The duplicate cleanup process will automatically identify any duplicates that exist in two separate directories, the rclone mount used for the debris service and any other directory location. It then deletes the duplicates from the rclone mount used for the debris service, preserving the files from any other directory.

To utilize the duplicate cleanup, ensure that DUPLICATE_CLEANUP=true and the following environment variables are set in the docker-compose file RCLONE_MOUNT_NAME, PLEX_TOKEN, & PLEX_ADDRESS.

Ensure that the rclone mount name is visible within Plex. For example, if the rclone mount name is "realdebrid," it must appear within the plex library structure.

NOTE: The duplicate cleanup function has not been widely tested to account for all possible configurations and should be monitored during the first use to ensure the desired results occur. Testing has been conducted on several configurations; however, the potential for deletion of files could still exist. A sample process for monitoring the duplicate cleanup function is described below.

  1. From within Plex, follow the process for finding duplicates in the plex shows library.

  2. Sort the duplicates in alphabetical order (By Show), then select the first duplicate and follow the process for getting the metadata

  3. Confirm that the duplicate files associated with step 2 are within different directories. One of which should have the rclone mount name within the file's directory path.

  4. View the XML information as described in the link provided in Step 2.

  5. Configure the duplicate cleanup interval to a short period, e.g., 10-15 minutes, so that the process will execute while you're viewing the duplicate identified in Step 2.

  6. Start rclone with pd_zurg, restart Plex, and navigate back to the duplicate identified in Step 2 or refresh your browser.

  7. View the output of pd_zurg while watching the duplicate within Plex.

  8. Once the duplicate cleanup process starts, it will list all the duplicates for the TV/Shows section first. It will then begin to delete those duplicates before moving on to the Movies section. Ensure that the duplicate identified in Step 2 has been listed by the duplicate cleanup process list of duplicates to delete.

  9. Be prepared to stop pd_zurg.

  10. Once the duplicate identified in Step 2 is listed as being deleted by the duplicate cleanup process, you can stop pd_zurg.

  11. Within Plex, refresh or find the item that was identified in Step 2 and "Get Info" or "View XML" again to confirm that the files previously listed no longer contain the rclone mount name in the directory path of the file.

  12. If Step 11 fails to delete the appropriate file or other issues occur, please report it in the GitHub Issues.

Singular or Multiple debrid service rclone mounts

The RD_API_KEY & AD_API_KEY dictate how Zurg w/ rclone and plex_debrid are to be configurated at startup. If a single debrid service API key is supplied, then the supplied RCLONE_MOUNT_NAME value and API key will be used to set up the appropriate mount. Additionally, the single debrid service API key, along with the appropriate debrid service, will be applied within the plex_debrid settings.json file.

If both the RD_API_KEY & AD_API_KEY are supplied, then the supplied RCLONE_MOUNT_NAME value will be appended with _RD & _AD to denote the individual mounts. Additionally, both debrid services will be added to the plex_debrid settings.json file.

Note: it is unknown if Zurg supports AllDebrid at this time.

Clone this wiki locally