*arrs

*arrs

Things for the family of *arr services (Sonarr, Radarr, Prowlarr, etc)

Notify Jellyfin that there is new stuff

Usually Jellyfin monitors the file system and detects and adds new files automatically (via inodes). This does not work if the drive the files are on is mounted via NFS. So the *arrs have to tell Jellyfin manually via API when they added something.

Sonarr

sonarr_new_or_upgraded.sh
#!/bin/bash

if [ "$sonarr_eventtype" = "Test" ]
then
    echo "Just a test, exiting.."
    exit 0
fi

if [ "$sonarr_eventtype" = "Download" ] && [ "$sonarr_isupgrade" = "True" ]
then
    echo "Reporting upgrade of $sonarr_series_title S $sonarr_episodefile_seasonnumber E $sonarr_episodefile_episodenumbers to Jellyfin (tvdbId: $sonarr_series_tvdbid)"

    curl --request POST \
        --url "http://localhost:8096/Library/Series/Updated?tvdbId=$sonarr_series_tvdbid" \
        --header 'Authorization: MediaBrowser Token=REPLACE_ME'
elif [ "$sonarr_eventtype" = "Download" ] && [ "$sonarr_isupgrade" = "False" ]
then
    echo "Reporting new series $sonarr_series_title S $sonarr_episodefile_seasonnumber E $sonarr_episodefile_episodenumbers to Jellyfin (tvdbId: $sonarr_series_tvdbid)"

    curl --request POST \
        --url "http://localhost:8096/Library/Series/Added?tvdbId=$sonarr_series_tvdbid" \
        --header 'Authorization: MediaBrowser Token=REPLACE_ME'
fi

Radarr

radarr_new_or_upgraded.sh
#!/bin/bash

if [ "$radarr_eventtype" = "Test" ]
then
    echo "Just a test, exiting.."
    exit 0
fi

if [ "$radarr_eventtype" = "Download" ] && [ "$radarr_isupgrade" = "True" ]
then
    echo "Reporting upgrade of $radarr_movie_title to Jellyfin (tmdbId: $radarr_movie_tmdbid)"

    curl --request POST \
        --url "http://localhost:8096/Library/Movies/Updated?tmdbId=$radarr_movie_tmdbid" \
        --header 'Authorization: MediaBrowser Token=REPLACE_ME'
elif [ "$radarr_eventtype" = "Download" ] && [ "$radarr_isupgrade" = "False" ]
then
    echo "Reporting new movie $radarr_movie_title to Jellyfin (tmdbId: $radarr_movie_tmdbid)"

    curl --request POST \
        --url "http://localhost:8096/Library/Movies/Added?tmdbId=$radarr_movie_tmdbid" \
        --header 'Authorization: MediaBrowser Token=REPLACE_ME'
fi