Kouzukii / ffxiv-priceinsight

A FFXIV Plugin to display marketboard prices on item tooltips
MIT License
17 stars 14 forks source link

Timezone calculation issue? #33

Closed ariahrism closed 6 months ago

ariahrism commented 6 months ago

When I hover on an item, it will say something like 300g (15h ago) but in fact the price was just updated, so I'm lead to believe that the 15h calculation is just a bug. I'm constantly needing to do mental math to guess the actual freshness of the price.

Is this a known issue or a limitation? If not, I can try to help investigate if needed.

Kouzukii commented 6 months ago

I've had a look and indeed the time of the listing does not match the "last upload time" for that world on universalis. This number is however already reported incorrectly by the universalis API. I'll see if karashiiro has an idea what the issue could be.

Kouzukii commented 6 months ago

e.g. https://universalis.app/api/v2/Spriggan/29431 (Neo-Ishgardian Bottoms of Maiming)

{
  "itemID": 29431,
  "worldID": 85,
  "lastUploadTime": 1703799966102,
  "listings": [
    {
      "lastReviewTime": 1703747697,
      "pricePerUnit": 2999,
      "quantity": 1,
      "stainID": 0,
      "creatorName": "",
     // ...

"lastUploadTime": 1703799966102 = December 28, 2023 21:46:06 GMT "lastReviewTime": 1703747697 = December 28, 2023 07:14:57 GMT

Kouzukii commented 6 months ago

Alright looks like this is a misunderstanding on my part "lastReviewTime" refers to the time the item was posted (wouldn't something like "timeOfListing" be more descriptive?) Well anyways, I'll be correcting the displayed timestamps to use the correct worldUploadTimes in the next update.

ariahrism commented 6 months ago

Thank you for looking into it! I didn't realize you had two dates to work with. I was assuming that the 15h ago was in reference to the time shown on Universalis:

image

I'm not sure what the "ReviewTime" vs "UploadTime" difference is, but I would expect the timestamp to reflect the last time the data was updated, like the picture above, same as the timestamp that Universalis provides.