mirror of
https://github.com/meeb/tubesync.git
synced 2025-06-23 05:26:37 +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,
|
from .tasks import (map_task_to_instance, get_error_message,
|
||||||
get_source_completed_tasks, get_media_download_task,
|
get_source_completed_tasks, get_media_download_task,
|
||||||
delete_task_by_media, index_source_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)
|
youtube_help, youtube_validation_urls)
|
||||||
from . import signals
|
from . import signals
|
||||||
from . import youtube
|
from . import youtube
|
||||||
@ -897,13 +897,11 @@ class AddMediaServerView(FormView):
|
|||||||
|
|
||||||
template_name = 'sync/mediaserver-add.html'
|
template_name = 'sync/mediaserver-add.html'
|
||||||
server_types = {
|
server_types = {
|
||||||
'plex': MediaServer.SERVER_TYPE_PLEX,
|
'plex': MediaServerType.PLEX.value,
|
||||||
}
|
|
||||||
server_type_names = {
|
|
||||||
MediaServer.SERVER_TYPE_PLEX: _('Plex'),
|
|
||||||
}
|
}
|
||||||
|
server_type_names = dict(MediaServerType.choices)
|
||||||
forms = {
|
forms = {
|
||||||
MediaServer.SERVER_TYPE_PLEX: PlexMediaServerForm,
|
MediaServerType.PLEX.value: PlexMediaServerForm,
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@ -1020,7 +1018,7 @@ class UpdateMediaServerView(FormView, SingleObjectMixin):
|
|||||||
template_name = 'sync/mediaserver-update.html'
|
template_name = 'sync/mediaserver-update.html'
|
||||||
model = MediaServer
|
model = MediaServer
|
||||||
forms = {
|
forms = {
|
||||||
MediaServer.SERVER_TYPE_PLEX: PlexMediaServerForm,
|
MediaServerType.PLEX.value: PlexMediaServerForm,
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
|
Loading…
Reference in New Issue
Block a user