Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filtering by tag doesn't work when calibredb-tag-width set to 0 #81

Open
sarg opened this issue Oct 14, 2024 · 0 comments
Open

Filtering by tag doesn't work when calibredb-tag-width set to 0 #81

sarg opened this issue Oct 14, 2024 · 0 comments

Comments

@sarg
Copy link

sarg commented Oct 14, 2024

Filtering by tag when its column width is set to zero yields:

(sqlite-error ("SQL logic error" "near \"LIMIT\": syntax error" 1 1))
  transient--exit-and-debug(error (sqlite-error ("SQL logic error" "near \"LIMIT\": syntax error" 1 1)))
  calibredb-query("SELECT * .... WHERE  LIMIT 44 ")
  calibredb-candidates(:where " LIMIT 44 " :count nil)
  (let* ((words (split-string filter " ")) (limit (plist-get properties :limit)) (count (plist-get properties :count)) (page (plist-get properties :page))) (calibredb-candidates :where (concat (cond (calibredb-tag-filter-p (mapconcat #'(lambda ... ...) words " AND ")) (calibredb-format-filter-p (mapconcat #'(lambda ... ...) words " AND ")) (calibredb-author-filter-p (mapconcat #'(lambda ... ...) words " AND ")) (calibredb-date-filter-p (mapconcat #'(lambda ... ...) words " AND ")) (t (mapconcat #'(lambda ... ...) words " AND "))) (if limit (progn (format " LIMIT %s " limit))) (if page (progn (format " OFFSET %s " (* (1- page) calibredb-search-page-max-rows))))) :count count))
  calibredb-search-candidates("read" :limit 44 :page nil)

That happens due to this check in calibredb-search-candidates: https://github.com/chenyanming/calibredb.el/blob/master/calibredb-search.el#L893

Also it seems that there is a copy-paste mistake as other cases of cond also check the same condition (equal (calibredb-tag-width) 0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant