Repository navigation
fix(playtime): read firmware without playedTimeOnConsole and treat every column as optional - #19
Merged
Merged
Conversation
…ery column as optional On firmware such as 6.02, tbl_iconinfo_<user> has no playedTimeOnConsole column, so no table qualified, the games list returned an error and the Profile showed HTTP 500 (#18). A profile table now only needs titleId. Playtime comes from playedTimeOnConsole, then gltTotalPlayedTime (the PSN total), then 0. The last-played date comes from lastPlayedDateOnConsole, then gltlastPlayedDate, then lastAccessTime. tbl_contentinfo and tbl_appbrowse are read only when they have titleId. Fixes #18
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On firmware such as 6.02, the profile table
tbl_iconinfo_<user>inapp.dbhas noplayedTimeOnConsolecolumn. The payload only accepted tables with that column, so it found none, the games list returned an error and the Profile showed "Could not load the data (HTTP 500)". Trophies were unaffected. The same missing column is reported on 4.03 in another project.Fix
Every column the playtime reader uses is now optional:
titleId. Tables without it are skipped.playedTimeOnConsole, thengltTotalPlayedTime(the total PSN keeps for the game, in seconds), then 0.lastPlayedDateOnConsole, thengltlastPlayedDate, thenlastAccessTime.tbl_contentinfoandtbl_appbrowseare read only when they havetitleId.gltTotalPlayedTimeincludes other consoles and is empty on a console that stays offline, so the README FAQ now says so.Tests
The host fixture gains three profile tables: one shaped like 6.02 (
gltTotalPlayedTime, noplayedTimeOnConsole), one with onlytitleIdandlastAccessTime, and one withouttitleId. The 6.02 test failed before the fix (the table was ignored) and passes now.make -C payload host-test: 110 tests, 0 failed.Fixes #18