Skip to content

Commit

Permalink
ENH: Log an error on startup when Sonarr/Radarr URL does not contain …
Browse files Browse the repository at this point in the history
…http prefix #5

VER: 1.3.4
  • Loading branch information
toddrob99 committed Nov 9, 2020
1 parent 5acec2c commit 587d177
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions radarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ def __init__(self, api_url, api_key, verbose=False):
self.logger.debug("Logging started!")
if api_url[-1] == "/":
api_url = api_url[:-1]
if api_url[:4] != "http":
self.logger.error(
"Invalid Radarr URL detected. Please update your settings to include http:// or https:// on the beginning of the URL."
)
self.api_url = api_url + "/api/{endpoint}?apikey=" + api_key

def lookup_movie(self, title=None, tmdb_id=None):
Expand Down
2 changes: 1 addition & 1 deletion searcharr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import sonarr
import settings

__version__ = "1.3.3"
__version__ = "1.3.4"

DBPATH = os.path.join(os.path.dirname(os.path.realpath(__file__)), "data")
DBFILE = "searcharr.db"
Expand Down
4 changes: 4 additions & 0 deletions sonarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ def __init__(self, api_url, api_key, verbose=False):
self.logger.debug("Logging started!")
if api_url[-1] == "/":
api_url = api_url[:-1]
if api_url[:4] != "http":
self.logger.error(
"Invalid Sonarr URL detected. Please update your settings to include http:// or https:// on the beginning of the URL."
)
self.api_url = api_url + "/api/{endpoint}?apikey=" + api_key
self._all_series = {}
self.get_all_series()
Expand Down

0 comments on commit 587d177

Please sign in to comment.