mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-07-06 21:37:47 +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:
@@ -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