fix: Reolink metadata should not reject media with labels (#1900)

- Related to: #1870
This commit is contained in:
Dermot Duffy
2025-02-17 20:13:21 -08:00
committed by GitHub
parent c66c3ec919
commit bb147a45fd
6 changed files with 128 additions and 33 deletions
@@ -143,6 +143,28 @@ const TEST_FILES: BrowseMedia = {
can_expand: false,
thumbnail: null,
},
{
title: '21:35:05 0:00:41 Zebra Person Vehicle',
media_class: 'video',
media_content_type: 'video',
media_content_id:
'media-source://reolink/FILE|01J8XHYTNH77WE3C654K03KX1F|0|sub|Rec_20241105_052905_211_S.mp4',
children_media_class: null,
can_play: true,
can_expand: false,
thumbnail: null,
},
{
title: '21:37:00',
media_class: 'video',
media_content_type: 'video',
media_content_id:
'media-source://reolink/FILE|01J8XHYTNH77WE3C654K03KX1F|0|sub|Rec_20241105_052905_211_S.mp4',
children_media_class: null,
can_play: true,
can_expand: false,
thumbnail: null,
},
{
title: '22:04:49 0:00:35',
media_class: 'video',
@@ -363,6 +385,39 @@ describe('ReolinkCameraManagerEngine', () => {
},
{
browseMedia: [
{
_metadata: {
cameraID: 'office',
startDate: new Date('2024-11-04T21:37:00.000Z'),
endDate: new Date('2024-11-04T21:37:00.000Z'),
},
can_expand: false,
can_play: true,
children_media_class: null,
media_class: 'video',
media_content_id:
'media-source://reolink/FILE|01J8XHYTNH77WE3C654K03KX1F|0|sub|Rec_20241105_052905_211_S.mp4',
media_content_type: 'video',
thumbnail: null,
title: '21:37:00',
},
{
_metadata: {
cameraID: 'office',
endDate: new Date('2024-11-04T21:35:46.000Z'),
startDate: new Date('2024-11-04T21:35:05.000Z'),
what: ['person', 'vehicle', 'zebra'],
},
can_expand: false,
can_play: true,
children_media_class: null,
media_class: 'video',
media_content_id:
'media-source://reolink/FILE|01J8XHYTNH77WE3C654K03KX1F|0|sub|Rec_20241105_052905_211_S.mp4',
media_content_type: 'video',
thumbnail: null,
title: '21:35:05 0:00:41 Zebra Person Vehicle',
},
{
_metadata: {
cameraID: 'office',
@@ -720,8 +775,8 @@ describe('ReolinkCameraManagerEngine', () => {
thumbnail: null,
children: [
{
// Title not matching format.
title: '21:23:53 0:00:34 _____MALFORMED_____',
// Title has invalid title (should be timestamp).
title: 'AA:BB:CC',
media_class: 'video',
media_content_type: 'video',
media_content_id: