mirror of
https://github.com/moonD4rk/HackBrowserData.git
synced 2026-05-27 19:22:22 +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,12 @@ import (
|
||||
"github.com/moond4rk/hackbrowserdata/utils/sqliteutil"
|
||||
)
|
||||
|
||||
const firefoxBookmarkQuery = `SELECT id, url, type, dateAdded, COALESCE(title, '')
|
||||
FROM (SELECT * FROM moz_bookmarks INNER JOIN moz_places ON moz_bookmarks.fk=moz_places.id)`
|
||||
const (
|
||||
firefoxBookmarkQuery = `SELECT id, url, type, dateAdded, COALESCE(title, '')
|
||||
FROM (SELECT * FROM moz_bookmarks INNER JOIN moz_places ON moz_bookmarks.fk=moz_places.id)`
|
||||
firefoxCountBookmarkQuery = `SELECT COUNT(*) FROM moz_bookmarks
|
||||
INNER JOIN moz_places ON moz_bookmarks.fk=moz_places.id`
|
||||
)
|
||||
|
||||
func extractBookmarks(path string) ([]types.BookmarkEntry, error) {
|
||||
bookmarks, err := sqliteutil.QueryRows(path, true, firefoxBookmarkQuery,
|
||||
@@ -45,3 +49,7 @@ func bookmarkType(bt int64) string {
|
||||
return "folder"
|
||||
}
|
||||
}
|
||||
|
||||
func countBookmarks(path string) (int, error) {
|
||||
return sqliteutil.CountRows(path, true, firefoxCountBookmarkQuery)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user