Add vw_adlists view which returns only enabled adlists

Signed-off-by: DL6ER <dl6er@dl6er.de>
pull/2611/head
DL6ER 5 years ago
parent 53e3ff2b24
commit bd0215524b
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

@ -20,6 +20,10 @@ CREATE VIEW vw_whitelist AS SELECT DISTINCT a.domain
FROM whitelist a
WHERE a.enabled == 1;
CREATE VIEW vw_regex AS SELECT DISTINCT a.filter
CREATE VIEW vw_regex AS SELECT DISTINCT a.domain
FROM regex a
WHERE a.enabled == 1;
CREATE VIEW vw_adlists AS SELECT DISTINCT a.address
FROM adlists a
WHERE a.enabled == 1;

@ -238,7 +238,7 @@ gravity_GetBlocklistUrls() {
# Retrieve source URLs from gravity database
# We source only enabled adlists, sqlite3 stores boolean values as 0 (false) or 1 (true)
mapfile -t sources <<< "$(sqlite3 "${gravityDBfile}" "SELECT address FROM adlists WHERE enabled = 1;" 2> /dev/null)"
mapfile -t sources <<< "$(sqlite3 "${gravityDBfile}" "SELECT address FROM vw_adlists;" 2> /dev/null)"
# Parse source domains from $sources
mapfile -t sourceDomains <<< "$(

Loading…
Cancel
Save