Fix Workshop Mods for YOMI:HUSTLE when using bionic steam#1745
Fix Workshop Mods for YOMI:HUSTLE when using bionic steam#1745Nightwalker743 wants to merge 1 commit into
Conversation
📝 WalkthroughWalkthroughWorkshopManager adds Yomi Hustle-specific recovery and ZIP filtering. WorkshopSymlinker accepts extension filters, propagates them through sync operations, and restricts flat-file symlinks to matching payloads. ChangesYomi Hustle workshop synchronization
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant WorkshopManager
participant WorkshopSymlinker
participant WorkshopContent
WorkshopManager->>WorkshopSymlinker: Sync Yomi items with ZIP filtering
WorkshopSymlinker->>WorkshopContent: Select ZIP payloads
WorkshopSymlinker->>WorkshopContent: Create filtered symlinks
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@app/src/main/java/app/gamenative/workshop/WorkshopManager.kt`:
- Around line 327-343: Update the YOMI recovery branch in WorkshopManager’s item
filter to use any { ... } != true for the missing-ZIP check. Before returning
true, call invalidateWorkshopItemForRedownload with the item’s directory/item
context so the existing extracted directory tree is deleted and the next
download starts cleanly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 367045d6-ac9b-47e9-8801-c9bf29e13785
📒 Files selected for processing (2)
app/src/main/java/app/gamenative/workshop/WorkshopManager.ktapp/src/main/java/app/gamenative/workshop/WorkshopSymlinker.kt
| // Older builds extracted YOMI's Workshop ZIPs and deleted the archives. | ||
| // Re-download those items once so the original archive (and therefore | ||
| // its multiplayer hash) is restored instead of rebuilding a different ZIP. | ||
| if ( | ||
| item.appId == YOMI_HUSTLE_APP_ID && | ||
| File(itemDir, ".zip_extracted").isFile && | ||
| itemDir.listFiles()?.none { | ||
| it.isFile && it.extension.equals("zip", ignoreCase = true) | ||
| } != false | ||
| ) { | ||
| Timber.tag(TAG).i( | ||
| "Item ${item.publishedFileId} '${item.title}' needs sync: " + | ||
| "restoring YOMI Workshop ZIP removed by an older build" | ||
| ) | ||
| return@filter true | ||
| } | ||
|
|
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Clear the directory to reclaim disk space and simplify the check.
Simply returning true here flags the item for redownload but does not delete the existing directory. Because older builds extracted the ZIP payload directly into this directory, all of those extracted files will remain indefinitely alongside the newly downloaded ZIP, wasting disk space.
Call the existing invalidateWorkshopItemForRedownload helper to delete the directory tree before returning true. This guarantees a completely fresh download and reclaims space.
Additionally, you can express the missing-ZIP check more idiomatically in Kotlin: any { ... } != true behaves identically to none { ... } != false (handling both empty and null arrays gracefully) but is much easier to read.
♻️ Proposed refactor
// Older builds extracted YOMI's Workshop ZIPs and deleted the archives.
// Re-download those items once so the original archive (and therefore
// its multiplayer hash) is restored instead of rebuilding a different ZIP.
if (
item.appId == YOMI_HUSTLE_APP_ID &&
File(itemDir, ".zip_extracted").isFile &&
- itemDir.listFiles()?.none {
+ itemDir.listFiles()?.any {
it.isFile && it.extension.equals("zip", ignoreCase = true)
- } != false
+ } != true
) {
- Timber.tag(TAG).i(
- "Item ${item.publishedFileId} '${item.title}' needs sync: " +
- "restoring YOMI Workshop ZIP removed by an older build"
+ invalidateWorkshopItemForRedownload(
+ itemDir,
+ partialDir,
+ "restoring YOMI Workshop ZIP removed by an older build for '${item.title}'"
)
return@filter true
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| // Older builds extracted YOMI's Workshop ZIPs and deleted the archives. | |
| // Re-download those items once so the original archive (and therefore | |
| // its multiplayer hash) is restored instead of rebuilding a different ZIP. | |
| if ( | |
| item.appId == YOMI_HUSTLE_APP_ID && | |
| File(itemDir, ".zip_extracted").isFile && | |
| itemDir.listFiles()?.none { | |
| it.isFile && it.extension.equals("zip", ignoreCase = true) | |
| } != false | |
| ) { | |
| Timber.tag(TAG).i( | |
| "Item ${item.publishedFileId} '${item.title}' needs sync: " + | |
| "restoring YOMI Workshop ZIP removed by an older build" | |
| ) | |
| return@filter true | |
| } | |
| // Older builds extracted YOMI's Workshop ZIPs and deleted the archives. | |
| // Re-download those items once so the original archive (and therefore | |
| // its multiplayer hash) is restored instead of rebuilding a different ZIP. | |
| if ( | |
| item.appId == YOMI_HUSTLE_APP_ID && | |
| File(itemDir, ".zip_extracted").isFile && | |
| itemDir.listFiles()?.any { | |
| it.isFile && it.extension.equals("zip", ignoreCase = true) | |
| } != true | |
| ) { | |
| invalidateWorkshopItemForRedownload( | |
| itemDir, | |
| partialDir, | |
| "restoring YOMI Workshop ZIP removed by an older build for '${item.title}'" | |
| ) | |
| return@filter true | |
| } |
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@app/src/main/java/app/gamenative/workshop/WorkshopManager.kt` around lines
327 - 343, Update the YOMI recovery branch in WorkshopManager’s item filter to
use any { ... } != true for the missing-ZIP check. Before returning true, call
invalidateWorkshopItemForRedownload with the item’s directory/item context so
the existing extracted directory tree is deleted and the next download starts
cleanly.
Description
Fix Workshop Mods for YOMI:HUSTLE when using bionic steam
Recording
https://drive.google.com/file/d/1E_O43I_LkIXG4x8QPA-Fu3l6uVTVPzZ6/view?usp=drivesdk
Type of Change
Checklist
#code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.CONTRIBUTING.md.Summary by cubic
Fixes YOMI:HUSTLE Workshop mods on Bionic Steam. We now keep ZIP archives and symlink them directly, restoring removed archives to maintain multiplayer hashes.
YOMI_HUSTLE_APP_IDand treat its Workshop payloads as flat.zipfiles (no extraction).WorkshopSymlinkerto symlink only allowed extensions (e.g.,.zip) into the target mod directory.Written for commit 0a0cf41. Summary will update on new commits.
Summary by CodeRabbit