-
-
Notifications
You must be signed in to change notification settings - Fork 357
Fix List layout crash with external storage #1758
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
Open
Meloon33
wants to merge
8
commits into
utkarshdalal:master
Choose a base branch
from
Meloon33:fix/list-layout-external-storage-crash
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
893d34b
Fix List layout crash with external storage
b343e84
Refactor ContainerManager to singleton pattern to improve performance…
0ea500d
Implement asynchronous icon loading and fix list layout divider overlap
d4f00e5
Improve documentation coverage for PR review
920b07d
Update .artifacts/9266bc76-2492-4ea3-87e8-b690e9961ac9/implementation…
Meloon33 4a3738d
Update artifacts for list layout fix
b0491fb
Finalize and polish PR #1758: Fix List Layout External Storage Crash
56de92b
Fix List layout crash with external storage and documentation polish
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,7 +173,7 @@ object CustomGameScanner { | |
|
|
||
| // 2) Try extracting from the selected container executable | ||
| try { | ||
| val cm = ContainerManager(context) | ||
| val cm = ContainerManager.getInstance(context) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. P2: Concurrent icon resolutions can both observe a null singleton and each rescan Prompt for AI agents |
||
| if (cm.hasContainer(appId)) { | ||
| val container = cm.getContainerById(appId) | ||
| val relExe = container.executablePath | ||
|
|
@@ -518,15 +518,19 @@ object CustomGameScanner { | |
| if (manualFolders.isNotEmpty()) { | ||
| val existingAppIds = mutableSetOf<String>() | ||
| for (manualPath in manualFolders) { | ||
| // Filter by query if provided | ||
| if (q.isNotEmpty()) { | ||
| val folderName = File(manualPath).name | ||
| if (!folderName.contains(q, ignoreCase = true)) continue | ||
| } | ||
| try { | ||
| // Filter by query if provided | ||
| if (q.isNotEmpty()) { | ||
| val folderName = File(manualPath).name | ||
| if (!folderName.contains(q, ignoreCase = true)) continue | ||
| } | ||
|
|
||
| val manualItem = createLibraryItemFromFolder(manualPath) | ||
| if (manualItem != null && existingAppIds.add(manualItem.appId)) { | ||
| items.add(manualItem.copy(index = indexCounter++)) | ||
| val manualItem = createLibraryItemFromFolder(manualPath) | ||
| if (manualItem != null && existingAppIds.add(manualItem.appId)) { | ||
| items.add(manualItem.copy(index = indexCounter++)) | ||
| } | ||
| } catch (e: Exception) { | ||
| Timber.tag("CustomGameScanner").e(e, "Error scanning custom game folder: $manualPath") | ||
| } | ||
| } | ||
| } | ||
|
|
@@ -565,8 +569,13 @@ object CustomGameScanner { | |
|
|
||
| fun createLibraryItemFromFolder(folderPath: String): LibraryItem? { | ||
| val folder = File(folderPath) | ||
| if (!folder.exists() || !folder.isDirectory) { | ||
| Timber.tag("CustomGameScanner").w("Folder does not exist or is not a directory: $folderPath") | ||
| try { | ||
| if (!folder.exists() || !folder.isDirectory) { | ||
| Timber.tag("CustomGameScanner").w("Folder does not exist or is not a directory: $folderPath") | ||
| return null | ||
| } | ||
| } catch (e: Exception) { | ||
| Timber.tag("CustomGameScanner").e(e, "Error accessing folder: $folderPath") | ||
| return null | ||
| } | ||
|
|
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.