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):
|
def __init__(self, trackType : TrackType, trackId = None):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
@@ -82,13 +75,11 @@ class TrackDeleteScreen(Screen):
|
|||||||
|
|
||||||
def compose(self):
|
def compose(self):
|
||||||
|
|
||||||
typeLabel = TrackDeleteScreen.TRACK_TYPE_LABELS[int(self.trackType.value)-1]
|
|
||||||
|
|
||||||
yield Header()
|
yield Header()
|
||||||
|
|
||||||
with Grid():
|
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")
|
# 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):
|
def __init__(self, trackType : TrackType, streamId = None, patternId = None):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|
||||||
@@ -144,14 +138,12 @@ class TrackDetailsScreen(Screen):
|
|||||||
#
|
#
|
||||||
# self.subtitleStreamsTable.cursor_type = 'row'
|
# self.subtitleStreamsTable.cursor_type = 'row'
|
||||||
|
|
||||||
typeLabel = TrackDetailsScreen.TRACK_TYPE_LABELS[int(self.trackType.value)-1]
|
|
||||||
|
|
||||||
yield Header()
|
yield Header()
|
||||||
|
|
||||||
with Grid():
|
with Grid():
|
||||||
|
|
||||||
# 1
|
# 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")
|
# yield Input(type="text", id="pattern_input", classes="four")
|
||||||
|
|
||||||
# 2
|
# 2
|
||||||
|
|||||||
@@ -1,6 +1,19 @@
|
|||||||
from enum import Enum
|
from enum import Enum
|
||||||
|
|
||||||
class TrackType(Enum):
|
class TrackType(Enum):
|
||||||
|
|
||||||
VIDEO = 1
|
VIDEO = 1
|
||||||
AUDIO = 2
|
AUDIO = 2
|
||||||
SUBTITLE = 3
|
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