feat: add CountEntries to skip decryption for list --detail (#562)

* feat: add CountEntries to skip decryption for list --detail (#549)
* test: add CountEntries and countCategory tests at browser level
* fix: address review feedback on CountRows and countLocalStorage
* test: add CountRows unit tests
This commit is contained in:
Roger
2026-04-07 22:28:39 +08:00
committed by GitHub
parent 5f42d4fe5f
commit b3bbc0dadf
40 changed files with 1009 additions and 101 deletions
+13 -3
View File
@@ -11,9 +11,15 @@ import (
"github.com/moond4rk/hackbrowserdata/utils/sqliteutil"
)
const firefoxDownloadQuery = `SELECT place_id, GROUP_CONCAT(content), url, dateAdded
FROM (SELECT * FROM moz_annos INNER JOIN moz_places ON moz_annos.place_id=moz_places.id)
t GROUP BY place_id`
const (
firefoxDownloadQuery = `SELECT place_id, GROUP_CONCAT(content), url, dateAdded
FROM (SELECT * FROM moz_annos INNER JOIN moz_places ON moz_annos.place_id=moz_places.id)
t GROUP BY place_id`
firefoxCountDownloadQuery = `SELECT COUNT(*) FROM
(SELECT place_id FROM moz_annos
INNER JOIN moz_places ON moz_annos.place_id=moz_places.id
GROUP BY place_id)`
)
func extractDownloads(path string) ([]types.DownloadEntry, error) {
downloads, err := sqliteutil.QueryRows(path, true, firefoxDownloadQuery,
@@ -52,3 +58,7 @@ func extractDownloads(path string) ([]types.DownloadEntry, error) {
})
return downloads, nil
}
func countDownloads(path string) (int, error) {
return sqliteutil.CountRows(path, true, firefoxCountDownloadQuery)
}