frigate icon indicating copy to clipboard operation
frigate copied to clipboard

Multiselect to remove events

Open Homas opened this issue 3 years ago • 13 comments

Describe what you are trying to accomplish and why in non technical terms I want to be able to select multiple events so that I can remove them at the same moment.

Describe the solution you'd like I want to keep the events for long period of time 90+ days and I want to be able to remove events which I'm not interested in (e.g. false positives, detections if someone from my family is on camera, e.g. working on backyard etc)

Describe alternatives you've considered You can manually delete them one by one but literally it takes time. I also considering to be able to turn off detections for some time e.g. 30 minutes or till sunset but it will require automation and dependencies on other software e.g. hass

Additional context It should be an easy fix :)

Homas avatar Oct 20 '21 20:10 Homas

2nd this request. I have a test camera in my home office, and its recorded 100's of events of me just moving a little... would love to delete them all. Or is there a command that could clear all recordings and events for a particular camera?

mgf909 avatar Nov 01 '21 06:11 mgf909

3rd this request! I have a new Frigate setup and I am regularly using up all my storage while I tune my object detection. I would prefer not to have to remove all events every time, or buy more storage for spurious events.

Once the multi-select mechanism is in place it would be fantastic if selected events could be deleted OR archived.

richardkuw avatar Nov 01 '21 21:11 richardkuw

I'm not an expert in snowpack and preact so I made a "dirty hack" and I'm not going to add that as a pull request. I hope someone will be able to make it in a better way. The changes are minimal so I hope it may make to the next official build.

I've added the following features:

  • "has clip" filter;
  • refresh page button (I didn't find a way to refresh just the table);
  • (de)select all visible events;
  • select events;
  • delete selected events;

Known issues:

  • I didn't add a new API call, so events are deleted one by one and there is no progress indicator. Depending on # of events it takes some time.
  • I didn't create a nice confirmation window and used a standard javascript dialog to confirm deletion.
  • has clip filter filter doesn't display correct value when applied.
  • refresh button, has a wrong icon. I just reused an existing icon.
  • the refresh button refreshes the whole page. It would be better to refresh just the table.
  • if all events were selected/deleted. Older events may not be loaded so you will need to refresh the page. Screenshot 2022-01-02 at 10 21 25

https://github.com/Homas/frigate/commit/9ff4866f44d6670ad145104265693fc14c9c1f84

Homas avatar Jan 02 '22 18:01 Homas

Definitely need this! Is made worse by fact you cannot locally develop (at least not for registry despatch).

You are forced into a painfully slow edit, commit, push, trigger cycle which is slow enough, and then you have to delete all those test runs (and squash your commit history)

SteveALee avatar Jan 25 '22 12:01 SteveALee

You are forced into a painfully slow edit, commit, push, trigger cycle which is slow enough, and then you have to delete all those test runs (and squash your commit history)

What are you talking about?

blakeblackshear avatar Jan 25 '22 14:01 blakeblackshear

duplicate of #2223 can you please make it happen ?

MrAlucardDante avatar Mar 14 '22 08:03 MrAlucardDante

duplicate of #2223 can you please make it happen ?

#2223 is not a duplicate of this

#2223 : Nuke all events button this one: Ability to select multiple events in the page and delete them in one go

although this properly implemented might address the needs of #2223

brilthor avatar Jun 08 '22 13:06 brilthor

Any chance this feature will make in in 0.11 ?

Nocturne2k avatar Aug 16 '22 11:08 Nocturne2k

Any chance this feature will make in in 0.11 ?

Have you used 0.11? The deleting experience is much improved as it only takes one click to delete an event.

What you see now for delete behavior in 0.11 is what will be there in final release.

NickM-27 avatar Aug 16 '22 12:08 NickM-27

Have you used 0.11? The deleting experience is much improved as it only takes one click to delete an event. What you see now for delete behavior in 0.11 is what will be there in final release.

But there is already the possibility to select a day or a week. Sometime i just want to delete a whole day because i did testing for example. So why not add a button for "Delete all shown". So you can Filter by Day, Week, whatever and delete all events from that timeframe.

Nocturne2k avatar Aug 17 '22 12:08 Nocturne2k

But there is already the possibility to select a day or a week. Sometime i just want to delete a whole day because i did testing for example. So why not add a button for "Delete all shown". So you can Filter by Day, Week, whatever and delete all events from that timeframe.

I wasn't suggesting that what is in 0.11 is the optimal solution or even considered a proper solution to this issue, just that it is much improved and much faster than 0.10.

In any case, what is in 0.11 is what will be there in the final 0.11 release

NickM-27 avatar Aug 17 '22 12:08 NickM-27

Just as sidenote:

Who is looking for a "emergency solution" to be able to delete all events, i just used xdotool to quick'n'dirty automate a mouse click every second to automatically push the delete button of frigate-events (always sitting at the same spot)

#!/bin/bash
while [ 1 ]; do
  xdotool click 1 &
  sleep 1
done

Funny to watch and saved me, although i know that this is not a "professional soution" :sweat_smile:

Looking forward to be able to e.g. do this in frigate-gui like:

  • delete all events
  • delete events older than
  • delete all events but exclude starred

SHU-red avatar Jan 15 '23 14:01 SHU-red

Is there any news about this functionality?. I think this one is required for this product. Many features but this one is missing....

rgutialo avatar Jan 24 '23 10:01 rgutialo

+1

gtxaspec avatar May 27 '23 02:05 gtxaspec

+1

Also, I noticed that if you try to delete a starred event, the confirmation window cannot be closed without agreeing. You have to refresh the page.

AMD-NICK avatar Jun 16 '23 20:06 AMD-NICK

+1

Lockie85 avatar Jul 14 '23 11:07 Lockie85

+1

dCypherNx avatar Sep 26 '23 21:09 dCypherNx

+1

iayanpahwa avatar Oct 04 '23 19:10 iayanpahwa

Sorry @NickM-27 for duplicating this request! Adding my request here, in addition, not sure if this would be a different request, but adding this to the Frigate+ Images interface would be the cats b-hole as well. ;)

