You've already forked AstralRinth
forked from didirus/AstralRinth
Tag fetching and caching (#59)
* basic framework. still has errors * added functionality for main endpoints + some structuring * formatting * unused code * mimicked CLI function with wait_for process * added basic auth bindings * made PR changes, added playground * cargo fmt * removed missed println * misc tests fixes * cargo fmt * added windows support * cargo fmt * all OS use dunce * restructured profile slightly; fixed mac bug * profile changes, new main.rs * fixed requested pr + canonicaliation bug * fixed regressed bug in ui * fixed regressed bugs * fixed git error * typo * ran prettier * clippy * playground clippy * ported profile loading fix * profile change for real, url println and clippy * PR changes * auth bindings + semisynch flow * fixed dropping task error * prettier, eslint, clippy * removed debugging modifications * removed unused function that eslinter missed :( * initial errored push * working draft * added tag system! * fixed merge issue --------- Co-authored-by: Wyatt <wyatt@modrinth.com>
This commit is contained in:
@@ -3,9 +3,9 @@ use serde::{Serialize, Serializer};
|
||||
use thiserror::Error;
|
||||
|
||||
pub mod auth;
|
||||
|
||||
pub mod profile;
|
||||
pub mod profile_create;
|
||||
pub mod tags;
|
||||
pub mod settings;
|
||||
|
||||
pub type Result<T> = std::result::Result<T, TheseusGuiError>;
|
||||
|
||||
47
theseus_gui/src-tauri/src/api/tags.rs
Normal file
47
theseus_gui/src-tauri/src/api/tags.rs
Normal file
@@ -0,0 +1,47 @@
|
||||
use crate::api::Result;
|
||||
use theseus::tags::{
|
||||
Category, DonationPlatform, GameVersion, License, Loader, TagBundle,
|
||||
};
|
||||
|
||||
/// Gets cached category tags from the database
|
||||
#[tauri::command]
|
||||
pub async fn tags_get_category_tags() -> Result<Vec<Category>> {
|
||||
Ok(theseus::tags::get_category_tags().await?)
|
||||
}
|
||||
|
||||
/// Gets cached report type tags from the database
|
||||
#[tauri::command]
|
||||
pub async fn tags_get_report_type_tags() -> Result<Vec<String>> {
|
||||
Ok(theseus::tags::get_report_type_tags().await?)
|
||||
}
|
||||
|
||||
/// Gets cached loader tags from the database
|
||||
#[tauri::command]
|
||||
pub async fn tags_get_loader_tags() -> Result<Vec<Loader>> {
|
||||
Ok(theseus::tags::get_loader_tags().await?)
|
||||
}
|
||||
|
||||
/// Gets cached game version tags from the database
|
||||
#[tauri::command]
|
||||
pub async fn tags_get_game_version_tags() -> Result<Vec<GameVersion>> {
|
||||
Ok(theseus::tags::get_game_version_tags().await?)
|
||||
}
|
||||
|
||||
/// Gets cached license tags from the database
|
||||
#[tauri::command]
|
||||
pub async fn tags_get_license_tags() -> Result<Vec<License>> {
|
||||
Ok(theseus::tags::get_license_tags().await?)
|
||||
}
|
||||
|
||||
/// Gets cached donation platform tags from the database
|
||||
#[tauri::command]
|
||||
pub async fn tags_get_donation_platform_tags() -> Result<Vec<DonationPlatform>>
|
||||
{
|
||||
Ok(theseus::tags::get_donation_platform_tags().await?)
|
||||
}
|
||||
|
||||
/// Gets cached tag bundle from the database
|
||||
#[tauri::command]
|
||||
pub async fn tags_get_tag_bundle() -> Result<TagBundle> {
|
||||
Ok(theseus::tags::get_tag_bundle().await?)
|
||||
}
|
||||
Reference in New Issue
Block a user