Improved languages profile health check to include default assigned profiles

master^2 v1.5.1
Mikael Lofjärd 2 weeks ago committed by GitHub
parent 60febe3d12
commit 0413dbaa4c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -75,11 +75,13 @@ def get_health_issues():
.where(TableShows.profileId.is_not(None))).scalar() .where(TableShows.profileId.is_not(None))).scalar()
movies_with_profile = database.execute(select(func.count(TableMovies.radarrId)) movies_with_profile = database.execute(select(func.count(TableMovies.radarrId))
.where(TableMovies.profileId.is_not(None))).scalar() .where(TableMovies.profileId.is_not(None))).scalar()
default_series_profile_empty = settings.general.serie_default_enabled and settings.general.serie_default_profile == ''
default_movies_profile_empty = settings.general.movie_default_enabled and settings.general.movie_default_profile == ''
if languages_profiles_count == 0: if languages_profiles_count == 0:
health_issues.append({'object': 'Missing languages profile', health_issues.append({'object': 'Missing languages profile',
'issue': 'You must create at least one languages profile and assign it to your content.'}) 'issue': 'You must create at least one languages profile and assign it to your content.'})
elif languages_profiles_count > 0 and ((settings.general.use_sonarr and series_with_profile == 0) or elif languages_profiles_count > 0 and ((settings.general.use_sonarr and series_with_profile == 0 and default_series_profile_empty) or
(settings.general.use_radarr and movies_with_profile == 0)): (settings.general.use_radarr and movies_with_profile == 0 and default_movies_profile_empty)):
health_issues.append({'object': 'No assigned languages profile', health_issues.append({'object': 'No assigned languages profile',
'issue': 'Although you have created at least one languages profile, you must assign it ' 'issue': 'Although you have created at least one languages profile, you must assign it '
'to your content.'}) 'to your content.'})

Loading…
Cancel
Save