Skip to content

Add .rar to the extract-eligible extension list - #108

Open
Auxxed wants to merge 1 commit into
thisisgm:mainfrom
Auxxed:extract-rar
Open

Auxxed wants to merge 1 commit into
thisisgm:mainfrom
Auxxed:extract-rar

Conversation

@Auxxed

@Auxxed Auxxed commented Sep 10, 2026

Copy link
Copy Markdown

Summary

  • ui/js/Archive.js gates the "Extract" context-menu row (and the extract destination-name logic) on a hardcoded EXTENSIONS array. .rar was missing, so right-clicking a .rar file never offered Extract — even though the Rust backend already handles it fine: extract_argv() in src/backend/archive.rs routes any non-.7z archive to bsdtar, which reads RAR archives via libarchive without any special-casing needed.
  • Adds .rar to EXTENSIONS, fixing both isArchive() (menu gating) and extractDir() (destination naming), since both derive from the same table.
  • Extends tests/js/archive.js to cover .rar in both functions.

Fixes #107

Test plan

  • ./tests/js.sh — full suite passes, 2986 checks, 0 failed
  • ./tests/js.sh archive — 21 checks, 0 failed (verified the 2 new assertions actually fail without the fix, by reverting Archive.js temporarily and re-running)
  • No changes to src/backend/archive.rs — extraction already worked via bsdtar; this only fixes the UI-side gate

Known caveat (not addressed by this PR): libarchive's RAR reader is read-only and doesn't cover every RAR variant — plain RAR5 archives and RAR archives using BCJ2/PPMd compression can still fail to extract via bsdtar, while older RAR4 archives generally work. That's a bsdtar/libarchive limitation outside this PR's scope; happy to follow up with a friendlier error message pointing at unrar as a fallback if that's wanted.

🤖 Generated with Claude Code

https://claude.ai/code/session_01RUEVNrijEoLhAEenXRx5es

Summary by CodeRabbit

  • New Features
    • Added support for recognizing RAR files as archives.
    • RAR files now resolve to their expected extraction directory.

ui/js/Archive.js gates the Extract context-menu row and the extract
destination-name logic on a hardcoded EXTENSIONS array. .rar was
missing, so right-clicking a .rar file never offered Extract even
though the Rust backend already handles it: extract_argv() in
src/backend/archive.rs routes any non-.7z archive to bsdtar, which
reads RAR archives fine via libarchive.

Extends tests/js/archive.js to cover .rar in both isArchive and
extractDir.

Fixes thisisgm#107

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RUEVNrijEoLhAEenXRx5es
@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 5edec7e1-a619-4867-83ed-9c4cd67a4756

📥 Commits

Reviewing files that changed from the base of the PR and between b992e76 and 56f939a.

📒 Files selected for processing (2)
  • tests/js/archive.js
  • ui/js/Archive.js

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Walkthrough

Walkthrough

The archive extension list now includes .rar. Archive detection and extraction-directory tests now cover RAR files.

Changes

RAR archive support

Layer / File(s) Summary
RAR extension and validation
ui/js/Archive.js, tests/js/archive.js
EXTENSIONS now includes .rar. Tests verify RAR archive detection and extraction to the movie directory.

Priority: ➖ Normal

Estimated code review effort: 1 (Trivial) | ~5 minutes

Severity of issue fixed: Medium

Suggested reviewers: thisisgm

Merge Risk: ⚪ Minimal · up to 56f93

The change is narrowly scoped and mergeable.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the primary change: adding .rar to the extensions eligible for extraction.
Linked Issues check ✅ Passed The changes satisfy issue [#107]. The UI now recognizes .rar files, the backend remains unchanged as required, and tests cover both isArchive() and extractDir().
Out of Scope Changes check ✅ Passed All changes are limited to adding .rar support in the UI and updating related JavaScript tests. No unrelated changes are present.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

Some tools did not complete. Review the errors below.

🔧 Biome (2.5.10)
tests/js/archive.js

File contains syntax errors that prevent linting: Line 1: Expected a statement but instead found '.'.; Line 1: Expected a semicolon or an implicit semicolon after a statement, but found none; Line 1: Expected a semicolon or an implicit semicolon after a statement, but found none; Line 2: Expected a semicolon or an implicit semicolon after a statement, but found none

ui/js/Archive.js

File contains syntax errors that prevent linting: Line 1: Expected a statement but instead found '.pragma library'.


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.

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.

.rar missing from the Extract-eligible extension list

1 participant