Skip to content

Commit 3fb3cc7

Browse files
authored
11.0 sql fix (#216)
1 parent 26ddf79 commit 3fb3cc7

4 files changed

Lines changed: 12 additions & 22 deletions

File tree

include/saves.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,6 @@ enum cmd_code_enum
120120
CMD_EXP_PS1_VM1,
121121
CMD_EXP_DATABASE,
122122
CMD_DB_REBUILD,
123-
CMD_DB_DEL_FIX,
124123
CMD_DB_DLC_REBUILD,
125124

126125
// Import commands

source/exec_cmd.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,15 +1853,6 @@ void execCodeCommand(code_entry_t* code, const char* codecmd)
18531853
code->activated = 0;
18541854
break;
18551855

1856-
case CMD_DB_DEL_FIX:
1857-
if (appdb_fix_delete(code->file, apollo_config.user_id))
1858-
show_message("User %x database fixed successfully!\nLog out for changes to take effect", apollo_config.user_id);
1859-
else
1860-
show_message("Database fix failed!");
1861-
1862-
code->activated = 0;
1863-
break;
1864-
18651856
case CMD_DB_DLC_REBUILD:
18661857
if (addcont_dlc_rebuild(code->file))
18671858
show_message("DLC database fixed successfully!\nLog out for changes to take effect");

source/saves.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1157,10 +1157,6 @@ int ReadBackupCodes(save_entry_t * bup)
11571157
asprintf(&cmd->file, "%saddcont.db", bup->path);
11581158
list_append(bup->codes, cmd);
11591159

1160-
cmd = _createCmdCode(PATCH_COMMAND, "\x18 Restore Delete option to XMB items (app.db fix)", CMD_DB_DEL_FIX);
1161-
asprintf(&cmd->file, "%sapp.db", bup->path);
1162-
list_append(bup->codes, cmd);
1163-
11641160
cmd = _createCmdCode(PATCH_COMMAND, CHAR_ICON_COPY " Backup System Database Folder", CMD_EXP_DATABASE);
11651161
list_append(bup->codes, cmd);
11661162

source/sqlite_db.c

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ static void insert_appinfo_sfo_value_int(sqlite3* db, const char* titleId, const
238238

239239
int appdb_rebuild(const char* db_path, uint32_t userid)
240240
{
241-
int fw, i;
241+
int i;
242242
DIR *dp;
243243
struct dirent *dirp;
244244
char path[256];
@@ -247,9 +247,6 @@ int appdb_rebuild(const char* db_path, uint32_t userid)
247247
sfo_context_t* sfo;
248248
uint64_t pkg_size;
249249

250-
if ((fw = get_firmware_version()) < 0)
251-
return 0;
252-
253250
dp = opendir("/user/app");
254251
if (!dp)
255252
{
@@ -297,13 +294,20 @@ int appdb_rebuild(const char* db_path, uint32_t userid)
297294
sfo_category = "gd";
298295

299296
LOG("Adding (%s) %s '%s' to tbl_appbrowse_%010d...", sfo_titleid, sfo_content, sfo_title, userid);
300-
char* query = sqlite3_mprintf("INSERT INTO tbl_appbrowse_%010d VALUES (%Q, %Q, %Q, '/user/appmeta/%s',"
297+
char* query = sqlite3_mprintf("INSERT INTO tbl_appbrowse_%010d (titleId, contentId, titleName,"
298+
"metaDataPath, lastAccessTime, contentStatus, onDisc, parentalLevel, visible,"
299+
"sortPriority, pathInfo, lastAccessIndex, dispLocation, canRemove, category, contentType, pathInfo2,"
300+
"presentBoxStatus, entitlement, thumbnailUrl, lastUpdateTime, playableDate, contentSize,"
301+
"installDate, platform, uiCategory, skuId, disableLiveDetail, linkType, linkUri,"
302+
"serviceIdAddCont1, serviceIdAddCont2, serviceIdAddCont3, serviceIdAddCont4,"
303+
"serviceIdAddCont5, serviceIdAddCont6, serviceIdAddCont7, folderType, folderInfo,"
304+
"parentFolderId, positionInFolder, activeDate, entitlementTitleName, hddLocation,"
305+
"externalHddAppStatus, entitlementIdKamaji, mTime) VALUES (%Q, %Q, %Q, '/user/appmeta/%s',"
301306
"'2020-01-01 20:20:03.000', 0, 0, 5, 1, 100, 0, 1, 5, 1, %Q, 0, 0, 0, 0, NULL, NULL, NULL, %ld,"
302307
"'2020-01-01 20:20:01.000', 0, %Q, NULL, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,"
303-
"0, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, '2020-01-01 20:20:02.000'%s)",
308+
"0, NULL, NULL, NULL, NULL, NULL, 0, 0, NULL, '2020-01-01 20:20:02.000')",
304309
userid, sfo_titleid, sfo_content, sfo_title, dirp->d_name, sfo_category, pkg_size,
305-
(strcmp(sfo_category, "gde") == 0) ? "app" : "game",
306-
(fw <= 0x555) ? "" : ",0,0,0,0,0,NULL");
310+
(strcmp(sfo_category, "gde") == 0) ? "app" : "game");
307311

308312
if (sqlite3_exec(db, query, NULL, NULL, NULL) != SQLITE_OK)
309313
{

0 commit comments

Comments
 (0)