morpheus65535 / oscarr

Oscarr is a dashboard application for users of Plex, Emby, Sonarr, Radarr and Bazarr. It gives you and overview of your media management software.
GNU General Public License v3.0
57 stars 12 forks source link

Error in the Oscarr -> Bazarr connection #17

Open edualm opened 4 years ago

edualm commented 4 years ago

Describe the bug The Oscarr -> Bazarr connection causes Oscarr to crash.

To Reproduce

  1. Configure the Oscarr -> Bazarr connection on Oscarr.
  2. Tap the 'Bazarr' tab on Oscarr.

Expected behavior The app not to crash.

Observed behavior The app crashes.

Screenshots Exception:

SyntaxError('EOL while scanning string literal', ('<unknown>', 1, 10, "['en', 'pb"))

Traceback:

Traceback (most recent call last):
  File "/opt/oscarr/.local/lib/python2.7/site-packages/bottle.py", line 868, in _handle
    return route.call(**args)
  File "/opt/oscarr/.local/lib/python2.7/site-packages/bottle.py", line 1748, in wrapper
    rv = callback(*a, **ka)
  File "/opt/oscarr/oscarr.py", line 365, in bazarr
    output = template('bazarr', __file__=__file__, oscarr_version=oscarr_version, base_url=base_url, missing_list=missing_list, history_list=history_list)
  File "/opt/oscarr/.local/lib/python2.7/site-packages/bottle.py", line 3630, in template
    return TEMPLATES[tplid].render(kwargs)
  File "/opt/oscarr/.local/lib/python2.7/site-packages/bottle.py", line 3419, in render
    self.execute(stdout, env)
  File "/opt/oscarr/.local/lib/python2.7/site-packages/bottle.py", line 3406, in execute
    eval(self.co, env)
  File "/opt/oscarr/views/bazarr.tpl", line 89, in <module>
    subs_languages = ast.literal_eval(str(row[3]))
  File "/usr/lib/python2.7/ast.py", line 49, in literal_eval
    node_or_string = parse(node_or_string, mode='eval')
  File "/usr/lib/python2.7/ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
  File "<unknown>", line 1
    ['en', 'pb
             ^
SyntaxError: EOL while scanning string literal

Software (please complete the following information):

Additional context I'm using Bazarr with a custom base URL.

If I don't set the Base URL on Oscarr, I get a Unable to connect to Bazarr. Check your settings. error as expected. If I set the Base URL (either as /bazarr or /bazarr/) I get the reported error).