fix: Expose gallery and media views as media type agnostic (#2335)

This commit is contained in:
Dermot Duffy
2026-02-08 08:04:11 -08:00
committed by GitHub
parent 0a099b95f7
commit 21f9469784
22 changed files with 363 additions and 238 deletions
+2
View File
@@ -91,8 +91,10 @@ export class ActionFactory {
case 'clips':
case 'folder':
case 'folders':
case 'gallery':
case 'image':
case 'live':
case 'media':
case 'recording':
case 'recordings':
case 'review':
@@ -131,10 +131,16 @@ export class QueryStringManager {
case 'clip':
case 'clips':
case 'diagnostics':
case 'folder':
case 'folders':
case 'gallery':
case 'image':
case 'live':
case 'media':
case 'recording':
case 'recordings':
case 'review':
case 'reviews':
case 'snapshot':
case 'snapshots':
case 'timeline':
@@ -159,10 +165,16 @@ export class QueryStringManager {
case 'clip':
case 'clips':
case 'diagnostics':
case 'folder':
case 'folders':
case 'gallery':
case 'image':
case 'live':
case 'media':
case 'recording':
case 'recordings':
case 'review':
case 'reviews':
case 'snapshot':
case 'snapshots':
case 'timeline':
@@ -105,23 +105,30 @@ export class ViewQueryExecutor {
const cameraForQuery = view.isGrid() ? undefined : view.camera;
const getDefaultQueryModifiers = async () => {
const query = builder.buildDefaultCameraQuery(cameraForQuery, {
limit: this._getLimit(),
});
return await executeQuery(query);
};
switch (view.view) {
case 'live':
if (config.live.controls.thumbnails.mode !== 'none') {
const defaultQuery = builder.buildDefaultCameraQuery(cameraForQuery);
if (defaultQuery) {
viewModifiers.push(...(await executeQuery(defaultQuery)));
}
viewModifiers.push(...(await getDefaultQueryModifiers()));
}
break;
case 'timeline':
// Timeline view always queries all cameras with media capabilities.
viewModifiers.push(...(await executeQuery(builder.buildDefaultCameraQuery())));
break;
case 'gallery':
case 'media':
// If the user is looking at media in the `media` view and then
// changes camera (via the menu) it should default to showing clips
// for the new camera.
// If the user is looking at media in the `media` view and then changes
// camera (via the menu) it should default to the default camera media
// type.
viewModifiers.push(...(await getDefaultQueryModifiers()));
break;
case 'clip':
case 'clips':
viewModifiers.push(