pihole_adlist_tool icon indicating copy to clipboard operation
pihole_adlist_tool copied to clipboard

Add assigned group(s) for adlist in result

Open thomasmerz opened this issue 3 years ago • 3 comments

It would really be nice to have the assigned group for each adlist also in the resulting table in addition to "id, enabled, total_domains, domains_covered, hits_covered, unique_domains_covered, address" which should also be sortable:

# sqlite3 ./gravity.db "select * from 'group'"
0|1|Default|1604414479|1614120328|The default group
22|1|adult-content|1614119689|1614120454|
23|1|test-group|1637245963|1637245963|for testing before going in production

# sqlite3 ./gravity.db "select * from adlist_by_group order by 1"
1|0
5|0
13|0
19|0
20|0
21|0
23|0
27|0
28|0
30|0
32|0
33|0
34|0
35|0
37|0
42|22
43|0
59|0
60|0
62|0
63|0
64|0
67|0
68|0
69|0
71|22
72|22
73|22
74|0
77|22
80|22
81|22
82|22
82|23
83|0
84|0
85|0
87|0
88|22
89|0
90|0

If I find some time, I will make a PR and tell you when I'm starting before you're also trying to add this enhancement.

thomasmerz avatar Mar 21 '23 14:03 thomasmerz

This would make such "documentation" / grouping much easier ❤️

thomasmerz avatar Mar 21 '23 15:03 thomasmerz

The problem I see: the number of assigned groups is unpredictable - we can end up in a veeeery long list.

yubiuser avatar Mar 21 '23 20:03 yubiuser

Maybe or maybe not 🤔 I can't think of a usecase to have more groups than adlists oder clients. For example I've only 2 additional groups: one for testing new adliste before adding to the default group and one for the kids. I'll think about a PR as a prototype for this. Maybe as an optional parameter?

thomasmerz avatar Mar 22 '23 11:03 thomasmerz