-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor for performance, readability and maintainability #210
Commits on Jul 25, 2024
-
Configuration menu - View commit details
-
Copy full SHA for df5873e - Browse repository at this point
Copy the full SHA df5873eView commit details -
Refactor code for improved readability and maintainability
Several changes were made to the codebase to improve code readability and maintainability. These include the restructuring of multiple conditional statements, improved logger messaging, deletion of unnecessary comments and spaces, modification of class and method visibility, and alteration of class structure and parameters for better performance and clarity.
Configuration menu - View commit details
-
Copy full SHA for fa32fdb - Browse repository at this point
Copy the full SHA fa32fdbView commit details -
Configuration menu - View commit details
-
Copy full SHA for e2b4b56 - Browse repository at this point
Copy the full SHA e2b4b56View commit details -
Refactor code for better readability and async treatment
Several synchronous methods have been transformed into asynchronous tasks across ViewModel and utilities. All the constructors in the classes ListItem and PickedListItem were refactored into property initialization for better readability. Also, localization strings now use the LangProvider directly for language access. These significant changes will improve the codebase's maintainability.
Configuration menu - View commit details
-
Copy full SHA for 38c134a - Browse repository at this point
Copy the full SHA 38c134aView commit details -
Refactor: Simplify SearchResult data load method
Refactored the LoadData method in SearchResultViewModel.cs for better readability and logical flow. Extracted complex search result checks into a separate private method, HasSearchResult(). This makes the code cleaner and more maintainable by avoiding nested ternary operations and deep if conditions.
Configuration menu - View commit details
-
Copy full SHA for 73d1d3b - Browse repository at this point
Copy the full SHA 73d1d3bView commit details -
Refactor media type string properties and detail-fetching logic
The commit alters properties in the MediaTypes class to be constants rather than static getters. In the FileUtils class, it refactors the multipart conditional logic for fetching media details into a switch expression and separate helper methods for cleaner, more maintainable code.
Configuration menu - View commit details
-
Copy full SHA for cdd8e6e - Browse repository at this point
Copy the full SHA cdd8e6eView commit details -
Refactor: Simplify Search method in MainWindowViewModel
Previously, item processing was complex and involved many nested conditions. This made it difficult to understand and maintain. Now, item processing is simplified by extracting it into separate methods: `ProcessItemAsync`, `ProcessResultsAsync`, `AddToFinalList`, and `ProcessSubfolders`. This change improves the code's readability and maintainability.
Configuration menu - View commit details
-
Copy full SHA for 363430e - Browse repository at this point
Copy the full SHA 363430eView commit details -
Refactor search result processing in ProSearchResultViewModel
This update simplifies the result processing code in ProSearchResultViewModel by extracting reusable logic into separate methods. It also improves readability by breaking down complex conditions and loops into more manageable chunks. The handling of no results, processing of search results, and individual result items are now handled in their own methods.
Configuration menu - View commit details
-
Copy full SHA for dab6432 - Browse repository at this point
Copy the full SHA dab6432View commit details -
Refactor: Make GetClientAccessTokenAsync private and awaitable
Changed the GetClientAccessTokenAsync method from public to private as it does not need to be openly available. This method is now properly awaited in all calls to ensure sequential execution and prevent potential issues related to concurrency or incomplete tasks.
Configuration menu - View commit details
-
Copy full SHA for 9899d05 - Browse repository at this point
Copy the full SHA 9899d05View commit details -
refactor: Implement auto-scroll behavior in ScrollViewers
Extract auto-scroll logic into ScrollViewerBehavior and update XAML to use this new behavior. This cleaning encapsulates the auto-scroll functionality and removes redundant code, improving maintainability and readability.
Configuration menu - View commit details
-
Copy full SHA for 0415de2 - Browse repository at this point
Copy the full SHA 0415de2View commit details -
Configuration menu - View commit details
-
Copy full SHA for b467955 - Browse repository at this point
Copy the full SHA b467955View commit details -
fix: Refactor file validation logic
Simplify the file validation process by moving exclusion logic to `FileUtils`. Combined multiple conditions into a single method for clarity and maintainability.
Configuration menu - View commit details
-
Copy full SHA for aa013d1 - Browse repository at this point
Copy the full SHA aa013d1View commit details
Commits on Jul 26, 2024
-
refactor: Use MediaTypes constants for media type strings
Replaced hardcoded media type strings with `MediaTypes` constants across the entire codebase for better maintainability and consistency. This change affects various modules including ProcessUtils, MainWindowViewModel, SearchResultViewModel, TmdbDataTransformer, DataUtils, TMDBService, and IgdbDataTransformer.
Configuration menu - View commit details
-
Copy full SHA for 4b86e19 - Browse repository at this point
Copy the full SHA 4b86e19View commit details -
refactor: Segregate methods to simplify ResultPicked logic
Separated complex logic within the `ResultPicked` method into smaller methods to improve code readability and maintainability. Introduced `PrepareRating`, `PickResult`, `SelectMtvType`, `CastResult`, and `AddToPickedList` methods.
Configuration menu - View commit details
-
Copy full SHA for fe1051e - Browse repository at this point
Copy the full SHA fe1051eView commit details -
refactor: Refactor image URL generation
created a utility method to generate poster url for IGDB, also fix the issue of poster preview not working in game mode
Configuration menu - View commit details
-
Copy full SHA for 5ed8563 - Browse repository at this point
Copy the full SHA 5ed8563View commit details -
refactor: Unified image handling with a new IImage interface
Replaced direct image handling with `IImage` interface to streamline processing. Introduced `ArtworkWrapper` and `ImageDataWrapper` classes for better abstraction. Enhanced loading and processing logic for improved code clarity and maintainability.
Configuration menu - View commit details
-
Copy full SHA for 22177c1 - Browse repository at this point
Copy the full SHA 22177c1View commit details -
refactor: Simplify media type handling in PosterPickerViewModel
Refactored PosterPickerViewModel to streamline media type handling by extracting methods for different media types. Improved readability and maintainability by reducing redundancy.
Configuration menu - View commit details
-
Copy full SHA for b35e522 - Browse repository at this point
Copy the full SHA b35e522View commit details -
refactor: modularize SearchAndMakeMethod in MainWindowViewModel
Refactored SearchAndMakeMethod by extracting validation and initialization logic into separate helper methods. Improved code readability and maintainability by organizing related functionalities and reducing method complexity.
Configuration menu - View commit details
-
Copy full SHA for e9b9dce - Browse repository at this point
Copy the full SHA e9b9dceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7f233db - Browse repository at this point
Copy the full SHA 7f233dbView commit details -
fix: Remove async/await from sync methods and add static modifier
Refactored methods in PosterPickerViewModel to remove unnecessary async/await usage for synchronous operations. Made ProcessSubfolders method in MainWindowViewModel static to align it with its usage context. Added an async keyword to SearchAgainMethod to correctly await StartSearch execution in SearchResultViewModel.
Configuration menu - View commit details
-
Copy full SHA for 6ee179f - Browse repository at this point
Copy the full SHA 6ee179fView commit details -
refactor: Apply various code improvements and fixes
Refined method visibility, improved formatting, and fixed minor logical issues. Specifically, adjusted method access modifiers to `static`, used concise collection initializations, and corrected string formatting issues. Reorganized namespaces and fixed inconsistency in the handling of media types and file attributes.
Configuration menu - View commit details
-
Copy full SHA for eb5e32e - Browse repository at this point
Copy the full SHA eb5e32eView commit details -
refactor: readability and code style
Replaced switch with if-else in MainWindowViewModel for readability. Added exception for invalid search mode in TMDBService. Improved readability in FileUtils by adding braces around conditional return.
Configuration menu - View commit details
-
Copy full SHA for cce957f - Browse repository at this point
Copy the full SHA cce957fView commit details -
refactor: Extract dialog logic to ShowSearchResultDialog method
Refactored dialog handling for search results into a separate method to reduce code duplication and improve readability. This change affects the processing of zero, single, and multiple result cases.
Configuration menu - View commit details
-
Copy full SHA for c62d005 - Browse repository at this point
Copy the full SHA c62d005View commit details -
feature: Refactor and centralize PosterIcon code
Unified PosterIcon classes into a base class to avoid code duplication and simplify maintenance. Updated class for different PosterIcon variants to extend from the new PosterIconBase class.
Configuration menu - View commit details
-
Copy full SHA for af8f445 - Browse repository at this point
Copy the full SHA af8f445View commit details -
refactor: Centralize image opening logic
Refactored the image opening logic by creating a centralized `ShowImageBrowser` method in `UiUtil` class. This reduces redundancy and improves maintainability across the `ProSearchResultViewModel`, `PosterPickerViewModel`, and `ManualExplorerViewModel` classes.
Configuration menu - View commit details
-
Copy full SHA for e3480d3 - Browse repository at this point
Copy the full SHA e3480d3View commit details -
refactor: refactor data extraction to use a common method
Consolidate the logic for creating ListItem instances by introducing the TransformDetailsIntoListItem method. This reduces code duplication and simplifies updates.
Configuration menu - View commit details
-
Copy full SHA for 8684ef6 - Browse repository at this point
Copy the full SHA 8684ef6View commit details -
chore: Move ShowImageBrowser method to UiUtils
Moved `UiUtil.ShowImageBrowser` method to `UiUtils` and updated all references to use the new location.
Configuration menu - View commit details
-
Copy full SHA for cb051e5 - Browse repository at this point
Copy the full SHA cb051e5View commit details -
refactor: Move ListView sort logic to behavior class
Moved ListView sorting logic from code-behind to a new behavior class `ListViewClickSortBehavior`.
Configuration menu - View commit details
-
Copy full SHA for a0eccec - Browse repository at this point
Copy the full SHA a0eccecView commit details
Commits on Jul 27, 2024
-
chore: Remove unused using directives, and move most used directives …
…to GlobalUsing pattern Unnecessary using directives have been removed across multiple files to clean up the codebase and move frequently used directives to Usings.cs to reduce clutter
Configuration menu - View commit details
-
Copy full SHA for 49db1e2 - Browse repository at this point
Copy the full SHA 49db1e2View commit details -
fix: Improve error handling and remove unnecessary async
Enhanced error handling in `ProcessUtils.cs` by adding detailed error messages and throwing `InvalidOperationException`. Removed the unnecessary ` async ` keyword from `LoadGameData` in `PosterPickerViewModel.cs` as the method does not contain any async operations.
Configuration menu - View commit details
-
Copy full SHA for 95d2a19 - Browse repository at this point
Copy the full SHA 95d2a19View commit details -
refactor: Refactor TMDB data handling to use SearchResultData class
Refactored TmdbDataTransformer to encapsulate result details into a new SearchResultData class. This change simplifies the method signatures and improves code readability by reducing parameter count. Added SearchResultData.cs to define the new data structure.
Configuration menu - View commit details
-
Copy full SHA for 82584c8 - Browse repository at this point
Copy the full SHA 82584c8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e8efd5 - Browse repository at this point
Copy the full SHA 9e8efd5View commit details -
refactor: Simplify MainWindowViewModel constructor
Refactored MainWindowViewModel constructor by extracting property tracking, culture setup, and command line processing into separate methods for better readability and maintainability. Removed redundant initialization code and reorganized method calls for logical flow.
Configuration menu - View commit details
-
Copy full SHA for 3c433c5 - Browse repository at this point
Copy the full SHA 3c433c5View commit details -
fix: Replace
ProgressInfo
withProgressBarData
Updated the codebase to replace the `ProgressInfo` class with `ProgressBarData`. This change affects all instances where progress information is handled, including UI bindings and method parameters. Additionally, added an attribute `[Localizable(false)]` to `IconUtils`.
Configuration menu - View commit details
-
Copy full SHA for 2cc7282 - Browse repository at this point
Copy the full SHA 2cc7282View commit details -
Configuration menu - View commit details
-
Copy full SHA for e3efd42 - Browse repository at this point
Copy the full SHA e3efd42View commit details