[backup] games from server with images
This commit is contained in:
@ -13,6 +13,7 @@ unwrap_used = "warn"
|
||||
|
||||
[dependencies]
|
||||
# external
|
||||
bytes = { workspace = true }
|
||||
eyre = { workspace = true }
|
||||
semver = { workspace = true }
|
||||
serde = { workspace = true }
|
||||
|
@ -3,6 +3,7 @@
|
||||
|
||||
use std::{collections::HashMap, fmt};
|
||||
|
||||
use bytes::Bytes;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// A game
|
||||
@ -26,6 +27,8 @@ pub struct Game {
|
||||
pub genre: String,
|
||||
/// size in bytes: example: 3455063152
|
||||
pub size: u64,
|
||||
/// thumbnail image
|
||||
pub thumbnail: Option<Bytes>,
|
||||
}
|
||||
|
||||
impl fmt::Debug for Game {
|
||||
@ -103,7 +106,9 @@ impl GameDB {
|
||||
|
||||
#[must_use]
|
||||
pub fn all_games(&self) -> Vec<&Game> {
|
||||
self.games.values().collect()
|
||||
let mut games: Vec<_> = self.games.values().collect();
|
||||
games.sort_by(|a, b| a.name.cmp(&b.name));
|
||||
games
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user