Skip to content

Commit

Permalink
Merge pull request #40 from rhydlewis/of3-column-change-bug-fix
Browse files Browse the repository at this point in the history
Of3 column change bug fix
  • Loading branch information
rhydlewis authored Jul 8, 2019
2 parents 0a42e4e + 07bdfbb commit 5dd259c
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 14 deletions.
2 changes: 1 addition & 1 deletion info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2185,7 +2185,7 @@ Well, I want it because I can't quickly search for, say, a task within OmniFocus
</dict>
</dict>
<key>version</key>
<string>2.0.5</string>
<string>2.0.6</string>
<key>webaddress</key>
<string>rhydlewis.net</string>
</dict>
Expand Down
22 changes: 10 additions & 12 deletions queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
BLOCKED = str("blocked")
STATUS = str("status")
DUE_DATE = str("due_date")
ACTIVE = str("active")
AVAILABLE_TASK_COUNT = str("available_task_count")
REMAINING_TASK_COUNT = str("remaining_task_count")
SINGLETON = str("singleton")
Expand Down Expand Up @@ -52,8 +51,7 @@
TAG_SELECT = ", ".join([
"persistentIdentifier AS {0}".format(ID),
"name AS {0}".format(NAME),
"allowsNextAction AS {0}".format(ALLOWS_NEXT_ACTION),
"active AS {0}".format(ACTIVE)]) + ", availableTaskCount AS {0}".format(AVAILABLE_TASK_COUNT)
"allowsNextAction AS {0}".format(ALLOWS_NEXT_ACTION)]) + ", availableTaskCount AS {0}".format(AVAILABLE_TASK_COUNT)
PROJECT_SELECT = ", ".join([
"p.pk AS {0}".format(ID),
"t.name AS {0}".format(NAME),
Expand Down Expand Up @@ -103,16 +101,16 @@ def search_projects(active_only, query):


def search_tags(query):
where = "active = 1"
if query:
where = where + " AND lower(name) LIKE lower('%{0}%')".format(query)

return _generate_query(TAG_SELECT, "Context", where, NAME_SORT)
if not query:
return "SELECT {0} FROM {1} ORDER BY {2}".format(TAG_SELECT, "Context", NAME_SORT)
else:
where = "lower(name) LIKE lower('%{0}%')".format(query)
return _generate_query(TAG_SELECT, "Context", where, NAME_SORT)


def search_folders(query):
select = "persistentIdentifier AS {0}, name as {1}, active AS {2}, effectiveActive".format(ID, NAME, ACTIVE)
where = "(active = 1 OR effectiveActive = 1)"
select = "persistentIdentifier AS {0}, name as {1}".format(ID, NAME)
where = "(dateHidden is null AND effectiveDateHidden is null)"
if query:
where = where + " AND lower(name) LIKE lower('%{0}%')".format(query)

Expand All @@ -139,9 +137,9 @@ def show_recent_tasks(active_only):
return "SELECT {0} FROM {1} ORDER BY {2} LIMIT {3}".format(TASK_SELECT, TASK_FROM, "t.dateModified DESC", 10)

def show_due_tasks(version):
constraint = OF3_DUE_SOON_CONSTRAINT
constraint = OF2_DUE_SOON_CONSTRAINT
if version == DEFAULT_OF_VERSION:
constraint = OF2_DUE_SOON_CONSTRAINT
constraint = OF3_DUE_SOON_CONSTRAINT

return _generate_query(TASK_SELECT, TASK_FROM, NOT_COMPLETED_CLAUSE + constraint, "t.dateDue ASC") + " LIMIT 10"

Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.5
2.0.6

0 comments on commit 5dd259c

Please sign in to comment.