It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
high rated
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.
Attachments:
page6.jpg (26 Kb)
high rated
avatar
mrkgnao: Tried half a dozen times.

The good news:
- No duplicates
Well, nice to know that worked at least.

avatar
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)

avatar
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.
high rated
avatar
adaliabooks: [...]

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.

[...]
No idea why it's not working properly for mrkgnao, I'm starting to think that his W-Z games are cursed!

After reading mrkgnao's post, I loaded my library in one page to check that my games displayed in the correct order. And they did.
I did need to refresh the page for all of them to show (page 6 not loading caused some games to not show at all).

It goes without saying that getting the script to work as intended is priority. That's why I've been holding off posting some more covers I've done. I only mentioned this one as I think the text wasn't there before today, but I could be wrong.


avatar
adaliabooks: [...]

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.
Perhaps consult/brainstorm with Barefoot_Monkey?
high rated
avatar
HypersomniacLive: No idea why it's not working properly for mrkgnao, I'm starting to think that his W-Z games are cursed!

After reading mrkgnao's post, I loaded my library in one page to check that my games displayed in the correct order. And they did.
I did need to refresh the page for all of them to show (page 6 not loading caused some games to not show at all).

It goes without saying that getting the script to work as intended is priority. That's why I've been holding off posting some more covers I've done. I only mentioned this one as I think the text wasn't there before today, but I could be wrong.

Perhaps consult/brainstorm with Barefoot_Monkey?
Quite possibly... you're supposed to be from the Vatican, know any good exorcists? ;)

That's what's bugging me; if it was really the sorting (as tests suggest) then why does 'All' work? So it must be the pages changing, but all the possible problems there could have been with that have been dealt with...

I'm not sure, it could just have been one that no one could see to know whether it showed correctly...

Yeah, might be worth asking him. Not sure he's worked with this side of the website, but he presumably knows more about Javascript then I do if nothing else...



Just out of curiosity.. what happens if you stay on page 1 (with manual sort on and on 100 per page) and instead of changing page you change the sort order and filters a few times?
I'm wondering if that might lead to the same errors and it's some sort of cumulative effect of repeated refreshes of the pages...
high rated
avatar
adaliabooks: 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.
For pages 1-12 it is indeed a 100 game array.

For page 13 it is an empty array:
$$hashKey "object:11050"
page 12
products []
high rated
avatar
mrkgnao: For pages 1-12 it is indeed a 100 game array.

For page 13 it is an empty array:
$$hashKey "object:11050"
page 12
products []
I may have managed to replicate this (once) by messing around with the filters and sort orders and resetting my sort order, but while the last page disappeared briefly once I refreshed it was absolutely fine again and trying to repeat the process hasn't resulted in the same effect...

Still, the fact it is completely empty suggests that must be an issue with the slicing (particularly as the object is there in the first place, if it didn't exist at all it would mean the slice wasn't even reached), but the page number is correct (they start from 0 so should be 1 less than the actual current page) so it can't be going too wrong...
avatar
adaliabooks: [...]

Just out of curiosity.. what happens if you stay on page 1 (with manual sort on and on 100 per page) and instead of changing page you change the sort order and filters a few times?
I'm wondering if that might lead to the same errors and it's some sort of cumulative effect of repeated refreshes of the pages...
Will run this test now, and report back.
high rated
Changed sort order from GOG's list from "Title" to "Purchase Date" (1st refresh), to "Oldest First" (2nd refresh), to "Newest First" (3rd refresh), back to "Title" (4th refresh). Each time, the page loaded and displayed OK.

I then applied a "Genre" filter (5th refresh), got two pages, went to page 2 (6th refresh), then cleared it (7th refresh), then applied a "System" filter (8th refresh), cleared it (9the refresh), then a combination of two filters (10the refresh), cleared it (11th refresh).

With the filters, the page loaded, but as far as I can tell, one or more games went MIA at some cases (not sure if it was the same ones each time).

Do you want me to repeat the test, and save the console log for each action?
high rated
avatar
HypersomniacLive: Changed sort order from GOG's list from "Title" to "Purchase Date" (1st refresh), to "Oldest First" (2nd refresh), to "Newest First" (3rd refresh), back to "Title" (4th refresh). Each time, the page loaded and displayed OK.

