mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
Fix reviewed filter (#10039)
This commit is contained in:
parent
4e5546cc78
commit
7b11ff1af6
@ -2426,7 +2426,7 @@ def review():
|
||||
label_clause = reduce(operator.or_, label_clauses)
|
||||
clauses.append((label_clause))
|
||||
|
||||
if reviewed == 1:
|
||||
if reviewed == 0:
|
||||
clauses.append((ReviewSegment.has_been_reviewed == False))
|
||||
|
||||
if severity:
|
||||
|
@ -90,7 +90,7 @@ export default function ReviewFilterGroup({
|
||||
updateLabelFilter={(newLabels) => {
|
||||
onUpdateFilter({ ...filter, labels: newLabels });
|
||||
}}
|
||||
showReviewed={filter?.showReviewed || false}
|
||||
showReviewed={filter?.showReviewed || 0}
|
||||
setShowReviewed={(reviewed) =>
|
||||
onUpdateFilter({ ...filter, showReviewed: reviewed })
|
||||
}
|
||||
@ -228,8 +228,8 @@ type GeneralFilterButtonProps = {
|
||||
allLabels: string[];
|
||||
selectedLabels: string[] | undefined;
|
||||
updateLabelFilter: (labels: string[] | undefined) => void;
|
||||
showReviewed: boolean;
|
||||
setShowReviewed: (reviewed: boolean) => void;
|
||||
showReviewed?: 0 | 1;
|
||||
setShowReviewed: (reviewed?: 0 | 1) => void;
|
||||
};
|
||||
function GeneralFilterButton({
|
||||
allLabels,
|
||||
@ -256,7 +256,7 @@ function GeneralFilterButton({
|
||||
<Button
|
||||
className="capitalize flex justify-between items-center cursor-pointer w-full"
|
||||
variant="secondary"
|
||||
onClick={(_) => setShowReviewed(!showReviewed)}
|
||||
onClick={(_) => setShowReviewed(showReviewed == 0 ? 1 : 0)}
|
||||
>
|
||||
{showReviewed ? (
|
||||
<LuCheck className="w-6 h-6" />
|
||||
|
@ -22,9 +22,9 @@ export default function Events() {
|
||||
useApiFilter<ReviewFilter>();
|
||||
|
||||
const onUpdateFilter = useCallback((newFilter: ReviewFilter) => {
|
||||
setSize(1);
|
||||
setReviewFilter(newFilter);
|
||||
}, [])
|
||||
setSize(1);
|
||||
setReviewFilter(newFilter);
|
||||
}, []);
|
||||
|
||||
// review paging
|
||||
|
||||
@ -45,7 +45,7 @@ export default function Events() {
|
||||
const pagedParams = {
|
||||
cameras: reviewSearchParams["cameras"],
|
||||
labels: reviewSearchParams["labels"],
|
||||
reviewed: reviewSearchParams["showReviewed"] == true ? 1 : 0,
|
||||
reviewed: reviewSearchParams["showReviewed"],
|
||||
before: lastDate,
|
||||
after: reviewSearchParams["after"] || timeRange.after,
|
||||
limit: API_LIMIT,
|
||||
@ -56,7 +56,7 @@ export default function Events() {
|
||||
const params = {
|
||||
cameras: reviewSearchParams["cameras"],
|
||||
labels: reviewSearchParams["labels"],
|
||||
reviewed: reviewSearchParams["showReviewed"] == true ? 1 : 0,
|
||||
reviewed: reviewSearchParams["showReviewed"],
|
||||
limit: API_LIMIT,
|
||||
before: reviewSearchParams["before"] || timeRange.before,
|
||||
after: reviewSearchParams["after"] || timeRange.after,
|
||||
|
@ -25,5 +25,5 @@ export type ReviewFilter = {
|
||||
labels?: string[];
|
||||
before?: number;
|
||||
after?: number;
|
||||
showReviewed?: boolean;
|
||||
showReviewed?: 0 | 1;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user