mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-10-13 03:37:12 +02:00
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:
1 parent
5f42d4fe5f
commit
b3bbc0dadf
40 files changed
+1009
-101
No files matched your search
@@ -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)
|
||||
}
|
||||
Reference in new issue
Block a user