aboutsummaryrefslogtreecommitdiff
path: root/src-tauri/src/mod_management
AgeCommit message (Collapse)Author
2024-05-02fix: Address clippy warning around direct `ToString` implementation (#914)GeckoEidechse
fix: Address clippy warning https://rust-lang.github.io/rust-clippy/master/index.html#/to_string_trait_impl
2024-02-13fix: Remove most leftover dbg prints (#803)GeckoEidechse
Removes all but one leftover `dbg!()` prints. The remaining one is in a function that is yet to be implemented.
2023-10-13refactor: Move `install_mod_wrapper` (#627)GeckoEidechse
Move `install_mod_wrapper` to `mod_management` module to clean up `main.rs`.
2023-08-08fix: Fix typo in commentGeckoEidechse
2023-08-01refactor Generalise temporary directory structure (#458)Jan
The temp folder we create could be reused for a lot more things, like extracting Northstar before moving files into the correct place. As such adjust the naming and structure to accommodate this.
2023-07-30refactor: Add Profile to GameInstall (#453)Jan
Add Profile to GameInstall Replace hardcoded uses of R2Northstar with profile attribute
2023-07-23feat: Add basic warning on plugin install (#441)GeckoEidechse
Plugins in Northstar have unrestricted device access. As such we want to warn user before installing one with an option to abort.
2023-07-22feat: Prevent mods with plugins to be installed (#438)GeckoEidechse
This is a temporary measure until a proper implementation exists that properly warns user before installing plugin
2023-07-21feat: Support installing Thunderstore packages (#426)GeckoEidechse
Support for installing mods from Thunderstore directly into the `packages` folder. Adds some basic sanity check during installation. After successful installation, the old version of the mod is removed. This includes both from `packages` and from `mods`.
2023-07-19feat: Add ability to delete package (#425)GeckoEidechse
Adds ability to delete mods from `packages` directory.
2023-07-19feat: Support reading mods from Northstar `packages` directory (#417)GeckoEidechse
2023-07-18refactor: Move code for legacy TS mod deletion to separate file (#424)GeckoEidechse
2023-07-17fix: Add regex check for parsing TS mod string (#421)GeckoEidechse
Otherwise we accept improper formatted Thunderstore mod strings like `AUTHOR-MOD-VERSION-RANDOM_STUFF`
2023-07-17feat: Implement `to_string` for `ParsedThunderstoreModString` (#420)GeckoEidechse
Allows printing `ParsedThunderstoreModString` in the Thunderstore mod string format
2023-07-16refactor: Move code for legacy mod install reading to separate file (#416)GeckoEidechse
Moves some logic related to reading legacy installed mods to new file in order to clean up code before adding new logic.
2023-07-07chore: Bump libthermite to `0.6.5` (#409)GeckoEidechse
And update code accordingly Co-authored-by: AnActualEmerald <emerald_actual@protonmail.com>
2023-06-28fix: Use empty map for enabled mods (#397)GeckoEidechse
if treating enabledmods.json as object fails
2023-06-01feat: Log folder names when indexing mods (#373)GeckoEidechse
2023-05-29fix: Return error on TS package index fetch fail (#371)GeckoEidechse
instead of panicking
2023-05-17feat: Better logging regarding mod installation (#363)GeckoEidechse
* fix: Make log comment more specific * feat: Log attempting to create temp dir * feat: Log mod to install and GameInstall struct * refactor: Replace `dbg` with proper logging * refactor: Replace `dbg` with proper logging * feat: Warning log mod install error * style: Fix formatting * feat: Log libthermite error and modstring when mod install fails
2023-05-10refactor: Move code from `lib.rs` into `main.rs` (#330)GeckoEidechse
Move remaining logic in one big move
2023-05-10refactor: Move `get_enabled_mods` to different source file (#311)GeckoEidechse
Move `get_enabled_mods` into the mod management module.
2023-05-10refactor: Import constants from crate rootGeckoEidechse
Instead of lib
2023-05-09refactor: Move `get_enabled_mods` to `main.rs` (#333)GeckoEidechse
Part of #329
2023-05-06refactor: Always remove zip files (#304)cat_or_not
* refactor: Always remove zip files * docs: Add comment explaining the use of the struct
2023-04-30refactor: Use error in `ParsedThunderstoreModString::FromStr` instead of ↵cat_or_not
panic (#295) report error instead of panic
2023-04-16Use pass-by-reference where possible (#266)cat_or_not
Use pass-by-reference where possible also contains some other small changes
2023-04-16fix: Fix incorrect is_empty check (#270)GeckoEidechse
Fixes a regression introduced in #244 that prevented any Thunderstore mods from being uninstalled Closes #269
2023-03-27fix: Various clippy fixes (#243)GeckoEidechse
* fix: Remove redundant return * fix: Remove unnecessary borrow * fix: Remove unnecessary import * fix: Use char for single character replacement instead of string * fix: Iterate over values directly instead of key-value pair * fix: Remove unnecessary let binding * fix: Remove unnecessary return statement * fix: Use char for single character replacement instead of string * refactor: Use struct short hand initialization
2023-03-27fix: Replace `<=0` with `.is_empty()` (#244)GeckoEidechse
2023-03-26fix: Remove redundant string conversions (#242)GeckoEidechse
As pointed out by clippy
2023-03-26refactor: Replace all `println!()` with log statements (#236)GeckoEidechse
* refactor: Replace all println with calls to logger in `do_install()` * refactor: Replace all println with calls to logger in `verify_install_location()` * refactor: Replace all println with calls to logger in `get_northstar_release_notes()` * refactor: Replace all println with calls to logger in `update_northstar_caller()` * refactor: Replace all println with calls to logger in `install_northstar_caller()` * refactor: Replace all println with calls to logger in `apply_launcher_pr()` * refactor: Replace all println with calls to logger in `apply_mods_pr()` * refactor: Replace all println with calls to logger in `find_game_install_location()` * refactor: Replace all println with calls to logger in `install_mod_caller()` * refactor: Replace all println with calls to logger in `set_mod_enabled_status()` * refactor: Replace all println with calls to logger in `parse_installed_mods()` * refactor: Replace all println with calls to logger in `origin_install_location_detection()` * refactor: Replace all println with calls to logger in `query_thunderstore_packages_api()` * refactor: Replace all println with calls to logger in `add_batch_file()` * refactor: Replace all println with calls to logger in `extract()` * refactor: Replace all println with calls to logger in `check_is_northstar_outdated()`
2023-02-11refactor: Move various consts to `constants.rs` (#162)GeckoEidechse
* refactor: Move list of core mods to consts source Move the list of core Northstar mods to constants.rs * fix: Add missing newline * refactor: Move list of blacklisted mods to consts source file * refactor: Move list of TF2 Origin IDs to consts source file
2023-02-07feat: Show mod version in LocalMods View (#159)GeckoEidechse
* refactor: Parse using serde deserialisation * refactor: Parse using serde deserial. (TS mod str) Reduce code by making use of serde deserialisation. Still supports legacy method * chore: Remove commented out fields While useful, it just made the code messy... * feat: Show mod version in LocalMods view * refactor: Move mod version to new line in source code Makes diffing in git easier * fix: Hide version number if not available
2023-02-06chore: Bump libthermite version to 0.5.2 (#163)GeckoEidechse
And fix corresponding code that broke in the process Basically just removing `await`s as the networking functions are no longer async.
2023-02-06refactor: Parse using serde deserialisation (#158)GeckoEidechse
* refactor: Parse using serde deserialisation * refactor: Parse using serde deserial. (TS mod str) Reduce code by making use of serde deserialisation. Still supports legacy method * chore: Remove commented out fields While useful, it just made the code messy...
2023-02-02fix: Prevent ModsView from crashing if Northstar is not installed (#152)Jan
2023-01-22chore: Autoformat Rust source files (#143)GeckoEidechse
2023-01-22fix: Properly parse mod string (#141)GeckoEidechse
2023-01-13refactor: Bump libthermite (#133)GeckoEidechse
* chore: Bump libthermite to v0.4.0-rc.1 And update broken code in FlightCore accordingly * chore: Bump libthermite to v0.4.0 And update broken code in FlightCore accordingly * feat: Parse TS mod string using new standard Instead of reading `mod.json`, we now build Thunderstore mod string using `manifest.json` and `thunderstore_author.txt`. The old method for reading is still supported for now but will likely be replaced by a converted function in the future. See also discussion in https://github.com/0neGal/viper/issues/165
2023-01-08feat: Delete given Thunderstore mod (#111)GeckoEidechse
* feat: Expose installed NS mod directory This allows other functions to get a mod directory directly which is useful for e.g. deleting a mod. * feat: Add button to delete Northstar mod * refactor: Return vector of NorthstarMod instead of unnamed Tuples * feat: Delete given Thunderstore mod * refactor: replace information button by a dropdown menu with remove item * refactor: only display removal mod option if said mod is installed * feat: only display dropdown menu for installed mods * refactor: Remove leftover print statement * chore: Remove leftover todo comment * feat: Show confirm warning before deleting mod * refactor: Call func directly instead of proxy Removes the `func_caller` pattern * fix: Call reloading mods after attempted delete * feat: Hook up deleting mod backend function Now clicking "Remove Mod" calls the appropriate backend function that removes the corresponding mod. * refactor: Call func directly instead of proxy Removes the `func_caller` pattern * style: Autoformat * feat: Support removing outdated mods No longer include the version number in the comparison check * fix: Rephrase error message * feat: Show pop-up confirmation before deleting mod for Thunderstore mod in ThunderstoreView Co-authored-by: Alystrasz <contact@remyraes.com> Co-authored-by: Remy Raes <raes.remy@gmail.com>
2023-01-04feat: Add button to delete Northstar mod (#110)GeckoEidechse
* feat: Expose installed NS mod directory This allows other functions to get a mod directory directly which is useful for e.g. deleting a mod. * feat: Add button to delete Northstar mod * refactor: Return vector of NorthstarMod instead of unnamed Tuples * refactor: Remove leftover print statement * chore: Remove leftover todo comment * feat: Show confirm warning before deleting mod * refactor: Call func directly instead of proxy Removes the `func_caller` pattern * fix: Call reloading mods after attempted delete
2023-01-04refactor: Remove unnecessary caller function pattern (#128)GeckoEidechse
* refactor: Remove unnecessary caller function Instead call `disable_all_but_core` directly * refactor: Remove unnecessary caller function Instead call `get_installed_mods_and_properties` directly * refactor: Remove unused exposed backend function * refactor: Remove unnecessary caller function Instead call `set_mod_enabled_status` directly * refactor: Remove unnecessary caller function Instead call `verify_game_files` directly * refactor: Remove unnecessary caller function Instead call `get_log_list` directly
2022-12-12feat: Expose installed NS mod directory (#109)GeckoEidechse
* feat: Expose installed NS mod directory This allows other functions to get a mod directory directly which is useful for e.g. deleting a mod. * refactor: Return vector of NorthstarMod instead of unnamed Tuples
2022-12-05refactor: Move variable to global const (#85)GeckoEidechse
Makes it easier to update/re-use in the future Co-authored-by: Remy Raes <contact@remyraes.com>
2022-11-28style: Auto-format all Rust code (#84)GeckoEidechse
2022-11-28feat: Rebuild `enabledmods.json` if value not found (#69)GeckoEidechse
* feat: Rebuild enabledmods.json if value not found When toggling a mod on enabled mods that is not present in `enabledmods.json` we would previously just error out. Now we rebuild the `enabledmods.json` file in a Northstar compatible format and then toggle the mod in question. * feat: Handle missing or corrupted enabledmods.json * chore: Remove leftover print statement
2022-11-19feat: Return Thunderstore mod string of installed mods. (#56)GeckoEidechse
* refactor: Rename function to better differentiate what it does * refactor: Add TS mod string field to NS mod struct This allows us to expose to frontend which Thunderstore mod a Northstar mod may belong to. Field is optional as not all mods may contain a Thunderstore mod string for example when they were installed manually. * feat: Add TS mod string field to NS mod interace * feat: Parse TS mod string and expose to frontend * fix: Mark unused variable as such
2022-11-19feat: Initial support for installing mods from TS (#32)GeckoEidechse
* feat: Initial support for installing mods from TS This is the basic code needed to install a mod from Thunderstore * refactor: Remove console log, show msg in notif Instead of console logging result message, show it in notification instead. * refactor: Rename function to indicate behaviour Function not only installs but also downloads mod first. Although it does remove downloaded zip post installation. * refactor: Move install logic to dedicated module `mod_management` module didn't exist when this PR was created * chore: Trim single leftover newline * fix: Update code for newer `libthermite` version * feat: Allow installing older versions of mods Installs the given version number instead of only allowing latest. * fix: Explicit error msg for installing NS as mod While it would fail during install anyway, having explicit error message is nicer * feat: Write TS mod string to mod.json Write Thunderstore mod string of installed mod to its `mod.json` This way we can later check whether a mod is outdated based on the Thunderstore mod string * fix: Early return on empty string Prevent trying to install the first mod that matches an early string. We should never pass an empty string in the first place but better safe then sorry. * build: Add dependency for recursive async Needed for recursive mod dependency install * feat: Recursively install mod dependencies * fix: Early catch installing R2modman as mod Just in case to prevent someone trying to install R2modman as a mod. * refactor: Remove debug prints * fix: Allow installing mods having NS as dependency They would previously error out as Northstar cannot be installed as dependency. We now catch that specific error and return Ok(()) * fix: Delete download folder after mod install Deletes download folder after mod install if non-empty. * fix: Do not early leave when dependency is NS Logic error, instead of skipping installing Northstar as dependency it would previously just return early with success. * chore: Remove leftover commented out code
2022-11-13feat: Add JSON5 support, allows comments in JSON (#50)GeckoEidechse
Some mods have comments in their JSON. Northstar handles it fine, so we should too.