Skip to content

Commit 34b4780

Browse files
authored
Add URL and Attribute Type to Firefox places downloads (#47)
This adds the URL field to the Firefox places download definition to save time having to cross-reference the database for the places id. It also adds an attribute type field to allow filtering out of field types if needed.
1 parent 2fe137c commit 34b4780

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

definitions/Firefox_Bookmarks.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,22 +50,29 @@ Sources:
5050
ORDER BY Bookmarks.id ASC
5151
5252
- name: Downloads
53+
Preamble: |
54+
LET DownloadTypes <= dict(`downloads/destinationFileURI`='FileURI', `downloads/destinationFileName`='Filename', `downloads/metaData`='Metadata')
55+
5356
VQL: |
54-
SELECT PlaceID, Content,
57+
SELECT PlaceID, URL, Content,
58+
get(item= DownloadTypes, field=str(str=name), default="Unknown") AS Type,
5559
timestamp(epoch=dateAdded) AS DateAdded,
5660
timestamp(epoch=lastModified) AS LastModified,
5761
OSPath
5862
FROM Rows
5963
WHERE LastModified > DateAfter AND LastModified < DateBefore
60-
AND Content =~ FilterRegex
64+
AND (URL, Content) =~ FilterRegex
6165
6266
SQL: |
6367
SELECT
6468
moz_annos.place_id AS PlaceID,
69+
moz_places.url AS URL,
6570
moz_annos.content AS Content,
71+
moz_anno_attributes.name,
6672
dateAdded,
6773
lastModified
6874
FROM moz_annos
6975
INNER JOIN moz_anno_attributes ON moz_annos.anno_attribute_id = moz_anno_attributes.id
76+
INNER JOIN moz_places ON moz_places.id = moz_annos.place_id
7077
WHERE moz_anno_attributes.name IN ('downloads/destinationFileURI','downloads/destinationFileName','downloads/metaData')
7178
ORDER BY moz_annos.dateAdded ASC

0 commit comments

Comments
 (0)