|
|
@ -33,9 +33,9 @@ class MediaDetailsScreen(Screen):
|
|
|
|
CSS = """
|
|
|
|
CSS = """
|
|
|
|
|
|
|
|
|
|
|
|
Grid {
|
|
|
|
Grid {
|
|
|
|
grid-size: 5 12;
|
|
|
|
grid-size: 4 8;
|
|
|
|
grid-rows: 2 2 2 2 2 6 2 2 6 2 2 2;
|
|
|
|
grid-rows: 8 2 2 8 2 8 2 8;
|
|
|
|
grid-columns: 25 25 25 25 25;
|
|
|
|
grid-columns: 25 125 10 75;
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
padding: 1;
|
|
|
|
padding: 1;
|
|
|
@ -49,7 +49,7 @@ class MediaDetailsScreen(Screen):
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
DataTable {
|
|
|
|
DataTable {
|
|
|
|
min-height: 6;
|
|
|
|
min-height: 40;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#toplabel {
|
|
|
|
#toplabel {
|
|
|
@ -67,10 +67,23 @@ class MediaDetailsScreen(Screen):
|
|
|
|
column-span: 5;
|
|
|
|
column-span: 5;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.triple {
|
|
|
|
|
|
|
|
row-span: 3;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.box {
|
|
|
|
.box {
|
|
|
|
height: 100%;
|
|
|
|
height: 100%;
|
|
|
|
border: solid green;
|
|
|
|
border: solid green;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.yellow {
|
|
|
|
|
|
|
|
tint: yellow 40%;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#differences-table {
|
|
|
|
|
|
|
|
row-span: 8;
|
|
|
|
|
|
|
|
/* tint: magenta 40%; */
|
|
|
|
|
|
|
|
}
|
|
|
|
"""
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
|
|
def __init__(self, patternId = None, showId = None):
|
|
|
|
def __init__(self, patternId = None, showId = None):
|
|
|
@ -79,6 +92,10 @@ class MediaDetailsScreen(Screen):
|
|
|
|
self.context = self.app.getContext()
|
|
|
|
self.context = self.app.getContext()
|
|
|
|
self.Session = self.context['database']['session'] # convenience
|
|
|
|
self.Session = self.context['database']['session'] # convenience
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.__pc = PatternController(context = self.context)
|
|
|
|
|
|
|
|
self.__sc = ShowController(context = self.context)
|
|
|
|
|
|
|
|
self.__tc = TrackController(context = self.context)
|
|
|
|
|
|
|
|
|
|
|
|
if not 'command' in self.context.keys() or self.context['command'] != 'inspect':
|
|
|
|
if not 'command' in self.context.keys() or self.context['command'] != 'inspect':
|
|
|
|
raise click.ClickException(f"MediaDetailsScreen.__init__(): Can only perform command 'inspect'")
|
|
|
|
raise click.ClickException(f"MediaDetailsScreen.__init__(): Can only perform command 'inspect'")
|
|
|
|
|
|
|
|
|
|
|
@ -96,7 +113,8 @@ class MediaDetailsScreen(Screen):
|
|
|
|
self.__mediaFilenamePattern = self.__mediaFileProperties.getPattern()
|
|
|
|
self.__mediaFilenamePattern = self.__mediaFileProperties.getPattern()
|
|
|
|
self.__storedMediaFilenamePattern = self.__mediaFilenamePattern.getMediaDescriptor()
|
|
|
|
self.__storedMediaFilenamePattern = self.__mediaFilenamePattern.getMediaDescriptor()
|
|
|
|
|
|
|
|
|
|
|
|
raise click.ClickException(f"diff {self.__mediaDescriptor.compare(self.__storedMediaFilenamePattern)}")
|
|
|
|
# raise click.ClickException(f"diff {self.__mediaDescriptor.compare(self.__storedMediaFilenamePattern)}")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# def loadTracks(self, show_id):
|
|
|
|
# def loadTracks(self, show_id):
|
|
|
|
#
|
|
|
|
#
|
|
|
@ -161,7 +179,13 @@ class MediaDetailsScreen(Screen):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def on_mount(self):
|
|
|
|
def on_mount(self):
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
|
|
row = (' ', '<New show>', ' ') # Convert each element to a string before adding
|
|
|
|
|
|
|
|
self.showsTable.add_row(*map(str, row))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for show in self.__sc.getAllShows():
|
|
|
|
|
|
|
|
row = (int(show.id), show.name, show.year) # Convert each element to a string before adding
|
|
|
|
|
|
|
|
self.showsTable.add_row(*map(str, row))
|
|
|
|
|
|
|
|
|
|
|
|
# if self.show_obj:
|
|
|
|
# if self.show_obj:
|
|
|
|
# self.query_one("#showlabel", Static).update(f"{self.show_obj['id']} - {self.show_obj['name']} ({self.show_obj['year']})")
|
|
|
|
# self.query_one("#showlabel", Static).update(f"{self.show_obj['id']} - {self.show_obj['name']} ({self.show_obj['year']})")
|
|
|
@ -176,35 +200,105 @@ class MediaDetailsScreen(Screen):
|
|
|
|
|
|
|
|
|
|
|
|
def compose(self):
|
|
|
|
def compose(self):
|
|
|
|
|
|
|
|
|
|
|
|
# self.audioStreamsTable = DataTable(classes="five")
|
|
|
|
|
|
|
|
#
|
|
|
|
# Create the DataTable widget
|
|
|
|
# # Define the columns with headers
|
|
|
|
self.showsTable = DataTable()
|
|
|
|
# self.column_key_audio_subid = self.audioStreamsTable.add_column("Subindex", width=20)
|
|
|
|
|
|
|
|
# self.column_key_audio_layout = self.audioStreamsTable.add_column("Layout", width=20)
|
|
|
|
# Define the columns with headers
|
|
|
|
# self.column_key_audio_language = self.audioStreamsTable.add_column("Language", width=20)
|
|
|
|
self.column_key_id = self.showsTable.add_column("ID", width=10)
|
|
|
|
# self.column_key_audio_title = self.audioStreamsTable.add_column("Title", width=30)
|
|
|
|
self.column_key_name = self.showsTable.add_column("Name", width=50)
|
|
|
|
# self.column_key_audio_default = self.audioStreamsTable.add_column("Default", width=10)
|
|
|
|
self.column_key_year = self.showsTable.add_column("Year", width=10)
|
|
|
|
# self.column_key_audio_forced = self.audioStreamsTable.add_column("Forced", width=10)
|
|
|
|
|
|
|
|
#
|
|
|
|
self.showsTable.cursor_type = 'row'
|
|
|
|
# self.audioStreamsTable.cursor_type = 'row'
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# self.subtitleStreamsTable = DataTable(classes="five")
|
|
|
|
self.trackTagsTable = DataTable()
|
|
|
|
#
|
|
|
|
|
|
|
|
# # Define the columns with headers
|
|
|
|
# Define the columns with headers
|
|
|
|
# self.column_key_subtitle_subid = self.subtitleStreamsTable.add_column("Subindex", width=20)
|
|
|
|
self.column_key_track_tag_key = self.trackTagsTable.add_column("Key", width=10)
|
|
|
|
# self.column_key_subtitle_spacer = self.subtitleStreamsTable.add_column(" ", width=20)
|
|
|
|
self.column_key_track_tag_value = self.trackTagsTable.add_column("Value", width=30)
|
|
|
|
# self.column_key_subtitle_language = self.subtitleStreamsTable.add_column("Language", width=20)
|
|
|
|
|
|
|
|
# self.column_key_subtitle_title = self.subtitleStreamsTable.add_column("Title", width=30)
|
|
|
|
self.trackTagsTable.cursor_type = 'row'
|
|
|
|
# self.column_key_subtitle_default = self.subtitleStreamsTable.add_column("Default", width=10)
|
|
|
|
|
|
|
|
# self.column_key_subtitle_forced = self.subtitleStreamsTable.add_column("Forced", width=10)
|
|
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
# self.subtitleStreamsTable.cursor_type = 'row'
|
|
|
|
self.audioStreamsTable = DataTable()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Define the columns with headers
|
|
|
|
|
|
|
|
self.column_key_audio_subid = self.audioStreamsTable.add_column("Subindex", width=20)
|
|
|
|
|
|
|
|
self.column_key_audio_layout = self.audioStreamsTable.add_column("Layout", width=20)
|
|
|
|
|
|
|
|
self.column_key_audio_language = self.audioStreamsTable.add_column("Language", width=20)
|
|
|
|
|
|
|
|
self.column_key_audio_title = self.audioStreamsTable.add_column("Title", width=30)
|
|
|
|
|
|
|
|
self.column_key_audio_default = self.audioStreamsTable.add_column("Default", width=10)
|
|
|
|
|
|
|
|
self.column_key_audio_forced = self.audioStreamsTable.add_column("Forced", width=10)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.audioStreamsTable.cursor_type = 'row'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.subtitleStreamsTable = DataTable()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Define the columns with headers
|
|
|
|
|
|
|
|
self.column_key_subtitle_subid = self.subtitleStreamsTable.add_column("Subindex", width=20)
|
|
|
|
|
|
|
|
self.column_key_subtitle_spacer = self.subtitleStreamsTable.add_column(" ", width=20)
|
|
|
|
|
|
|
|
self.column_key_subtitle_language = self.subtitleStreamsTable.add_column("Language", width=20)
|
|
|
|
|
|
|
|
self.column_key_subtitle_title = self.subtitleStreamsTable.add_column("Title", width=30)
|
|
|
|
|
|
|
|
self.column_key_subtitle_default = self.subtitleStreamsTable.add_column("Default", width=10)
|
|
|
|
|
|
|
|
self.column_key_subtitle_forced = self.subtitleStreamsTable.add_column("Forced", width=10)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.subtitleStreamsTable.cursor_type = 'row'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Create the DataTable widget
|
|
|
|
|
|
|
|
self.diffsTable = DataTable(id='differences-table') # classes="triple"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Define the columns with headers
|
|
|
|
|
|
|
|
self.column_key_differences = self.diffsTable.add_column("Differences", width=70)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
self.diffsTable.cursor_type = 'row'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yield Header()
|
|
|
|
yield Header()
|
|
|
|
|
|
|
|
|
|
|
|
# with Grid():
|
|
|
|
with Grid():
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1
|
|
|
|
|
|
|
|
yield Static("Show")
|
|
|
|
|
|
|
|
yield self.showsTable
|
|
|
|
|
|
|
|
yield Static(" ")
|
|
|
|
|
|
|
|
yield self.diffsTable
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 2
|
|
|
|
|
|
|
|
yield Static("Pattern")
|
|
|
|
|
|
|
|
yield Input(type="text")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
yield Static(" ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 3
|
|
|
|
|
|
|
|
yield Static(" ", classes="three")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 4
|
|
|
|
|
|
|
|
yield Static("Media Tags")
|
|
|
|
|
|
|
|
yield self.trackTagsTable
|
|
|
|
|
|
|
|
yield Static(" ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 5
|
|
|
|
|
|
|
|
yield Static(" ", classes="three")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 6
|
|
|
|
|
|
|
|
yield Static("Audio Streams")
|
|
|
|
|
|
|
|
yield self.audioStreamsTable
|
|
|
|
|
|
|
|
yield Static(" ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 7
|
|
|
|
|
|
|
|
yield Static(" ", classes="three")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 8
|
|
|
|
|
|
|
|
yield Static("Subtitle Streams")
|
|
|
|
|
|
|
|
yield self.subtitleStreamsTable
|
|
|
|
|
|
|
|
yield Static(" ")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 1
|
|
|
|
# 1
|
|
|
|
# yield Static("Edit filename pattern" if self.__pattern is not None else "New filename pattern", id="toplabel")
|
|
|
|
# yield Static("Edit filename pattern" if self.__pattern is not None else "New filename pattern", id="toplabel")
|
|
|
|