Improve genre parsing
Fix game list sorting
This commit is contained in:
@@ -39,7 +39,20 @@ enum Status {
|
||||
impl MainView {
|
||||
pub fn new(mut db_factory: RocksDBFactory) -> color_eyre::Result<Self> {
|
||||
let db = db_factory.get_current_context()?;
|
||||
let games = db.get_all_values::<DLSiteManiax>()?;
|
||||
let mut games = db.get_all_values::<DLSiteManiax>()?;
|
||||
games.sort_by(|a, b| {
|
||||
let left = a.rj_num
|
||||
.chars().skip(2)
|
||||
.collect::<String>()
|
||||
.parse::<u32>()
|
||||
.unwrap();
|
||||
let right = b.rj_num
|
||||
.chars().skip(2)
|
||||
.collect::<String>()
|
||||
.parse::<u32>()
|
||||
.unwrap();
|
||||
left.cmp(&right)
|
||||
});
|
||||
let dl_game_list = GameList::new(games)?;
|
||||
let view = Self {
|
||||
state: MainViewState {
|
||||
|
||||
Reference in New Issue
Block a user