mrkgnao: Tried half a dozen times.
The good news:
- No duplicates
Well, nice to know that worked at least.
mrkgnao: The less good news:
- When I first load the library, W-Z are at the beginning
- If I move to page 2 and then back to page 1, W-Z are no longer at the beginning
- The order of pages is incorrect (e.g. I-L comes two pages after L-N)
- Moving from page 12 to 13 results in an empty page 13 (but no duplicates)
- Moved two games to positions 0, 1. When I reload the library they are in position 1, 34 respectively (i.e. after the first and last W-Z). If I move to page 2 and return to page1 , they are in positions 0, 1, as expected (i.e. before 11th Hour).
Thoughts:
- I am thinking that your dependence on GOG's caching might be the issue. Perhaps GOG's caching is limited to 256 items and that's why you see no problem and we do. Perhaps try to download the entire library first and cache it yourself, ignoring any loads beyond that point.
Can't say this particularly surprises me. There is obviously something going on that I can't see / find, but I'm stumped as to what it is.
I'm really not sure why the last page doesn't show (are there any other errors for that one? what is the contents of angular.element(document.querySelectorAll('.list')).scope().afProducts when run in the console? It should be an object with a variable 'page' = 0 and an array of 100 games in it) and I'm not sure whether it is related or not to the other issues.
It's possible, but I doubt it... unfortunately to test it requires a lot of extra work as right now I just use GoG's built in method to build the url to fetch the games and that's also what caches the result of each AJAX. Without that I have to figure out how to manually build the right url each time, plus possibly implement my own method of caching.. If I thought it was an issue I would try it, but it's a lot of work when I'm fairly sure it's not the problem..
But you could do a test, if you turn my script off, open the console and scroll through all the pages of your library and back to page one again you should see one AJAX call for each page. As you go back a further call shouldn't be made as the already cached data is loaded instead.
I can't imagine it stops at any particular number (and nothing in the source code suggests it would)
HypersomniacLive: On "100 games per page", games display in my manual order for pages 1-5. Page 6 does not load, see attachment for Console log.
But, if I enter the number of a previous page, it goes to it (didn't work previously), and previous pages still display correctly. Typing 6 goes to page 6, but it still doesn't load.
Something worth noting is that it takes longer for both the shelf and the covers to load/render.
On a side note -
Pathologic Classic HD has the overlay text even though the cover is different.
So other than the last page missing it's basically working? Odd, why is it all right for you but not mrkgnao...
That's probably the extra run through the array to remove duplicates (I'd assume anyway)
Yeah, I've been ignoring the covers until I can get manual sort fixed, then I'll finish uploading and sorting all the missing or broken ones.
Here's my big stumbling block:
This went unnoticed for so long because none of these issues occur if you view your library on 'All', correct?
Why?
The code is practically identical, except one slices all the pages and games and the other just slices the games that should be on the current page only. So what is breaking in that tiny bit of code that's different (or what else is going on that I'm missing) that is making it not work?
The most obvious answer is the page changes, and that somehow extra games are being loaded into the array when you change pages, but the array is completely cleared with each change made so I can't see why that would happen... plus all the relevant functions are only being called the correct amount of times.
There's something I'm missing, I'm absolutely sure of it... I'm just not sure what it could be.
Thanks guys, I'll keep trying and thinking.