mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-08-20 00:07:11 +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:
@@ -8,8 +8,11 @@ import (
|
||||
"github.com/moond4rk/hackbrowserdata/utils/sqliteutil"
|
||||
)
|
||||
|
||||
const defaultDownloadQuery = `SELECT target_path, tab_url, total_bytes, start_time, end_time,
|
||||
mime_type FROM downloads`
|
||||
const (
|
||||
defaultDownloadQuery = `SELECT target_path, tab_url, total_bytes, start_time, end_time,
|
||||
mime_type FROM downloads`
|
||||
countDownloadQuery = `SELECT COUNT(*) FROM downloads`
|
||||
)
|
||||
|
||||
func extractDownloads(path string) ([]types.DownloadEntry, error) {
|
||||
downloads, err := sqliteutil.QueryRows(path, false, defaultDownloadQuery,
|
||||
@@ -37,3 +40,7 @@ func extractDownloads(path string) ([]types.DownloadEntry, error) {
|
||||
})
|
||||
return downloads, nil
|
||||
}
|
||||
|
||||
func countDownloads(path string) (int, error) {
|
||||
return sqliteutil.CountRows(path, false, countDownloadQuery)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user