From f8229fff1192899c287b20d5cbe5d5f4516da982 Mon Sep 17 00:00:00 2001 From: tcely Date: Wed, 12 Feb 2025 06:07:37 -0500 Subject: [PATCH] Use `MediaServerType` --- tubesync/sync/models.py | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/tubesync/sync/models.py b/tubesync/sync/models.py index da2bcb9b..a721bb98 100644 --- a/tubesync/sync/models.py +++ b/tubesync/sync/models.py @@ -26,7 +26,8 @@ from .matching import (get_best_combined_format, get_best_audio_format, get_best_video_format) from .mediaservers import PlexMediaServer from .fields import CommaSepChoiceField -from .choices import CapChoices, IndexSchedule, SponsorBlock_Category, YouTube_SourceType +from .choices import (CapChoices, IndexSchedule, MediaServerType, + SponsorBlock_Category, YouTube_SourceType) media_file_storage = FileSystemStorage(location=str(settings.DOWNLOAD_ROOT), base_url='/media-data/') @@ -1612,11 +1613,7 @@ class MediaServer(models.Model): A remote media server, such as a Plex server. ''' - SERVER_TYPE_PLEX = 'p' - SERVER_TYPES = (SERVER_TYPE_PLEX,) - SERVER_TYPE_CHOICES = ( - (SERVER_TYPE_PLEX, _('Plex')), - ) + SERVER_TYPE_PLEX = MediaServerType.PLEX.value ICONS = { SERVER_TYPE_PLEX: '', } @@ -1628,8 +1625,8 @@ class MediaServer(models.Model): _('server type'), max_length=1, db_index=True, - choices=SERVER_TYPE_CHOICES, - default=SERVER_TYPE_PLEX, + choices=MediaServerType.choices, + default=MediaServerType.PLEX, help_text=_('Server type') ) host = models.CharField(