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
avatar
adaliabooks: It depends... it could be that all the games are appearing twice (and just the first is reported as an error) or it could be that certain games are the issue.
Not sure about the fourth page thing though...
avatar
moonshineshadow: No clue :D
I just noticed it when looking at the errors, and was wondering why the heck the fourth page told me the error was about a game that should not be there at all. First I thought I had made a mistake but after checking in my library, the game definitely is on the third page :D
Edit: My best guess was that the games were being pulled from one array into the other while still being sorted (so as a game moved up or down the list it might get added twice), but that really shouldn't be possible, particularly after that last update...

Can you run this:

copy(JSON.stringify(angular.element(document.querySelectorAll('.list')).scope().afProducts));

On one of the missing pages and attach the results?
I want to see whether the games are actually being duplicated in the array there...

Thanks.
Post edited January 06, 2016 by adaliabooks
high rated
avatar
adaliabooks: Can you run this:
copy(JSON.stringify(angular.element(document.querySelectorAll('.list')).scope().afProducts));
On one of the missing pages and attach the results?
I want to see whether the games are actually being duplicated in the array there...
Thanks.
I did it on the second page (using 100 games per page).

[edit] In the first line it says Samarost2, but that is the last game of the page before.
Attachments:
output.jpg (67 Kb)
Post edited January 06, 2016 by moonshineshadow
high rated
avatar
adaliabooks: Can you run this:
copy(JSON.stringify(angular.element(document.querySelectorAll('.list')).scope().afProducts));
On one of the missing pages and attach the results?
I want to see whether the games are actually being duplicated in the array there...
Thanks.
avatar
moonshineshadow: I did it on the second page (using 100 games per page).

[edit] In the first line it says Samarost2, but that is the last game of the page before.
Thanks moon, that helped. There are only 100 games, quite a lot of them are duplicated but not all. So that presumably means that the array is not just being duplicated, but the games are being added wrong..
high rated
Right.. I've updated with a little test to see if there's something else which might be a problem.

There are two console logs, one is "Injected Code Finished" and the other is "Manual Sort Finished"

The Injected Code one should come first, if it doesn't then I think I can sort it.

If it does, it's back to the drawing board...
high rated
avatar
adaliabooks: If you comment out line 2646 do the missing pages appear again?
Everything looks ok, it's basically sorted correctly by title, except...
Moving from page 12 to page 13 does nothing except change the number in the little box (13 of 13). It continues to display the contents of page 12 (T- W).
high rated
avatar
adaliabooks: If you comment out line 2646 do the missing pages appear again?
avatar
mrkgnao: Everything looks ok, it's basically sorted correctly by title, except...
Moving from page 12 to page 13 does nothing except change the number in the little box (13 of 13). It continues to display the contents of page 12 (T- W).
So it's still the manual sort function that's the problem...
Would you mind trying the next update and reporting the console output?
high rated
avatar
adaliabooks: Right.. I've updated with a little test to see if there's something else which might be a problem.

There are two console logs, one is "Injected Code Finished" and the other is "Manual Sort Finished"

The Injected Code one should come first, if it doesn't then I think I can sort it.

