diff --git a/Readme.md b/Readme.md index 71d37d3..efe414b 100644 --- a/Readme.md +++ b/Readme.md @@ -13,7 +13,7 @@ Running `lnshot` will generate a set of [symbolic links](https://en.wikipedia.or ``` 📂 ~/Pictures/Steam Screenshots └ 📂 Ticky - ├ 📂 Hardspace Shipbreaker + ├ 📂 Hardspace: Shipbreaker │ └ 🌌 20221020102933_1.jpg ├ 📂 Need for Speed: Most Wanted │ └ 🌃 20221005164632_1.jpg @@ -41,7 +41,7 @@ Instead of this: `lnshot` can detect Steam's installation directory, and automatically find your Pictures folder across all three supported Steam platforms. -User folders are generated for each Steam user logged into your system (filtering is not yet supported). Game folders will be named after your game title for non-Steam shortcuts, and named the same as the `steamapps/common` installation folder for games managed by Steam, which is usually a reasonable name. This may change to use the full Steam app name in the future. +User folders are generated for each Steam user logged into your system (filtering is not yet supported). Game folders will be named after each game's title. `lnshot` does this offline, using only the metadata Steam already has stored on your hard disk. diff --git a/src/main.rs b/src/main.rs index 95cb6b2..0397fe3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ use anyhow::{Context, Result}; use clap::{Parser, Subcommand}; use directories::UserDirs; use steamid_ng::SteamID; -use steamlocate::{SteamDir}; +use steamlocate::SteamDir; /// Symlink your Steam games' screenshot directories into your Pictures folder #[derive(Parser, Debug)] @@ -124,16 +124,16 @@ fn main() -> Result<()> { ); let symlink_name = if let Some(Some(app)) = steam_apps.get(&(appid as u32)) { - app.path - .file_name() - .with_context(|| "Failed to retrieve file name from install path")? + app.name + .clone() + .with_context(|| "Failed to retrieve Steam app name")? } else if let Some(shortcut) = steam_shortcuts.iter().find(|shortcut| { u64::from(shortcut.appid & 0x7fffff) == appid || shortcut.steam_id() == appid }) { - std::ffi::OsStr::new(&shortcut.app_name) + shortcut.app_name.to_string() } else { - std::ffi::OsStr::new(appid_str) + appid_str.to_string() }; let target_symlink_path = target_screenshots_dir.join(symlink_name); @@ -355,16 +355,16 @@ fn main() -> Result<()> { let steam_shortcuts = steam_dir.shortcuts(); let symlink_name = if let Some(Some(app)) = steam_apps.get(&(appid as u32)) { - app.path - .file_name() - .with_context(|| "Failed to retrieve file name from install path")? + app.name + .clone() + .with_context(|| "Failed to retrieve Steam app name")? } else if let Some(shortcut) = steam_shortcuts.iter().find(|shortcut| { u64::from(shortcut.appid & 0x7fffff) == appid || shortcut.steam_id() == appid }) { - std::ffi::OsStr::new(&shortcut.app_name) + shortcut.app_name.to_string() } else { - std::ffi::OsStr::new(&appid_str) + appid_str.to_string() }; let target_symlink_path = target_screenshots_dir.join(symlink_name);