Skip to content

fix: fixed premiumize connect#92

Merged
Nat3z merged 1 commit intomainfrom
fix/premiumize
Mar 2, 2026
Merged

fix: fixed premiumize connect#92
Nat3z merged 1 commit intomainfrom
fix/premiumize

Conversation

@Nat3z
Copy link
Owner

@Nat3z Nat3z commented Mar 2, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Improved error handling and recovery for download folder operations.
    • Enhanced transfer status polling with refined timeout and error handling.
  • Improvements

    • Strengthened API integration with proper headers and form data handling.
    • Added fallback mechanism to locate existing folders during download initialization.

@vercel
Copy link

vercel bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
open-game-installer-web Ready Ready Preview, Comment Mar 2, 2026 8:07pm

@Nat3z Nat3z merged commit a346eeb into main Mar 2, 2026
6 checks passed
@Nat3z Nat3z deleted the fix/premiumize branch March 2, 2026 20:07
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 2, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting

📥 Commits

Reviewing files that changed from the base of the PR and between b320768 and 3b8fb91.

📒 Files selected for processing (1)
  • application/src/frontend/lib/downloads/services/PremiumizeService.ts

📝 Walkthrough

Walkthrough

The Premiumize download service is enhanced with folder creation logic, refined transfer status polling, improved API header handling, and state cleanup mechanisms. The implementation introduces a new flow to create and locate an OpenGameInstaller folder, alongside modifications to API key configuration, form data serialization, and error handling patterns.

Changes

Cohort / File(s) Summary
Type Definitions
application/src/frontend/lib/downloads/services/PremiumizeService.ts
Expanded PremiumizeFolderContentItem with optional fields (size, mime_type, transcode_status, link, stream_link, virus_scan) and PremiumizeFolderResponse to include breadcrumbs and optional folder_id.
API Configuration & Headers
application/src/frontend/lib/downloads/services/PremiumizeService.ts
Changed API key source from 'premiumize' to 'realdebrid' config; added Accept: application/json header to API calls; updated form data serialization using Object.fromEntries.
Folder Management Flow
application/src/frontend/lib/downloads/services/PremiumizeService.ts
Introduced folder creation logic (POST /folder/create) with fallback search to locate existing OpenGameInstaller folder by iterating folder content; refactored folder content lookup with error handling for missing folders.
Transfer & Download Flow
application/src/frontend/lib/downloads/services/PremiumizeService.ts
Refined transfer status polling with clarified timeout and error handling; updated direct download retrieval with Accept header; ensured currentDownloads cleanup in finally block; adjusted temp download ID creation timing and button state restoration.

Sequence Diagram(s)

sequenceDiagram
    participant Client as Client/UI
    participant Service as PremiumizeService
    participant API as Premiumize API
    
    Client->>Service: startDownload(...)
    
    rect rgba(100, 150, 200, 0.5)
    Note over Service,API: Folder Creation Flow
    Service->>API: POST /folder/create (OpenGameInstaller)
    alt Folder creation succeeds
        API-->>Service: folder_id
    else Folder creation fails
        Service->>API: GET /folder/list (search folders)
        API-->>Service: folder list
        Service->>Service: Find OpenGameInstaller folder
    end
    end
    
    rect rgba(150, 200, 100, 0.5)
    Note over Service,API: Content & Transfer Flow
    Service->>API: GET /folder/content (with Accept header)
    API-->>Service: folder content data
    Service->>Service: Locate OpenGameInstaller folder
    Service->>API: POST /transfer/create (form data)
    API-->>Service: transfer response
    end
    
    rect rgba(200, 150, 100, 0.5)
    Note over Service,API: Status Polling Loop
    loop Until success/timeout
        Service->>API: GET /transfer/list (with Accept header)
        API-->>Service: transfer status
        alt Status finished
            Service->>Service: Extract folder_id
            break Resolve with folder_id
            end
        else Status error
            break Reject with error
            end
        else Timeout exceeded
            break Reject with timeout
            end
        end
    end
    end
    
    rect rgba(200, 100, 150, 0.5)
    Note over Service,API: Direct Download
    Service->>API: GET /transfer/directdl (with Accept header)
    API-->>Service: direct download URL
    Service->>Client: Dispatch download with headers
    Service->>Service: Cleanup currentDownloads
    end
    
    Service-->>Client: Download initiated/Error
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~50 minutes

Poem

🐰 A folder formed in Silicon Valley deep,
Where transfers dance and APIs keep
Their promises with headers held tight,
The Premiumize service burns so bright!
Downloads flow like carrots so fine,
State cleaned up—a change sublime! 🥕✨

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/premiumize

Tip

Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs).
Share your feedback on Discord.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typecheck Passed - All type checks successful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant