Commit b6663d1d authored by Anton Palgunov's avatar Anton Palgunov

fix: module parsing

parent e16823cd
...@@ -15,7 +15,7 @@ from gi.repository import Gtk, Adw, Gdk, GObject, GLib ...@@ -15,7 +15,7 @@ from gi.repository import Gtk, Adw, Gdk, GObject, GLib
GITHUB_API_URL = "https://api.github.com/search/repositories" GITHUB_API_URL = "https://api.github.com/search/repositories"
GITLAB_API_URL = "https://gitlab.com/api/v4/projects" GITLAB_API_URL = "https://gitlab.com/api/v4/projects"
CACHE_DIR = os.path.join(os.path.expanduser("~"), ".cache", "tuneit_shop") CACHE_DIR = os.path.join(os.path.expanduser("~"), ".cache", "tuneit", "shop")
if not os.path.exists(CACHE_DIR): if not os.path.exists(CACHE_DIR):
os.makedirs(CACHE_DIR, exist_ok=True) os.makedirs(CACHE_DIR, exist_ok=True)
...@@ -119,7 +119,7 @@ def retrieve_modules_full_list(force_refresh=False, initial_page=1, per_page=30) ...@@ -119,7 +119,7 @@ def retrieve_modules_full_list(force_refresh=False, initial_page=1, per_page=30)
"description": item["description"] or "", "description": item["description"] or "",
"html_url": item["html_url"], "html_url": item["html_url"],
"star_url": item["html_url"] + "/stargazers", "star_url": item["html_url"] + "/stargazers",
"module_yaml": module_info "module_yaml": module_info[0]
}) })
# GitLab # GitLab
...@@ -142,7 +142,7 @@ def retrieve_modules_full_list(force_refresh=False, initial_page=1, per_page=30) ...@@ -142,7 +142,7 @@ def retrieve_modules_full_list(force_refresh=False, initial_page=1, per_page=30)
"description": item["description"] or "", "description": item["description"] or "",
"html_url": item["web_url"], "html_url": item["web_url"],
"star_url": item["web_url"] + "/-/starrers", "star_url": item["web_url"] + "/-/starrers",
"module_yaml": module_info "module_yaml": module_info[0]
}) })
# Сохраняем в кеш # Сохраняем в кеш
...@@ -238,7 +238,7 @@ class ModuleCard(Gtk.Box): ...@@ -238,7 +238,7 @@ class ModuleCard(Gtk.Box):
if module_data["module_yaml"]: if module_data["module_yaml"]:
cover_url = module_data["module_yaml"].get("cover", "") cover_url = module_data["module_yaml"].get("cover", "")
if cover_url: if cover_url:
# TODO: Загрузка обложки # TODO: Загрузка обложки в кеш и отображение
try: try:
texture = Gdk.Texture.new_for_uri(cover_url) texture = Gdk.Texture.new_for_uri(cover_url)
cover_image = Gtk.Image.new_from_paintable(texture) cover_image = Gtk.Image.new_from_paintable(texture)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment