Allow live thumbnails to load recordings .

This commit is contained in:
Dermot Duffy
2024-02-03 14:23:49 -08:00
parent 3398670b44
commit 93a475c7f4
18 changed files with 295 additions and 101 deletions
+100
View File
@@ -1590,5 +1590,105 @@ describe('should handle version specific upgrades', () => {
});
});
});
describe('should rename thumbnails.media to thumbnails.events_media_type', () => {
it.each([['all' as const], ['clips' as const], ['snapshots' as const]])(
'%s',
(mediaEventType: string) => {
const config = {
live: {
controls: {
thumbnails: {
media: mediaEventType,
},
},
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
live: {
controls: {
thumbnails: {
events_media_type: mediaEventType,
},
},
},
});
},
);
});
describe('should rename timeline.media to timeline.events_media_type', () => {
it.each([['all' as const], ['clips' as const], ['snapshots' as const]])(
'%s',
(mediaEventType: string) => {
const config = {
timeline: {
media: mediaEventType,
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
timeline: {
events_media_type: mediaEventType,
},
});
},
);
});
describe('should rename live.controls.timeline.media to live.controls.timeline.events_media_type', () => {
it.each([['all' as const], ['clips' as const], ['snapshots' as const]])(
'%s',
(mediaEventType: string) => {
const config = {
live: {
controls: {
timeline: {
media: mediaEventType,
},
},
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
live: {
controls: {
timeline: {
events_media_type: mediaEventType,
},
},
},
});
},
);
});
describe('should rename media_viewer.controls.timeline.media to media_viewer.controls.timeline.events_media_type', () => {
it.each([['all' as const], ['clips' as const], ['snapshots' as const]])(
'%s',
(mediaEventType: string) => {
const config = {
media_viewer: {
controls: {
timeline: {
media: mediaEventType,
},
},
},
};
expect(upgradeConfig(config)).toBeTruthy();
expect(config).toEqual({
media_viewer: {
controls: {
timeline: {
events_media_type: mediaEventType,
},
},
},
});
},
);
});
});
});
+5 -4
View File
@@ -77,7 +77,8 @@ describe('config defaults', () => {
position: 'bottom-right',
},
thumbnails: {
media: 'all',
media_type: 'events',
events_media_type: 'all',
mode: 'right',
show_details: true,
show_download_control: true,
@@ -87,7 +88,7 @@ describe('config defaults', () => {
},
timeline: {
clustering_threshold: 3,
media: 'all',
events_media_type: 'all',
mode: 'none',
show_recordings: true,
style: 'ribbon',
@@ -143,7 +144,7 @@ describe('config defaults', () => {
},
timeline: {
clustering_threshold: 3,
media: 'all',
events_media_type: 'all',
mode: 'none',
show_recordings: true,
style: 'ribbon',
@@ -268,7 +269,7 @@ describe('config defaults', () => {
size: 100,
},
},
media: 'all',
events_media_type: 'all',
show_recordings: true,
style: 'stack',
window_seconds: 3600,
+2 -2
View File
@@ -101,7 +101,7 @@ describe('changeViewToRecentEventsForCameraAndDependents', () => {
{},
createView(),
{
mediaType: 'clips',
eventsMediaType: 'clips',
},
);
expect(elementHandler.viewHandler).not.toBeCalled();
@@ -222,7 +222,7 @@ describe('changeViewToRecentEventsForCameraAndDependents', () => {
{},
createView(),
{
mediaType: mediaType,
eventsMediaType: mediaType,
},
);