Skip to content

Commit

Permalink
feat: Add serialization and deserialization to server API settings an…
Browse files Browse the repository at this point in the history
…d requests

This change adds the `json` module's `loads` and `dumps` functions to serialize and deserialize server API settings and requests. This allows the settings and requests to be converted to and from JSON format, making them easier to handle and store.
  • Loading branch information
realashleybailey committed Nov 6, 2023
1 parent 8ad9021 commit 44cc9b3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions apps/wizarr-backend/wizarr_backend/api/routes/server_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from app.utils.software_lifecycle import get_current_version, need_update, get_latest_version, get_latest_beta_version
from app.extensions import cache

from json import loads, dumps


api = Namespace("Server", description="Server related operations", path="/server")

Expand All @@ -21,8 +23,8 @@ def get(self):
from helpers.requests import get_requests

resp = {
"settings": get_settings(disallowed=["server_api_key"]),
"requests": get_requests(disallowed=["api_key"]),
"settings": loads(dumps(get_settings(disallowed=["server_api_key"]), indent=4, sort_keys=True, default=str)),
"requests": loads(dumps(get_requests(disallowed=["api_key"]), indent=4, sort_keys=True, default=str)),
"version": str(get_current_version()),
"update_available": need_update(),
"debug": True if app.debug else False,
Expand Down

0 comments on commit 44cc9b3

Please sign in to comment.