| 545 | } |
| 546 | |
| 547 | int export_thread(SceSize args_size, ExportArguments *args) { |
| 548 | SceUID thid = -1; |
| 549 | |
| 550 | // Lock power timers |
| 551 | powerLock(); |
| 552 | |
| 553 | // Set progress to 0% |
| 554 | sceMsgDialogProgressBarSetValue(SCE_MSG_DIALOG_PROGRESSBAR_TARGET_BAR_DEFAULT, 0); |
| 555 | sceKernelDelayThread(DIALOG_WAIT); // Needed to see the percentage |
| 556 | |
| 557 | FileListEntry *file_entry = fileListGetNthEntry(args->file_list, args->index); |
| 558 | |
| 559 | int count = 0; |
| 560 | FileListEntry *head = NULL; |
| 561 | FileListEntry *mark_entry_one = NULL; |
| 562 | |
| 563 | if (fileListFindEntry(args->mark_list, file_entry->name)) { // On marked entry |
| 564 | count = args->mark_list->length; |
| 565 | head = args->mark_list->head; |
| 566 | } else { |
| 567 | count = 1; |
| 568 | mark_entry_one = fileListCopyEntry(file_entry); |
| 569 | head = mark_entry_one; |
| 570 | } |
| 571 | |
| 572 | char path[MAX_PATH_LENGTH]; |
| 573 | FileListEntry *mark_entry = NULL; |
| 574 | |
| 575 | // Get paths info |
| 576 | uint64_t size = 0; |
| 577 | uint32_t files = 0; |
| 578 | |
| 579 | mark_entry = head; |
| 580 | |
| 581 | int i; |
| 582 | for (i = 0; i < count; i++) { |
| 583 | snprintf(path, MAX_PATH_LENGTH, "%s%s", args->file_list->path, mark_entry->name); |
| 584 | getPathInfo(path, &size, NULL, &files, mediaPathHandler); |
| 585 | mark_entry = mark_entry->next; |
| 586 | } |
| 587 | |
| 588 | // No media files |
| 589 | if (size == 0) { |
| 590 | closeWaitDialog(); |
| 591 | infoDialog(language_container[EXPORT_NO_MEDIA]); |
| 592 | goto EXIT; |
| 593 | } |
| 594 | |
| 595 | // Check memory card free space |
| 596 | if (checkMemoryCardFreeSpace("ux0:", size)) |
| 597 | goto EXIT; |
| 598 | |
| 599 | // Update thread |
| 600 | thid = createStartUpdateThread(size, 0); |
| 601 | |
| 602 | // Export process |
| 603 | uint64_t value = 0; |
| 604 | uint32_t songs = 0, videos = 0, pictures = 0; |
nothing calls this directly
no test coverage detected