Media query extension should still honor time start/end.
This commit is contained in:
@@ -268,25 +268,22 @@ export class CameraManager {
|
|||||||
const newChunkQueries: T[] = [];
|
const newChunkQueries: T[] = [];
|
||||||
|
|
||||||
// The re-constituted combined query.
|
// The re-constituted combined query.
|
||||||
const newCombinedQueries: T[] = [];
|
const extendedQueries: T[] = [];
|
||||||
|
|
||||||
for (const query of queries) {
|
for (const query of queries) {
|
||||||
const newChunkQuery = { ...query };
|
const newChunkQuery = { ...query };
|
||||||
const newCombinedQuery = { ...query };
|
|
||||||
|
|
||||||
if (direction === 'later') {
|
if (direction === 'later') {
|
||||||
newChunkQuery.start = getTimeFromResults('latest') ?? undefined;
|
newChunkQuery.start = getTimeFromResults('latest') ?? undefined;
|
||||||
newChunkQuery.end = undefined;
|
|
||||||
newCombinedQuery.end = undefined;
|
|
||||||
} else if (direction === 'earlier') {
|
} else if (direction === 'earlier') {
|
||||||
newChunkQuery.end = getTimeFromResults('earliest') ?? undefined;
|
newChunkQuery.end = getTimeFromResults('earliest') ?? undefined;
|
||||||
newChunkQuery.start = undefined;
|
|
||||||
newCombinedQuery.start = undefined;
|
|
||||||
}
|
}
|
||||||
newChunkQuery.limit = chunkSize;
|
newChunkQuery.limit = chunkSize;
|
||||||
newCombinedQuery.limit = (query.limit ?? 0) + chunkSize;
|
|
||||||
|
|
||||||
newCombinedQueries.push(newCombinedQuery);
|
extendedQueries.push({
|
||||||
|
...query,
|
||||||
|
limit: (query.limit ?? 0) + chunkSize,
|
||||||
|
});
|
||||||
newChunkQueries.push(newChunkQuery);
|
newChunkQueries.push(newChunkQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,7 +296,7 @@ export class CameraManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
queries: newCombinedQueries,
|
queries: extendedQueries,
|
||||||
results: this._sortMedia(results.concat(newChunkMedia)),
|
results: this._sortMedia(results.concat(newChunkMedia)),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user