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)
|
label_clause = reduce(operator.or_, label_clauses)
|
||||||
clauses.append((label_clause))
|
clauses.append((label_clause))
|
||||||
|
|
||||||
if reviewed == 1:
|
if reviewed == 0:
|
||||||
clauses.append((ReviewSegment.has_been_reviewed == False))
|
clauses.append((ReviewSegment.has_been_reviewed == False))
|
||||||
|
|
||||||
if severity:
|
if severity:
|
||||||
|
@ -90,7 +90,7 @@ export default function ReviewFilterGroup({
|
|||||||
updateLabelFilter={(newLabels) => {
|
updateLabelFilter={(newLabels) => {
|
||||||
onUpdateFilter({ ...filter, labels: newLabels });
|
onUpdateFilter({ ...filter, labels: newLabels });
|
||||||
}}
|
}}
|
||||||
showReviewed={filter?.showReviewed || false}
|
showReviewed={filter?.showReviewed || 0}
|
||||||
setShowReviewed={(reviewed) =>
|
setShowReviewed={(reviewed) =>
|
||||||
onUpdateFilter({ ...filter, showReviewed: reviewed })
|
onUpdateFilter({ ...filter, showReviewed: reviewed })
|
||||||
}
|
}
|
||||||
@ -228,8 +228,8 @@ type GeneralFilterButtonProps = {
|
|||||||
allLabels: string[];
|
allLabels: string[];
|
||||||
selectedLabels: string[] | undefined;
|
selectedLabels: string[] | undefined;
|
||||||
updateLabelFilter: (labels: string[] | undefined) => void;
|
updateLabelFilter: (labels: string[] | undefined) => void;
|
||||||
showReviewed: boolean;
|
showReviewed?: 0 | 1;
|
||||||
setShowReviewed: (reviewed: boolean) => void;
|
setShowReviewed: (reviewed?: 0 | 1) => void;
|
||||||
};
|
};
|
||||||
function GeneralFilterButton({
|
function GeneralFilterButton({
|
||||||
allLabels,
|
allLabels,
|
||||||
@ -256,7 +256,7 @@ function GeneralFilterButton({
|
|||||||
<Button
|
<Button
|
||||||
className="capitalize flex justify-between items-center cursor-pointer w-full"
|
className="capitalize flex justify-between items-center cursor-pointer w-full"
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
onClick={(_) => setShowReviewed(!showReviewed)}
|
onClick={(_) => setShowReviewed(showReviewed == 0 ? 1 : 0)}
|
||||||
>
|
>
|
||||||
{showReviewed ? (
|
{showReviewed ? (
|
||||||
<LuCheck className="w-6 h-6" />
|
<LuCheck className="w-6 h-6" />
|
||||||
|
@ -22,9 +22,9 @@ export default function Events() {
|
|||||||
useApiFilter<ReviewFilter>();
|
useApiFilter<ReviewFilter>();
|
||||||
|
|
||||||
const onUpdateFilter = useCallback((newFilter: ReviewFilter) => {
|
const onUpdateFilter = useCallback((newFilter: ReviewFilter) => {
|
||||||
setSize(1);
|
setSize(1);
|
||||||
setReviewFilter(newFilter);
|
setReviewFilter(newFilter);
|
||||||
}, [])
|
}, []);
|
||||||
|
|
||||||
// review paging
|
// review paging
|
||||||
|
|
||||||
@ -45,7 +45,7 @@ export default function Events() {
|
|||||||
const pagedParams = {
|
const pagedParams = {
|
||||||
cameras: reviewSearchParams["cameras"],
|
cameras: reviewSearchParams["cameras"],
|
||||||
labels: reviewSearchParams["labels"],
|
labels: reviewSearchParams["labels"],
|
||||||
reviewed: reviewSearchParams["showReviewed"] == true ? 1 : 0,
|
reviewed: reviewSearchParams["showReviewed"],
|
||||||
before: lastDate,
|
before: lastDate,
|
||||||
after: reviewSearchParams["after"] || timeRange.after,
|
after: reviewSearchParams["after"] || timeRange.after,
|
||||||
limit: API_LIMIT,
|
limit: API_LIMIT,
|
||||||
@ -56,7 +56,7 @@ export default function Events() {
|
|||||||
const params = {
|
const params = {
|
||||||
cameras: reviewSearchParams["cameras"],
|
cameras: reviewSearchParams["cameras"],
|
||||||
labels: reviewSearchParams["labels"],
|
labels: reviewSearchParams["labels"],
|
||||||
reviewed: reviewSearchParams["showReviewed"] == true ? 1 : 0,
|
reviewed: reviewSearchParams["showReviewed"],
|
||||||
limit: API_LIMIT,
|
limit: API_LIMIT,
|
||||||
before: reviewSearchParams["before"] || timeRange.before,
|
before: reviewSearchParams["before"] || timeRange.before,
|
||||||
after: reviewSearchParams["after"] || timeRange.after,
|
after: reviewSearchParams["after"] || timeRange.after,
|
||||||
|
@ -25,5 +25,5 @@ export type ReviewFilter = {
|
|||||||
labels?: string[];
|
labels?: string[];
|
||||||
before?: number;
|
before?: number;
|
||||||
after?: number;
|
after?: number;
|
||||||
showReviewed?: boolean;
|
showReviewed?: 0 | 1;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user