superdong69 avatar Oct 07 '23 13:10 superdong69

@AMD-NICK why did you downvote the +1 above your post then +1 yourself?

Also why are people downvoting +1s (upvotes) in general. Seems odd.

Lockie85 avatar Oct 07 '23 13:10 Lockie85

@AMD-NICK why did you downvote the +1 above your post then +1 yourself?

Also why are people downvoting +1s (upvotes) in general. Seems odd.

idk, I think it was a miss click. Fixed

AMD-NICK avatar Oct 10 '23 17:10 AMD-NICK

Adding my 'please' to this feature request. :-)

One camera in a Warehouse that only records when the security system is armed produces tens of false positives every night (hundreds over a week). Therefore, it would be great to have check-boxes and a 'Select all' to be able to quickly delete unwanted events and save storage space. (I've tried tweaking detection sizes and creating masks/zones, but the contents change and move so often it's a bit of a lost cause... or beyond my ability to tune!)

I get pages and pages of events like this: image

jasonpstokes avatar Nov 27 '23 21:11 jasonpstokes

Bump, a solution please.

sochartgit avatar Dec 19 '23 14:12 sochartgit

I know it's not the solution we want, but I put together a little script to loop through the events and simulate a click to delete them:

const bulkDelete = async (max = Infinity, timeout = 250) => {
    try {
        const getEvent = async () => {
            await new Promise(r => setTimeout(r, timeout));
    
            const events = document.getElementsByClassName('flex bg-slate-100 dark:bg-slate-800 rounded cursor-pointer min-w-[330px]');
    
            if (!events) return undefined;
            if (events.length === 0) return undefined;
            return events[0];
        }
      
    
        let event = getEvent();
        let i = 1;
        while (event && i <= max) {
            console.log(`deleting event number ${i}`);
            event.childNodes[1].childNodes[2].childNodes[0].dispatchEvent(new Event('click'));
            event = await getEvent();
            i = i + 1;
        }
    } catch (error) {
        console.log('error: ', error);
    }
}

And then call it like:

await bulkDelete() // note that you can setup a limit of events to delete and the ~time between clicks

Tintef avatar Dec 28 '23 01:12 Tintef

bump. have hundreds id like to delete and have to do it one by one.

moogoos avatar Jan 15 '24 03:01 moogoos

+1

tclemos avatar Feb 08 '24 02:02 tclemos

Must be one of the most requested features and seemingly not that complex. Curious why this hasn't been implemented yet!

fwiw +1

hapklaar avatar Mar 19 '24 15:03 hapklaar

The UI is currently being rewritten for 0.14 and multiselect to remove has been implemented, closing https://github.com/blakeblackshear/frigate/pull/10161

NickM-27 avatar Mar 19 '24 15:03 NickM-27

In the meantime, I just created a script to do this. It's not fast, but it works:

https://github.com/blakeblackshear/frigate/assets/1627178/7a981947-d490-4ba2-9dab-a8c155f05acd

You can fins this script and the instructions here. Hope you find it useful!

mattogodoy avatar Apr 16 '24 15:04 mattogodoy

I was looking for this, made simple trick:

#!/bin/bash

events=$(curl -s http://localhost:5000/api/events)

echo $events | jq -c '.[]' | while read -r event; do
    id=$(echo $event | jq -r '.id')
    response=$(curl -s -o /dev/null -w "%{http_code}" -X DELETE "http://localhost:5000/api/events/$id")
    if [ "$response" -eq 200 ]; then
        echo "Deleted event with ID: $id"
    else
        echo "Failed to delete event with ID: $id, Status: $response"
    fi
done

matheusfbraga avatar Jun 03 '24 01:06 matheusfbraga