You've already forked AstralRinth
forked from didirus/AstralRinth
Implement more database methods and basic API routes (#50)
* feat: Implement more database methods & add mod and version routes * feat: Implement deleting mods/versions & implement categories * feat: Implement routes for categories, game versions & loaders * feat: Reorganize API routes in a (hopefully) usable way
This commit is contained in:
@@ -171,7 +171,7 @@ pub mod base62_impl {
|
||||
|
||||
fn parse_base62(string: &str) -> Result<u64, DecodingError> {
|
||||
let mut num: u64 = 0;
|
||||
for c in string.chars().rev() {
|
||||
for c in string.chars() {
|
||||
let next_digit;
|
||||
if c.is_ascii_digit() {
|
||||
next_digit = (c as u8 - b'0') as u64;
|
||||
|
||||
@@ -81,20 +81,13 @@ pub struct Version {
|
||||
/// A single mod file, with a url for the file and the file's hash
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct VersionFile {
|
||||
/// A list of hashes of the file
|
||||
pub hashes: Vec<FileHash>,
|
||||
/// A map of hashes of the file. The key is the hashing algorithm
|
||||
/// and the value is the string version of the hash.
|
||||
pub hashes: std::collections::HashMap<String, String>,
|
||||
/// A direct link to the file for downloading it.
|
||||
pub url: String,
|
||||
}
|
||||
|
||||
/// A hash of a mod's file
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct FileHash {
|
||||
// TODO: decide specific algorithms
|
||||
/// The hashing algorithm used for this hash; could be "md5", "sha1", etc
|
||||
pub algorithm: String,
|
||||
/// The file hash, using the specified algorithm
|
||||
pub hash: String,
|
||||
/// A direct link to the file for downloading it.
|
||||
pub filename: String,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Clone)]
|
||||
|
||||
Reference in New Issue
Block a user