-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
v1.1.0 #43
v1.1.0 #43
Conversation
Paging information for pre-paginated feeds
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #43 +/- ##
============================================
- Coverage 99.43% 99.13% -0.31%
- Complexity 259 313 +54
============================================
Files 10 12 +2
Lines 890 1042 +152
============================================
+ Hits 885 1033 +148
- Misses 5 9 +4 ☔ View full report in Codecov by Sentry. |
@mikespub If And What do you think about this? |
Hi @ewilan-riviere I'm fine with re-using paginate() if that's what you want, but I assume you'll somehow want to combine the functionality of the original paginate() with the new paging() I added then? The reason I'm asking is because the paging() I used in the PR deals with "opaque" URLs as strings coming from the application, and then uses those directly in the feeds - which is why I used some random variations with f=.., n=.., p=.., l=... params for each in the Paging Test. It's not at all what the links actually look like in COPS, but it shouldn't matter :-) While the original paginate() tries to count items, pages, previous & next numbers etc. as integers, and then truncates the feed(s) and generates URL links for them - something completely different... |
@mikespub Thanks for quick answer! Yes, it's exactly what you done in your PR, I just update it with a new class to handle this with an object, like in your test The aim is to combine two paginations yes. // no pagination
$opds = Opds::make(getConfig())
->feeds(manyFeeds())
->get();
// with pagination (automatic)
$opds = Opds::make(getConfig())
->feeds(manyFeeds())
->pagination()
->get();
// with pagination (manual)
$opds = Opds::make(getConfig())
->feeds(manyFeeds())
->pagination(new OpdsPaging(
currentPage: $page,
totalItems: $total,
firstUrl: 'http://localhost:8080/opds?f=1',
lastUrl: 'http://localhost:8080/opds?l=42',
previousUrl: 'http://localhost:8080/opds?p=1',
nextUrl: 'http://localhost:8080/opds?n=3',
))
->get(); This is an example, for now pagination auto is into OpdsConfig and your new method EDIT |
@mikespub |
Ah yes, now I see - thanks, that's good for me too :-) |
OpdsPaging::class
based on Paging information for pre-paginated feeds #40 from @mikespub to handle manual pagination for issue [Bug]: Paginator revisited #38OpdsConfig::class
can have nullableupdated
attributeOpds
methodsend()
have now a new parameterbool $exit = false
to control if the script should exit after sending the response to replacebool $mock = false
parameter. By default,send()
will not exit the script.