ninc
This commit is contained in:
@@ -48,13 +48,6 @@ class TrackDeleteScreen(Screen):
|
||||
}
|
||||
"""
|
||||
|
||||
TRACK_TYPE_LABELS = [
|
||||
'video',
|
||||
'audio',
|
||||
'subtitle'
|
||||
]
|
||||
|
||||
|
||||
def __init__(self, trackType : TrackType, trackId = None):
|
||||
super().__init__()
|
||||
|
||||
@@ -82,13 +75,11 @@ class TrackDeleteScreen(Screen):
|
||||
|
||||
def compose(self):
|
||||
|
||||
typeLabel = TrackDeleteScreen.TRACK_TYPE_LABELS[int(self.trackType.value)-1]
|
||||
|
||||
yield Header()
|
||||
|
||||
with Grid():
|
||||
|
||||
yield Static(f"Are you sure to delete the following {typeLabel} stream?", id="toplabel", classes="two")
|
||||
yield Static(f"Are you sure to delete the following {self.trackType.label()} stream?", id="toplabel", classes="two")
|
||||
|
||||
# yield Static("", classes="two")
|
||||
#
|
||||
|
||||
@@ -62,12 +62,6 @@ class TrackDetailsScreen(Screen):
|
||||
}
|
||||
"""
|
||||
|
||||
TRACK_TYPE_LABELS = [
|
||||
'video',
|
||||
'audio',
|
||||
'subtitle'
|
||||
]
|
||||
|
||||
def __init__(self, trackType : TrackType, streamId = None, patternId = None):
|
||||
super().__init__()
|
||||
|
||||
@@ -144,14 +138,12 @@ class TrackDetailsScreen(Screen):
|
||||
#
|
||||
# self.subtitleStreamsTable.cursor_type = 'row'
|
||||
|
||||
typeLabel = TrackDetailsScreen.TRACK_TYPE_LABELS[int(self.trackType.value)-1]
|
||||
|
||||
yield Header()
|
||||
|
||||
with Grid():
|
||||
|
||||
# 1
|
||||
yield Static(f"Edit {typeLabel} stream" if self.track_obj else f"New {typeLabel} stream", id="toplabel", classes="five")
|
||||
yield Static(f"Edit {self.trackType.label()} stream" if self.track_obj else f"New {self.trackType.label()} stream", id="toplabel", classes="five")
|
||||
# yield Input(type="text", id="pattern_input", classes="four")
|
||||
|
||||
# 2
|
||||
|
||||
@@ -1,6 +1,19 @@
|
||||
from enum import Enum
|
||||
|
||||
class TrackType(Enum):
|
||||
|
||||
VIDEO = 1
|
||||
AUDIO = 2
|
||||
SUBTITLE = 3
|
||||
|
||||
|
||||
def label(self):
|
||||
"""Returns the stream type as string"""
|
||||
|
||||
labels = {
|
||||
TrackType.VIDEO: "video",
|
||||
TrackType.AUDIO: "audio",
|
||||
TrackType.SUBTITLE: "subtitle"
|
||||
}
|
||||
|
||||
return labels.get(self, "undefined")
|
||||
|
||||
Reference in New Issue
Block a user