Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions src-tauri/src/cache/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -570,11 +570,6 @@ pub fn put_info(
Ok(())
}

pub fn delete_info(conn: &Connection, key: &str, kind: &str) -> Result<(), Error> {
conn.execute("DELETE FROM info WHERE key = ?1 AND kind = ?2", [key, kind])?;
Ok(())
}

/// Replaces every cached game of `provider` with `games` in one transaction.
pub fn replace(conn: &mut Connection, provider: ProviderKind, games: &[Game]) -> Result<(), Error> {
let tx = conn.transaction()?;
Expand Down
14 changes: 7 additions & 7 deletions src-tauri/src/commands/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use rusqlite::Connection;
use serde::{Deserialize, Serialize};
use tauri::{AppHandle, Manager, State};

use super::library::rescan;
use super::library::rescan_local;
use super::{
AppState, Process, Res, Shared, Watch, allow, blocking, open_db, queue_view, unix_now,
};
Expand Down Expand Up @@ -395,15 +395,15 @@ fn act_blocking(
}
if game.provider == ProviderKind::Gog {
let result = act_gog(&state, action, game, dlc, dest);
rescan(app, true);
rescan_local(app);
return result
.map(|()| None)
.map_err(|e| store_error(ProviderKind::Gog, e));
}
if game.provider == ProviderKind::Amazon {
let result = act_amazon(&state, action, game, dest);
if !matches!(action, Action::Play | Action::PlayOutdated) {
rescan(app, true);
rescan_local(app);
}
return result
.map(|()| None)
Expand Down Expand Up @@ -465,7 +465,7 @@ fn act_blocking(
Action::Install | Action::Update | Action::Verify => unreachable!("queued above"),
};
if !matches!(action, Action::Play | Action::PlayOutdated) {
rescan(app, true);
rescan_local(app);
}
result
.map(|()| None)
Expand Down Expand Up @@ -748,12 +748,12 @@ fn run_queue(app: &AppHandle) {
let (toast, repaired) = finish_job(&mut s, &key, result, store);
save_queue(&state, &s.queue);
drop(s);
// In the background: the next job need not wait for a full online scan. Only that scan shows a store game
// as installed, so the finished job's progress and its toast wait for it.
// In the background: the next job need not wait for the scan. Only that scan shows a store game as
// installed, so the finished job's progress and its toast wait for it. Local: a job changes installs only.
let scan = app.clone();
let action = job.action;
tauri::async_runtime::spawn_blocking(move || {
let changed = rescan(&scan, true);
let changed = rescan_local(&scan);
let state = scan.state::<AppState>();
let mut s = state.lock();
s.library_changed |= changed;
Expand Down
Loading
Loading