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 methods #1083

Merged
merged 11 commits into from
Jun 3, 2024

Conversation

B13rg
Copy link

@B13rg B13rg commented Jun 1, 2024

Issue #1082

Creates a new way to export saved threads that includes the thread media and a json file with post data

Takes the list of ChanPosts associated with a thread and exports the post data in json format along with non-thumbnail media from the thread.

Saves everything in a zip in the format <chan>_<board>_<thread no.>_json.zip

Renamed the export types to be hopefully clearer:
image

@B13rg B13rg marked this pull request as ready for review June 1, 2024 06:14
@K1rakishou K1rakishou self-requested a review June 1, 2024 06:59
- Inject Gson into the class instead of creating it every single time.
- Close ByteArrayInputStream when copying is done.
Copy link
Owner

@K1rakishou K1rakishou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@B13rg
LGTM.

The only issue is I wouldn't recommend using ChanPost as a placeholder for converting stuff into json because that class will probably be changed soon so the json output will change too. Ideally, you need a new class, something like ChanPostDataToExport, (and also similar classes to all child ChanPost's child classes) then map them into these new classes and only after that convert them into json.

But if you are fine with a possibility that ChanPost might change in the future then I can merge this PR.

@B13rg
Copy link
Author

B13rg commented Jun 2, 2024

I'm totally fine with it changing, since it's just an export it should be fine.
If you have plans for eventually allowing importing of posts, I could use the themeparser import/export class for reference to be merged alongside the ChanPost changes

@K1rakishou K1rakishou merged commit 8e57c08 into K1rakishou:develop Jun 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants