From 6a8a94101a8b0f0861ca696984ff0391a48e1fd9 Mon Sep 17 00:00:00 2001 From: Jeffrey C <990135+JeffreyBytes@users.noreply.github.com> Date: Mon, 12 Jan 2026 10:59:52 -0600 Subject: [PATCH 01/55] Add filter to show unassociated streams in Streams table Adds a filter button with 'Only Unassociated' toggle option to the Streams table, allowing users to quickly identify streams from providers that are not associated with any channel. The filter button follows the existing UI pattern from ChannelTableHeader, positioned on the right side of the toolbar. Leverages existing backend support for the unassigned query parameter. Resolves #667 --- .../src/components/tables/StreamsTable.jsx | 35 ++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/frontend/src/components/tables/StreamsTable.jsx b/frontend/src/components/tables/StreamsTable.jsx index 21b13baf..8c931a65 100644 --- a/frontend/src/components/tables/StreamsTable.jsx +++ b/frontend/src/components/tables/StreamsTable.jsx @@ -20,6 +20,9 @@ import { ArrowUpNarrowWide, ArrowDownWideNarrow, Search, + Filter, + Square, + SquareCheck, } from 'lucide-react'; import { TextInput, @@ -48,7 +51,6 @@ import { Modal, NumberInput, Radio, - Checkbox, } from '@mantine/core'; import { useNavigate } from 'react-router-dom'; import useSettingsStore from '../../store/settings'; @@ -232,6 +234,7 @@ const StreamsTable = ({ onReady }) => { name: '', channel_group: '', m3u_account: '', + unassigned: '', }); const [columnSizing, setColumnSizing] = useLocalStorage( 'streams-table-column-sizing', @@ -382,6 +385,13 @@ const StreamsTable = ({ onReady }) => { })); }; + const toggleUnassignedOnly = () => { + setFilters((prev) => ({ + ...prev, + unassigned: prev.unassigned === '1' ? '' : '1', + })); + }; + const fetchData = useCallback(async () => { setIsLoading(true); @@ -1057,6 +1067,29 @@ const StreamsTable = ({ onReady }) => { + + + + + + + + ) : ( + + ) + } + > + Only Unassociated + + + + ; - } - - const WatchRecording = () => { - return + return ( + ); + }; + + const WatchRecording = () => { + return ( + - Watch - - ; - } + + + ); + }; const MainCard = ( { {isSeriesGroup ? 'Next recording' : 'Time'} - {start.format(`${dateformat}, YYYY ${timeformat}`)} – {end.format(timeformat)} + {start.format(`${dateformat}, YYYY ${timeformat}`)} –{' '} + {end.format(timeformat)} @@ -419,4 +433,4 @@ const RecordingCard = ({ recording, onOpenDetails, onOpenRecurring }) => { ); }; -export default RecordingCard; \ No newline at end of file +export default RecordingCard; diff --git a/frontend/src/components/cards/StreamConnectionCard.jsx b/frontend/src/components/cards/StreamConnectionCard.jsx index a00f3664..0e441cbe 100644 --- a/frontend/src/components/cards/StreamConnectionCard.jsx +++ b/frontend/src/components/cards/StreamConnectionCard.jsx @@ -25,7 +25,10 @@ import { Users, Video, } from 'lucide-react'; -import { toFriendlyDuration } from '../../utils/dateTimeUtils.js'; +import { + toFriendlyDuration, + useDateTimeFormat, +} from '../../utils/dateTimeUtils.js'; import { CustomTable, useTable } from '../tables/CustomTable/index.jsx'; import { TableHelper } from '../../helpers/index.jsx'; import logo from '../../images/logo.png'; @@ -68,9 +71,8 @@ const StreamConnectionCard = ({ // Get settings for speed threshold const settings = useSettingsStore((s) => s.settings); - // Get Date-format from localStorage - const [dateFormatSetting] = useLocalStorage('date-format', 'mdy'); - const dateFormat = dateFormatSetting === 'mdy' ? 'MM/DD' : 'DD/MM'; + // Get user's date/time format preferences + const { fullDateTimeFormat } = useDateTimeFormat(); // Create a map of M3U account IDs to names for quick lookup const m3uAccountsMap = useMemo(() => { @@ -258,7 +260,7 @@ const StreamConnectionCard = ({ { id: 'connected', header: 'Connected', - accessorFn: connectedAccessor(dateFormat), + accessorFn: connectedAccessor(fullDateTimeFormat), cell: ({ cell }) => ( { bdrs={6} bd={'1px solid rgba(255, 255, 255, 0.08)'} > - {connection.user_agent && - connection.user_agent !== 'Unknown' && ( - - - User Agent: - - - {connection.user_agent.length > 100 - ? `${connection.user_agent.substring(0, 100)}...` - : connection.user_agent} - - - )} + {connection.user_agent && connection.user_agent !== 'Unknown' && ( + + + User Agent: + + + {connection.user_agent.length > 100 + ? `${connection.user_agent.substring(0, 100)}...` + : connection.user_agent} + + + )} @@ -86,9 +107,7 @@ const ClientDetails = ({ connection, connectionStartTime }) => { {' '} ({Math.round(connection.last_seek_byte / (1024 * 1024))} MB /{' '} - {Math.round( - connection.total_content_size / (1024 * 1024) - )} + {Math.round(connection.total_content_size / (1024 * 1024))} MB) )} @@ -120,12 +139,11 @@ const ClientDetails = ({ connection, connectionStartTime }) => { )} ); -} +}; // Create a VOD Card component similar to ChannelCard const VodConnectionCard = ({ vodContent, stopVODClient }) => { - const [dateFormatSetting] = useLocalStorage('date-format', 'mdy'); - const dateFormat = dateFormatSetting === 'mdy' ? 'MM/DD' : 'DD/MM'; + const { fullDateTimeFormat } = useDateTimeFormat(); const [isClientExpanded, setIsClientExpanded] = useState(false); const [, setUpdateTrigger] = useState(0); // Force re-renders for progress updates @@ -197,9 +215,9 @@ const VodConnectionCard = ({ vodContent, stopVODClient }) => { // Get connection start time for tooltip const getConnectionStartTime = useCallback( (connection) => { - return calculateConnectionStartTime(connection, dateFormat); + return calculateConnectionStartTime(connection, fullDateTimeFormat); }, - [dateFormat] + [fullDateTimeFormat] ); return ( @@ -211,14 +229,16 @@ const VodConnectionCard = ({ vodContent, stopVODClient }) => { style={{ backgroundColor: '#27272A', }} - color='#FFF' + color="#FFF" maw={700} w={'100%'} > - + {/* Header with poster and basic info */} - { {connection && metadata.duration_secs && (() => { - const { totalTime, currentTime, percentage} = getProgressInfo(); + const { totalTime, currentTime, percentage } = getProgressInfo(); return totalTime > 0 ? ( @@ -346,8 +366,7 @@ const VodConnectionCard = ({ vodContent, stopVODClient }) => { Progress - {formatTime(currentTime)} /{' '} - {formatTime(totalTime)} + {formatTime(currentTime)} / {formatTime(totalTime)} { {isClientExpanded && ( + connectionStartTime={getConnectionStartTime(connection)} + /> )} )} @@ -419,4 +439,4 @@ const VodConnectionCard = ({ vodContent, stopVODClient }) => { ); }; -export default VodConnectionCard; \ No newline at end of file +export default VodConnectionCard; diff --git a/frontend/src/components/forms/RecordingDetailsModal.jsx b/frontend/src/components/forms/RecordingDetailsModal.jsx index 1abc6f3b..d9ece7bb 100644 --- a/frontend/src/components/forms/RecordingDetailsModal.jsx +++ b/frontend/src/components/forms/RecordingDetailsModal.jsx @@ -1,7 +1,20 @@ import useChannelsStore from '../../store/channels.jsx'; -import { useDateTimeFormat, useTimeHelpers } from '../../utils/dateTimeUtils.js'; +import { + useDateTimeFormat, + useTimeHelpers, +} from '../../utils/dateTimeUtils.js'; import React from 'react'; -import { Badge, Button, Card, Flex, Group, Image, Modal, Stack, Text, } from '@mantine/core'; +import { + Badge, + Button, + Card, + Flex, + Group, + Image, + Modal, + Stack, + Text, +} from '@mantine/core'; import useVideoStore from '../../store/useVideoStore.jsx'; import { notifications } from '@mantine/notifications'; import { @@ -19,22 +32,23 @@ import { } from '../../utils/forms/RecordingDetailsModalUtils.js'; const RecordingDetailsModal = ({ - opened, - onClose, - recording, - channel, - posterUrl, - onWatchLive, - onWatchRecording, - env_mode, - onEdit, - }) => { + opened, + onClose, + recording, + channel, + posterUrl, + onWatchLive, + onWatchRecording, + env_mode, + onEdit, +}) => { const allRecordings = useChannelsStore((s) => s.recordings); const channelMap = useChannelsStore((s) => s.channels); const { toUserTime, userNow } = useTimeHelpers(); const [childOpen, setChildOpen] = React.useState(false); const [childRec, setChildRec] = React.useState(null); - const [timeformat, dateformat] = useDateTimeFormat(); + const { timeFormat: timeformat, dateFormat: dateformat } = + useDateTimeFormat(); const safeRecording = recording || {}; const customProps = safeRecording.custom_properties || {}; @@ -61,7 +75,13 @@ const RecordingDetailsModal = ({ safeRecording._group_count && safeRecording._group_count > 1 ); const upcomingEpisodes = React.useMemo(() => { - return getUpcomingEpisodes(isSeriesGroup, allRecordings, program, toUserTime, userNow); + return getUpcomingEpisodes( + isSeriesGroup, + allRecordings, + program, + toUserTime, + userNow + ); }, [ allRecordings, isSeriesGroup, @@ -79,31 +99,32 @@ const RecordingDetailsModal = ({ if (now.isAfter(s) && now.isBefore(e)) { if (!channelMap[rec.channel]) return; - useVideoStore.getState().showVideo(getShowVideoUrl(channelMap[rec.channel], env_mode), 'live'); + useVideoStore + .getState() + .showVideo(getShowVideoUrl(channelMap[rec.channel], env_mode), 'live'); } - } + }; const handleOnWatchRecording = () => { - let fileUrl = getRecordingUrl(childRec.custom_properties, env_mode) + let fileUrl = getRecordingUrl(childRec.custom_properties, env_mode); if (!fileUrl) return; useVideoStore.getState().showVideo(fileUrl, 'vod', { - name: - childRec.custom_properties?.program?.title || 'Recording', + name: childRec.custom_properties?.program?.title || 'Recording', logo: { url: getPosterUrl( childRec.custom_properties?.poster_logo_id, undefined, channelMap[childRec.channel]?.logo?.cache_url - ) + ), }, }); - } + }; const handleRunComskip = async (e) => { e.stopPropagation?.(); try { - await runComSkip(recording) + await runComSkip(recording); notifications.show({ title: 'Removing commercials', message: 'Queued comskip for this recording', @@ -113,7 +134,7 @@ const RecordingDetailsModal = ({ } catch (error) { console.error('Failed to run comskip', error); } - } + }; if (!recording) return null; @@ -147,7 +168,7 @@ const RecordingDetailsModal = ({ const handleOnMainCardClick = () => { setChildRec(rec); setChildOpen(true); - } + }; return ( - {start.format(`${dateformat}, YYYY ${timeformat}`)} – {end.format(timeformat)} + {start.format(`${dateformat}, YYYY ${timeformat}`)} –{' '} + {end.format(timeformat)} @@ -197,142 +219,153 @@ const RecordingDetailsModal = ({ }; const WatchLive = () => { - return ; - } + return ( + + ); + }; const WatchRecording = () => { - return ; - } + return ( + + ); + }; const Edit = () => { - return ; - } + return ( + + ); + }; const Series = () => { - return - {upcomingEpisodes.length === 0 && ( - - No upcoming episodes found - - )} - {upcomingEpisodes.map((ep) => ( - - ))} - {childOpen && childRec && ( - setChildOpen(false)} - recording={childRec} - channel={channelMap[childRec.channel]} - posterUrl={getPosterUrl( - childRec.custom_properties?.poster_logo_id, - childRec.custom_properties, - channelMap[childRec.channel]?.logo?.cache_url - )} - env_mode={env_mode} - onWatchLive={handleOnWatchLive} - onWatchRecording={handleOnWatchRecording} - /> - )} - ; - } - - const Movie = () => { - return - {recordingName} - - - - {channel ? `${channel.channel_number} • ${channel.name}` : '—'} - - - {onWatchLive && } - {onWatchRecording && } - {onEdit && start.isAfter(userNow()) && } - {customProps.status === 'completed' && - (!customProps?.comskip || - customProps?.comskip?.status !== 'completed') && ( - - )} - - - - {start.format(`${dateformat}, YYYY ${timeformat}`)} – {end.format(timeformat)} - - {rating && ( - - - {rating} - - - )} - {description && ( - - {description} + return ( + + {upcomingEpisodes.length === 0 && ( + + No upcoming episodes found )} - {statRows.length > 0 && ( - - - Stream Stats - - {statRows.map(([k, v]) => ( - - - {k} - - {v} - - ))} - + {upcomingEpisodes.map((ep) => ( + + ))} + {childOpen && childRec && ( + setChildOpen(false)} + recording={childRec} + channel={channelMap[childRec.channel]} + posterUrl={getPosterUrl( + childRec.custom_properties?.poster_logo_id, + childRec.custom_properties, + channelMap[childRec.channel]?.logo?.cache_url + )} + env_mode={env_mode} + onWatchLive={handleOnWatchLive} + onWatchRecording={handleOnWatchRecording} + /> )} - ; - } + ); + }; + + const Movie = () => { + return ( + + {recordingName} + + + + {channel ? `${channel.channel_number} • ${channel.name}` : '—'} + + + {onWatchLive && } + {onWatchRecording && } + {onEdit && start.isAfter(userNow()) && } + {customProps.status === 'completed' && + (!customProps?.comskip || + customProps?.comskip?.status !== 'completed') && ( + + )} + + + + {start.format(`${dateformat}, YYYY ${timeformat}`)} –{' '} + {end.format(timeformat)} + + {rating && ( + + + {rating} + + + )} + {description && ( + + {description} + + )} + {statRows.length > 0 && ( + + + Stream Stats + + {statRows.map(([k, v]) => ( + + + {k} + + {v} + + ))} + + )} + + + ); + }; return ( { const fetchRecordings = useChannelsStore((s) => s.fetchRecordings); const recordings = useChannelsStore((s) => s.recordings); const { toUserTime, userNow } = useTimeHelpers(); - const [timeformat, dateformat] = useDateTimeFormat(); + const { timeFormat: timeformat, dateFormat: dateformat } = + useDateTimeFormat(); const [saving, setSaving] = useState(false); const [deleting, setDeleting] = useState(false); @@ -198,73 +211,70 @@ const RecurringRuleModal = ({ opened, onClose, ruleId, onEditOccurrence }) => { const handleEnableChange = (event) => { form.setFieldValue('enabled', event.currentTarget.checked); handleToggleEnabled(event.currentTarget.checked); - } + }; const handleStartDateChange = (value) => { form.setFieldValue('start_date', value || dayjs().toDate()); - } + }; const handleEndDateChange = (value) => { form.setFieldValue('end_date', value); - } + }; const handleStartTimeChange = (value) => { form.setFieldValue('start_time', toTimeString(value)); - } + }; const handleEndTimeChange = (value) => { form.setFieldValue('end_time', toTimeString(value)); - } + }; const UpcomingList = () => { - return - {upcomingOccurrences.map((occ) => { - const occStart = toUserTime(occ.start_time); - const occEnd = toUserTime(occ.end_time); + return ( + + {upcomingOccurrences.map((occ) => { + const occStart = toUserTime(occ.start_time); + const occEnd = toUserTime(occ.end_time); - return ( - - - - - {occStart.format(`${dateformat}, YYYY`)} - - - {occStart.format(timeformat)} – {occEnd.format(timeformat)} - - - - - + return ( + + + + + {occStart.format(`${dateformat}, YYYY`)} + + + {occStart.format(timeformat)} – {occEnd.format(timeformat)} + + + + + + - - - ); - })} - ; - } + + ); + })} + + ); + }; return ( { No future airings currently scheduled. - ) : } + ) : ( + + )} ); }; -export default RecurringRuleModal; \ No newline at end of file +export default RecurringRuleModal; diff --git a/frontend/src/components/tables/EPGsTable.jsx b/frontend/src/components/tables/EPGsTable.jsx index f6952542..20027088 100644 --- a/frontend/src/components/tables/EPGsTable.jsx +++ b/frontend/src/components/tables/EPGsTable.jsx @@ -3,7 +3,6 @@ import API from '../../api'; import useEPGsStore from '../../store/epgs'; import EPGForm from '../forms/EPG'; import DummyEPGForm from '../forms/DummyEPG'; -import { TableHelper } from '../../helpers'; import { ActionIcon, Text, @@ -14,7 +13,6 @@ import { Flex, useMantineTheme, Switch, - Badge, Progress, Stack, Group, @@ -31,9 +29,9 @@ import { SquarePlus, ChevronDown, } from 'lucide-react'; -import dayjs from 'dayjs'; -import useSettingsStore from '../../store/settings'; +import { format } from '../../utils/dateTimeUtils.js'; import useLocalStorage from '../../hooks/useLocalStorage'; +import { useDateTimeFormat } from '../../utils/dateTimeUtils.js'; import ConfirmationDialog from '../../components/ConfirmationDialog'; import useWarningsStore from '../../store/warnings'; import { CustomTable, useTable } from './CustomTable'; @@ -116,17 +114,8 @@ const EPGsTable = () => { const refreshProgress = useEPGsStore((s) => s.refreshProgress); const theme = useMantineTheme(); - // Get tableSize directly from localStorage instead of the store + const { fullDateTimeFormat } = useDateTimeFormat(); const [tableSize] = useLocalStorage('table-size', 'default'); - - // Get proper size for action icons to match ChannelsTable - const iconSize = - tableSize === 'compact' ? 'xs' : tableSize === 'large' ? 'md' : 'sm'; - - // Calculate density for Mantine Table - const tableDensity = - tableSize === 'compact' ? 'xs' : tableSize === 'large' ? 'xl' : 'md'; - const isWarningSuppressed = useWarningsStore((s) => s.isWarningSuppressed); const suppressWarning = useWarningsStore((s) => s.suppressWarning); @@ -356,11 +345,11 @@ const EPGsTable = () => { enableSorting: false, cell: ({ cell }) => { const value = cell.getValue(); - return value ? ( - {new Date(value).toLocaleString()} - ) : ( - Never - ); + if (!value) { + return Never; + } + const formatted = format(value, fullDateTimeFormat); + return {formatted}; }, }, { @@ -391,7 +380,7 @@ const EPGsTable = () => { size: tableSize == 'compact' ? 75 : 100, }, ], - [refreshProgress] + [refreshProgress, fullDateTimeFormat] ); const [isLoading, setIsLoading] = useState(true); diff --git a/frontend/src/components/tables/M3UsTable.jsx b/frontend/src/components/tables/M3UsTable.jsx index 6e88af56..6ae42e51 100644 --- a/frontend/src/components/tables/M3UsTable.jsx +++ b/frontend/src/components/tables/M3UsTable.jsx @@ -19,9 +19,6 @@ import { ActionIcon, Tooltip, Switch, - Progress, - Stack, - Badge, Group, Center, } from '@mantine/core'; @@ -29,16 +26,13 @@ import { SquareMinus, SquarePen, RefreshCcw, - Check, - X, ArrowUpDown, ArrowUpNarrowWide, ArrowDownWideNarrow, SquarePlus, } from 'lucide-react'; -import dayjs from 'dayjs'; -import useSettingsStore from '../../store/settings'; import useLocalStorage from '../../hooks/useLocalStorage'; +import { useDateTimeFormat, format } from '../../utils/dateTimeUtils.js'; import ConfirmationDialog from '../../components/ConfirmationDialog'; import useWarningsStore from '../../store/warnings'; import { CustomTable, useTable } from './CustomTable'; @@ -131,9 +125,7 @@ const RowActions = ({ const M3UTable = () => { const [playlist, setPlaylist] = useState(null); const [playlistModalOpen, setPlaylistModalOpen] = useState(false); - const [groupFilterModalOpen, setGroupFilterModalOpen] = useState(false); const [rowSelection, setRowSelection] = useState([]); - const [activeFilterValue, setActiveFilterValue] = useState('all'); const [playlistCreated, setPlaylistCreated] = useState(false); const [confirmDeleteOpen, setConfirmDeleteOpen] = useState(false); const [deleteTarget, setDeleteTarget] = useState(null); @@ -152,6 +144,7 @@ const M3UTable = () => { const theme = useMantineTheme(); const [tableSize] = useLocalStorage('table-size', 'default'); + const { fullDateTimeFormat } = useDateTimeFormat(); const generateStatusString = (data) => { if (data.progress == 100) { @@ -582,11 +575,11 @@ const M3UTable = () => { size: 175, cell: ({ cell }) => { const value = cell.getValue(); - return value ? ( - {new Date(value).toLocaleString()} - ) : ( - Never - ); + if (!value) { + return Never; + } + const formatted = format(value, fullDateTimeFormat); + return {formatted}; }, }, { @@ -611,7 +604,13 @@ const M3UTable = () => { size: tableSize == 'compact' ? 75 : 100, }, ], - [refreshPlaylist, editPlaylist, deletePlaylist, toggleActive] + [ + refreshPlaylist, + editPlaylist, + deletePlaylist, + toggleActive, + fullDateTimeFormat, + ] ); //optionally access the underlying virtualizer instance diff --git a/frontend/src/components/tables/UsersTable.jsx b/frontend/src/components/tables/UsersTable.jsx index 467423dc..af4e3087 100644 --- a/frontend/src/components/tables/UsersTable.jsx +++ b/frontend/src/components/tables/UsersTable.jsx @@ -5,14 +5,7 @@ import useUsersStore from '../../store/users'; import useAuthStore from '../../store/auth'; import { USER_LEVELS, USER_LEVEL_LABELS } from '../../constants'; import useWarningsStore from '../../store/warnings'; -import { - SquarePlus, - SquareMinus, - SquarePen, - EllipsisVertical, - Eye, - EyeOff, -} from 'lucide-react'; +import { SquarePlus, SquareMinus, SquarePen, Eye, EyeOff } from 'lucide-react'; import { ActionIcon, Box, @@ -22,14 +15,13 @@ import { Flex, Group, useMantineTheme, - Menu, - UnstyledButton, LoadingOverlay, Stack, } from '@mantine/core'; import { CustomTable, useTable } from './CustomTable'; import ConfirmationDialog from '../ConfirmationDialog'; import useLocalStorage from '../../hooks/useLocalStorage'; +import { useDateTimeFormat, format } from '../../utils/dateTimeUtils.js'; const UserRowActions = ({ theme, row, editUser, deleteUser }) => { const [tableSize, _] = useLocalStorage('table-size', 'default'); @@ -78,6 +70,7 @@ const UserRowActions = ({ theme, row, editUser, deleteUser }) => { const UsersTable = () => { const theme = useMantineTheme(); + const { fullDateFormat, fullDateTimeFormat } = useDateTimeFormat(); /** * STORES @@ -210,9 +203,7 @@ const UsersTable = () => { cell: ({ getValue }) => { const date = getValue(); return ( - - {date ? new Date(date).toLocaleDateString() : '-'} - + {date ? format(date, fullDateFormat) : '-'} ); }, }, @@ -224,7 +215,7 @@ const UsersTable = () => { const date = getValue(); return ( - {date ? new Date(date).toLocaleString() : 'Never'} + {date ? format(date, fullDateTimeFormat) : 'Never'} ); }, @@ -280,7 +271,15 @@ const UsersTable = () => { ), }, ], - [theme, editUser, deleteUser, visiblePasswords, togglePasswordVisibility] + [ + theme, + editUser, + deleteUser, + visiblePasswords, + togglePasswordVisibility, + fullDateFormat, + fullDateTimeFormat, + ] ); const closeUserForm = () => { diff --git a/frontend/src/pages/Guide.jsx b/frontend/src/pages/Guide.jsx index ac0fdf82..64fa3099 100644 --- a/frontend/src/pages/Guide.jsx +++ b/frontend/src/pages/Guide.jsx @@ -65,9 +65,7 @@ import { PROGRAM_HEIGHT, sortChannels, } from './guideUtils'; -import { - getShowVideoUrl, -} from '../utils/cards/RecordingCardUtils.js'; +import { getShowVideoUrl } from '../utils/cards/RecordingCardUtils.js'; import { add, convertToMs, @@ -79,10 +77,12 @@ import { } from '../utils/dateTimeUtils.js'; import GuideRow from '../components/GuideRow.jsx'; import HourTimeline from '../components/HourTimeline'; -const ProgramRecordingModal = React.lazy(() => - import('../components/forms/ProgramRecordingModal')); -const SeriesRecordingModal = React.lazy(() => - import('../components/forms/SeriesRecordingModal')); +const ProgramRecordingModal = React.lazy( + () => import('../components/forms/ProgramRecordingModal') +); +const SeriesRecordingModal = React.lazy( + () => import('../components/forms/SeriesRecordingModal') +); import { showNotification } from '../utils/notificationUtils.js'; import ErrorBoundary from '../components/ErrorBoundary.jsx'; @@ -230,7 +230,7 @@ export default function TVChannelGuide({ startDate, endDate }) { [rowHeights] ); - const [timeFormat, dateFormat] = useDateTimeFormat(); + const { timeFormat, dateFormat } = useDateTimeFormat(); // Format day label using relative terms when possible (Today, Tomorrow, etc) const formatDayLabel = useCallback( @@ -774,9 +774,11 @@ export default function TVChannelGuide({ startDate, endDate }) { style={{ cursor: 'pointer', zIndex: isExpanded ? 25 : 5, - transition: isExpanded ? 'height 0.2s ease, width 0.2s ease' : 'height 0.2s ease', + transition: isExpanded + ? 'height 0.2s ease, width 0.2s ease' + : 'height 0.2s ease', }} - pos='absolute' + pos="absolute" left={leftPx + gapSize} top={0} w={isExpanded ? expandedWidthPx : widthPx} @@ -806,7 +808,7 @@ export default function TVChannelGuide({ startDate, endDate }) { }} w={'100%'} h={'100%'} - pos='relative' + pos="relative" display={'flex'} p={isExpanded ? 12 : 8} c={isPast ? '#a0aec0' : '#fff'} @@ -1007,7 +1009,7 @@ export default function TVChannelGuide({ startDate, endDate }) { }} w={'100%'} h={'100%'} - c='#ffffff' + c="#ffffff" ff={'Roboto, sans-serif'} onClick={handleClickOutside} // Close expanded program when clicking outside > @@ -1016,9 +1018,9 @@ export default function TVChannelGuide({ startDate, endDate }) { direction="column" style={{ zIndex: 1000, - position: 'sticky' + position: 'sticky', }} - c='#ffffff' + c="#ffffff" p={'12px 20px'} top={0} > @@ -1101,7 +1103,7 @@ export default function TVChannelGuide({ startDate, endDate }) { backgroundColor: '#245043', }} bd={'1px solid #3BA882'} - color='#FFFFFF' + color="#FFFFFF" > Series Rules @@ -1125,7 +1127,7 @@ export default function TVChannelGuide({ startDate, endDate }) { @@ -1152,7 +1154,7 @@ export default function TVChannelGuide({ startDate, endDate }) { flex: 1, overflow: 'hidden', }} - pos='relative' + pos="relative" > @@ -1190,7 +1192,7 @@ export default function TVChannelGuide({ startDate, endDate }) { flex: 1, overflow: 'hidden', }} - pos='relative' + pos="relative" > {nowPosition >= 0 && ( @@ -1200,7 +1202,7 @@ export default function TVChannelGuide({ startDate, endDate }) { zIndex: 15, pointerEvents: 'none', }} - pos='absolute' + pos="absolute" left={nowPosition + CHANNEL_WIDTH - guideScrollLeft} top={0} bottom={0} @@ -1225,7 +1227,7 @@ export default function TVChannelGuide({ startDate, endDate }) { {GuideRow} ) : ( - + No channels match your filters @@ -91,7 +100,12 @@ vi.mock('@mantine/core', async () => { TextInput: ({ value, onChange, placeholder, icon, rightSection }) => (
{icon} - + {rightSection}
), @@ -111,7 +125,12 @@ vi.mock('@mantine/core', async () => { ), ActionIcon: ({ children, onClick, variant, size, color }) => ( - ), @@ -122,21 +141,23 @@ vi.mock('@mantine/core', async () => { vi.mock('react-window', () => ({ VariableSizeList: ({ children, itemData, itemCount }) => (
- {Array.from({ length: Math.min(itemCount, 5) }, (_, i) => + {Array.from({ length: Math.min(itemCount, 5) }, (_, i) => (
{children({ index: i, style: {}, - data: itemData.filteredChannels[i] + data: itemData.filteredChannels[i], })}
- )} + ))}
), })); vi.mock('../../components/GuideRow', () => ({ - default: ({ data }) =>
GuideRow for {data?.name}
, + default: ({ data }) => ( +
GuideRow for {data?.name}
+ ), })); vi.mock('../../components/HourTimeline', () => ({ default: ({ hourTimeline }) => ( @@ -184,7 +205,9 @@ vi.mock('../guideUtils', async () => { }; }); vi.mock('../../utils/cards/RecordingCardUtils.js', async () => { - const actual = await vi.importActual('../../utils/cards/RecordingCardUtils.js'); + const actual = await vi.importActual( + '../../utils/cards/RecordingCardUtils.js' + ); return { ...actual, getShowVideoUrl: vi.fn(), @@ -262,7 +285,9 @@ describe('Guide', () => { }); useEPGsStore.mockImplementation((selector) => - selector ? selector({ tvgsById: {}, epgs: {} }) : { tvgsById: {}, epgs: {} } + selector + ? selector({ tvgsById: {}, epgs: {} }) + : { tvgsById: {}, epgs: {} } ); useSettingsStore.mockReturnValue('production'); @@ -274,13 +299,18 @@ describe('Guide', () => { if (format?.includes('dddd')) return 'Monday, 01/15/2024 • 12:00 PM'; return '12:00 PM'; }); - dateTimeUtils.initializeTime.mockImplementation(date => date || now); + dateTimeUtils.initializeTime.mockImplementation((date) => date || now); dateTimeUtils.startOfDay.mockReturnValue(now.startOf('day')); dateTimeUtils.add.mockImplementation((date, amount, unit) => dayjs(date).add(amount, unit) ); - dateTimeUtils.convertToMs.mockImplementation(date => dayjs(date).valueOf()); - dateTimeUtils.useDateTimeFormat.mockReturnValue(['12h', 'MM/DD/YYYY']); + dateTimeUtils.convertToMs.mockImplementation((date) => + dayjs(date).valueOf() + ); + dateTimeUtils.useDateTimeFormat.mockReturnValue({ + timeFormat: '12h', + dateFormat: 'MM/DD/YYYY', + }); guideUtils.fetchPrograms.mockResolvedValue([ { @@ -300,8 +330,8 @@ describe('Guide', () => { ]); guideUtils.fetchRules.mockResolvedValue([]); - guideUtils.filterGuideChannels.mockImplementation( - (channels) => Object.values(channels) + guideUtils.filterGuideChannels.mockImplementation((channels) => + Object.values(channels) ); guideUtils.createRecording.mockResolvedValue(undefined); guideUtils.createSeriesRule.mockResolvedValue(undefined); @@ -348,7 +378,9 @@ describe('Guide', () => { render(); // await waitFor(() => { - expect(screen.getByText('No channels match your filters')).toBeInTheDocument(); + expect( + screen.getByText('No channels match your filters') + ).toBeInTheDocument(); // }); }); @@ -356,7 +388,7 @@ describe('Guide', () => { render(); // await waitFor(() => { - expect(screen.getByText(/2 channels/)).toBeInTheDocument(); + expect(screen.getByText(/2 channels/)).toBeInTheDocument(); // }); }); }); @@ -394,7 +426,8 @@ describe('Guide', () => { const user = userEvent.setup({ delay: null }); render(); - const searchInput = await screen.findByPlaceholderText('Search channels...'); + const searchInput = + await screen.findByPlaceholderText('Search channels...'); await user.type(searchInput, 'News'); await waitFor(() => { @@ -457,7 +490,8 @@ describe('Guide', () => { render(); // Set some filters - const searchInput = await screen.findByPlaceholderText('Search channels...'); + const searchInput = + await screen.findByPlaceholderText('Search channels...'); await user.type(searchInput, 'Test'); // Clear them @@ -479,7 +513,9 @@ describe('Guide', () => { await user.click(rulesButton); await waitFor(() => { - expect(screen.getByTestId('series-recording-modal')).toBeInTheDocument(); + expect( + screen.getByTestId('series-recording-modal') + ).toBeInTheDocument(); }); vi.useFakeTimers(); @@ -538,7 +574,12 @@ describe('Guide', () => { describe('Error Handling', () => { it('shows notification when no channels are available', async () => { useChannelsStore.mockImplementation((selector) => { - const state = { channels: {}, recordings: [], channelGroups: {}, profiles: {} }; + const state = { + channels: {}, + recordings: [], + channelGroups: {}, + profiles: {}, + }; return selector ? selector(state) : state; }); @@ -616,4 +657,4 @@ describe('Guide', () => { vi.setSystemTime(new Date('2024-01-15T12:00:00Z')); }); }); -}); \ No newline at end of file +}); diff --git a/frontend/src/utils/__tests__/dateTimeUtils.test.js b/frontend/src/utils/__tests__/dateTimeUtils.test.js index 54644dcd..62d8190e 100644 --- a/frontend/src/utils/__tests__/dateTimeUtils.test.js +++ b/frontend/src/utils/__tests__/dateTimeUtils.test.js @@ -336,7 +336,8 @@ describe('dateTimeUtils', () => { const { result } = renderHook(() => dateTimeUtils.useDateTimeFormat()); - expect(result.current).toEqual(['h:mma', 'MMM D']); + expect(result.current.timeFormat).toBe('h:mma'); + expect(result.current.dateFormat).toBe('MMM D'); }); it('should return 24h format when set', () => { @@ -344,7 +345,7 @@ describe('dateTimeUtils', () => { const { result } = renderHook(() => dateTimeUtils.useDateTimeFormat()); - expect(result.current[0]).toBe('HH:mm'); + expect(result.current.timeFormat).toBe('HH:mm'); }); it('should return dmy date format when set', () => { @@ -352,7 +353,7 @@ describe('dateTimeUtils', () => { const { result } = renderHook(() => dateTimeUtils.useDateTimeFormat()); - expect(result.current[1]).toBe('D MMM'); + expect(result.current.dateFormat).toBe('D MMM'); }); }); diff --git a/frontend/src/utils/cards/StreamConnectionCardUtils.js b/frontend/src/utils/cards/StreamConnectionCardUtils.js index 5c9d9ccc..75d8e9b2 100644 --- a/frontend/src/utils/cards/StreamConnectionCardUtils.js +++ b/frontend/src/utils/cards/StreamConnectionCardUtils.js @@ -68,19 +68,19 @@ export const switchStream = (channel, streamId) => { return API.switchStream(channel.channel_id, streamId); }; -export const connectedAccessor = (dateFormat) => { +export const connectedAccessor = (fullDateTimeFormat) => { return (row) => { // Check for connected_since (which is seconds since connection) if (row.connected_since) { // Calculate the actual connection time by subtracting the seconds from current time const connectedTime = subtract(getNow(), row.connected_since, 'second'); - return format(connectedTime, `${dateFormat} HH:mm:ss`); + return format(connectedTime, fullDateTimeFormat); } // Fallback to connected_at if it exists if (row.connected_at) { const connectedTime = initializeTime(row.connected_at * 1000); - return format(connectedTime, `${dateFormat} HH:mm:ss`); + return format(connectedTime, fullDateTimeFormat); } return 'Unknown'; diff --git a/frontend/src/utils/cards/VodConnectionCardUtils.js b/frontend/src/utils/cards/VodConnectionCardUtils.js index 3bf635b6..bf0a2219 100644 --- a/frontend/src/utils/cards/VodConnectionCardUtils.js +++ b/frontend/src/utils/cards/VodConnectionCardUtils.js @@ -117,9 +117,9 @@ export const calculateConnectionDuration = (connection) => { return 'Unknown duration'; } -export const calculateConnectionStartTime = (connection, dateFormat) => { +export const calculateConnectionStartTime = (connection, fullDateTimeFormat) => { if (connection.connected_at) { - return format(connection.connected_at * 1000, `${dateFormat} HH:mm:ss`); + return format(connection.connected_at * 1000, fullDateTimeFormat); } // Fallback: calculate from client_id timestamp @@ -128,7 +128,7 @@ export const calculateConnectionStartTime = (connection, dateFormat) => { const parts = connection.client_id.split('_'); if (parts.length >= 2) { const clientStartTime = parseInt(parts[1]); - return format(clientStartTime, `${dateFormat} HH:mm:ss`); + return format(clientStartTime, fullDateTimeFormat); } } catch { // Ignore parsing errors diff --git a/frontend/src/utils/dateTimeUtils.js b/frontend/src/utils/dateTimeUtils.js index 6d90d42a..2b9c0888 100644 --- a/frontend/src/utils/dateTimeUtils.js +++ b/frontend/src/utils/dateTimeUtils.js @@ -112,7 +112,21 @@ export const useDateTimeFormat = () => { const timeFormat = timeFormatSetting === '12h' ? 'h:mma' : 'HH:mm'; const dateFormat = dateFormatSetting === 'mdy' ? 'MMM D' : 'D MMM'; - return [timeFormat, dateFormat]; + // Full format strings for detailed date-time displays + const fullDateFormat = dateFormatSetting === 'mdy' ? 'MM/DD/YYYY' : 'DD/MM/YYYY'; + const fullTimeFormat = timeFormatSetting === '12h' ? 'h:mm:ss A' : 'HH:mm:ss'; + const fullDateTimeFormat = `${fullDateFormat}, ${fullTimeFormat}`; + + return { + timeFormat, + dateFormat, + fullDateFormat, + fullTimeFormat, + fullDateTimeFormat, + // Also return raw settings for cases that need them + timeFormatSetting, + dateFormatSetting, + }; }; export const toTimeString = (value) => { From 7fc2cbc45be3ffd88f48807dedbdb1f5ee049438 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Mon, 19 Jan 2026 20:16:06 -0600 Subject: [PATCH 27/55] tests: Fixed frontend tests failing after datetime utility changes. --- .../cards/__tests__/StreamConnectionCardUtils.test.js | 4 ++-- .../cards/__tests__/VodConnectionCardUtils.test.js | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/frontend/src/utils/cards/__tests__/StreamConnectionCardUtils.test.js b/frontend/src/utils/cards/__tests__/StreamConnectionCardUtils.test.js index 92c028c9..a1596280 100644 --- a/frontend/src/utils/cards/__tests__/StreamConnectionCardUtils.test.js +++ b/frontend/src/utils/cards/__tests__/StreamConnectionCardUtils.test.js @@ -167,11 +167,11 @@ describe('StreamConnectionCardUtils', () => { dateTimeUtils.subtract.mockReturnValue(mockConnectedTime); dateTimeUtils.format.mockReturnValue('01/01/2024 10:00:00'); - const accessor = StreamConnectionCardUtils.connectedAccessor('MM/DD/YYYY'); + const accessor = StreamConnectionCardUtils.connectedAccessor('MM/DD/YYYY, HH:mm:ss'); const result = accessor({ connected_since: 7200 }); expect(dateTimeUtils.subtract).toHaveBeenCalledWith(mockNow, 7200, 'second'); - expect(dateTimeUtils.format).toHaveBeenCalledWith(mockConnectedTime, 'MM/DD/YYYY HH:mm:ss'); + expect(dateTimeUtils.format).toHaveBeenCalledWith(mockConnectedTime, 'MM/DD/YYYY, HH:mm:ss'); expect(result).toBe('01/01/2024 10:00:00'); }); diff --git a/frontend/src/utils/cards/__tests__/VodConnectionCardUtils.test.js b/frontend/src/utils/cards/__tests__/VodConnectionCardUtils.test.js index 9765daf3..19b71a9d 100644 --- a/frontend/src/utils/cards/__tests__/VodConnectionCardUtils.test.js +++ b/frontend/src/utils/cards/__tests__/VodConnectionCardUtils.test.js @@ -279,9 +279,9 @@ describe('VodConnectionCardUtils', () => { dateTimeUtils.format.mockReturnValue('01/15/2024 14:30:00'); const connection = { connected_at: 1705329000 }; - const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY'); + const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY, HH:mm:ss'); - expect(dateTimeUtils.format).toHaveBeenCalledWith(1705329000000, 'MM/DD/YYYY HH:mm:ss'); + expect(dateTimeUtils.format).toHaveBeenCalledWith(1705329000000, 'MM/DD/YYYY, HH:mm:ss'); expect(result).toBe('01/15/2024 14:30:00'); }); @@ -289,15 +289,15 @@ describe('VodConnectionCardUtils', () => { dateTimeUtils.format.mockReturnValue('01/15/2024 13:00:00'); const connection = { client_id: 'vod_1705323600000_abc' }; - const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY'); + const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY, HH:mm:ss'); - expect(dateTimeUtils.format).toHaveBeenCalledWith(1705323600000, 'MM/DD/YYYY HH:mm:ss'); + expect(dateTimeUtils.format).toHaveBeenCalledWith(1705323600000, 'MM/DD/YYYY, HH:mm:ss'); expect(result).toBe('01/15/2024 13:00:00'); }); it('should return Unknown when no timestamp data available', () => { const connection = {}; - const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY'); + const result = VodConnectionCardUtils.calculateConnectionStartTime(connection, 'MM/DD/YYYY, HH:mm:ss'); expect(result).toBe('Unknown'); }); From 2c5cc636a796bb761cf445a2ab99dca9a112bc4c Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Mon, 19 Jan 2026 21:03:18 -0600 Subject: [PATCH 28/55] Security: - Updated react-router from 7.11.0 to 7.12.0 to address two security vulnerabilities: - **High**: Open Redirect XSS vulnerability in Action/Server Action Request Processing ([GHSA-h5cw-625j-3rxh](https://github.com/advisories/GHSA-h5cw-625j-3rxh), [GHSA-2w69-qvjg-hvjx](https://github.com/advisories/GHSA-2w69-qvjg-hvjx)) - **Moderate**: SSR XSS vulnerability in ScrollRestoration component ([GHSA-8v8x-cx79-35w7](https://github.com/advisories/GHSA-8v8x-cx79-35w7)) - Updated react-router-dom from 7.11.0 to 7.12.0 (dependency of react-router) --- CHANGELOG.md | 7 +++++++ frontend/package-lock.json | 14 +++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d63bbf4..2ac820df 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Security + +- Updated react-router from 7.11.0 to 7.12.0 to address two security vulnerabilities: + - **High**: Open Redirect XSS vulnerability in Action/Server Action Request Processing ([GHSA-h5cw-625j-3rxh](https://github.com/advisories/GHSA-h5cw-625j-3rxh), [GHSA-2w69-qvjg-hvjx](https://github.com/advisories/GHSA-2w69-qvjg-hvjx)) + - **Moderate**: SSR XSS vulnerability in ScrollRestoration component ([GHSA-8v8x-cx79-35w7](https://github.com/advisories/GHSA-8v8x-cx79-35w7)) +- Updated react-router-dom from 7.11.0 to 7.12.0 (dependency of react-router) + ### Added - Unassociated streams filter: Added "Only Unassociated" filter option to streams table for quickly finding streams not assigned to any channels - Thanks [@JeffreyBytes](https://github.com/JeffreyBytes) (Closes #667) diff --git a/frontend/package-lock.json b/frontend/package-lock.json index ed9e6010..476b764b 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -4404,9 +4404,9 @@ } }, "node_modules/react-router": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.11.0.tgz", - "integrity": "sha512-uI4JkMmjbWCZc01WVP2cH7ZfSzH91JAZUDd7/nIprDgWxBV1TkkmLToFh7EbMTcMak8URFRa2YoBL/W8GWnCTQ==", + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/react-router/-/react-router-7.12.0.tgz", + "integrity": "sha512-kTPDYPFzDVGIIGNLS5VJykK0HfHLY5MF3b+xj0/tTyNYL1gF1qs7u67Z9jEhQk2sQ98SUaHxlG31g1JtF7IfVw==", "license": "MIT", "dependencies": { "cookie": "^1.0.1", @@ -4426,12 +4426,12 @@ } }, "node_modules/react-router-dom": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.11.0.tgz", - "integrity": "sha512-e49Ir/kMGRzFOOrYQBdoitq3ULigw4lKbAyKusnvtDu2t4dBX4AGYPrzNvorXmVuOyeakai6FUPW5MmibvVG8g==", + "version": "7.12.0", + "resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-7.12.0.tgz", + "integrity": "sha512-pfO9fiBcpEfX4Tx+iTYKDtPbrSLLCbwJ5EqP+SPYQu1VYCXdy79GSj0wttR0U4cikVdlImZuEZ/9ZNCgoaxwBA==", "license": "MIT", "dependencies": { - "react-router": "7.11.0" + "react-router": "7.12.0" }, "engines": { "node": ">=20.0.0" From 3646ec5e46255e1fc224ef75315640061ff3846d Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Mon, 19 Jan 2026 21:13:02 -0600 Subject: [PATCH 29/55] changelog: Update changelog to reflect streamlink update. --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2ac820df..2644c9e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Updated streamlink from 8.1.0 to 8.1.2 to fix YouTube live stream playback issues and improve Pluto TV ad detection - Fixed date/time formatting across all tables to respect user's UI preferences (time format and date format) set in Settings page: - Stream connection card "Connected" column - VOD connection card "Connection Start Time" column From 3a5a676097300041b37349e5153a4f8299488c38 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Mon, 19 Jan 2026 21:28:22 -0600 Subject: [PATCH 30/55] changelog: Update changelog to reference github issue for streamlink. --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2644c9e7..91fc4bb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,7 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed -- Updated streamlink from 8.1.0 to 8.1.2 to fix YouTube live stream playback issues and improve Pluto TV ad detection +- Updated streamlink from 8.1.0 to 8.1.2 to fix YouTube live stream playback issues and improve Pluto TV ad detection (Fixes #869) - Fixed date/time formatting across all tables to respect user's UI preferences (time format and date format) set in Settings page: - Stream connection card "Connected" column - VOD connection card "Connection Start Time" column From 0e1db3e39cfd24e98343c17717cc74263b08c85d Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 20 Jan 2026 13:37:40 -0600 Subject: [PATCH 31/55] Enhancement: - Stats page enhancements: Added "Now Playing" program information for active streams with smart polling that only fetches EPG data when programs are about to change (not on every stats refresh). Features include: - Currently playing program title displayed with live broadcast indicator (green Radio icon) - Expandable program descriptions via chevron button - Efficient POST-based API endpoint (`/api/epg/current-programs/`) supporting batch channel queries or fetching all channels - Smart scheduling that fetches new program data 5 seconds after current program ends - Only polls when active channel list changes, not on stats refresh - Channel preview button: Added preview functionality to active stream cards on stats page --- CHANGELOG.md | 7 + apps/epg/api_urls.py | 3 +- apps/epg/api_views.py | 86 ++++++++++++ frontend/src/api.js | 17 +++ .../components/cards/StreamConnectionCard.jsx | 127 +++++++++++++++--- frontend/src/pages/Stats.jsx | 127 ++++++++++++++++-- frontend/src/utils/pages/StatsUtils.js | 35 +++++ 7 files changed, 368 insertions(+), 34 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 91fc4bb2..c371dd93 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Stats page enhancements: Added "Now Playing" program information for active streams with smart polling that only fetches EPG data when programs are about to change (not on every stats refresh). Features include: + - Currently playing program title displayed with live broadcast indicator (green Radio icon) + - Expandable program descriptions via chevron button + - Efficient POST-based API endpoint (`/api/epg/current-programs/`) supporting batch channel queries or fetching all channels + - Smart scheduling that fetches new program data 5 seconds after current program ends + - Only polls when active channel list changes, not on stats refresh +- Channel preview button: Added preview functionality to active stream cards on stats page - Unassociated streams filter: Added "Only Unassociated" filter option to streams table for quickly finding streams not assigned to any channels - Thanks [@JeffreyBytes](https://github.com/JeffreyBytes) (Closes #667) - Client-side logo caching: Added `Cache-Control` and `Last-Modified` headers to logo responses, enabling browsers to cache logos locally for 4 hours (local files) and respecting upstream cache headers (remote logos). This reduces network traffic and nginx load while providing faster page loads through browser-level caching that complements the existing nginx server-side cache - Thanks [@DawtCom](https://github.com/DawtCom) - DVR recording remux fallback strategy: Implemented two-stage TS→MP4→MKV fallback when direct TS→MKV conversion fails due to timestamp issues. On remux failure, system now attempts TS→MP4 conversion (MP4 container handles broken timestamps better) followed by MP4→MKV conversion, automatically recovering from provider timestamp corruption. Failed conversions now properly clean up partial files and preserve source TS for manual recovery. diff --git a/apps/epg/api_urls.py b/apps/epg/api_urls.py index 2818e66b..ed4b3105 100644 --- a/apps/epg/api_urls.py +++ b/apps/epg/api_urls.py @@ -1,6 +1,6 @@ from django.urls import path, include from rest_framework.routers import DefaultRouter -from .api_views import EPGSourceViewSet, ProgramViewSet, EPGGridAPIView, EPGImportAPIView, EPGDataViewSet +from .api_views import EPGSourceViewSet, ProgramViewSet, EPGGridAPIView, EPGImportAPIView, EPGDataViewSet, CurrentProgramsAPIView app_name = 'epg' @@ -12,6 +12,7 @@ router.register(r'epgdata', EPGDataViewSet, basename='epgdata') urlpatterns = [ path('grid/', EPGGridAPIView.as_view(), name='epg_grid'), path('import/', EPGImportAPIView.as_view(), name='epg_import'), + path('current-programs/', CurrentProgramsAPIView.as_view(), name='current_programs'), ] urlpatterns += router.urls diff --git a/apps/epg/api_views.py b/apps/epg/api_views.py index 2fc5a743..319368d0 100644 --- a/apps/epg/api_views.py +++ b/apps/epg/api_views.py @@ -417,3 +417,89 @@ class EPGDataViewSet(viewsets.ReadOnlyModelViewSet): except KeyError: return [Authenticated()] + +# ───────────────────────────── +# 6) Current Programs API +# ───────────────────────────── +class CurrentProgramsAPIView(APIView): + """ + Lightweight endpoint that returns currently playing programs for specified channel IDs. + Accepts POST with JSON body containing channel_ids array, or null/empty to fetch all channels. + """ + + def get_permissions(self): + try: + return [ + perm() for perm in permission_classes_by_method[self.request.method] + ] + except KeyError: + return [Authenticated()] + + @swagger_auto_schema( + operation_description="Get currently playing programs for specified channels or all channels", + request_body=openapi.Schema( + type=openapi.TYPE_OBJECT, + properties={ + 'channel_ids': openapi.Schema( + type=openapi.TYPE_ARRAY, + items=openapi.Schema(type=openapi.TYPE_INTEGER), + description="Array of channel IDs. If null or omitted, returns all channels with current programs.", + nullable=True, + ) + }, + ), + responses={200: openapi.Response('Current programs', ProgramDataSerializer(many=True))}, + ) + def post(self, request, format=None): + # Get channel IDs from request body + channel_ids = request.data.get('channel_ids', None) + + # Import Channel model + from apps.channels.models import Channel + + # Build query for channels with EPG data + query = Channel.objects.filter(epg_data__isnull=False) + + # Filter by specific channel IDs if provided + if channel_ids is not None: + if not isinstance(channel_ids, list): + return Response( + {"error": "channel_ids must be an array of integers or null"}, + status=status.HTTP_400_BAD_REQUEST + ) + + try: + channel_ids = [int(id) for id in channel_ids] + except (ValueError, TypeError): + return Response( + {"error": "channel_ids must contain valid integers"}, + status=status.HTTP_400_BAD_REQUEST + ) + + query = query.filter(id__in=channel_ids) + + # Get channels with EPG data + channels = query.select_related('epg_data') + + # Get current time + now = timezone.now() + + # Build list of current programs + current_programs = [] + + for channel in channels: + # Query for current program + program = ProgramData.objects.filter( + epg=channel.epg_data, + start_time__lte=now, + end_time__gt=now + ).first() + + if program: + # Serialize program and add channel_id for easy mapping + program_data = ProgramDataSerializer(program).data + program_data['channel_id'] = channel.id + current_programs.append(program_data) + + return Response(current_programs, status=status.HTTP_200_OK) + diff --git a/frontend/src/api.js b/frontend/src/api.js index 2c74f3f7..4b728622 100644 --- a/frontend/src/api.js +++ b/frontend/src/api.js @@ -1101,6 +1101,23 @@ export default class API { } } + static async getCurrentPrograms(channelIds = null) { + try { + const response = await request( + `${host}/api/epg/current-programs/`, + { + method: 'POST', + body: { channel_ids: channelIds }, + } + ); + + return response; + } catch (e) { + console.error('Failed to retrieve current programs', e); + return []; + } + } + // Notice there's a duplicated "refreshPlaylist" method above; // you might want to rename or remove one if it's not needed. diff --git a/frontend/src/components/cards/StreamConnectionCard.jsx b/frontend/src/components/cards/StreamConnectionCard.jsx index 0e441cbe..5488aef5 100644 --- a/frontend/src/components/cards/StreamConnectionCard.jsx +++ b/frontend/src/components/cards/StreamConnectionCard.jsx @@ -15,11 +15,16 @@ import { Stack, Text, Tooltip, + useMantineTheme, } from '@mantine/core'; import { + ChevronDown, + ChevronRight, + CirclePlay, Gauge, HardDriveDownload, HardDriveUpload, + Radio, SquareX, Timer, Users, @@ -48,6 +53,7 @@ import { getStreamsByIds, switchStream, } from '../../utils/cards/StreamConnectionCardUtils.js'; +import useVideoStore from '../../store/useVideoStore'; // Create a separate component for each channel card to properly handle the hook const StreamConnectionCard = ({ @@ -57,6 +63,8 @@ const StreamConnectionCard = ({ stopChannel, logos, channelsByUUID, + channels, + currentProgram, }) => { const location = useLocation(); const [availableStreams, setAvailableStreams] = useState([]); @@ -65,11 +73,18 @@ const StreamConnectionCard = ({ const [currentM3UProfile, setCurrentM3UProfile] = useState(null); // Add state for current M3U profile const [data, setData] = useState([]); const [previewedStream, setPreviewedStream] = useState(null); + const [isProgramDescExpanded, setIsProgramDescExpanded] = useState(false); + + const theme = useMantineTheme(); // Get M3U account data from the playlists store const m3uAccounts = usePlaylistsStore((s) => s.playlists); - // Get settings for speed threshold + // Get settings for speed threshold and environment mode const settings = useSettingsStore((s) => s.settings); + const env_mode = + useSettingsStore((s) => s.environment?.env_mode) || 'production'; + // Get video preview function + const showVideo = useVideoStore((s) => s.showVideo); // Get user's date/time format preferences const { fullDateTimeFormat } = useDateTimeFormat(); @@ -393,6 +408,23 @@ const StreamConnectionCard = ({ // Create select options for available streams const streamOptions = getStreamOptions(availableStreams, m3uAccountsMap); + // Handle preview channel button click + const handlePreviewChannel = () => { + const channelDbId = channelsByUUID[channel.channel_id]; + if (!channelDbId) return; + + const actualChannel = channels[channelDbId]; + if (!actualChannel?.uuid) return; + + const uri = `/proxy/ts/stream/${actualChannel.uuid}`; + let url = `${window.location.protocol}//${window.location.host}${uri}`; + if (env_mode === 'dev') { + url = `${window.location.protocol}//${window.location.hostname}:5656${uri}`; + } + + showVideo(url); + }; + if (location.pathname !== '/stats') { return <>; } @@ -462,9 +494,7 @@ const StreamConnectionCard = ({ - - {channelName} - + {channelName} @@ -474,8 +504,32 @@ const StreamConnectionCard = ({ - {/* Display M3U profile information */} - + {/* Display M3U profile and current program */} + + {currentProgram ? ( + + + + Now Playing: + + + {currentProgram.title} + + setIsProgramDescExpanded(!isProgramDescExpanded)} + > + {isProgramDescExpanded ? ( + + ) : ( + + )} + + + ) : ( + + )} @@ -484,22 +538,53 @@ const StreamConnectionCard = ({ - {/* Add stream selection dropdown */} + {/* Expandable program description */} + {currentProgram && + isProgramDescExpanded && + currentProgram.description && ( + + + {currentProgram.description} + + + )} + + {/* Add stream selection dropdown and preview button */} {availableStreams.length > 0 && ( - - + +
+ {channel.name && ( + + + + + + )} + +
)} {/* Add stream information badges */} diff --git a/frontend/src/pages/Stats.jsx b/frontend/src/pages/Stats.jsx index 19702ae6..fe88b399 100644 --- a/frontend/src/pages/Stats.jsx +++ b/frontend/src/pages/Stats.jsx @@ -1,5 +1,20 @@ -import React, { Suspense, useCallback, useEffect, useMemo, useState } from 'react'; -import { Box, Button, Group, LoadingOverlay, NumberInput, Text, Title, } from '@mantine/core'; +import React, { + Suspense, + useCallback, + useEffect, + useMemo, + useRef, + useState, +} from 'react'; +import { + Box, + Button, + Group, + LoadingOverlay, + NumberInput, + Text, + Title, +} from '@mantine/core'; import useChannelsStore from '../store/channels'; import useLogosStore from '../store/logos'; import useStreamProfilesStore from '../store/streamProfiles'; @@ -10,22 +25,27 @@ import { fetchActiveChannelStats, getClientStats, getCombinedConnections, + getCurrentPrograms, getStatsByChannelId, getVODStats, stopChannel, stopClient, stopVODClient, } from '../utils/pages/StatsUtils.js'; -const VodConnectionCard = React.lazy(() => - import('../components/cards/VodConnectionCard.jsx')); -const StreamConnectionCard = React.lazy(() => - import('../components/cards/StreamConnectionCard.jsx')); +const VodConnectionCard = React.lazy( + () => import('../components/cards/VodConnectionCard.jsx') +); +const StreamConnectionCard = React.lazy( + () => import('../components/cards/StreamConnectionCard.jsx') +); const Connections = ({ combinedConnections, clients, channelsByUUID, + channels, handleStopVODClient, + currentPrograms, }) => { const logos = useLogosStore((s) => s.logos); @@ -55,6 +75,8 @@ const Connections = ({ stopChannel={stopChannel} logos={logos} channelsByUUID={channelsByUUID} + channels={channels} + currentProgram={currentPrograms[connection.data.channel_id]} /> ); } else if (connection.type === 'vod') { @@ -84,6 +106,20 @@ const StatsPage = () => { const [vodConnections, setVodConnections] = useState([]); const [channelHistory, setChannelHistory] = useState({}); const [isPollingActive, setIsPollingActive] = useState(false); + const [currentPrograms, setCurrentPrograms] = useState({}); + + // Use refs to hold latest values without triggering effects + const channelHistoryRef = useRef(channelHistory); + const channelsByUUIDRef = useRef(channelsByUUID); + + // Update refs when values change + useEffect(() => { + channelHistoryRef.current = channelHistory; + }, [channelHistory]); + + useEffect(() => { + channelsByUUIDRef.current = channelsByUUID; + }, [channelsByUUID]); // Use localStorage for stats refresh interval (in seconds) const [refreshIntervalSeconds, setRefreshIntervalSeconds] = useLocalStorage( @@ -191,7 +227,13 @@ const StatsPage = () => { // Use functional update to access previous state without dependency setChannelHistory((prevChannelHistory) => { // Create a completely new object based only on current channel stats - const stats = getStatsByChannelId(channelStats, prevChannelHistory, channelsByUUID, channels, streamProfiles); + const stats = getStatsByChannelId( + channelStats, + prevChannelHistory, + channelsByUUID, + channels, + streamProfiles + ); console.log('Processed active channels:', stats); @@ -202,6 +244,64 @@ const StatsPage = () => { }); }, [channelStats, channels, channelsByUUID, streamProfiles]); + // Track which channel IDs are active (only changes when channels start/stop, not on stats updates) + const activeChannelIds = useMemo(() => { + return Object.keys(channelHistory).sort().join(','); + }, [channelHistory]); + + // Smart polling for current programs - only fetch when active channels change + useEffect(() => { + // Skip if no active channels + if (!activeChannelIds) { + setCurrentPrograms({}); + return; + } + + let timer = null; + + const fetchPrograms = async () => { + // Use refs to get latest values without adding dependencies + const programs = await getCurrentPrograms( + channelHistoryRef.current, + channelsByUUIDRef.current + ); + setCurrentPrograms(programs); + + // Schedule next fetch based on nearest program end time + if (programs && Object.keys(programs).length > 0) { + const now = new Date(); + let nearestEndTime = null; + + Object.values(programs).forEach((program) => { + if (program && program.end_time) { + const endTime = new Date(program.end_time); + if ( + endTime > now && + (!nearestEndTime || endTime < nearestEndTime) + ) { + nearestEndTime = endTime; + } + } + }); + + if (nearestEndTime) { + const timeUntilChange = nearestEndTime.getTime() - now.getTime(); + const fetchDelay = Math.max(timeUntilChange + 5000, 0); + + timer = setTimeout(fetchPrograms, fetchDelay); + } + } + }; + + // Initial fetch + fetchPrograms(); + + // Cleanup timer on unmount or when active channels change + return () => { + if (timer) clearTimeout(timer); + }; + }, [activeChannelIds]); // Only depend on activeChannelIds + // Combine active streams and VOD connections into a single mixed list const combinedConnections = useMemo(() => { return getCombinedConnections(channelHistory, vodConnections); @@ -216,11 +316,12 @@ const StatsPage = () => { Active Connections - {channelHistoryLength} { - channelHistoryLength !== 1 ? 'streams' : 'stream' - } • {vodConnectionsCount} { - vodConnectionsCount !== 1 ? 'VOD connections' : 'VOD connection' - } + {channelHistoryLength}{' '} + {channelHistoryLength !== 1 ? 'streams' : 'stream'} •{' '} + {vodConnectionsCount}{' '} + {vodConnectionsCount !== 1 + ? 'VOD connections' + : 'VOD connection'} Refresh Interval (seconds): @@ -273,7 +374,9 @@ const StatsPage = () => { combinedConnections={combinedConnections} clients={clients} channelsByUUID={channelsByUUID} + channels={channels} handleStopVODClient={handleStopVODClient} + currentPrograms={currentPrograms} />
diff --git a/frontend/src/utils/pages/StatsUtils.js b/frontend/src/utils/pages/StatsUtils.js index a25e33f0..72198122 100644 --- a/frontend/src/utils/pages/StatsUtils.js +++ b/frontend/src/utils/pages/StatsUtils.js @@ -20,6 +20,41 @@ export const getVODStats = async () => { return await API.getVODStats(); }; +export const getCurrentPrograms = async (channelHistory, channelsByUUID) => { + try { + // Get all active channel IDs that have actual channels (not just streams) + const activeChannelIds = Object.values(channelHistory) + .filter(ch => ch.name && channelsByUUID && channelsByUUID[ch.channel_id]) + .map(ch => channelsByUUID[ch.channel_id]) + .filter(id => id !== undefined); + + if (activeChannelIds.length === 0) { + return {}; + } + + const programs = await API.getCurrentPrograms(activeChannelIds); + + // Convert array to map keyed by channel UUID for easy lookup + const programsMap = {}; + if (programs && Array.isArray(programs)) { + programs.forEach(program => { + // Find the channel UUID from the channel ID + const channelEntry = Object.entries(channelsByUUID).find( + ([uuid, id]) => id === program.channel_id + ); + if (channelEntry) { + programsMap[channelEntry[0]] = program; + } + }); + } + + return programsMap; + } catch (error) { + console.error('Error fetching current programs:', error); + return {}; + } +}; + export const getCombinedConnections = (channelHistory, vodConnections) => { const activeStreams = Object.values(channelHistory).map((channel) => ({ type: 'stream', From c6f359c15988c8f7bf34a40d762138e3b38131aa Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 20 Jan 2026 14:56:32 -0600 Subject: [PATCH 32/55] Enhancement: Refactor StreamsTable component to improve MultiSelect UI with tooltips and pill displays for selected groups and M3Us. --- .../src/components/tables/StreamsTable.jsx | 199 +++++++++--------- 1 file changed, 97 insertions(+), 102 deletions(-) diff --git a/frontend/src/components/tables/StreamsTable.jsx b/frontend/src/components/tables/StreamsTable.jsx index ac189b32..e165c62c 100644 --- a/frontend/src/components/tables/StreamsTable.jsx +++ b/frontend/src/components/tables/StreamsTable.jsx @@ -51,6 +51,7 @@ import { NumberInput, Radio, LoadingOverlay, + Pill, } from '@mantine/core'; import { useNavigate } from 'react-router-dom'; import useSettingsStore from '../../store/settings'; @@ -871,52 +872,48 @@ const StreamsTable = ({ onReady }) => { ? filters.channel_group.split(',').filter(Boolean) : []; return ( - { - const index = selectedGroups.indexOf(value); - if (index === 0) { - return ( - - - {value} - - {selectedGroups.length > 1 && ( - - +{selectedGroups.length - 1} - + + {selectedGroups.length > 0 && ( + + {selectedGroups.slice(0, 10).map((group, idx) => ( +
{group}
+ ))} + {selectedGroups.length > 10 && ( +
+ +{selectedGroups.length - 10} more +
)} -
- ); - } - return null; - }} - style={{ width: '100%' }} - /> + + } + position="top" + withArrow + > + + {selectedGroups[0]} + {selectedGroups.length > 1 && ( + +{selectedGroups.length - 1} + )} + +
+ )} + + ); } @@ -924,66 +921,64 @@ const StreamsTable = ({ onReady }) => { const selectedM3Us = filters.m3u_account ? filters.m3u_account.split(',').filter(Boolean) : []; + const firstLabel = selectedM3Us.length > 0 + ? (m3uOptions.find((opt) => opt.value === selectedM3Us[0])?.label || selectedM3Us[0]) + : null; return ( - { - const index = selectedM3Us.indexOf(value); - if (index === 0) { - const label = - m3uOptions.find((opt) => opt.value === value)?.label || - value; - return ( - - - {label} - - {selectedM3Us.length > 1 && ( - - +{selectedM3Us.length - 1} - + + {selectedM3Us.length > 0 && ( + + {selectedM3Us.slice(0, 10).map((val, idx) => ( +
+ {m3uOptions.find((opt) => opt.value === val)?.label || val} +
+ ))} + {selectedM3Us.length > 10 && ( +
+ +{selectedM3Us.length - 10} more +
)} -
- ); - } - return null; - }} - style={{ flex: 1, minWidth: 0 }} - rightSectionPointerEvents="auto" - rightSection={React.createElement(sortingIcon, { - onClick: (e) => { - e.stopPropagation(); - onSortingChange('m3u'); - }, - size: 14, - style: { cursor: 'pointer' }, - })} - /> + + } + position="top" + withArrow + > + + {firstLabel} + {selectedM3Us.length > 1 && ( + +{selectedM3Us.length - 1} + )} + + + )} + { + e.stopPropagation(); + onSortingChange('m3u'); + }, + size: 14, + style: { cursor: 'pointer' }, + })} + /> +
); } From 091c1686e55ff143f45c8e38514d12d5eb9e2bd1 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 20 Jan 2026 15:31:34 -0600 Subject: [PATCH 33/55] Enhancement: Added tooltip on filter pills showing all selected items in a vertical list (up to 10 items, with "+N more" indicator) Also fixed +N not working as intended. --- CHANGELOG.md | 1 + .../src/components/tables/ChannelsTable.jsx | 14 ++ .../tables/CustomTable/CustomTableHeader.jsx | 58 ++++---- .../CustomTable/MultiSelectHeaderWrapper.jsx | 120 ++++++++++++++++ .../src/components/tables/StreamsTable.jsx | 135 +++++------------- 5 files changed, 206 insertions(+), 122 deletions(-) create mode 100644 frontend/src/components/tables/CustomTable/MultiSelectHeaderWrapper.jsx diff --git a/CHANGELOG.md b/CHANGELOG.md index c371dd93..cb61bbf4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -70,6 +70,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Added tooltip on filter pills showing all selected items in a vertical list (up to 10 items, with "+N more" indicator) - Loading feedback for all confirmation dialogs: Extended visual loading indicators across all confirmation dialogs throughout the application. Delete, cleanup, and bulk operation dialogs now show an animated dots loader and disabled state during async operations, providing consistent user feedback for backups (restore/delete), channels, EPGs, logos, VOD logos, M3U accounts, streams, users, groups, filters, profiles, batch operations, and network access changes. - Channel profile edit and duplicate functionality: Users can now rename existing channel profiles and create duplicates with automatic channel membership cloning. Each profile action (edit, duplicate, delete) in the profile dropdown for quick access. - ProfileModal component extracted for improved code organization and maintainability of channel profile management operations. diff --git a/frontend/src/components/tables/ChannelsTable.jsx b/frontend/src/components/tables/ChannelsTable.jsx index b986e70e..78dd4f4c 100644 --- a/frontend/src/components/tables/ChannelsTable.jsx +++ b/frontend/src/components/tables/ChannelsTable.jsx @@ -1000,6 +1000,13 @@ const ChannelsTable = ({ onReady }) => { clearable onClick={stopPropagation} onChange={handleEPGChange} + value={ + Array.isArray(filters.epg) + ? filters.epg + : filters.epg + ? filters.epg.split(',').filter(Boolean) + : [] + } style={{ width: '100%' }} /> ); @@ -1058,6 +1065,13 @@ const ChannelsTable = ({ onReady }) => { clearable onClick={stopPropagation} onChange={handleGroupChange} + value={ + Array.isArray(filters.channel_group) + ? filters.channel_group + : filters.channel_group + ? filters.channel_group.split(',').filter(Boolean) + : [] + } style={{ width: '100%' }} /> ); diff --git a/frontend/src/components/tables/CustomTable/CustomTableHeader.jsx b/frontend/src/components/tables/CustomTable/CustomTableHeader.jsx index 1bfc7773..0adc516e 100644 --- a/frontend/src/components/tables/CustomTable/CustomTableHeader.jsx +++ b/frontend/src/components/tables/CustomTable/CustomTableHeader.jsx @@ -1,6 +1,7 @@ import { Box, Center, Checkbox, Flex } from '@mantine/core'; import { flexRender } from '@tanstack/react-table'; import { useCallback, useMemo } from 'react'; +import MultiSelectHeaderWrapper from './MultiSelectHeaderWrapper'; const CustomTableHeader = ({ getHeaderGroups, @@ -12,33 +13,42 @@ const CustomTableHeader = ({ headerPinned = true, }) => { const renderHeaderCell = (header) => { + let content; + if (headerCellRenderFns[header.id]) { - return headerCellRenderFns[header.id](header); + content = headerCellRenderFns[header.id](header); + } else { + switch (header.id) { + case 'select': + content = ( +
+ 0 && + selectedTableIds.length !== allRowIds.length + } + onChange={onSelectAllChange} + /> +
+ ); + break; + + default: + content = flexRender( + header.column.columnDef.header, + header.getContext() + ); + } } - switch (header.id) { - case 'select': - return ( -
- 0 && - selectedTableIds.length !== allRowIds.length - } - onChange={onSelectAllChange} - /> -
- ); - - default: - return flexRender(header.column.columnDef.header, header.getContext()); - } + // Automatically wrap content to enhance MultiSelect components + return {content}; }; // Get header groups for dependency tracking diff --git a/frontend/src/components/tables/CustomTable/MultiSelectHeaderWrapper.jsx b/frontend/src/components/tables/CustomTable/MultiSelectHeaderWrapper.jsx new file mode 100644 index 00000000..947d03d9 --- /dev/null +++ b/frontend/src/components/tables/CustomTable/MultiSelectHeaderWrapper.jsx @@ -0,0 +1,120 @@ +import React, { cloneElement, isValidElement } from 'react'; +import { Box, Flex, Pill, Tooltip, MultiSelect } from '@mantine/core'; + +/** + * Automatically wraps MultiSelect components with pill display and tooltips + * Recursively searches through React children to find and enhance MultiSelect + */ +const MultiSelectHeaderWrapper = ({ children }) => { + const enhanceMultiSelect = (element) => { + if (!isValidElement(element)) { + return element; + } + + // Check if this element is a MultiSelect + if (element.type === MultiSelect) { + const { value = [], data = [], ...otherProps } = element.props; + const selectedValues = Array.isArray(value) ? value : []; + + if (selectedValues.length === 0) { + // No selections - just render the MultiSelect with hidden pills + return cloneElement(element, { + ...otherProps, + value, + data, + styles: { pill: { display: 'none' } }, + }); + } + + // Get first label + const firstLabel = + data.find((opt) => opt.value === selectedValues[0])?.label || + selectedValues[0]; + + // Build tooltip content + const tooltipContent = ( +
+ {selectedValues.slice(0, 10).map((val, idx) => { + const label = data.find((opt) => opt.value === val)?.label || val; + return
{label}
; + })} + {selectedValues.length > 10 && ( +
+ +{selectedValues.length - 10} more +
+ )} +
+ ); + + return ( + + + + 1 + ? 'calc(100% - 50px)' + : 'calc(100% - 30px)', + overflow: 'hidden', + textOverflow: 'ellipsis', + whiteSpace: 'nowrap', + display: 'block', + pointerEvents: 'auto', + }} + > + {firstLabel} + + {selectedValues.length > 1 && ( + + +{selectedValues.length - 1} + + )} + + + {cloneElement(element, { + ...otherProps, + value, + data, + styles: { pill: { display: 'none' } }, + style: { width: '100%', ...otherProps.style }, + })} + + ); + } + + // Check if element has children - recursively enhance them + if (element.props && element.props.children) { + const enhancedChildren = React.Children.map( + element.props.children, + (child) => enhanceMultiSelect(child) + ); + + // Clone element with enhanced children + return cloneElement(element, {}, enhancedChildren); + } + + return element; + }; + + return <>{enhanceMultiSelect(children)}; +}; + +export default MultiSelectHeaderWrapper; diff --git a/frontend/src/components/tables/StreamsTable.jsx b/frontend/src/components/tables/StreamsTable.jsx index e165c62c..aa210b6e 100644 --- a/frontend/src/components/tables/StreamsTable.jsx +++ b/frontend/src/components/tables/StreamsTable.jsx @@ -872,48 +872,20 @@ const StreamsTable = ({ onReady }) => { ? filters.channel_group.split(',').filter(Boolean) : []; return ( - - {selectedGroups.length > 0 && ( - - {selectedGroups.slice(0, 10).map((group, idx) => ( -
{group}
- ))} - {selectedGroups.length > 10 && ( -
- +{selectedGroups.length - 10} more -
- )} - - } - position="top" - withArrow - > - - {selectedGroups[0]} - {selectedGroups.length > 1 && ( - +{selectedGroups.length - 1} - )} - -
- )} - -
+ ); } @@ -921,64 +893,31 @@ const StreamsTable = ({ onReady }) => { const selectedM3Us = filters.m3u_account ? filters.m3u_account.split(',').filter(Boolean) : []; - const firstLabel = selectedM3Us.length > 0 - ? (m3uOptions.find((opt) => opt.value === selectedM3Us[0])?.label || selectedM3Us[0]) - : null; return ( - - {selectedM3Us.length > 0 && ( - - {selectedM3Us.slice(0, 10).map((val, idx) => ( -
- {m3uOptions.find((opt) => opt.value === val)?.label || val} -
- ))} - {selectedM3Us.length > 10 && ( -
- +{selectedM3Us.length - 10} more -
- )} - - } - position="top" - withArrow - > - - {firstLabel} - {selectedM3Us.length > 1 && ( - +{selectedM3Us.length - 1} - )} - -
- )} - { - e.stopPropagation(); - onSortingChange('m3u'); - }, - size: 14, - style: { cursor: 'pointer' }, - })} - /> -
+ { + e.stopPropagation(); + onSortingChange('m3u'); + }, + size: 14, + style: { cursor: 'pointer' }, + })} + />
); } From 6b9e6b2d8a3e6a232b5a4e478b90bb239bdafde9 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 20 Jan 2026 15:38:36 -0600 Subject: [PATCH 34/55] tests: Fix frontent tests for new stats features. --- frontend/src/pages/__tests__/Stats.test.jsx | 57 +++++++++++++-------- 1 file changed, 37 insertions(+), 20 deletions(-) diff --git a/frontend/src/pages/__tests__/Stats.test.jsx b/frontend/src/pages/__tests__/Stats.test.jsx index bf5cdb42..c22ceac9 100644 --- a/frontend/src/pages/__tests__/Stats.test.jsx +++ b/frontend/src/pages/__tests__/Stats.test.jsx @@ -14,6 +14,7 @@ import useChannelsStore from '../../store/channels'; import useLogosStore from '../../store/logos'; import { fetchActiveChannelStats, + getCurrentPrograms, getClientStats, getCombinedConnections, getStatsByChannelId, @@ -30,11 +31,11 @@ vi.mock('../../store/streamProfiles'); vi.mock('../../hooks/useLocalStorage'); vi.mock('../../components/SystemEvents', () => ({ - default: () =>
SystemEvents
+ default: () =>
SystemEvents
, })); vi.mock('../../components/ErrorBoundary.jsx', () => ({ - default: ({ children }) =>
{children}
+ default: ({ children }) =>
{children}
, })); vi.mock('../../components/cards/VodConnectionCard.jsx', () => ({ @@ -92,6 +93,7 @@ vi.mock('../../utils/pages/StatsUtils', () => { return { fetchActiveChannelStats: vi.fn(), getVODStats: vi.fn(), + getCurrentPrograms: vi.fn(), getClientStats: vi.fn(), getCombinedConnections: vi.fn(), getStatsByChannelId: vi.fn(), @@ -112,9 +114,7 @@ describe('StatsPage', () => { 'channel-2': mockChannels[1], }; - const mockStreamProfiles = [ - { id: 1, name: 'Profile 1' }, - ]; + const mockStreamProfiles = [{ id: 1, name: 'Profile 1' }]; const mockLogos = { 'logo-1': 'logo-url-1', @@ -131,9 +131,7 @@ describe('StatsPage', () => { vod_connections: [ { content_uuid: 'vod-1', - connections: [ - { client_id: 'client-1', ip: '192.168.1.1' }, - ], + connections: [{ client_id: 'client-1', ip: '192.168.1.1' }], }, ], }; @@ -152,7 +150,11 @@ describe('StatsPage', () => { const mockCombinedConnections = [ { id: 1, type: 'stream', data: { id: 1, uuid: 'channel-1' } }, { id: 2, type: 'stream', data: { id: 2, uuid: 'channel-2' } }, - { id: 3, type: 'vod', data: { content_uuid: 'vod-1', connections: [{ client_id: 'client-1' }] } }, + { + id: 3, + type: 'vod', + data: { content_uuid: 'vod-1', connections: [{ client_id: 'client-1' }] }, + }, ]; let mockSetChannelStats; @@ -194,6 +196,7 @@ describe('StatsPage', () => { // Setup API mocks fetchActiveChannelStats.mockResolvedValue(mockChannelStats); getVODStats.mockResolvedValue(mockVODStats); + getCurrentPrograms.mockResolvedValue({}); getStatsByChannelId.mockReturnValue(mockProcessedChannelHistory); getClientStats.mockReturnValue(mockClients); getCombinedConnections.mockReturnValue(mockCombinedConnections); @@ -206,7 +209,7 @@ describe('StatsPage', () => { describe('Initial Rendering', () => { it('renders the page title', async () => { render(); - await screen.findByText('Active Connections') + await screen.findByText('Active Connections'); }); it('fetches initial stats on mount', async () => { @@ -229,7 +232,7 @@ describe('StatsPage', () => { it('renders SystemEvents component', async () => { render(); - await screen.findByTestId('system-events') + await screen.findByTestId('system-events'); }); }); @@ -266,7 +269,7 @@ describe('StatsPage', () => { useLocalStorage.mockReturnValue([0, mockSetRefreshInterval]); render(); - await screen.findByText('Refreshing disabled') + await screen.findByText('Refreshing disabled'); }); }); @@ -348,8 +351,12 @@ describe('StatsPage', () => { render(); await waitFor(() => { - expect(screen.getByTestId('stream-connection-card-channel-1')).toBeInTheDocument(); - expect(screen.getByTestId('stream-connection-card-channel-2')).toBeInTheDocument(); + expect( + screen.getByTestId('stream-connection-card-channel-1') + ).toBeInTheDocument(); + expect( + screen.getByTestId('stream-connection-card-channel-2') + ).toBeInTheDocument(); }); }); @@ -357,7 +364,9 @@ describe('StatsPage', () => { render(); await waitFor(() => { - expect(screen.getByTestId('vod-connection-card-vod-1')).toBeInTheDocument(); + expect( + screen.getByTestId('vod-connection-card-vod-1') + ).toBeInTheDocument(); }); }); @@ -376,7 +385,9 @@ describe('StatsPage', () => { render(); await waitFor(() => { - expect(screen.getByTestId('stop-vod-client-client-1')).toBeInTheDocument(); + expect( + screen.getByTestId('stop-vod-client-client-1') + ).toBeInTheDocument(); }); const stopButton = screen.getByTestId('stop-vod-client-client-1'); @@ -422,14 +433,18 @@ describe('StatsPage', () => { render(); await waitFor(() => { - expect(getClientStats).toHaveBeenCalledWith(mockProcessedChannelHistory); + expect(getClientStats).toHaveBeenCalledWith( + mockProcessedChannelHistory + ); }); }); }); describe('Error Handling', () => { it('handles fetchActiveChannelStats error gracefully', async () => { - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}); + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => {}); fetchActiveChannelStats.mockRejectedValue(new Error('API Error')); render(); @@ -445,7 +460,9 @@ describe('StatsPage', () => { }); it('handles getVODStats error gracefully', async () => { - const consoleError = vi.spyOn(console, 'error').mockImplementation(() => {}); + const consoleError = vi + .spyOn(console, 'error') + .mockImplementation(() => {}); getVODStats.mockRejectedValue(new Error('VOD API Error')); render(); @@ -491,4 +508,4 @@ describe('StatsPage', () => { }); }); }); -}); \ No newline at end of file +}); From 0984ec98349db8ec8d0ddade1878c2900e02d6e7 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 20 Jan 2026 16:31:41 -0600 Subject: [PATCH 35/55] Enhancement: Add Progress bar showing elapsed and remaining time for currently playing programs --- CHANGELOG.md | 1 + .../components/cards/StreamConnectionCard.jsx | 51 +++++++++++++++++++ 2 files changed, 52 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb61bbf4..2946d261 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Stats page enhancements: Added "Now Playing" program information for active streams with smart polling that only fetches EPG data when programs are about to change (not on every stats refresh). Features include: - Currently playing program title displayed with live broadcast indicator (green Radio icon) - Expandable program descriptions via chevron button + - Progress bar showing elapsed and remaining time for currently playing programs - Efficient POST-based API endpoint (`/api/epg/current-programs/`) supporting batch channel queries or fetching all channels - Smart scheduling that fetches new program data 5 seconds after current program ends - Only polls when active channel list changes, not on stats refresh diff --git a/frontend/src/components/cards/StreamConnectionCard.jsx b/frontend/src/components/cards/StreamConnectionCard.jsx index 5488aef5..e8b8a33b 100644 --- a/frontend/src/components/cards/StreamConnectionCard.jsx +++ b/frontend/src/components/cards/StreamConnectionCard.jsx @@ -11,6 +11,7 @@ import { Center, Flex, Group, + Progress, Select, Stack, Text, @@ -549,6 +550,56 @@ const StreamConnectionCard = ({ )} + {/* Program progress bar */} + {currentProgram && + isProgramDescExpanded && + currentProgram.start_time && + currentProgram.end_time && + (() => { + const now = new Date(); + const startTime = new Date(currentProgram.start_time); + const endTime = new Date(currentProgram.end_time); + const totalDuration = (endTime - startTime) / 1000; // in seconds + const elapsed = (now - startTime) / 1000; // in seconds + const remaining = (endTime - now) / 1000; // in seconds + const percentage = Math.min( + 100, + Math.max(0, (elapsed / totalDuration) * 100) + ); + + const formatProgramTime = (seconds) => { + const absSeconds = Math.abs(seconds); + const hours = Math.floor(absSeconds / 3600); + const minutes = Math.floor((absSeconds % 3600) / 60); + const secs = Math.floor(absSeconds % 60); + if (hours > 0) { + return `${hours}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`; + } + return `${minutes}:${secs.toString().padStart(2, '0')}`; + }; + + return ( + + + + {formatProgramTime(elapsed)} elapsed + + + {formatProgramTime(remaining)} remaining + + + + + ); + })()} + {/* Add stream selection dropdown and preview button */} {availableStreams.length > 0 && ( From 8bc88112aa3fbdc17e6088e485482537b0fb56c4 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 20 Jan 2026 17:09:28 -0600 Subject: [PATCH 36/55] Enhancement: Improved pill functionality and sizing. --- .../CustomTable/MultiSelectHeaderWrapper.jsx | 95 ++++++++++++++++--- 1 file changed, 80 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/tables/CustomTable/MultiSelectHeaderWrapper.jsx b/frontend/src/components/tables/CustomTable/MultiSelectHeaderWrapper.jsx index 947d03d9..8fca940f 100644 --- a/frontend/src/components/tables/CustomTable/MultiSelectHeaderWrapper.jsx +++ b/frontend/src/components/tables/CustomTable/MultiSelectHeaderWrapper.jsx @@ -1,4 +1,4 @@ -import React, { cloneElement, isValidElement } from 'react'; +import React, { cloneElement, isValidElement, useRef } from 'react'; import { Box, Flex, Pill, Tooltip, MultiSelect } from '@mantine/core'; /** @@ -6,6 +6,8 @@ import { Box, Flex, Pill, Tooltip, MultiSelect } from '@mantine/core'; * Recursively searches through React children to find and enhance MultiSelect */ const MultiSelectHeaderWrapper = ({ children }) => { + const inputRef = useRef(null); + const enhanceMultiSelect = (element) => { if (!isValidElement(element)) { return element; @@ -13,7 +15,7 @@ const MultiSelectHeaderWrapper = ({ children }) => { // Check if this element is a MultiSelect if (element.type === MultiSelect) { - const { value = [], data = [], ...otherProps } = element.props; + const { value = [], data = [], onChange, ...otherProps } = element.props; const selectedValues = Array.isArray(value) ? value : []; if (selectedValues.length === 0) { @@ -22,6 +24,7 @@ const MultiSelectHeaderWrapper = ({ children }) => { ...otherProps, value, data, + onChange, styles: { pill: { display: 'none' } }, }); } @@ -46,8 +49,42 @@ const MultiSelectHeaderWrapper = ({ children }) => { ); + // Handle opening the dropdown when pill is clicked + const handlePillClick = (e) => { + // Check if the click is on the remove button (it has a data-attribute) + if (e.target.closest('[data-disabled]') || e.target.closest('button')) { + return; // Let the remove button handle it + } + e.stopPropagation(); + // Focus and click the input to open the dropdown + if (inputRef.current) { + const input = inputRef.current.querySelector('input'); + if (input) { + input.focus(); + input.click(); + } + } + }; + + // Handle removing a single filter value + const handleRemoveFirst = (e) => { + e?.stopPropagation?.(); + if (onChange && selectedValues.length > 0) { + const newValues = selectedValues.slice(1); + onChange(newValues); + } + }; + + // Handle clearing all filters + const handleClearAll = (e) => { + e?.stopPropagation?.(); + if (onChange) { + onChange([]); + } + }; + return ( - + { position: 'absolute', top: 4, left: 4, - right: 30, + right: 20, zIndex: 1, pointerEvents: 'none', overflow: 'hidden', @@ -63,28 +100,55 @@ const MultiSelectHeaderWrapper = ({ children }) => { > 1 ? '1 1 auto' : '0 1 auto', minWidth: 0, maxWidth: - selectedValues.length > 1 - ? 'calc(100% - 50px)' - : 'calc(100% - 30px)', - overflow: 'hidden', - textOverflow: 'ellipsis', - whiteSpace: 'nowrap', - display: 'block', + selectedValues.length > 1 ? 'calc(100% - 40px)' : '100%', pointerEvents: 'auto', }} > - {firstLabel} + + {firstLabel} + {selectedValues.length > 1 && ( - +{selectedValues.length - 1} + + +{selectedValues.length - 1} + )} @@ -93,6 +157,7 @@ const MultiSelectHeaderWrapper = ({ children }) => { ...otherProps, value, data, + onChange, styles: { pill: { display: 'none' } }, style: { width: '100%', ...otherProps.style }, })} From c9b454431c678a08298a3b316720d20e286d666a Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 20 Jan 2026 18:01:17 -0600 Subject: [PATCH 37/55] Enhancement: Streams table UI: Added descriptive tooltips to top-toolbar buttons (Add to Channel, Create Channels, Filters, Create Stream, Delete) and to row action icons (Add to Channel, Create New Channel). Tooltips now use a 500ms open delay for consistent behavior with existing table header tooltips. Streams table button labels: Renamed "Remove" to "Delete" and "Add Stream to Channel" to "Add to Channel" for clarity and consistency with other UI terminology. --- CHANGELOG.md | 2 + .../src/components/tables/StreamsTable.jsx | 157 ++++++++++-------- 2 files changed, 90 insertions(+), 69 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2946d261..b1738429 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,10 +38,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - User-level content filtering: Non-admin users can opt to hide mature content channels across all interfaces (web UI, M3U playlists, EPG data, XtreamCodes API) via "Hide Mature Content" toggle in user settings (stored in custom_properties, admin users always see all content) - Table header pin toggle: Pin/unpin table headers to keep them visible while scrolling. Toggle available in channel table menu and UI Settings page. Setting persists across sessions and applies to all tables. (Closes #663) - Cascading filters for streams table: Improved filter usability with hierarchical M3U and Group dropdowns. M3U acts as the parent filter showing only active/enabled accounts, while Group options dynamically update to display only groups available in the selected M3U(s). Only enabled M3U's are displayed. (Closes #647) +- Streams table UI: Added descriptive tooltips to top-toolbar buttons (Add to Channel, Create Channels, Filters, Create Stream, Delete) and to row action icons (Add to Channel, Create New Channel). Tooltips now use a 500ms open delay for consistent behavior with existing table header tooltips. ### Changed - Table preferences (header pin and table size) now managed together with centralized state management and localStorage persistence. +- Streams table button labels: Renamed "Remove" to "Delete" and "Add Stream to Channel" to "Add to Channel" for clarity and consistency with other UI terminology. - Frontend tests GitHub workflow now uses Node.js 24 (matching Dockerfile) and runs on both `main` and `dev` branch pushes and pull requests for comprehensive CI coverage. - Table preferences architecture refactored: Migrated `table-size` preference from individual `useLocalStorage` calls to centralized `useTablePreferences` hook. All table components now read preferences from the table instance (`table.tableSize`, `.g maintainability and providing consistent API across all tables. - Optimized unassociated streams filter performance: Replaced inefficient reverse foreign key NULL check (`channels__isnull=True`) with Count annotation approach, reducing query time from 4-5 seconds to under 500ms for large datasets (75k+ streams) diff --git a/frontend/src/components/tables/StreamsTable.jsx b/frontend/src/components/tables/StreamsTable.jsx index aa210b6e..22e7cb67 100644 --- a/frontend/src/components/tables/StreamsTable.jsx +++ b/frontend/src/components/tables/StreamsTable.jsx @@ -117,7 +117,7 @@ const StreamRowActions = ({ return ( <> - + - + { gap={6} > - + ? 'light' + : 'default' + } + size="xs" + onClick={addStreamsToChannel} + p={5} + color={ + selectedStreamIds.length > 0 && + selectedChannelIds.length === 1 + ? theme.tailwind.green[5] + : undefined + } + style={ + selectedStreamIds.length > 0 && + selectedChannelIds.length === 1 + ? { + borderWidth: '1px', + borderColor: theme.tailwind.green[5], + color: 'white', + } + : undefined + } + disabled={ + !( + selectedStreamIds.length > 0 && + selectedChannelIds.length === 1 + ) + } + > + Add to Channel + + - + +
- + + + @@ -1185,31 +1200,35 @@ const StreamsTable = ({ onReady }) => { - + + + - + + + From 2fc2486c344ccb46e332ba9136fa4e61008fdf06 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 20 Jan 2026 18:51:13 -0600 Subject: [PATCH 38/55] Enhancement: Added "Hide Stale" filter to quickly hide streams marked as stale. --- CHANGELOG.md | 1 + apps/channels/api_views.py | 7 +++- .../src/components/tables/StreamsTable.jsx | 34 ++++++++++++++++--- 3 files changed, 36 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b1738429..599fb986 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Only polls when active channel list changes, not on stats refresh - Channel preview button: Added preview functionality to active stream cards on stats page - Unassociated streams filter: Added "Only Unassociated" filter option to streams table for quickly finding streams not assigned to any channels - Thanks [@JeffreyBytes](https://github.com/JeffreyBytes) (Closes #667) +- Streams table: Added "Hide Stale" filter to quickly hide streams marked as stale. - Client-side logo caching: Added `Cache-Control` and `Last-Modified` headers to logo responses, enabling browsers to cache logos locally for 4 hours (local files) and respecting upstream cache headers (remote logos). This reduces network traffic and nginx load while providing faster page loads through browser-level caching that complements the existing nginx server-side cache - Thanks [@DawtCom](https://github.com/DawtCom) - DVR recording remux fallback strategy: Implemented two-stage TS→MP4→MKV fallback when direct TS→MKV conversion fails due to timestamp issues. On remux failure, system now attempts TS→MP4 conversion (MP4 container handles broken timestamps better) followed by MP4→MKV conversion, automatically recovering from provider timestamp corruption. Failed conversions now properly clean up partial files and preserve source TS for manual recovery. - Mature content filtering support: diff --git a/apps/channels/api_views.py b/apps/channels/api_views.py index f9daf0d0..11940177 100644 --- a/apps/channels/api_views.py +++ b/apps/channels/api_views.py @@ -149,7 +149,7 @@ class StreamViewSet(viewsets.ModelViewSet): qs = qs.filter(channels__id=assigned) unassigned = self.request.query_params.get("unassigned") - if unassigned == "1": + if unassigned and str(unassigned).lower() in ("1", "true", "yes", "on"): # Use annotation with Count for better performance on large datasets qs = qs.annotate(channel_count=Count('channels')).filter(channel_count=0) @@ -158,6 +158,11 @@ class StreamViewSet(viewsets.ModelViewSet): group_names = channel_group.split(",") qs = qs.filter(channel_group__name__in=group_names) + # Allow client to hide stale streams (streams marked as is_stale=True) + hide_stale = self.request.query_params.get("hide_stale") + if hide_stale and str(hide_stale).lower() in ("1", "true", "yes", "on"): + qs = qs.filter(is_stale=False) + return qs def list(self, request, *args, **kwargs): diff --git a/frontend/src/components/tables/StreamsTable.jsx b/frontend/src/components/tables/StreamsTable.jsx index 22e7cb67..5b9182b2 100644 --- a/frontend/src/components/tables/StreamsTable.jsx +++ b/frontend/src/components/tables/StreamsTable.jsx @@ -232,7 +232,8 @@ const StreamsTable = ({ onReady }) => { name: '', channel_group: '', m3u_account: '', - unassigned: '', + unassigned: false, + hide_stale: false, }); const [columnSizing, setColumnSizing] = useLocalStorage( 'streams-table-column-sizing', @@ -398,7 +399,14 @@ const StreamsTable = ({ onReady }) => { const toggleUnassignedOnly = () => { setFilters((prev) => ({ ...prev, - unassigned: prev.unassigned === '1' ? '' : '1', + unassigned: !prev.unassigned, + })); + }; + + const toggleHideStale = () => { + setFilters((prev) => ({ + ...prev, + hide_stale: !prev.hide_stale, })); }; @@ -426,9 +434,13 @@ const StreamsTable = ({ onReady }) => { params.append('ordering', `${sortDirection}${sortField}`); } - // Apply debounced filters + // Apply debounced filters; send boolean filters as 'true' when set Object.entries(debouncedFilters).forEach(([key, value]) => { - if (value) params.append(key, value); + if (typeof value === 'boolean') { + if (value) params.append(key, 'true'); + } else if (value !== null && value !== undefined && value !== '') { + params.append(key, String(value)); + } }); try { @@ -1188,7 +1200,7 @@ const StreamsTable = ({ onReady }) => { ) : ( @@ -1197,6 +1209,18 @@ const StreamsTable = ({ onReady }) => { > Only Unassociated + + ) : ( + + ) + } + > + Hide Stale + From e43aba67e71730796e5e1b1b4062c034449973cd Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Tue, 20 Jan 2026 19:35:19 -0600 Subject: [PATCH 39/55] Enhancement: Refactor StreamConnectionCard layout for improved UI, separating channel name and current program display. --- .../components/cards/StreamConnectionCard.jsx | 57 ++++++++++--------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/frontend/src/components/cards/StreamConnectionCard.jsx b/frontend/src/components/cards/StreamConnectionCard.jsx index e8b8a33b..6c5fc4fb 100644 --- a/frontend/src/components/cards/StreamConnectionCard.jsx +++ b/frontend/src/components/cards/StreamConnectionCard.jsx @@ -494,9 +494,8 @@ const StreamConnectionCard = ({ - - {channelName} - + {/* Stream Profile on right */} + - {/* Display M3U profile and current program */} + {/* Channel Name on left, M3U Profile on right */} - {currentProgram ? ( - - - - Now Playing: - - - {currentProgram.title} - - setIsProgramDescExpanded(!isProgramDescExpanded)} - > - {isProgramDescExpanded ? ( - - ) : ( - - )} - - - ) : ( - - )} + {channelName} + @@ -539,6 +516,30 @@ const StreamConnectionCard = ({ + {/* Display current program on its own line */} + {currentProgram && ( + + + + Now Playing: + + + {currentProgram.title} + + setIsProgramDescExpanded(!isProgramDescExpanded)} + > + {isProgramDescExpanded ? ( + + ) : ( + + )} + + + )} + {/* Expandable program description */} {currentProgram && isProgramDescExpanded && From cbb8a521633e2d619e1e83acefab8d5d5865f3b2 Mon Sep 17 00:00:00 2001 From: Mattias Svensson Date: Wed, 21 Jan 2026 08:04:49 +0100 Subject: [PATCH 40/55] Fix: nginx startup failure due to group name mismatch The script was creating a group named 'dispatch' (hardcoded) while nginx.conf expected a group matching POSTGRES_USER (e.g., 'dispatcharr'). Changes: - Use $POSTGRES_USER for group name instead of hardcoded 'dispatch' - Make sed command more robust to match any existing user directive This ensures the group name matches the user name, fixing the error: "getgrnam("dispatcharr") failed in /etc/nginx/nginx.conf:1" Fixes #877 Co-Authored-By: Claude Opus 4.5 --- docker/init/01-user-setup.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/docker/init/01-user-setup.sh b/docker/init/01-user-setup.sh index d7041265..1b0e0a27 100644 --- a/docker/init/01-user-setup.sh +++ b/docker/init/01-user-setup.sh @@ -6,17 +6,17 @@ export PGID=${PGID:-1000} # Check if group with PGID exists if getent group "$PGID" >/dev/null 2>&1; then - # Group exists, check if it's named 'dispatch' + # Group exists, check if it's named correctly (should match POSTGRES_USER) existing_group=$(getent group "$PGID" | cut -d: -f1) - if [ "$existing_group" != "dispatch" ]; then - # Rename the existing group to 'dispatch' - groupmod -n "dispatch" "$existing_group" - echo "Group $existing_group with GID $PGID renamed to dispatch" + if [ "$existing_group" != "$POSTGRES_USER" ]; then + # Rename the existing group to match POSTGRES_USER + groupmod -n "$POSTGRES_USER" "$existing_group" + echo "Group $existing_group with GID $PGID renamed to $POSTGRES_USER" fi else - # Group doesn't exist, create it - groupadd -g "$PGID" dispatch - echo "Group dispatch with GID $PGID created" + # Group doesn't exist, create it with same name as POSTGRES_USER + groupadd -g "$PGID" "$POSTGRES_USER" + echo "Group $POSTGRES_USER with GID $PGID created" fi # Create user if it doesn't exist @@ -86,5 +86,5 @@ if getent group video >/dev/null 2>&1; then fi fi -# Run nginx as specified user -sed -i "s/user www-data;/user $POSTGRES_USER;/g" /etc/nginx/nginx.conf +# Run nginx as specified user (replace any existing user directive on line 1) +sed -i "1s/^user .*/user $POSTGRES_USER;/" /etc/nginx/nginx.conf From 58d14664e3e6005539db2b43e554f6761f864219 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Wed, 21 Jan 2026 16:35:00 -0600 Subject: [PATCH 41/55] Enhancement: Adjust layout and spacing in StreamConnectionCard for improved UI consistency and readability --- .../components/cards/StreamConnectionCard.jsx | 40 ++++++++++--------- 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/frontend/src/components/cards/StreamConnectionCard.jsx b/frontend/src/components/cards/StreamConnectionCard.jsx index 6c5fc4fb..bd7c327c 100644 --- a/frontend/src/components/cards/StreamConnectionCard.jsx +++ b/frontend/src/components/cards/StreamConnectionCard.jsx @@ -450,14 +450,14 @@ const StreamConnectionCard = ({ w={'100%'} > - + - +
@@ -494,42 +494,46 @@ const StreamConnectionCard = ({ - {/* Stream Profile on right */} - + {/* Stream Profile on right - absolutely positioned */} + - - - {/* Channel Name on left, M3U Profile on right */} - - {channelName} + + {/* M3U Profile on right - absolutely positioned */} + {m3uProfileName} - + + + {/* Channel Name on left */} + + {channelName} + {/* Display current program on its own line */} {currentProgram && ( - - - + + + Now Playing: - + {currentProgram.title} setIsProgramDescExpanded(!isProgramDescExpanded)} + style={{ flexShrink: 0 }} > {isProgramDescExpanded ? ( @@ -603,7 +607,7 @@ const StreamConnectionCard = ({ {/* Add stream selection dropdown and preview button */} {availableStreams.length > 0 && ( - + @@ -640,7 +644,7 @@ const StreamConnectionCard = ({ )} {/* Add stream information badges */} - + {channel.resolution && ( From e79622f513474b68a178b3418a89b747f8a2cf05 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Wed, 21 Jan 2026 16:44:31 -0600 Subject: [PATCH 42/55] adjust arrow to be next to title always. --- frontend/src/components/cards/StreamConnectionCard.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/components/cards/StreamConnectionCard.jsx b/frontend/src/components/cards/StreamConnectionCard.jsx index bd7c327c..1cd99814 100644 --- a/frontend/src/components/cards/StreamConnectionCard.jsx +++ b/frontend/src/components/cards/StreamConnectionCard.jsx @@ -526,7 +526,7 @@ const StreamConnectionCard = ({ Now Playing: - + {currentProgram.title} Date: Wed, 21 Jan 2026 16:55:25 -0600 Subject: [PATCH 43/55] Bug fix: Fixed long IP addresses overlapping adjacent columns in stream connection card by adding truncation with tooltips displaying the full address. (Fixes #712) --- CHANGELOG.md | 1 + frontend/src/components/cards/StreamConnectionCard.jsx | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 599fb986..14b41dcf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed long IP addresses overlapping adjacent columns in stream connection card by adding truncation with tooltips displaying the full address. (Fixes #712) - Updated streamlink from 8.1.0 to 8.1.2 to fix YouTube live stream playback issues and improve Pluto TV ad detection (Fixes #869) - Fixed date/time formatting across all tables to respect user's UI preferences (time format and date format) set in Settings page: - Stream connection card "Connected" column diff --git a/frontend/src/components/cards/StreamConnectionCard.jsx b/frontend/src/components/cards/StreamConnectionCard.jsx index 1cd99814..bf72b109 100644 --- a/frontend/src/components/cards/StreamConnectionCard.jsx +++ b/frontend/src/components/cards/StreamConnectionCard.jsx @@ -271,6 +271,14 @@ const StreamConnectionCard = ({ { header: 'IP Address', accessorKey: 'ip_address', + size: 150, + cell: ({ cell }) => ( + + + {cell.getValue()} + + + ), }, // Updated Connected column with tooltip { From 6e70753d1c7e949e7dfc816851c6f93f30b2bc3b Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Thu, 22 Jan 2026 14:25:33 -0600 Subject: [PATCH 44/55] changelog: Fixed nginx startup failure due to group name mismatch in non-container deployments --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 14b41dcf..c63d73e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Fixed long IP addresses overlapping adjacent columns in stream connection card by adding truncation with tooltips displaying the full address. (Fixes #712) +- Fixed nginx startup failure due to group name mismatch in non-container deployments - Thanks [@s0len](https://github.com/s0len) (Fixes #877) - Updated streamlink from 8.1.0 to 8.1.2 to fix YouTube live stream playback issues and improve Pluto TV ad detection (Fixes #869) - Fixed date/time formatting across all tables to respect user's UI preferences (time format and date format) set in Settings page: - Stream connection card "Connected" column From d4f412e3525dddc645941d81dddfec017b8e0971 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Fri, 23 Jan 2026 10:33:14 -0600 Subject: [PATCH 45/55] Bug Fix: Channels table pagination error handling: Fixed "Invalid page" error notifications that appeared when filters reduced the result set while on a page beyond the new total. The API layer now automatically detects invalid page errors, resets pagination to page 1, and retries the request transparently. (Fixes #864) --- CHANGELOG.md | 1 + frontend/src/api.js | 58 +++++++++++++++++++ .../src/components/tables/ChannelsTable.jsx | 39 ++++++++----- 3 files changed, 82 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c63d73e5..bd73931a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -51,6 +51,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Channels table pagination error handling: Fixed "Invalid page" error notifications that appeared when filters reduced the result set while on a page beyond the new total. The API layer now automatically detects invalid page errors, resets pagination to page 1, and retries the request transparently. (Fixes #864) - Fixed long IP addresses overlapping adjacent columns in stream connection card by adding truncation with tooltips displaying the full address. (Fixes #712) - Fixed nginx startup failure due to group name mismatch in non-container deployments - Thanks [@s0len](https://github.com/s0len) (Fixes #877) - Updated streamlink from 8.1.0 to 8.1.2 to fix YouTube live stream playback issues and improve Pluto TV ad detection (Fixes #869) diff --git a/frontend/src/api.js b/frontend/src/api.js index 4b728622..3df0b475 100644 --- a/frontend/src/api.js +++ b/frontend/src/api.js @@ -198,6 +198,31 @@ export default class API { return response; } catch (e) { + // Handle invalid page error by resetting to page 1 and retrying + if (e.body?.detail === 'Invalid page.') { + const currentPagination = useChannelsTableStore.getState().pagination; + + // Only retry if we're not already on page 1 + if (currentPagination.pageIndex > 0) { + // Reset to page 1 + useChannelsTableStore.getState().setPagination({ + ...currentPagination, + pageIndex: 0, + }); + + // Update params to page 1 and retry + const newParams = new URLSearchParams(params); + newParams.set('page', '1'); + + const response = await request( + `${host}/api/channels/channels/?${newParams.toString()}` + ); + + useChannelsTableStore.getState().queryChannels(response, newParams); + return response; + } + } + errorNotification('Failed to fetch channels', e); } } @@ -218,6 +243,39 @@ export default class API { return response; } catch (e) { + // Handle invalid page error by resetting to page 1 and retrying + if (e.body?.detail === 'Invalid page.') { + const currentPagination = useChannelsTableStore.getState().pagination; + + // Only retry if we're not already on page 1 + if (currentPagination.pageIndex > 0) { + // Reset to page 1 + useChannelsTableStore.getState().setPagination({ + ...currentPagination, + pageIndex: 0, + }); + + // Update params to page 1 and retry + const newParams = new URLSearchParams(API.lastQueryParams); + newParams.set('page', '1'); + API.lastQueryParams = newParams; + + const [response, ids] = await Promise.all([ + request( + `${host}/api/channels/channels/?${newParams.toString()}` + ), + API.getAllChannelIds(newParams), + ]); + + useChannelsTableStore + .getState() + .queryChannels(response, newParams); + useChannelsTableStore.getState().setAllQueryIds(ids); + + return response; + } + } + errorNotification('Failed to fetch channels', e); } } diff --git a/frontend/src/components/tables/ChannelsTable.jsx b/frontend/src/components/tables/ChannelsTable.jsx index 78dd4f4c..bcacfe98 100644 --- a/frontend/src/components/tables/ChannelsTable.jsx +++ b/frontend/src/components/tables/ChannelsTable.jsx @@ -421,25 +421,32 @@ const ChannelsTable = ({ onReady }) => { } }); - const [results, ids] = await Promise.all([ - await API.queryChannels(params), - await API.getAllChannelIds(params), - ]); + try { + const [results, ids] = await Promise.all([ + await API.queryChannels(params), + await API.getAllChannelIds(params), + ]); - setIsLoading(false); - hasFetchedData.current = true; + setIsLoading(false); + hasFetchedData.current = true; - setTablePrefs((prev) => ({ - ...prev, - pageSize: pagination.pageSize, - })); - setAllRowIds(ids); + setTablePrefs((prev) => ({ + ...prev, + pageSize: pagination.pageSize, + })); + setAllRowIds(ids); - // Signal ready after first successful data fetch AND EPG data is loaded - // This prevents the EPG column from showing "Not Assigned" while EPG data is still loading - if (!hasSignaledReady.current && onReady && tvgsLoaded) { - hasSignaledReady.current = true; - onReady(); + // Signal ready after first successful data fetch AND EPG data is loaded + // This prevents the EPG column from showing "Not Assigned" while EPG data is still loading + if (!hasSignaledReady.current && onReady && tvgsLoaded) { + hasSignaledReady.current = true; + onReady(); + } + } catch (error) { + setIsLoading(false); + // API layer handles "Invalid page" errors by resetting and retrying + // Just re-throw to show notification for actual errors + throw error; } }, [ pagination, From 5348a4a5640b8ae937ee6dcdb2ad6a1e0b1733e7 Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Fri, 23 Jan 2026 16:03:26 -0600 Subject: [PATCH 46/55] Feature: Editable Channel Table Mode: - Added a robust inline editing mode for the channels table, allowing users to quickly edit channel fields (name, number, group, EPG, logo) directly in the table without opening a modal. - EPG and logo columns now support searchable dropdowns with instant filtering and keyboard navigation for fast assignment. - Drag-and-drop reordering of channels enabled when unlocked, with persistent order updates. - Group column now uses a searchable dropdown for quick group assignment, matching the UX of EPG and logo selectors. - All editable cells provide clear focus, hover, and disabled states for improved accessibility and usability. - Table unlock/edit mode toggle with clear visual cues and safe-guarded save logic to prevent accidental edits. - All changes are saved via API with optimistic UI updates and error handling. --- CHANGELOG.md | 8 + apps/channels/api_views.py | 75 +- frontend/src/api.js | 18 + .../src/components/tables/ChannelsTable.jsx | 217 ++--- .../ChannelsTable/ChannelTableHeader.jsx | 38 + .../tables/ChannelsTable/DraggableRow.jsx | 59 ++ .../tables/ChannelsTable/EditableCell.jsx | 781 ++++++++++++++++++ .../tables/CustomTable/CustomTable.jsx | 6 +- .../tables/CustomTable/CustomTableBody.jsx | 77 +- .../tables/CustomTable/CustomTableHeader.jsx | 5 + frontend/src/store/channelsTable.jsx | 13 + 11 files changed, 1188 insertions(+), 109 deletions(-) create mode 100644 frontend/src/components/tables/ChannelsTable/DraggableRow.jsx create mode 100644 frontend/src/components/tables/ChannelsTable/EditableCell.jsx diff --git a/CHANGELOG.md b/CHANGELOG.md index bd73931a..9d920d41 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Editable Channel Table Mode: + - Added a robust inline editing mode for the channels table, allowing users to quickly edit channel fields (name, number, group, EPG, logo) directly in the table without opening a modal. + - EPG and logo columns now support searchable dropdowns with instant filtering and keyboard navigation for fast assignment. + - Drag-and-drop reordering of channels enabled when unlocked, with persistent order updates. + - Group column now uses a searchable dropdown for quick group assignment, matching the UX of EPG and logo selectors. + - All editable cells provide clear focus, hover, and disabled states for improved accessibility and usability. + - Table unlock/edit mode toggle with clear visual cues and safe-guarded save logic to prevent accidental edits. + - All changes are saved via API with optimistic UI updates and error handling. - Stats page enhancements: Added "Now Playing" program information for active streams with smart polling that only fetches EPG data when programs are about to change (not on every stats refresh). Features include: - Currently playing program title displayed with live broadcast indicator (green Radio icon) - Expandable program descriptions via chevron button diff --git a/apps/channels/api_views.py b/apps/channels/api_views.py index 11940177..2b2870fa 100644 --- a/apps/channels/api_views.py +++ b/apps/channels/api_views.py @@ -8,7 +8,7 @@ from drf_yasg.utils import swagger_auto_schema from drf_yasg import openapi from django.shortcuts import get_object_or_404, get_list_or_404 from django.db import transaction -from django.db.models import Count +from django.db.models import Count, F from django.db.models import Q import os, json, requests, logging, mimetypes from django.utils.http import http_date @@ -1251,6 +1251,79 @@ class ChannelViewSet(viewsets.ModelViewSet): except Exception as e: return Response({"error": str(e)}, status=400) + @swagger_auto_schema( + method="post", + operation_description=( + "Reorder a channel by moving it after another channel (or to the start if insert_after_id is null). " + "The channel will receive the next whole number after the target channel, and all subsequent " + "channels will be renumbered accordingly." + ), + request_body=openapi.Schema( + type=openapi.TYPE_OBJECT, + properties={ + "insert_after_id": openapi.Schema( + type=openapi.TYPE_INTEGER, + description="ID of the channel to insert after. Use null to move to the beginning.", + nullable=True, + ), + }, + ), + responses={ + 200: "Channel reordered successfully", + 404: "Channel not found", + 400: "Invalid request", + }, + ) + @action(detail=True, methods=["post"], url_path="reorder") + def reorder(self, request, pk=None): + """ + Reorder a channel by moving it near a target position. + Finds the first available channel number without unnecessarily shifting other channels. + """ + channel = self.get_object() + insert_after_id = request.data.get("insert_after_id") + old_channel_number = channel.channel_number + + with transaction.atomic(): + if insert_after_id is None: + # Move to the beginning - find first available number starting from 1 + new_channel_number = 1 + # Check if 1 is taken, find first gap + occupied = set(Channel.objects.exclude(id=channel.id).values_list('channel_number', flat=True)) + while new_channel_number in occupied: + new_channel_number += 1 + else: + try: + target_channel = Channel.objects.get(id=insert_after_id) + target_number = target_channel.channel_number or 0 + desired_position = int(target_number) + 1 + + # Get all occupied channel numbers (excluding the channel being moved) + occupied = set(Channel.objects.exclude(id=channel.id).values_list('channel_number', flat=True)) + + # Find the first available number at or after the desired position + new_channel_number = desired_position + while new_channel_number in occupied: + new_channel_number += 1 + + except Channel.DoesNotExist: + return Response( + {"error": "Target channel not found"}, + status=status.HTTP_404_NOT_FOUND, + ) + + # Update the dragged channel's number + channel.channel_number = new_channel_number + channel.save(update_fields=['channel_number']) + + return Response( + { + "message": f"Channel {channel.name} moved to position {new_channel_number}", + "channel": self.get_serializer(channel).data, + }, + status=status.HTTP_200_OK, + ) + @swagger_auto_schema( method="post", operation_description="Associate multiple channels with EPG data without triggering a full refresh", diff --git a/frontend/src/api.js b/frontend/src/api.js index 3df0b475..a831ad22 100644 --- a/frontend/src/api.js +++ b/frontend/src/api.js @@ -568,6 +568,24 @@ export default class API { } } + static async reorderChannel(channelId, insertAfterId) { + try { + const response = await request( + `${host}/api/channels/channels/${channelId}/reorder/`, + { + method: 'POST', + body: { + insert_after_id: insertAfterId, + }, + } + ); + + return response; + } catch (e) { + errorNotification('Failed to reorder channel', e); + } + } + static async setChannelEPG(channelId, epgDataId) { try { const response = await request( diff --git a/frontend/src/components/tables/ChannelsTable.jsx b/frontend/src/components/tables/ChannelsTable.jsx index bcacfe98..9106fdcc 100644 --- a/frontend/src/components/tables/ChannelsTable.jsx +++ b/frontend/src/components/tables/ChannelsTable.jsx @@ -5,6 +5,17 @@ import React, { useCallback, useRef, } from 'react'; +import { + DndContext, + closestCenter, + PointerSensor, + useSensor, + useSensors, +} from '@dnd-kit/core'; +import { + SortableContext, + verticalListSortingStrategy, +} from '@dnd-kit/sortable'; import useChannelsStore from '../../store/channels'; import { notifications } from '@mantine/notifications'; import API from '../../api'; @@ -61,9 +72,18 @@ import ChannelTableStreams from './ChannelTableStreams'; import LazyLogo from '../LazyLogo'; import useLocalStorage from '../../hooks/useLocalStorage'; import useEPGsStore from '../../store/epgs'; +import { useChannelLogoSelection } from '../../hooks/useSmartLogos'; import { CustomTable, useTable } from './CustomTable'; import ChannelsTableOnboarding from './ChannelsTable/ChannelsTableOnboarding'; import ChannelTableHeader from './ChannelsTable/ChannelTableHeader'; +import { + EditableTextCell, + EditableNumberCell, + EditableGroupCell, + EditableEPGCell, + EditableLogoCell, +} from './ChannelsTable/EditableCell'; +import { DraggableRow } from './ChannelsTable/DraggableRow'; import useWarningsStore from '../../store/warnings'; import ConfirmationDialog from '../ConfirmationDialog'; import useAuthStore from '../../store/auth'; @@ -231,6 +251,10 @@ const ChannelsTable = ({ onReady }) => { const tvgsById = useEPGsStore((s) => s.tvgsById); const epgs = useEPGsStore((s) => s.epgs); const tvgsLoaded = useEPGsStore((s) => s.tvgsLoaded); + + // Get channel logos for logo selection + const { logos: channelLogos, ensureLogosLoaded } = useChannelLogoSelection(); + const theme = useMantineTheme(); const channelGroups = useChannelsStore((s) => s.channelGroups); const canEditChannelGroup = useChannelsStore((s) => s.canEditChannelGroup); @@ -258,6 +282,7 @@ const ChannelsTable = ({ onReady }) => { const setChannelStreams = useChannelsTableStore((s) => s.setChannelStreams); const allRowIds = useChannelsTableStore((s) => s.allQueryIds); const setAllRowIds = useChannelsTableStore((s) => s.setAllQueryIds); + const isUnlocked = useChannelsTableStore((s) => s.isUnlocked); // store/channels const channels = useChannelsStore((s) => s.channels); @@ -320,6 +345,15 @@ const ChannelsTable = ({ onReady }) => { const hasFetchedData = useRef(false); + // Drag-and-drop sensors + const sensors = useSensors( + useSensor(PointerSensor, { + activationConstraint: { + distance: 8, // Require 8px movement before dragging starts + }, + }) + ); + // Column sizing state for resizable columns // Store in localStorage but with empty object as default const [columnSizing, setColumnSizing] = useLocalStorage( @@ -746,6 +780,47 @@ const ChannelsTable = ({ onReady }) => { } }; + const handleDragEnd = async (event) => { + const { active, over } = event; + + if (!over || active.id === over.id) { + return; + } + + const activeIndex = rows.findIndex((row) => row.id === active.id); + const overIndex = rows.findIndex((row) => row.id === over.id); + + if (activeIndex === -1 || overIndex === -1) { + return; + } + + const activeChannel = rows[activeIndex].original; + const overChannel = rows[overIndex].original; + + try { + // Optimistically update the local state + const reorderedData = [...data]; + const [movedItem] = reorderedData.splice(activeIndex, 1); + reorderedData.splice(overIndex, 0, movedItem); + useChannelsTableStore.setState({ channels: reorderedData }); + + // Call backend to reorder + await API.reorderChannel( + activeChannel.id, + overIndex > activeIndex + ? overChannel.id + : rows[overIndex - 1]?.original.id || null + ); + + // Refetch to get updated channel numbers + await API.requeryChannels(); + } catch (error) { + // Revert on error + console.error('Failed to reorder channel:', error); + await API.requeryChannels(); + } + }; + /** * useEffect */ @@ -817,22 +892,7 @@ const ChannelsTable = ({ onReady }) => { size: columnSizing.channel_number || 40, minSize: 30, maxSize: 100, - cell: ({ getValue }) => { - const value = getValue(); - // Format as integer if no decimal component - const formattedValue = - value !== null && value !== undefined - ? value === Math.floor(value) - ? Math.floor(value) - : value - : ''; - - return ( - - {formattedValue} - - ); - }, + cell: (props) => , }, { id: 'name', @@ -840,73 +900,20 @@ const ChannelsTable = ({ onReady }) => { size: columnSizing.name || 200, minSize: 100, grow: true, - cell: ({ getValue }) => ( - - {getValue()} - - ), + cell: (props) => , }, { id: 'epg', header: 'EPG', accessorKey: 'epg_data_id', - cell: ({ getValue }) => { - const epgDataId = getValue(); - const epgObj = epgDataId ? tvgsById[epgDataId] : null; - const tvgName = epgObj?.name; - const tvgId = epgObj?.tvg_id; - const epgName = - epgObj && epgObj.epg_source - ? epgs[epgObj.epg_source]?.name || epgObj.epg_source - : null; - - const tooltip = epgObj - ? `${epgName ? `EPG Name: ${epgName}\n` : ''}${tvgName ? `TVG Name: ${tvgName}\n` : ''}${tvgId ? `TVG-ID: ${tvgId}` : ''}`.trim() - : ''; - - // If channel has an EPG assignment but tvgsById hasn't loaded yet, show loading - const isEpgDataPending = epgDataId && !epgObj && !tvgsLoaded; - - return ( - - {epgObj && epgName ? ( - {tooltip} - } - withArrow - position="top" - > - - {epgObj.epg_source} - {tvgId} - - - ) : epgObj ? ( - {epgObj.name} - ) : isEpgDataPending ? ( - - ) : ( - Not Assigned - )} - - ); - }, + cell: (props) => ( + + ), size: columnSizing.epg || 200, minSize: 80, }, @@ -916,16 +923,8 @@ const ChannelsTable = ({ onReady }) => { channelGroups[row.channel_group_id] ? channelGroups[row.channel_group_id].name : '', - cell: ({ getValue }) => ( - - {getValue()} - + cell: (props) => ( + ), size: columnSizing.channel_group || 175, minSize: 100, @@ -941,19 +940,21 @@ const ChannelsTable = ({ onReady }) => { maxSize: 120, enableResizing: false, header: '', - cell: ({ getValue }) => { - const logoId = getValue(); - - return ( -
- -
- ); - }, + cell: (props) => ( + { + // Ensure logos are loaded when user tries to edit + ensureLogosLoaded(); + }} + style={{ width: '100%', height: '100%' }} + > + + + ), }, { id: 'actions', @@ -1099,6 +1100,7 @@ const ChannelsTable = ({ onReady }) => { manualSorting: true, manualFiltering: true, enableRowSelection: true, + enableDragDrop: true, onRowSelectionChange: onRowSelectionChange, state: { pagination, @@ -1463,7 +1465,18 @@ const ChannelsTable = ({ onReady }) => { borderRadius: 'var(--mantine-radius-default)', }} > - + + row.id)} + strategy={verticalListSortingStrategy} + > + + +
s.user); const isWarningSuppressed = useWarningsStore((s) => s.isWarningSuppressed); const suppressWarning = useWarningsStore((s) => s.suppressWarning); + const isUnlocked = useChannelsTableStore((s) => s.isUnlocked); + const setIsUnlocked = useChannelsTableStore((s) => s.setIsUnlocked); const headerPinned = table?.headerPinned ?? false; const setHeaderPinned = table?.setHeaderPinned || (() => {}); @@ -239,6 +244,10 @@ const ChannelTableHeader = ({ setHeaderPinned(!headerPinned); }; + const toggleUnlock = () => { + setIsUnlocked(!isUnlocked); + }; + return ( @@ -258,6 +267,23 @@ const ChannelTableHeader = ({ + + {isUnlocked && ( + + + Editing Mode + + )} + : + } + onClick={toggleUnlock} + disabled={authUser.user_level != USER_LEVELS.ADMIN} + > + + {isUnlocked ? 'Lock Table' : 'Unlock for Editing'} + + + { + const isUnlocked = useChannelsTableStore((s) => s.isUnlocked); + + const { + attributes, + listeners, + setNodeRef, + transform, + transition, + isDragging, + } = useSortable({ + id: row.id, + disabled: !isUnlocked, + }); + + const style = { + transform: CSS.Transform.toString(transform), + transition, + opacity: isDragging ? 0.5 : 1, + position: 'relative', + }; + + return ( +
+ {isUnlocked && ( + + + + )} +
+ {children} +
+
+ ); +}; diff --git a/frontend/src/components/tables/ChannelsTable/EditableCell.jsx b/frontend/src/components/tables/ChannelsTable/EditableCell.jsx new file mode 100644 index 00000000..065e4631 --- /dev/null +++ b/frontend/src/components/tables/ChannelsTable/EditableCell.jsx @@ -0,0 +1,781 @@ +import React, { + useState, + useCallback, + useEffect, + useRef, + useMemo, +} from 'react'; +import { + Box, + TextInput, + Select, + NumberInput, + Tooltip, + Center, + Skeleton, +} from '@mantine/core'; +import API from '../../../api'; +import useChannelsTableStore from '../../../store/channelsTable'; + +// Editable text cell +export const EditableTextCell = ({ row, column, getValue }) => { + const isUnlocked = useChannelsTableStore((s) => s.isUnlocked); + const initialValue = getValue() || ''; + const [value, setValue] = useState(initialValue); + const [isFocused, setIsFocused] = useState(false); + const previousValue = useRef(initialValue); + const isMounted = useRef(false); + const debounceTimer = useRef(null); + + useEffect(() => { + const currentValue = getValue() || ''; + if (!isFocused && currentValue !== previousValue.current) { + setValue(currentValue); + previousValue.current = currentValue; + } + }, [getValue, isFocused]); + + const saveValue = useCallback( + async (newValue) => { + // Don't save if not mounted, not unlocked, or value hasn't changed + if ( + !isMounted.current || + !isUnlocked || + newValue === previousValue.current + ) { + return; + } + + try { + const response = await API.updateChannel({ + id: row.original.id, + [column.id]: newValue || null, + }); + previousValue.current = newValue; + + // Update the table store to reflect the change + if (response) { + useChannelsTableStore.getState().updateChannel(response); + } + } catch (error) { + // Revert on error + setValue(previousValue.current || ''); + } + }, + [row.original.id, column.id, isUnlocked] + ); + + useEffect(() => { + isMounted.current = true; + const timer = debounceTimer.current; + return () => { + isMounted.current = false; + if (timer) { + clearTimeout(timer); + } + }; + }, []); + + const handleChange = (e) => { + if (!isUnlocked) return; + const newValue = e.currentTarget.value; + setValue(newValue); + + // Clear existing timer + if (debounceTimer.current) { + clearTimeout(debounceTimer.current); + } + + // Set new timer + debounceTimer.current = setTimeout(() => { + saveValue(newValue); + }, 500); + }; + + const handleBlur = () => { + setIsFocused(false); + if (isUnlocked) { + saveValue(value); + } + }; + + const handleClick = () => { + if (isUnlocked) { + setIsFocused(true); + } + }; + + if (!isUnlocked || !isFocused) { + return ( + + {value} + + ); + } + + return ( + + ); +}; + +// Editable number cell +export const EditableNumberCell = ({ row, column, getValue }) => { + const isUnlocked = useChannelsTableStore((s) => s.isUnlocked); + const initialValue = getValue(); + const [value, setValue] = useState(initialValue); + const [isFocused, setIsFocused] = useState(false); + const previousValue = useRef(initialValue); + const isMounted = useRef(false); + + useEffect(() => { + const currentValue = getValue(); + if (!isFocused && currentValue !== previousValue.current) { + setValue(currentValue); + previousValue.current = currentValue; + } + }, [getValue, isFocused]); + + const saveValue = useCallback( + async (newValue) => { + // Don't save if not mounted, not unlocked, or value hasn't changed + if ( + !isMounted.current || + !isUnlocked || + newValue === previousValue.current + ) { + return; + } + + // For channel_number, don't save null/undefined values + if ( + column.id === 'channel_number' && + (newValue === null || newValue === undefined || newValue === '') + ) { + // Revert to previous value + setValue(previousValue.current); + return; + } + + try { + const response = await API.updateChannel({ + id: row.original.id, + [column.id]: newValue, + }); + previousValue.current = newValue; + + // Update the table store to reflect the change + if (response) { + useChannelsTableStore.getState().updateChannel(response); + + // If channel_number was changed, refetch to reorder the table + if (column.id === 'channel_number') { + await API.requeryChannels(); + // Exit edit mode after resorting to avoid confusion + setIsFocused(false); + } + } + } catch (error) { + // Revert on error + setValue(previousValue.current); + } + }, + [row.original.id, column.id, isUnlocked] + ); + + useEffect(() => { + isMounted.current = true; + return () => { + isMounted.current = false; + }; + }, []); + + const handleChange = (newValue) => { + if (!isUnlocked) return; + setValue(newValue); + }; + + const handleBlur = () => { + setIsFocused(false); + if (isUnlocked) { + saveValue(value); + } + }; + + const handleClick = () => { + if (isUnlocked) { + setIsFocused(true); + } + }; + + const formattedValue = + value !== null && value !== undefined + ? value === Math.floor(value) + ? Math.floor(value) + : value + : ''; + + if (!isUnlocked || !isFocused) { + return ( + + {formattedValue} + + ); + } + + return ( + + ); +}; + +// Editable select cell for groups +export const EditableGroupCell = ({ row, getValue, channelGroups }) => { + const isUnlocked = useChannelsTableStore((s) => s.isUnlocked); + const groupId = row.original.channel_group_id; + const groupName = channelGroups[groupId]?.name || ''; + const previousGroupId = useRef(groupId); + const [isFocused, setIsFocused] = useState(false); + const [searchValue, setSearchValue] = useState(''); + + const saveValue = useCallback( + async (newGroupId) => { + // Don't save if not unlocked or value hasn't changed + if ( + !isUnlocked || + String(newGroupId) === String(previousGroupId.current) + ) { + return; + } + + try { + const response = await API.updateChannel({ + id: row.original.id, + channel_group_id: parseInt(newGroupId, 10), + }); + previousGroupId.current = newGroupId; + + // Update the table store to reflect the change + if (response) { + useChannelsTableStore.getState().updateChannel(response); + } + } catch (error) { + console.error('Failed to update channel group:', error); + } + }, + [row.original.id, isUnlocked] + ); + + const handleClick = () => { + if (isUnlocked) { + setIsFocused(true); + } + }; + + const handleChange = (newGroupId) => { + saveValue(newGroupId); + setIsFocused(false); + setSearchValue(''); + }; + + const groupOptions = Object.values(channelGroups).map((group) => ({ + value: String(group.id), + label: group.name, + })); + + if (!isUnlocked || !isFocused) { + return ( + + {groupName} + + ); + } + + return ( + setIsFocused(false)} + data={epgOptions} + size="xs" + variant="unstyled" + searchable + searchValue={searchValue} + onSearchChange={setSearchValue} + autoFocus + placeholder={displayText} + nothingFoundMessage="No EPG found" + styles={{ + input: { + minHeight: 'unset', + height: '100%', + padding: '0 4px', + backgroundColor: 'rgba(255, 255, 255, 0.1)', + }, + }} + /> + ); +}; + +// Editable cell for Logo selection +export const EditableLogoCell = ({ row, getValue, channelLogos, LazyLogo }) => { + const isUnlocked = useChannelsTableStore((s) => s.isUnlocked); + const logoId = getValue(); + const previousLogoId = useRef(logoId); + const [isFocused, setIsFocused] = useState(false); + const [searchValue, setSearchValue] = useState(''); + + const saveValue = useCallback( + async (newLogoId) => { + // Don't save if not unlocked or value hasn't changed + if (!isUnlocked || String(newLogoId) === String(previousLogoId.current)) { + return; + } + + try { + const response = await API.updateChannel({ + id: row.original.id, + logo_id: newLogoId === 'null' ? null : parseInt(newLogoId, 10), + }); + previousLogoId.current = newLogoId; + + // Update the table store to reflect the change + if (response) { + useChannelsTableStore.getState().updateChannel(response); + } + } catch (error) { + console.error('Failed to update logo:', error); + } + }, + [row.original.id, isUnlocked] + ); + + const handleClick = () => { + if (isUnlocked) { + setSearchValue(''); + setIsFocused(true); + } + }; + + const handleChange = (newLogoId) => { + saveValue(newLogoId); + setSearchValue(''); + setIsFocused(false); + }; + + // Build logo options with logo data + const logoOptions = useMemo(() => { + const options = [ + { + value: 'null', + label: 'Default', + logo: null, + }, + ]; + + // Convert channelLogos object to array and sort by name + const logosArray = Object.values(channelLogos); + logosArray.sort((a, b) => (a.name || '').localeCompare(b.name || '')); + + logosArray.forEach((logo) => { + options.push({ + value: String(logo.id), + label: logo.name || `Logo ${logo.id}`, + logo: logo, + }); + }); + + return options; + }, [channelLogos]); + + // Get display text for the current logo + const displayText = + logoId && channelLogos[logoId] ? channelLogos[logoId].name : 'Default'; + + // Custom option renderer to show logo images + const renderOption = ({ option }) => { + if (option.value === 'null') { + return
Default
; + } + + return ( + + {option.label} { + e.target.style.display = 'none'; + }} + /> + {option.label} + + ); + }; + + if (!isUnlocked || !isFocused) { + // When not editing, show the logo image + return ( + + {LazyLogo && ( + + )} + + ); + } + + return ( + + setIsFocused(false)} + onBlur={onBlur} data={groupOptions} size="xs" variant="unstyled" @@ -401,12 +429,10 @@ export const EditableEPGCell = ({ tvgsLoaded, }) => { const isUnlocked = useChannelsTableStore((s) => s.isUnlocked); - const epgDataId = getValue(); - const previousEpgDataId = useRef(epgDataId); const [isFocused, setIsFocused] = useState(false); - const [searchValue, setSearchValue] = useState(''); + const epgDataId = getValue(); - // Format display text + // Format display text - needed for both locked and unlocked states const epgObj = epgDataId ? tvgsById[epgDataId] : null; const tvgId = epgObj?.tvg_id; const epgName = @@ -423,13 +449,90 @@ export const EditableEPGCell = ({ // Show skeleton while EPG data is loading (only if channel has an EPG assignment) const isEpgDataPending = epgDataId && !epgObj && !tvgsLoaded; + // Build tooltip content + const tooltip = epgObj + ? `${epgName ? `EPG Name: ${epgName}\n` : ''}${epgObj.name ? `TVG Name: ${epgObj.name}\n` : ''}${tvgId ? `TVG-ID: ${tvgId}` : ''}`.trim() + : ''; + + // Show simple display when locked OR when unlocked but not focused + if (!isUnlocked || !isFocused) { + // If loading EPG data, show skeleton + if (isEpgDataPending) { + return ( + isUnlocked && setIsFocused(true)} + style={{ + width: '100%', + height: '100%', + display: 'flex', + alignItems: 'center', + padding: '0 4px', + cursor: isUnlocked ? 'pointer' : 'default', + }} + > + + + ); + } + return ( + {tooltip}} + withArrow + position="top" + disabled={!epgObj} + openDelay={500} + > + isUnlocked && setIsFocused(true)} + style={{ + whiteSpace: 'nowrap', + overflow: 'hidden', + textOverflow: 'ellipsis', + padding: '0 4px', + cursor: isUnlocked ? 'pointer' : 'default', + }} + > + {displayText} + + + ); + } + + return ( + setIsFocused(false)} + /> + ); +}; + +// Inner component with all the editing logic - only rendered when focused +const EditableEPGCellInner = ({ + row, + tvgsById, + epgs, + epgDataId, + displayText, + onBlur, +}) => { + const previousEpgDataId = useRef(epgDataId); + const [searchValue, setSearchValue] = useState(''); + const saveValue = useCallback( async (newEpgDataId) => { - // Don't save if not unlocked or value hasn't changed - if ( - !isUnlocked || - String(newEpgDataId) === String(previousEpgDataId.current) - ) { + // Don't save if value hasn't changed + if (String(newEpgDataId) === String(previousEpgDataId.current)) { return; } @@ -449,20 +552,13 @@ export const EditableEPGCell = ({ console.error('Failed to update EPG:', error); } }, - [row.original.id, isUnlocked] + [row.original.id] ); - const handleClick = () => { - if (isUnlocked) { - setSearchValue(''); // Start with empty search - setIsFocused(true); - } - }; - const handleChange = (newEpgDataId) => { saveValue(newEpgDataId); setSearchValue(''); - setIsFocused(false); + onBlur(); }; // Build EPG options @@ -514,69 +610,11 @@ export const EditableEPGCell = ({ return options; }, [tvgsById, epgs]); - // Build tooltip content - const tooltip = epgObj - ? `${epgName ? `EPG Name: ${epgName}\n` : ''}${epgObj.name ? `TVG Name: ${epgObj.name}\n` : ''}${tvgId ? `TVG-ID: ${tvgId}` : ''}`.trim() - : ''; - - if (!isUnlocked || !isFocused) { - // If loading EPG data, show skeleton - if (isEpgDataPending) { - return ( - - - - ); - } - // Otherwise, show the normal EPG assignment cell - return ( - {tooltip}} - withArrow - position="top" - disabled={!epgObj} - openDelay={500} - > - - {displayText} - - - ); - } - return ( setIsFocused(false)} + onBlur={onBlur} data={logoOptions} size="xs" variant="unstyled" diff --git a/frontend/src/store/auth.jsx b/frontend/src/store/auth.jsx index efc531ab..2a002d52 100644 --- a/frontend/src/store/auth.jsx +++ b/frontend/src/store/auth.jsx @@ -56,9 +56,10 @@ const useAuthStore = create((set, get) => ({ // Ensure settings are loaded first await useSettingsStore.getState().fetchSettings(); - // Only after settings are loaded, fetch the essential data + // Fetch essential data needed for initial render + // Note: fetchChannels() is intentionally NOT awaited here - it's slow (~3s) + // and only needed for delete modal details. It loads in background after UI renders. await Promise.all([ - useChannelsStore.getState().fetchChannels(), useChannelsStore.getState().fetchChannelGroups(), useChannelsStore.getState().fetchChannelProfiles(), usePlaylistsStore.getState().fetchPlaylists(), @@ -72,7 +73,7 @@ const useAuthStore = create((set, get) => ({ await Promise.all([useUsersStore.getState().fetchUsers()]); } - // Only set isAuthenticated and isInitialized AFTER all data is loaded + // Only set isAuthenticated and isInitialized AFTER essential data is loaded // This prevents routes from rendering before data is ready set({ isAuthenticated: true, @@ -80,6 +81,9 @@ const useAuthStore = create((set, get) => ({ isInitializing: false, }); + // Load channels data in background (not blocking) - needed for delete modal details + useChannelsStore.getState().fetchChannels(); + // Note: Logos are loaded after the Channels page tables finish loading // This is handled by the tables themselves signaling completion } catch (error) { From 76c895f6138734f3a4bb84683314b628eca4444c Mon Sep 17 00:00:00 2001 From: SergeantPanda Date: Mon, 26 Jan 2026 17:37:50 -0600 Subject: [PATCH 55/55] Security: Fixed moderate severity Prototype Pollution vulnerability in Lodash (`_.unset` and `_.omit` functions) See [GHSA-xxjr-mmjv-4gpg](https://github.com/advisories/GHSA-xxjr-mmjv-4gpg) for details. --- CHANGELOG.md | 1 + frontend/package-lock.json | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fd90457..629ce88c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - **High**: Open Redirect XSS vulnerability in Action/Server Action Request Processing ([GHSA-h5cw-625j-3rxh](https://github.com/advisories/GHSA-h5cw-625j-3rxh), [GHSA-2w69-qvjg-hvjx](https://github.com/advisories/GHSA-2w69-qvjg-hvjx)) - **Moderate**: SSR XSS vulnerability in ScrollRestoration component ([GHSA-8v8x-cx79-35w7](https://github.com/advisories/GHSA-8v8x-cx79-35w7)) - Updated react-router-dom from 7.11.0 to 7.12.0 (dependency of react-router) +- Fixed moderate severity Prototype Pollution vulnerability in Lodash (`_.unset` and `_.omit` functions) See [GHSA-xxjr-mmjv-4gpg](https://github.com/advisories/GHSA-xxjr-mmjv-4gpg) for details. ### Added diff --git a/frontend/package-lock.json b/frontend/package-lock.json index 476b764b..0a349a3d 100644 --- a/frontend/package-lock.json +++ b/frontend/package-lock.json @@ -3720,9 +3720,9 @@ } }, "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "version": "4.17.23", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.23.tgz", + "integrity": "sha512-LgVTMpQtIopCi79SJeDiP0TfWi5CNEc/L/aRdTh3yIvmZXTnheWpKjSZhnvMl8iXbC1tFg9gdHHDMLoV7CnG+w==", "license": "MIT" }, "node_modules/lodash.clamp": {