Skip to content

Commit

Permalink
fix init to assign default profiles
Browse files Browse the repository at this point in the history
  • Loading branch information
lardbit committed Aug 20, 2024
1 parent 6223d6b commit 1c5c3ce
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/nefarious/management/commands/nefarious-init.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ def handle(self, *args, **options):
options['username'], options['password'], options['email'])))

# create settings if they don't already exist
nefarious_settings, _ = NefariousSettings.objects.get_or_create()

# assign default quality profiles
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)
nefarious_settings = NefariousSettings.objects.all().first()
if not nefarious_settings:
nefarious_settings = NefariousSettings.objects.create(
## define default quality profiles
quality_profile_tv=QualityProfile.objects.get(quality=PROFILE_ANY),
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:
Expand Down

0 comments on commit 1c5c3ce

Please sign in to comment.