Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use compact format for JSON files #22211

Merged
merged 1 commit into from
Jan 29, 2025
Merged

Conversation

Chocobo1
Copy link
Member

It saves a bit of space on disk and deters novice users from tampering them.

@Chocobo1 Chocobo1 added the Core label Jan 27, 2025
@Chocobo1 Chocobo1 added this to the 5.1 milestone Jan 27, 2025
@Chocobo1 Chocobo1 requested a review from a team January 27, 2025 08:42
@glassez
Copy link
Member

glassez commented Jan 27, 2025

Note that some (many) of these JSON files are essentially configuration files so I doubt we should use compact format for them.

@Chocobo1
Copy link
Member Author

Note that some (many) of these JSON files are essentially configuration files so I doubt we should use compact format for them.

Are those files really intended for user manual editing?

@glassez
Copy link
Member

glassez commented Jan 27, 2025

Note that some (many) of these JSON files are essentially configuration files so I doubt we should use compact format for them.

Are those files really intended for user manual editing?

I believe Yes. And they are often used this way in some scenarios, especially in no-GUI cases (even when there is access via WebUI, it often does not provide full support for configuring some features).

@Chocobo1
Copy link
Member Author

And they are often used this way in some scenarios, especially in no-GUI cases (even when there is access via WebUI, it often does not provide full support for configuring some features).

OK.
Last question. Not all of them are expected to be edited by users, right? Some of them can use compact format.
AFAIK uithemedialog.cpp and torrentfileswatcher.cpp should use indented format while others can use compact format.

src/base/bittorrent/sessionimpl.cpp Outdated Show resolved Hide resolved
src/base/rss/feed_serializer.cpp Show resolved Hide resolved
src/base/rss/rss_autodownloader.cpp Outdated Show resolved Hide resolved
src/base/rss/rss_session.cpp Outdated Show resolved Hide resolved
src/base/torrentfileswatcher.cpp Outdated Show resolved Hide resolved
src/gui/search/searchwidget.cpp Show resolved Hide resolved
src/gui/search/searchwidget.cpp Show resolved Hide resolved
src/gui/uithemedialog.cpp Outdated Show resolved Hide resolved
It saves a bit of space on disk and deters novice users from tampering them.
@Chocobo1 Chocobo1 merged commit f853616 into qbittorrent:master Jan 29, 2025
15 checks passed
@Chocobo1 Chocobo1 deleted the json_compact branch January 29, 2025 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants