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:
parent
29f73a6c09
commit
d2b7dba3bf
1 changed files with 5 additions and 3 deletions
|
@ -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', '')
|
||||
|
|
Loading…
Reference in a new issue