-
-
Notifications
You must be signed in to change notification settings - Fork 55
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
OpdsCatalog::getSearchUrl() #527
Conversation
@veloman-yunkan Thx, do you have a kiwix-desktop related PR, so I can just test if it works (no regression) from user perspective? |
No. It won't work until the new OPDS catalog API is merged and goes live on |
@veloman-yunkan Really hard to me then to verify it works fine from a user persective. Will let @mgautierfr do the review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Now the question is which one of the two schemes should be utilized for the search URL generation?
I prefer the old one. Mainly because it is easier to read.
if ( searchString.empty() ) | ||
return opdsSearchEndpoint; | ||
else | ||
return opdsSearchEndpoint + ("?" + searchString); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't we have buildSearchString
adding the ?
itself if needed ?
Then we would simply have to always add opdsSearchEndpoint
and searchString
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it but didn't like the result. getSearchUrl()
starts looking like a plagiarist that delegates all work to a ghost writer but receives all the credit. The current division of work between getSearchUrl()
and buildSearchString()
is more balanced.
2f36c15
to
c910dee
Compare
what is the status here? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
c910dee
to
f962d77
Compare
Codecov Report
@@ Coverage Diff @@
## master #527 +/- ##
==========================================
+ Coverage 65.05% 65.25% +0.19%
==========================================
Files 51 52 +1
Lines 3626 3649 +23
Branches 1825 1841 +16
==========================================
+ Hits 2359 2381 +22
- Misses 1265 1266 +1
Partials 2 2
Continue to review full report at Codecov.
|
f962d77
to
c3595aa
Compare
@veloman-yunkan #492 has been merge, I guess nothing stops us anymore to finish this PR? |
@kelson42 This PR is finished and pending review by @mgautierfr |
Nothing to say on the code. I'm a bit less sure about the generated endpoint. I will not block this PR for this, but I may block the next release however 🙂 |
This pull request has been automatically marked as stale because it has not had recent activity. It will be now be reviewed manually. Thank you for your contributions. |
c3595aa
to
b5c1b26
Compare
rebase/fixup on master. This PR is open for two long now. As we agree on the code we can merge it. |
Fixes #480.
Must be merged after #526.
This is a preliminary implementation of OPDS search url generation targeting the new API introduced by the yet unmerged #492.
Note that #488 has enabled us to search by all fields via the query parameter. For example a search by category can be done in two ways:
search_endpoint?category=whatever
search_endpoint?q=category:whatever
Internally, the old approach is converted to an equivalent of the new one with the slight difference of not assuming partial query (which is the default mode for the
q
parameter).Some fields (creator, publisher) are not exposed for searching in the old scheme but are available via the new scheme.
Now the question is which one of the two schemes should be utilized for the search URL generation?
Another question is what should be done about the filtering criteria
Filter::local()
,Filter::remote()
,Filter::remote()
? They have never been exposed through the OPDS search API.TODOs:
Filter::maxSize()
&Filter::rejectTags()
filtering criteria.