| 261 | } |
| 262 | |
| 263 | void dlc_callback_outer(void* data, const char* dir, const char* subdir) |
| 264 | { |
| 265 | refresh_data_t *refresh_data = (refresh_data_t*)data; |
| 266 | dlc_data_t dlc_data; |
| 267 | dlc_data.refresh_data = refresh_data; |
| 268 | dlc_data.list_size = 0; |
| 269 | char path[MAX_PATH_LENGTH]; |
| 270 | |
| 271 | // Get the title's dlc subdirectories |
| 272 | int len = snprintf(path, sizeof(path), "%s/%s", dir, subdir); |
| 273 | parse_dir_with_callback(SCE_S_IFDIR, path, dlc_callback_inner, &dlc_data); |
| 274 | |
| 275 | if (refresh_data->refresh_pass) { |
| 276 | // For dlc, the process happens in two phases to avoid promotion errors: |
| 277 | // 1. Move all dlc that require refresh out of addcont/title_id |
| 278 | // 2. Refresh the moved dlc_data |
| 279 | for (int i = 0; i < dlc_data.list_size; i++) { |
| 280 | if (refreshNeeded(dlc_data.list[i], "dlc")) { |
| 281 | snprintf(path, MAX_PATH_LENGTH, DLC_TEMP "/%s", &dlc_data.list[i][len + 1]); |
| 282 | removePath(path, NULL); |
| 283 | sceIoRename(dlc_data.list[i], path); |
| 284 | } else { |
| 285 | free(dlc_data.list[i]); |
| 286 | dlc_data.list[i] = NULL; |
| 287 | SetProgress(++refresh_data->processed, refresh_data->count); |
| 288 | } |
| 289 | } |
| 290 | |
| 291 | // Now that the dlc we need are out of addcont/title_id, refresh them |
| 292 | for (int i = 0; i < dlc_data.list_size; i++) { |
| 293 | if (dlc_data.list[i] != NULL) { |
| 294 | snprintf(path, MAX_PATH_LENGTH, DLC_TEMP "/%s", &dlc_data.list[i][len + 1]); |
| 295 | if (refreshApp(path) == 1) |
| 296 | refresh_data->refreshed++; |
| 297 | else |
| 298 | sceIoRename(path, dlc_data.list[i]); |
| 299 | SetProgress(++refresh_data->processed, refresh_data->count); |
| 300 | free(dlc_data.list[i]); |
| 301 | } |
| 302 | } |
| 303 | } |
| 304 | } |
| 305 | |
| 306 | void patch_callback(void* data, const char* dir, const char* subdir) |
| 307 | { |
nothing calls this directly
no test coverage detected