|
|
|
@ -1,7 +1,9 @@
|
|
|
|
|
# coding=utf-8
|
|
|
|
|
|
|
|
|
|
import json
|
|
|
|
|
|
|
|
|
|
from app.config import settings
|
|
|
|
|
from app.database import TableShowsRootfolder, TableMoviesRootfolder, database, select
|
|
|
|
|
from app.database import TableShowsRootfolder, TableMoviesRootfolder, TableLanguagesProfiles, database, select
|
|
|
|
|
from app.event_handler import event_stream
|
|
|
|
|
from .path_mappings import path_mappings
|
|
|
|
|
from sonarr.rootfolder import check_sonarr_rootfolder
|
|
|
|
@ -47,4 +49,21 @@ def get_health_issues():
|
|
|
|
|
health_issues.append({'object': path_mappings.path_replace_movie(item.path),
|
|
|
|
|
'issue': item.error})
|
|
|
|
|
|
|
|
|
|
# get languages profiles duplicate ids issues when there's a cutoff set
|
|
|
|
|
languages_profiles = database.execute(
|
|
|
|
|
select(TableLanguagesProfiles.items, TableLanguagesProfiles.name, TableLanguagesProfiles.cutoff)).all()
|
|
|
|
|
for languages_profile in languages_profiles:
|
|
|
|
|
if not languages_profile.cutoff:
|
|
|
|
|
# ignore profiles that don't have a cutoff set
|
|
|
|
|
continue
|
|
|
|
|
languages_profile_ids = []
|
|
|
|
|
for items in json.loads(languages_profile.items):
|
|
|
|
|
if items['id'] in languages_profile_ids:
|
|
|
|
|
health_issues.append({'object': languages_profile.name,
|
|
|
|
|
'issue': 'This languages profile has duplicate IDs. You need to edit this profile'
|
|
|
|
|
' and make sure to select the proper cutoff if required.'})
|
|
|
|
|
break
|
|
|
|
|
else:
|
|
|
|
|
languages_profile_ids.append(items['id'])
|
|
|
|
|
|
|
|
|
|
return health_issues
|
|
|
|
|