mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-22 13:06:34 +00:00
Use MediaServerType
This commit is contained in:
parent
f8229fff11
commit
4a1c0016fd
@ -31,7 +31,7 @@ from .utils import validate_url, delete_file
|
||||
from .tasks import (map_task_to_instance, get_error_message,
|
||||
get_source_completed_tasks, get_media_download_task,
|
||||
delete_task_by_media, index_source_task)
|
||||
from .choices import (YouTube_SourceType, youtube_long_source_types,
|
||||
from .choices import (MediaServerType, YouTube_SourceType, youtube_long_source_types,
|
||||
youtube_help, youtube_validation_urls)
|
||||
from . import signals
|
||||
from . import youtube
|
||||
@ -897,13 +897,11 @@ class AddMediaServerView(FormView):
|
||||
|
||||
template_name = 'sync/mediaserver-add.html'
|
||||
server_types = {
|
||||
'plex': MediaServer.SERVER_TYPE_PLEX,
|
||||
}
|
||||
server_type_names = {
|
||||
MediaServer.SERVER_TYPE_PLEX: _('Plex'),
|
||||
'plex': MediaServerType.PLEX.value,
|
||||
}
|
||||
server_type_names = dict(MediaServerType.choices)
|
||||
forms = {
|
||||
MediaServer.SERVER_TYPE_PLEX: PlexMediaServerForm,
|
||||
MediaServerType.PLEX.value: PlexMediaServerForm,
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
@ -1020,7 +1018,7 @@ class UpdateMediaServerView(FormView, SingleObjectMixin):
|
||||
template_name = 'sync/mediaserver-update.html'
|
||||
model = MediaServer
|
||||
forms = {
|
||||
MediaServer.SERVER_TYPE_PLEX: PlexMediaServerForm,
|
||||
MediaServerType.PLEX.value: PlexMediaServerForm,
|
||||
}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
|
Loading…
Reference in New Issue
Block a user