Update path handling for playnite portable case#86
Conversation
…esolve the variable
Summary of ChangesHello @dravorle, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the robustness and portability of Playnite installations by introducing a sophisticated path management system. It resolves critical issues where portable installations failed to correctly track or install ROMs when located within the Playnite directory. By dynamically expanding and collapsing "{PlayniteDir}" variables at runtime, the changes ensure that game and ROM paths remain valid even if the Playnite installation is moved. Furthermore, it streamlines the game metadata retrieval process by directly incorporating cover images. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to improve path handling for portable Playnite installations and updates the "Newtonsoft.Json" dependency to a more secure version. While it introduces architectural improvements and enhances "CoverImage" metadata handling, there are critical security and stability concerns. An unaddressed path traversal vulnerability in the game metadata fetching logic could allow arbitrary file writes. Furthermore, the new path expansion logic in "OnApplicationStarted" and "OnApplicationStopped" lacks crucial null checks for "game.Roms" and "game.InstallDirectory", potentially causing crashes, and the "string.Replace" operation in "OnApplicationStopped" needs a more precise check to prevent incorrect path modifications.
Quick Overview
This PR addresses and issue where portable Playnite installations are unable to install roms when their target directory is within the Playnite installation. It also provides the ability to move your installation around without it loosing track of installed files.
Issues
Changes
OnApplicationStarted
OnApplicationStopped
RomMInstallController
GetGames