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
Next issue / Previous issue are not always the good issue #329
Comments
A look at the code shows that the issue is a string and that strings are compared to get the next or previous issues. |
@BRUCELLA2 That's a good suggestion. Though the problem we'd then hit is that issue numbers aren't always numeric: I have comics in my library that have alphanumeric issue numbers. What we could do is use the Comic.sortableIssueNumber field, possibly. Or else use the cover date instead of the issue number since one would assume the cover date is more precisely (remember DC's New 52 put out issue #0 after issue #12?). |
I suspected there was a good reason for things to be implemented the way they are. :) |
@BRUCELLA2 Agreed. I've got a solution for you to check and will be pushing it shortly after I test it a bit. Thanks for finding this! |
@BRUCELLA2 The fix for this is now committed on develop and I'm pulling it into the release branch for rc8. Please close this when you have a chance to verify it's fixed. |
It doesn't seem to be working out as expected. Ex :
|
The logic in the code is that next issue is determined first by the cover date and then by the issue number; i.e., i've got multiple comics that have the same cover date but different issue numbers in the 2016 volume of Action Comics. The check needs to be a a logical AND because, otherwise, the issue navigation gets into a loop. If issue X and Y have the same cover date then they will always pass the cover date comparison and will get into a loop of being each other's next and previous issue. So the next issue needs to always have a cover date that's greater than or equal to the current issue and also have a greater issue number, and the previous a lower issue number. I had considered the problem with an issue 0. Unfortunately, it falls into a very hard to handle edge case that a certain other comic library didn't solve either 😄. That said, I supposed a further change would be to do a cover date check and, if they're different return the next/previous issue. Otherwise (since they'll have the same cover date) return the next higher or lower issue number. I'll add that enhancement and we can try again. |
@BRUCELLA2 I split the logic into two pieces: first it checks if the cover dates are different and returns, otherwise it compares the issue numbers and returns, otherwise it moves on. I'm able to scroll up and down each series I've tested locally. The behavior you're seeing is what I saw prior to the changes on this issue, so check the build details and make sure you're running against the development build that includes the fix. I'm checking in a new set of changes now. |
When doing the search it first looks at the cover date and finds the comic with the next higher/lower date. If two comics have the same cover date then it compares the issue numbers to see which is higher/lower. Since no two comics should ever have the same cover date and the same issue number, this should be a sufficient check.
0 and 1/2 issues will cause problems if the sort is based on cover date. DCs Countdown will be a problem if sorted numerically. Gen 13 has three 13 issues - 13a, 13b and 13c - haven’t bothered to check the cover date for them yet. How does the sort order field fit into this? |
@bareheiny The sorting treats the issue numbers as strings rather than numbers so the sorting will be alphanumeric. But, that said, it should only fallback to the issue number when the cover date are exactly the same. I think it's probably exceedingly unlikely that we'll get into a situation where we get odd issue numbers for multiple comics in the same series and volume published on the same date. |
When doing the search it first looks at the cover date and finds the comic with the next higher/lower date. If two comics have the same cover date then it compares the issue numbers to see which is higher/lower. Since no two comics should ever have the same cover date and the same issue number, this should be a sufficient check.
@BRUCELLA2 The changes should be included in the next incremental build. Please make sure you're running that when verifying. |
There is a problem somewhere. ComiXed Build Details Now I open #1 and the next issue is the #0 instead of #2 : I open #13 and the Previous issue is #9 instead of #0 Same i open #18 and the previous issue is always #9 instead #17 |
@BRUCELLA2 What DB are you using, the built in H2 supported one or an external one? Can you do the following SQL for me on your database:
and post that here? |
So, I use the built in H2. This is the result of the request : The order is correct. But it's not the same request but it's not the same request that's in the code. The ORDER BY is "ORDER BY cover_date,issue_number;" in this request and is "ORDER BY c.issueNumber,c.coverDate" in the code. with the following query (like what's in the code regarding order by) : SELECT id,issue_number,cover_date FROM comics WHERE series='Green Lantern' AND volume='2011' ORDER BY issue_number, cover_date; i have this result : Order is not what we want. (For information : i tested on my windows pc, with no dev tools and i have the same prob. I drop the db, make a new import and new scrap and the prob is always here. ) |
@BRUCELLA2 Ah, yeah, sorry for giving the wrong order. And I see what you're pointing out there. Though, strangely, the code as it is works correctly for me locally. But I'll update the code with the ordering swapped and see what behavior I get here. |
Sorting them first by cover date and then by issue number.
Sorting them first by cover date and then by issue number.
@BRUCELLA2 Okay, I've tested this using my own Green Lantern comics in the same range and the change seems to have fixed the issue entirely, including showing issue 0 at the right point in the ordering. Please give the development build a try when it finishes. |
Sorting them first by cover date and then by issue number.
For everything works as expected now. I close this issue. |
Sorting them first by cover date and then by issue number.
Describe the bug
When we go from issue to issue with the "Previous Issue" button or "Next Issue" button, the next (or the previous) issue is not good. If my issue is 1 the next issue is 10 (see capture)
To Reproduce
Steps to reproduce the behavior:
Expected behavior
if i'm on issue 1 the next issue is the issue 2
Screenshots
Desktop (please complete the following information):
ComiXed version : 0.6.0-0.rc7
OS: Windows 10 and Linux Mint 19.3 Tricia
Linux Browser name : Brave Version 1.9.76 Chromium: 81.0.4044.138 (Official Build) (64-bit) and firefox 77.0.1 (64 bits)
Windows Browser name : Brave Version 1.9.76 Chromium: 81.0.4044.138 (Official Build) (64-bit) and Chrome 83.0.4103.97 (Official Build) (64-bit)
ComiXed Build Detail
Source Branch c6993d1
Build Hostname fv-az129
Built On Jun 7, 2020, 12:20:01 AM
Version 0.6.0-0.rc7
Commit Hash c6993d1
Committer Name Darryl L. Pierce (mcpierce@gmail.com)
Time Of Last Commit Jun 7, 2020, 12:13:51 AM
Commit Message Added tags for v0.6.0-0.rc7 [#303]
Built From Uncommitted Code? true
Remote Origin https://github.com/comixed/comixed
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: