Skip to content

Commit

Permalink
swap QualityProfile.profile->quality in init
Browse files Browse the repository at this point in the history
  • Loading branch information
lardbit committed Aug 17, 2024
1 parent ba83c65 commit 9bcf4dc
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/nefarious/management/commands/nefarious-init.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ def handle(self, *args, **options):
nefarious_settings, _ = NefariousSettings.objects.get_or_create()

# assign default quality profiles
nefarious_settings.quality_profile_tv = QualityProfile.objects.get(profile=PROFILE_ANY)
nefarious_settings.quality_profile_movies = QualityProfile.objects.get(profile=PROFILE_HD_1080p)
nefarious_settings.save()
if not nefarious_settings.quality_profile_tv:
nefarious_settings.quality_profile_tv = QualityProfile.objects.get(quality=PROFILE_ANY)
if not nefarious_settings.quality_profile_movies:
nefarious_settings.quality_profile_movies = QualityProfile.objects.get(quality=PROFILE_HD_1080p)

# populate tmdb configuration if necessary
if not nefarious_settings.tmdb_configuration or not nefarious_settings.tmdb_languages:
tmdb_client = get_tmdb_client(nefarious_settings)
configuration = tmdb_client.Configuration()
nefarious_settings.tmdb_configuration = configuration.info()
nefarious_settings.tmdb_languages = configuration.languages()
nefarious_settings.save()

nefarious_settings.save()

0 comments on commit 9bcf4dc

Please sign in to comment.