refactor: removed redaktions-directus

This commit is contained in:
Matthias Jung
2026-02-01 21:37:52 +01:00
parent 2139685192
commit 74554dd821
5 changed files with 63 additions and 48 deletions
-26
View File
@@ -1,7 +1,4 @@
import json
from git import Repo
from tqdm import tqdm
from api.directus import DirectusAPI
@@ -13,29 +10,6 @@ class Download:
self.config = config
self.content_api = content_api
def download_snippets(self):
snippets = {}
for snippet in tqdm(self.content_api.get("items/snippet"), desc="Downloading snippets"):
snippets[snippet["ident"]] = snippet["content"]
with (self.config.p_data / "snippets.json").open("w", encoding="utf-8") as file:
json.dump(snippets, file, ensure_ascii=False, indent=4)
def download_content(self):
contents = []
for content in self.content_api.get(
"items/content"
): # tqdm(self.content_api.get("items/content"), desc="Downloading content"):
contents.append(
{
"url_part": content["url_part"],
"content": content["content"],
"sidebar": content["sidebar"],
}
)
with (self.config.p_data / "content.json").open("w", encoding="utf-8") as file:
json.dump(contents, file, ensure_ascii=False, indent=4)
def download_git_content(self):
repo_path = self.config.p_data / "git_content"
if not repo_path.exists():