Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entries in .csv file get rearranged when they shouldn't #80

Open
sakapoodle opened this issue Jun 25, 2020 · 4 comments
Open

Entries in .csv file get rearranged when they shouldn't #80

sakapoodle opened this issue Jun 25, 2020 · 4 comments

Comments

@sakapoodle
Copy link

I'm only fetching the Purchase History features of the items in my download list, Catalog and Download Queue is always disabled. The format on the CSV file I'm exporting is the following:
[{"property":"name","title":"name"},{"property":"baseGame","title":"baseGame"},{"property":"platform","title":"platform"},{"property":"url","title":"url"}]

I track my download list in a git repo for changes (new games/addons I add), so I'm assuming that they're simply added to the top of the CSV file, that's the way it should be anyway.

Yesterday my CSV file looked like this:

yesterday-csv

Today I added two games which should only add these lines:

new-games

But instead I got this:

csv-rearranged

With git diff --color-moved=plain I can sort out which lines were simply rearranged and which ones are actually new (marked in green) but still this causes unnecessary overhead.

Coming back to the download list a bit later I exported again to CSV, still some rearrangement happening:

further-rearrangement

I've exported a few times since and it seems to have "settled" but I want to know what's causing this. Is it some job that's running on PSN backend causing PSDLE to generate the items in a different order or is it caused by PSDLE.
Worth mentioning is that I added about 35 games yesterday to my account, maybe that's what's causing the issue? They all have the same date stamp so maybe they get jumbled and order is not preserved due to this?

Let me know if there's anything that can be done to fix this, I hope I can generate a cleaner git log to see which games I'm adding without the overhead that's caused by this issue.

@RePod
Copy link
Owner

RePod commented Jun 25, 2020

I haven't looked into if what the store returns is stable, but I would assume "maybe not". PSDLE also performs a sort every time it generates the user-facing list.

However, the user-facing list that is seen and used for exporting (repod.psdle.gamelist_cur) is rebuilt from the store-provided list which is sorted only once by date and never touched again repod.psdle.gamelist. Similar timestamps should keep their positions relative to each other provided by the store.

Do entries maintain their order on the download list properly?

@sakapoodle
Copy link
Author

sakapoodle commented Jun 25, 2020

Thanks for getting back to me, and explaining how the lists are sorted.
I'm unsure if the store-provided list was rearranged after those items were added, it's entirely possible.
There have been reports of items moving to the top of the list, and it sometimes happens for me too.
I'll have to keep a closer eye to see if it's the server-sided changes that are causing this issue or PSDLE itself, it's uncertain at this point.

Would it be possible to expose a button (in debug mode) that let's me download the server-sided download list "as is" without any sorting or modifications from PSDLE whatsoever? If I can easily serialize it then I could also track those records in version control and compare to what PSDLE generates as a means to figure out what the source of error is.
It could be as simple as running something like psdle.debug.showExportAsIsButton() in the browser console (I'm using Chrome on Linux) to make an additional button appear next to Export View / JSON / CSV.

@RePod
Copy link
Owner

RePod commented Jun 26, 2020

Would it be possible to expose a button (in debug mode) that let's me download the server-sided download list "as is" without any sorting or modifications from PSDLE whatsoever?

Below the Start button is a "Dump Raw" button which gives you what PSDLE parses, minus the Catalog info.

@sakapoodle
Copy link
Author

Thanks, I'll use the raw dump and version track it alongside the exported data.
I'll monitor the files and if I notice some correlation then I'll write in this issue thread again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants