Selective history deletion

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
dcuritois
Jr. Member
Jr. Member
Posts: 58
Joined: February 15th, 2012, 4:54 pm

Selective history deletion

Post by dcuritois »

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
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Selective history deletion

Post by sander »

rm *potato*
mv *potato*

details depend on operating system
Handyman1984
Newbie
Newbie
Posts: 24
Joined: April 11th, 2012, 5:20 am

Re: Selective history deletion

Post by Handyman1984 »

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...
dcuritois
Jr. Member
Jr. Member
Posts: 58
Joined: February 15th, 2012, 4:54 pm

Re: Selective history deletion

Post by dcuritois »

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?
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Selective history deletion

Post by sander »

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.
dcuritois
Jr. Member
Jr. Member
Posts: 58
Joined: February 15th, 2012, 4:54 pm

Re: Selective history deletion

Post by dcuritois »

Yeah, I don't know what I'm doing, so I guess I better not.
User avatar
sander
Release Testers
Release Testers
Posts: 9429
Joined: January 22nd, 2008, 2:22 pm

Re: Selective history deletion

Post by sander »

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
dcuritois
Jr. Member
Jr. Member
Posts: 58
Joined: February 15th, 2012, 4:54 pm

Re: Selective history deletion

Post by dcuritois »

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

Thanks!
Post Reply