fix(mediaServer): use proportional column widths, populate Emby playback/transcoding metadata

The User and Status columns used hardcoded pixel widths with table-layout:
fixed, so they stayed narrow regardless of how wide the widget actually
rendered - text truncated even with plenty of unused space in the
"currently playing" column. Switch both to percentages so they scale with
the widget.

Emby's integration also hardcoded playback/metadata to null for every
session, so the widget's existing progress bar, resolution, and bitrate
display never had anything to show. Port the same TranscodingInfo/
MediaStreams parsing Jellyfin already does (same underlying /Sessions API
shape) so Emby sessions get real position/duration, resolution, bitrate,
and transcode-status data. Also fix ticksToMs treating a position of
exactly 0 as missing, and share the one implementation between the two
integrations instead of duplicating it.
This commit is contained in:
Bergasha committed 2026-08-24 11:16:20 +10:00
1 parent ec295fe26e
commit b8bc304c5c
3 files changed
+87 -12

No files matched your search

@@ -50,7 +50,7 @@ type SortState = { column: SortColumn; descending: boolean } | null;
export const getMediaServerColumnVisibility = (width: number, isAdvanced: boolean) => ({
user: isAdvanced || width >= 300,
// The user (200px) and status (190px) columns together need a floor here, otherwise the
// The user (26%) and status (22%) columns together need a floor here, otherwise the
// currentlyPlaying column - the primary content - gets squeezed to almost nothing.
status: isAdvanced || width >= 540,
});
@@ -140,7 +140,7 @@ function StreamTableHeader({
sortable: boolean;
sort: SortState;
onSort: (column: SortColumn) => void;
width?: number;
width?: number | string;
}) {
const active = sort?.column === column;
const SortIcon = !active ? IconArrowsSort : sort.descending ? IconChevronDown : IconChevronUp;
@@ -285,7 +285,7 @@ export default function MediaServerWidget({
sortable={isAdvanced}
sort={sort}
onSort={toggleSort}
width={200}
width="26%"
/>
)}
<StreamTableHeader
@@ -302,7 +302,7 @@ export default function MediaServerWidget({
sortable={isAdvanced}
sort={sort}
onSort={toggleSort}
width={190}
width="22%"
/>
)}
</Table.Tr>