Improve camera names.
This commit is contained in:
@@ -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
@@ -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(' / ') ||
|
|
||||||
''
|
''
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user