1
0
Fork 0
mirror of https://github.com/morpheus65535/bazarr synced 2024-12-26 17:47:20 +00:00

Fixed package_info parsing to deal with single line text with \n separator

This commit is contained in:
morpheus65535 2021-04-07 19:39:11 -04:00
parent 29f73a6c09
commit d2b7dba3bf

View file

@ -99,11 +99,13 @@ if isinstance(settings.general.enabled_providers, str) and not settings.general.
package_info_file = os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))), 'package_info')
if os.path.isfile(package_info_file):
try:
splitted_lines = []
package_info = {}
with open(package_info_file) as file:
for line in file.readlines():
if line == '\n':
break
lines = file.readlines()
for line in lines:
splitted_lines += line.split(r'\n')
for line in splitted_lines:
splitted_line = line.split('=')
if len(splitted_line) == 2:
package_info[splitted_line[0].lower()] = splitted_line[1].replace('\n', '')