Changed variable names to fix grabbing envvars

This commit is contained in:
Lord Of Nougate 2022-07-18 19:42:28 +02:00
parent ad0ef39a47
commit 79c5ba4b30

View File

@ -3,7 +3,6 @@
# https://wiki.servarr.com/en/sonarr/custom-scripts # https://wiki.servarr.com/en/sonarr/custom-scripts
import os import os
from os import environ
import configparser import configparser
import requests import requests
@ -35,16 +34,16 @@ if os.getenv('sonarr_eventtype'):
if os.getenv('sonarr_eventtype') == 'Download': if os.getenv('sonarr_eventtype') == 'Download':
body = "New content added to Jellyfin: \n" body = "New content added to Jellyfin: \n"
series_title = environ.get('Sonarr_Series_Title') series_title = os.getenv('sonarr_series_title')
season_number = environ.get('Sonarr_EpisodeFile_SeasonNumber') season_number = os.getenv('sonarr_episodefile_seasonnumber')
episode_number = environ.get('Sonarr_EpisodeFile_EpisodeNumbers') episode_number = os.getenv('sonarr_episodefile_episodenumbers')
episode_title = environ.get('Sonarr_EpisodeFile_EpisodeTitles') episode_title = os.getenv('sonarr_episodefile_episodetitles')
release_quality = environ.get('Sonarr_EpisodeFile_Quality') release_quality = os.getenv('sonarr_episodefile_quality')
body += "%s - S%sE%s - %s [%s]\n" % (series_title, season_number, episode_number, episode_title, release_quality) body += "%s - S%sE%s - %s [%s]\n" % (series_title, season_number, episode_number, episode_title, release_quality)
toot(server_url, body, server_token) toot(server_url, body, server_token)
if os.getenv('sonarr_eventtype') == 'Test': if os.getenv('sonarr_eventtype') == 'Test':
toot(server_url, "Test message", server_token) toot(server_url, "Test message", server_token)