Selective history deletion

Get help with all aspects of SABnzbd

Selective history deletion

Postby dcuritois » April 21st, 2012, 9:12 am

If you want to remove certain items (say everything that matches "potato") is there an easy way to do it?
It becomes a bit tiresome moving the mouse all the way to the right to click on delete, and then left to click on remove and then back to the right and then back to the middle etc etc
dcuritois
Jr. Member
Jr. Member
 
Posts: 58
Joined: February 15th, 2012, 5:54 pm

Re: Selective history deletion

Postby sander » April 21st, 2012, 9:20 am

rm *potato*
mv *potato*

details depend on operating system
User avatar
sander
Release Testers
Release Testers
 
Posts: 3481
Joined: January 22nd, 2008, 3:22 pm

Re: Selective history deletion

Postby Handyman1984 » April 21st, 2012, 12:44 pm

I think dcuritois means in the plush skin sander.

It's not a solution, but:
You can also use your keyboard to navigate. Especially [Tab] and [Enter] might help you, combined with the mouse...
Handyman1984
Newbie
Newbie
 
Posts: 24
Joined: April 11th, 2012, 6:20 am

Re: Selective history deletion

Postby dcuritois » April 22nd, 2012, 10:39 am

Handyman1984 wrote:I think dcuritois means in the plush skin sander.



Heh, yeah I didn't understand that at all.

I thought sabnzbd was just the interface running in the browser, but it is more?

Handyman1984 wrote:It's not a solution, but:
You can also use your keyboard to navigate. Especially [Tab] and [Enter] might help you, combined with the mouse...


Thanks for the tip.

Is the information stored in a database one is expected to handle by external means?
dcuritois
Jr. Member
Jr. Member
 
Posts: 58
Joined: February 15th, 2012, 5:54 pm

Re: Selective history deletion

Postby sander » April 22nd, 2012, 10:52 am

dcuritois wrote:
Is the information stored in a database


Yes, the download history is stored in a SQLite3 database. The file is called history1.db

dcuritois wrote:... one is expected to handle by external means?


I would say no. However, you *can* ...
So if you know what you're doing, and you speak SQL, you could access that file. You could use sqlitebrowser (see http://sqlitebrowser.sourceforge.net/ ) for that.
User avatar
sander
Release Testers
Release Testers
 
Posts: 3481
Joined: January 22nd, 2008, 3:22 pm

Re: Selective history deletion

Postby dcuritois » April 22nd, 2012, 10:59 am

Yeah, I don't know what I'm doing, so I guess I better not.
dcuritois
Jr. Member
Jr. Member
 
Posts: 58
Joined: February 15th, 2012, 5:54 pm

Re: Selective history deletion

Postby sander » April 22nd, 2012, 11:37 am

dcuritois wrote:Yeah, I don't know what I'm doing, so I guess I better not.


:D

SQL is new to me, so I tried a few things from sqlitebrowser.These are the command I used:

Code: Select all
SELECT *
FROM history
WHERE name LIKE "%2012%"

DELETE FROM history
WHERE name LIKE "%2012%"


... meaning: find all downloads that have "2012" in the name. The second command is the delete command. It works. Cool.

Hey, and it also works from the command line:

Code: Select all
sander@R540:~/.sabnzbd/admin$ sqlite3 testje.db  "SELECT * FROM history WHERE name LIKE '%2010%' ;" | wc -l
10

sander@R540:~/.sabnzbd/admin$ sqlite3 testje.db  "DELETE FROM history WHERE name LIKE '%2010%' ;" | wc -l
0

sander@R540:~/.sabnzbd/admin$ sqlite3 testje.db  "SELECT * FROM history WHERE name LIKE '%2010%' ;" | wc -l
0

sander@R540:~/.sabnzbd/admin$


Explanation:
The first command looks up all downloads with "2010" in the name. There are 10 lines of output.
The second command deletes those downloads from the history
The third command shows that those entries are really deleted.

FYI: testje.db is a copy of SAB's history1.db

So this way you can select certain downloads (in this case: based on a word in the download), and delete them.

HTH
User avatar
sander
Release Testers
Release Testers
 
Posts: 3481
Joined: January 22nd, 2008, 3:22 pm

Re: Selective history deletion

Postby dcuritois » April 23rd, 2012, 9:28 am

Oh, that's very cool sander - I'll have to give that a shot :)

Thanks!
dcuritois
Jr. Member
Jr. Member
 
Posts: 58
Joined: February 15th, 2012, 5:54 pm


Return to General Help