diff --git a/src/nefarious/management/commands/nefarious-init.py b/src/nefarious/management/commands/nefarious-init.py index a6cac27c..c8cc1db1 100644 --- a/src/nefarious/management/commands/nefarious-init.py +++ b/src/nefarious/management/commands/nefarious-init.py @@ -1,7 +1,8 @@ from django.contrib.auth.models import User from django.core.management.base import BaseCommand -from nefarious.models import NefariousSettings +from nefarious.models import NefariousSettings, QualityProfile from nefarious.tmdb import get_tmdb_client +from nefarious.quality import PROFILE_HD_1080p, PROFILE_ANY class Command(BaseCommand): @@ -24,6 +25,11 @@ def handle(self, *args, **options): # create settings if they don't already exist 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() + # populate tmdb configuration if necessary if not nefarious_settings.tmdb_configuration or not nefarious_settings.tmdb_languages: tmdb_client = get_tmdb_client(nefarious_settings)