Improve camera names.

This commit is contained in:
Dermot Duffy
2022-04-23 15:22:33 -07:00
parent f8784bfc32
commit 36aed76878
2 changed files with 5 additions and 15 deletions
+2 -2
View File
@@ -176,14 +176,14 @@ export class BrowseMediaUtil {
): number => { ): number => {
if ( if (
!a.frigate?.event || !a.frigate?.event ||
(b.frigate?.event && b.frigate.event.start_time < a.frigate.event.start_time) (b.frigate?.event && b.frigate.event.start_time > a.frigate.event.start_time)
) { ) {
return 1; return 1;
} }
if ( if (
!b.frigate?.event || !b.frigate?.event ||
(a.frigate?.event && b.frigate.event.start_time > a.frigate.event.start_time) (a.frigate?.event && b.frigate.event.start_time < a.frigate.event.start_time)
) { ) {
return -1; return -1;
} }
+3 -13
View File
@@ -497,20 +497,10 @@ export function getCameraTitle(
// used on raw configuration in the editor. // used on raw configuration in the editor.
return ( return (
(typeof config?.title === 'string' && config.title) || (typeof config?.title === 'string' && config.title) ||
(typeof config?.camera_entity === 'string' ? getEntityTitle(hass, config.camera_entity) : '') ||
(typeof config?.webrtc_card === 'object' && config.webrtc_card && typeof config.webrtc_card['entity'] === 'string' && config.webrtc_card['entity']) ||
(typeof config?.camera_name === 'string' ? prettifyFrigateName(config.camera_name) : '') ||
(typeof config?.id === 'string' && config.id) || (typeof config?.id === 'string' && config.id) ||
[
typeof config?.camera_entity === 'string'
? getEntityTitle(hass, config.camera_entity)
: '',
typeof config?.client_id === 'string' ? config.client_id : '',
typeof config?.camera_name === 'string'
? prettifyFrigateName(config.camera_name)
: '',
typeof config?.label === 'string' ? prettifyFrigateName(config.label) : '',
typeof config?.zone === 'string' ? prettifyFrigateName(config.zone) : '',
]
.filter(Boolean)
.join(' / ') ||
'' ''
); );
} }