dcuritois wrote:Yeah, I don't know what I'm doing, so I guess I better not.
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