Page 1 of 1

Oblivion SPEL Records count

Posted: Wed Aug 02, 2023 1:54 am
by WaffleHouse2t2
The page Oblivion SPEL Records says there are 1,331 records. I retrieved 1,324 records, seven records short.

There are only 99 records on the first page. Other record types that I have used (like ALCH for potions) have 100 records on the first page.

I played around with the offset element of the URL. &offset=86& retrieves 99 records. &offset=87& retrieves 100 records. I figure that there is an entry that gets counted for the total display but is not retrieved, and that entry may or may not be an actual spell. There are several other offsets that retrieve less than 100 records but I assume if y'all can figure out why this one is wrong, the other six may be for the same reason.

I guess the questions are: Is the listed record count correct or is the records retrieved count correct? And what is causing the other count to be incorrect? Are other Game Data record counts incorrect?

Re: Oblivion SPEL Records count

Posted: Wed Aug 02, 2023 1:01 pm
by legoless
You would likely have better luck bringing this up on the CSList talk page: https://en.uesp.net/wiki/UESPWiki_talk:CSList

Re: Oblivion SPEL Records count

Posted: Wed Aug 02, 2023 10:12 pm
by SeaGtGruff
When I click on the "1300" link for the last page, I count 30 records, which I presume are numbered 1300 through 1329. But the top of the page says it's displaying records 1300 through 1330 of 1331 records. Since the record count starts with 0, my guess is that there's some sort of "add 1" logic going on in the coding for the text at the top of the pages, but there might be an error in that "add 1" logic which is causing some of the displayed numbers to be incremented incorrectly.

In other words, let's suppose the text is coded as "displaying records %X% through %Y% of %Z% records," or something like that. It looks like 1 is being added to the %Y% variable when it shouldn't be-- since %Y% is actually a record number (or record ID) rather than a number of records (or record count), and that the %Z% variable has also been incorrectly adjusted in some manner.

Alternately, it might be that the "1331" record count is actually correct, but there's a problem with the way the grid list has been coded, such that the first and/or last record that's displayed isn't always the correct one.

For instance, if the grid isn't coded to properly retrieve record number 0, that might explain why the first page displays only 99 records instead of 100 as expected, since the first record displayed would actually be record number 1 instead of record number 0 as it should be.

That might explain why subsequent pages do display 100 records as expected, although the actual record numbers might be off by 1 from what the page heading says they're supposed to be-- for instance, if it says the page is displaying records 100 through 199, it might be that the actual records being displayed are either 99 through 198 (if the logic is subtracting 1 when it shouldn't be) or 101 through 200 (if the logic is adding 1 when it shouldn't be).

So everything appears to be correct for all of the "in-between" pages, since they all display 100 records and there's no way to tell that the displayed records don't actually jive with the record numbers shown at the top of the page, but the error in the logic causes the first and last pages to appear off somehow-- namely, the first page displays 1 less record than it should, and the last page also doesn't seem to display the proper number of records.

All of that's just a guess, but it does seem like it might be a two-part issue-- a small error in the coding of the retrieval logic, plus another possible small error in the coding of the variables used in the page heading text.

Re: Oblivion SPEL Records count

Posted: Thu Aug 03, 2023 1:10 am
by WaffleHouse2t2

Re: Oblivion SPEL Records count

Posted: Thu Aug 03, 2023 1:41 am
by WaffleHouse2t2
SeaGtGruff wrote:When I click on the "1300" link for the last page, I count 30 records, which I presume are numbered 1300 through 1329. But the top of the page says it's displaying records 1300 through 1330 of 1331 records. Since the record count starts with 0, my guess is that there's some sort of "add 1" logic going on in the coding for the text at the top of the pages, but there might be an error in that "add 1" logic which is causing some of the displayed numbers to be incremented incorrectly.
If I understand your theory correctly, wouldn't the SPEL retrieve have been short by 13 or 14 records instead of 7? The ALCH retrieve should have been short by 2 or 3 records, but is spot on. Retrieved SPEL record counts, page by page:

Code: Select all

record    0, count  99
record  100, count 100
record  200, count 100
record  300, count 100
record  400, count  99
record  500, count 100
record  600, count 100
record  700, count  99
record  800, count 100
record  900, count 100
record 1000, count  99
record 1100, count  99
record 1200, count  99
record 1300, count  30
           total 1,324
The database programmer part of me thinks there is something in the data causing the retrieve to skip records. Another possibility is that the retrieve is skipping records marked "deleted" but they are counted in the total counter. But I am on the outside of a black box, looking in. :-)

Anyway, this conversation has been relocated to UESPWiki talk:CSList.

Re: Oblivion SPEL Records count

Posted: Thu Aug 03, 2023 7:22 am
by SeaGtGruff
Ah, I hadn't tried all of the in-between pages, so I didn't realize that some of them are also displaying 1 less record than expected. So your deleted record theory seems plausible.