Fixes broken channels stats after field name change from 'profile' to 'stream_profile'

This commit is contained in:
SergeantPanda 2025-03-27 16:11:04 -05:00
parent 9c3e20e756
commit b9f4893261
2 changed files with 3 additions and 4 deletions

View file

@ -37,8 +37,7 @@ class ChannelStatus:
'channel_id': channel_id,
'state': metadata.get(ChannelMetadataField.STATE.encode('utf-8'), b'unknown').decode('utf-8'),
'url': metadata.get(ChannelMetadataField.URL.encode('utf-8'), b'').decode('utf-8'),
'profile': metadata.get(ChannelMetadataField.STREAM_PROFILE.encode('utf-8'),
metadata.get(ChannelMetadataField.PROFILE.encode('utf-8'), b'unknown')).decode('utf-8'),
'stream_profile': metadata.get(ChannelMetadataField.STREAM_PROFILE.encode('utf-8'), b'').decode('utf-8'),
'started_at': metadata.get(ChannelMetadataField.INIT_TIME.encode('utf-8'), b'0').decode('utf-8'),
'owner': metadata.get(ChannelMetadataField.OWNER.encode('utf-8'), b'unknown').decode('utf-8'),
'buffer_index': int(buffer_index_value.decode('utf-8')) if buffer_index_value else 0,
@ -273,7 +272,7 @@ class ChannelStatus:
'channel_id': channel_id,
'state': metadata.get(ChannelMetadataField.STATE.encode('utf-8'), b'unknown').decode('utf-8'),
'url': metadata.get(ChannelMetadataField.URL.encode('utf-8'), b'').decode('utf-8'),
'profile': metadata.get(ChannelMetadataField.PROFILE.encode('utf-8'), b'unknown').decode('utf-8'),
'stream_profile': metadata.get(ChannelMetadataField.STREAM_PROFILE.encode('utf-8'), b'').decode('utf-8'),
'owner': metadata.get(ChannelMetadataField.OWNER.encode('utf-8'), b'unknown').decode('utf-8'),
'buffer_index': int(buffer_index_value.decode('utf-8')) if buffer_index_value else 0,
'client_count': client_count,

View file

@ -315,7 +315,7 @@ const ChannelsPage = () => {
...channels[channelsByUUID[ch.channel_id]],
bitrates,
stream_profile: streamProfiles.find(
(profile) => profile.id == parseInt(ch.profile)
(profile) => profile.id == parseInt(ch.stream_profile)
),
};