If it does, it's back to the drawing board...
ICF appears before MSF both on pages that display and on those that do not due to duplicate error.
avatar
mrkgnao: ICF appears before MSF both on pages that display and on those that do not due to duplicate error.
Thanks, so it's not that then...
high rated
avatar
mrkgnao: ICF appears before MSF both on pages that display and on those that do not due to duplicate error.
avatar
adaliabooks: Thanks, so it's not that then...
Perhaps you could add your own debug function for detecting duplicates and call that function after every step of the manual sort to determine at what stage the corruption occurs. Then we could run this non-version and tell you what the console shows.
high rated
avatar
adaliabooks: Thanks, so it's not that then...
avatar
mrkgnao: Perhaps you could add your own debug function for detecting duplicates and call that function after every step of the manual sort to determine at what stage the corruption occurs. Then we could run this non-version and tell you what the console shows.
Hmmm... it's possible, but I don't know where or when I'd run it.
Basically there are two arrays, one containing all the games and one containing the 100 to show on any given page (or a number of arrays each containing 100 games depending on your setting).
The one containing all the games is the one that gets sorted, and the outputs you guys have all provided of your libraries show that that array doesn't contain duplicates.
The other arrays get sliced from that one (depending on which page you're looking at etc.) and that's where the duplicates are occurring.
But I can't check the second array when sorting because the sort function knows nothing about it, and I can't check it for duplicates when it's slicing because it's a single line function that copies from one array to the other...

The only thing I can think is the slice is occurring while the array is being sorted, but the results suggest that isn't the case...
avatar
adaliabooks: But I can't check the second array when sorting because the sort function knows nothing about it, and I can't check it for duplicates when it's slicing because it's a single line function that copies from one array to the other...
Which line is that?
high rated
avatar
mrkgnao: Which line is that?
Line 2845

This is the whole loop:

for (var i = ((currentPage - 1) * (gamesPerPage / 100)); i < Math.min((currentPage * (gamesPerPage / 100)), gogData.totalPages); i++)
{
libraryScope.afProducts.push({ page: i, products: libraryScope.afManualSortProducts.slice(i * 100, (i * 100)+100)});
}

It just loops through and slices the arrays out of the main array...
high rated
Right, I've got another update with a test.

It should print off two lists of five game titles (with "Break") in between.

They should be identical, but if the sorting is still occurring they may not be...
high rated
avatar
adaliabooks: Right, I've got another update with a test.

It should print off two lists of five game titles (with "Break") in between.

They should be identical, but if the sorting is still occurring they may not be...
They're more or less identical for displaying and non-displaying pages (except the (line?) number after account).
Here is the one for the first non-displaying page (this time, page #9).

Object { isGalaxyCompatible: true, tags: Array[0], id: 1207659783, availability: Object, title: "Raven, The: Legacy of a Master Thief", image: "//images-1.gog.com/b8def14e5fae3875…", url: "/game/the_raven_legacy_of_a_master_…", worksOn: Object, category: "Adventure", rating: 36, 11 more… } account:194:21
Object { isGalaxyCompatible: true, tags: Array[0], id: 1207659783, availability: Object, title: "Raven, The: Legacy of a Master Thief", image: "//images-1.gog.com/b8def14e5fae3875…", url: "/game/the_raven_legacy_of_a_master_…", worksOn: Object, category: "Adventure", rating: 36, 11 more… } account:195:21
Object { isGalaxyCompatible: true, tags: Array[0], id: 1432906190, availability: Object, title: "Ravenloft: Stone Prophet", image: "//images-3.gog.com/d92b8ec6c16ee140…", url: "/game/dungeons_dragons_ravenloft_se…", worksOn: Object, category: "Role-playing", rating: 0, 11 more… } account:196:21
Object { isGalaxyCompatible: true, tags: Array[0], id: 1432906190, availability: Object, title: "Ravenloft: Stone Prophet", image: "//images-3.gog.com/d92b8ec6c16ee140…", url: "/game/dungeons_dragons_ravenloft_se…", worksOn: Object, category: "Role-playing", rating: 0, 11 more… } account:197:21
Object { isGalaxyCompatible: true, tags: Array[0], id: 1432905053, availability: Object, title: "Ravenloft: Strahd's Possession", image: "//images-2.gog.com/09ac11d61f3b628d…", url: "/game/dungeons_dragons_ravenloft_se…", worksOn: Object, category: "Role-playing", rating: 0, 11 more… } account:198:21

Break account:199:21

Object { isGalaxyCompatible: true, tags: Array[0], id: 1207659783, availability: Object, title: "Raven, The: Legacy of a Master Thief", image: "//images-1.gog.com/b8def14e5fae3875…", url: "/game/the_raven_legacy_of_a_master_…", worksOn: Object, category: "Adventure", rating: 36, 11 more… } account:201:21
Object { isGalaxyCompatible: true, tags: Array[0], id: 1207659783, availability: Object, title: "Raven, The: Legacy of a Master Thief", image: "//images-1.gog.com/b8def14e5fae3875…", url: "/game/the_raven_legacy_of_a_master_…", worksOn: Object, category: "Adventure", rating: 36, 11 more… } account:202:21
Object { isGalaxyCompatible: true, tags: Array[0], id: 1432906190, availability: Object, title: "Ravenloft: Stone Prophet", image: "//images-3.gog.com/d92b8ec6c16ee140…", url: "/game/dungeons_dragons_ravenloft_se…", worksOn: Object, category: "Role-playing", rating: 0, 11 more… } account:203:21
Object { isGalaxyCompatible: true, tags: Array[0], id: 1432906190, availability: Object, title: "Ravenloft: Stone Prophet", image: "//images-3.gog.com/d92b8ec6c16ee140…", url: "/game/dungeons_dragons_ravenloft_se…", worksOn: Object, category: "Role-playing", rating: 0, 11 more… } account:204:21
Object { isGalaxyCompatible: true, tags: Array[0], id: 1432905053, availability: Object, title: "Ravenloft: Strahd's Possession", image: "//images-2.gog.com/09ac11d61f3b628d…", url: "/game/dungeons_dragons_ravenloft_se…", worksOn: Object, category: "Role-playing", rating: 0, 11 more… }
Post edited January 06, 2016 by mrkgnao
high rated
avatar
adaliabooks: Right, I've got another update with a test.
It should print off two lists of five game titles (with "Break") in between.
They should be identical, but if the sorting is still occurring they may not be...
So on the first page, they are identical, the first five games of that page... on the second page they are also identical, but there are duplicates.
Post edited January 06, 2016 by moonshineshadow