I then applied a "Genre" filter (5th refresh), got two pages, went to page 2 (6th refresh), then cleared it (7th refresh), then applied a "System" filter (8th refresh), cleared it (9the refresh), then a combination of two filters (10the refresh), cleared it (11th refresh).

With the filters, the page loaded, but as far as I can tell, one or more games went MIA at some cases (not sure if it was the same ones each time).

Do you want me to repeat the test, and save the console log for each action?
Thanks Hyper, no don't worry about trying it again. Looks like there are might be a few issues with lots of refreshes and option changes but the duplicates error isn't occurring so it's probably not just refreshes and changes in general but perhaps could be page changes...
Hmmm....
high rated
avatar
adaliabooks: Thanks Hyper, no don't worry about trying it again. Looks like there are might be a few issues with lots of refreshes and option changes but the duplicates error isn't occurring so it's probably not just refreshes and changes in general but perhaps could be page changes...
Hmmm....
Well, I just toyed a bit with the sorting order, and games went MIA after only 3 refreshes. And after refreshing the tab, it looks like it completely skipped page 2, and went straight to page 3.
high rated
avatar
adaliabooks: Thanks Hyper, no don't worry about trying it again. Looks like there are might be a few issues with lots of refreshes and option changes but the duplicates error isn't occurring so it's probably not just refreshes and changes in general but perhaps could be page changes...
Hmmm....
avatar
HypersomniacLive: Well, I just toyed a bit with the sorting order, and games went MIA after only 3 refreshes. And after refreshing the tab, it looks like it completely skipped page 2, and went straight to page 3.
Ok. So not the same problem, but certainly problems.. so maybe multiple refreshes is the issue (combined with a larger library?). Gives me something else to look at anyway.

Thanks Hyper.
high rated
avatar
adaliabooks: Ok. So not the same problem, but certainly problems.. so maybe multiple refreshes is the issue (combined with a larger library?). Gives me something else to look at anyway.

Thanks Hyper.
Just to be clear - number said it was page 2, but the content displayed was that of my page 3. So, perhaps still the same problem?
high rated
Ok, took a day off and tried again.

This time I've (kind of) taken mrkgnao's advice and somewhat bypassed GoG's caching. I've set it so that it only reloads the list of games if the filters have changed (so changing the sorting order or page just uses the current retrieved list, this may have an effect on resetting the sort order but I'll fix that later if this works).

I've also changed the function that adds the retrieved pages into one array to sort, instead of complicated splicing and concatenating that I barely understood I've instead saved them first into a temporary array in page order and then added all those arrays together before sorting.

I'm hoping between the two of those we might see a fix for all or most of the issues we're having.. but we'll see.

I'm also slightly drunk, so while I've tested everything and it seems to work (which so far has meant bugger all anyway) there may be some things I've overlooked... :D
high rated
avatar
adaliabooks:
Did a little testing. Looks a lot better.
No empty pages, no duplicates. All 13 pages load. Manual sort seems to work from the 3-4 games I moved around.

However, the order of pages is pretty messed up, more or less something like:
W-Z
A-N
R-Sh
N-R
Sh-St
T-W
St-T
The breaks happen not at the beginning of a page, but around game #33 of the page, most likely because the 33 W-Z games at the beginning shift everything by 33.
high rated
avatar
adaliabooks:
avatar
mrkgnao: Did a little testing. Looks a lot better.
No empty pages, no duplicates. All 13 pages load. Manual sort seems to work from the 3-4 games I moved around.

However, the order of pages is pretty messed up, more or less something like:
W-Z
A-N
R-Sh
N-R
Sh-St
T-W
St-T
The breaks happen not at the beginning of a page, but around game #33 of the page, most likely because the 33 W-Z games at the beginning shift everything by 33.
Yay.
That's what we're looking for. I should work drunk more often.

So the main problem still seems to be the W - Z games appearing at the front, though there is clearly something else messed up about the sorting too..

Is that how they appeared when you first loaded the page? It might even just be a hangover at this stage (frozen in the manual sort) and reset (probably) won't work because of the caching.. I'll try fix the reset tomorrow to see if that makes any difference, if not I'll try work out what the issue is (and go back and see what it was I did earlier that seemed to fix it)