Skip to content

Commit

Permalink
Fix bug involving "Recently Deleted" and "Notes" folders
Browse files Browse the repository at this point in the history
  • Loading branch information
sballin committed Jun 11, 2020
1 parent 3e9ddfc commit 166f699
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 3 additions & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -680,8 +680,10 @@ or create note</string>
<key>sortByDate</key>
<string>1</string>
</dict>
<key>variablesdontexport</key>
<array/>
<key>version</key>
<string>3.0.1</string>
<string>3.0.2</string>
<key>webaddress</key>
<string>https://github.com/sballin/alfred-search-notes-app</string>
</dict>
Expand Down
16 changes: 8 additions & 8 deletions search/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,20 +42,21 @@ FROM (
INNER JOIN zicnotedata AS n ON c.znotedata = n.z_pk -- note id (int) distinct from xcoredataID
WHERE
noteTitle IS NOT NULL AND
noteFolderID > 1 AND -- 1 is the Recently Deleted folder
modDate IS NOT NULL AND
xcoredataID IS NOT NULL AND
noteBodyZipped IS NOT NULL AND
c.zmarkedfordeletion != 1
) AS notes
LEFT JOIN (
INNER JOIN (
SELECT
z_pk AS folderID,
ztitle2 AS folderTitle
FROM ziccloudsyncingobject
WHERE
folderTitle IS NOT NULL AND
zmarkedfordeletion != 1
ztitle2 AS folderTitle,
zfoldertype as isRecentlyDeletedFolder
FROM ziccloudsyncingobject
WHERE
folderTitle IS NOT NULL AND
isRecentlyDeletedFolder != 1 AND
zmarkedfordeletion != 1
) AS folders ON noteFolderID = folderID
LEFT JOIN (
SELECT z_uuid FROM z_metadata
Expand All @@ -74,7 +75,6 @@ LEFT JOIN (
SELECT z_uuid FROM z_metadata
)
WHERE
z_pk > 1 AND -- 1 is the Recently Deleted folder
title IS NOT NULL AND
zmarkedfordeletion != 1 AND
lower(title) LIKE lower(?)
Expand Down

0 comments on commit 166f699

Please sign in to comment.