Skip to content

Commit

Permalink
Print progress when syncing
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipK committed Oct 2, 2021
1 parent d9a5357 commit 3462ee7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The goal is that you do not have to leave your Steam library to launch games fro
- [x] [Itch.io](https://itch.io/app) integration
- [x] [Origin](https://www.origin.com) integration (currently only windows, linux comming soon)
- [x] Cross Platform
- [x] Small (~1.5mb on disk), lightweight (~2mb ram) and fast(~1s sync)
- [x] Small (~1.5mb on disk), lightweight (~2mb ram) and fast(~30ms sync)
- [x] UI For configuration
- [ ] GOG integration
- [ ] UPlay integration
Expand Down
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ async fn run_sync(settings: &Settings) -> Result<(), Box<dyn Error>> {
let userinfo_shortcuts = get_shortcuts_paths(&settings.steam)?;
println!("Found {} user(s)", userinfo_shortcuts.len());
for user in userinfo_shortcuts.iter() {
let start_time = std::time::Instant::now();

let shortcut_info = get_shortcuts_for_user(user);

let mut new_user_shortcuts: Vec<ShortcutOwned> = shortcut_info.shortcuts;
Expand Down Expand Up @@ -223,9 +225,15 @@ async fn run_sync(settings: &Settings) -> Result<(), Box<dyn Error>> {

save_shortcuts(&shortcuts, Path::new(&shortcut_info.path));

let duration = start_time.elapsed();

println!("Finished synchronizing games in: {:?}", duration);

if settings.steamgrid_db.enabled {
let auth_key = &settings.steamgrid_db.auth_key;
if let Some(auth_key) = auth_key {
let start_time = std::time::Instant::now();
println!("Checking for game images");
let client = steamgriddb_api::Client::new(auth_key);
let mut search = CachedSearch::new(&client);
let known_images = get_users_images(user).unwrap();
Expand All @@ -238,6 +246,8 @@ async fn run_sync(settings: &Settings) -> Result<(), Box<dyn Error>> {
)
.await?;
search.save();
let duration = start_time.elapsed();
println!("Finished getting images in: {:?}", duration);
} else {
println!("Steamgrid DB Auth Key not found, please add one as described here: https://github.com/PhilipK/steam_shortcuts_sync#configuration");
}
Expand Down

0 comments on commit 3462ee7

Please sign in to comment.