Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Include thread json in thread export #1082

Open
B13rg opened this issue May 31, 2024 · 3 comments
Open

Include thread json in thread export #1082

B13rg opened this issue May 31, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@B13rg
Copy link

B13rg commented May 31, 2024

Currently there are two export functions:

  • ExportDownloadedThreadAsHtmlUseCase: exports thread html, media, and thumbnails into .zip
  • ExportDownloadedThreadMediaUseCase: export thread media and thumbnails into folder

As part of the export process, I think it should include the thread json file which I think is fetched from ${siteName()}_${boardCode()}_${threadNo}.json. This will make it easier to access thread data with scripts

@K1rakishou K1rakishou added the enhancement New feature or request label May 31, 2024
@B13rg
Copy link
Author

B13rg commented May 31, 2024

Location to add for Thread export:

Location for thread media export:

I'll try and get a PR for this myself, do you have any suggestions for where I should be getting the thread data from in those functions?

@K1rakishou
Copy link
Owner

@B13rg
Unfortunately, there is no prepared json because downloaded threads are stored in the database. You will have to create the json manually by iterating through the posts.
See

chanPosts.forEach { chanPost ->
formatPost(chanPost).byteInputStream().use { formattedPostStream ->
formattedPostStream.copyTo(zos)
}
}

@K1rakishou
Copy link
Owner

K1rakishou commented May 31, 2024

@B13rg
You should probably just copy the whole class, rename it to ExportDownloadedThreadAsJsonUseCase and then do the conversion. Then hook it up to the bottom panel (add a new button with an icon or something like that) of LocalArchiveController and that should be it.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants