Skip to content

fix(frontend): show media details for Remote Dev / Gateway files#100

Merged
twangodev merged 1 commit into
mainfrom
fix/remote-media-details
Jul 1, 2026
Merged

fix(frontend): show media details for Remote Dev / Gateway files#100
twangodev merged 1 commit into
mainfrom
fix/remote-media-details

Conversation

@twangodev

@twangodev twangodev commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Drops the isRemote short-circuit in maybeSendMediaInfo so a MediaInfo payload (and thus the details disclosure chevron) reaches the player for Remote Dev / Gateway files, which probe host-side by file id exactly like the spectrogram already does.

Summary by CodeRabbit

  • Bug Fixes
    • Improved media file detection so probing now follows a clearer eligibility rule.
    • Media info is no longer probed for headerless/raw audio formats, while regular remote media remains eligible.
    • Added coverage for remote files and raw audio cases to prevent regressions.

maybeSendMediaInfo short-circuited on source.isRemote, so no MediaInfo
payload ever reached the player for a remote file. Without a payload
hasMediaInfo stays false and the details disclosure chevron is never
rendered. The probe runs host-side and resolves the file by id, exactly
like the spectrogram, which already omits the guard, so remote files can
be probed too. Gate on a new EditorMediaSource.canProbeMediaInfo that
excludes only raw headerless codecs.
Copilot AI review requested due to automatic review settings July 1, 2026 20:03
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a canProbeMediaInfo boolean property to EditorMediaSource derived from file extension classification against raw audio extensions. MediaLoader.maybeSendMediaInfo() now uses this single property to gate probing instead of separate remote and raw-audio checks. New unit tests verify eligibility for remote and raw-audio files.

Changes

Media probing eligibility

Layer / File(s) Summary
canProbeMediaInfo property
frontend/src/main/kotlin/dev/twango/jetplay/media/EditorMediaSource.kt
New canProbeMediaInfo property computed from file extension, disabled for extensions in MediaClassification.rawAudioExtensions.
Simplified probing gate
frontend/src/main/kotlin/dev/twango/jetplay/editor/MediaLoader.kt
maybeSendMediaInfo() now guards on source.canProbeMediaInfo instead of separate remote/raw-audio checks.
Eligibility tests
frontend/src/test/kotlin/dev/twango/jetplay/media/EditorMediaSourceTest.kt
Adds tests using LightVirtualFile verifying canProbeMediaInfo is true for normal remote media and false for raw audio codec files.

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

Sequence Diagram(s)

sequenceDiagram
  participant MediaLoader
  participant EditorMediaSource
  MediaLoader->>EditorMediaSource: check canProbeMediaInfo
  EditorMediaSource-->>MediaLoader: true/false
  MediaLoader->>MediaLoader: proceed or skip media-info probe
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: enabling media details for Remote Dev / Gateway files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/remote-media-details

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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR enables media details (MediaInfo payload and the UI disclosure chevron) for Remote Dev / Gateway files by removing the isRemote short-circuit and relying on a dedicated eligibility flag on EditorMediaSource, while still excluding headerless raw audio codecs from probing.

Changes:

  • Add EditorMediaSource.canProbeMediaInfo to centralize MediaInfo-probing eligibility (remote files allowed; raw audio excluded).
  • Update MediaLoader.maybeSendMediaInfo() to gate solely on source.canProbeMediaInfo.
  • Extend EditorMediaSourceTest to cover remote-like LightVirtualFile eligibility and raw audio ineligibility.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
frontend/src/test/kotlin/dev/twango/jetplay/media/EditorMediaSourceTest.kt Adds tests for Remote Dev/Gateway-like files and raw audio MediaInfo probing eligibility.
frontend/src/main/kotlin/dev/twango/jetplay/media/EditorMediaSource.kt Introduces canProbeMediaInfo to allow host-side probing for remote files while excluding raw codecs.
frontend/src/main/kotlin/dev/twango/jetplay/editor/MediaLoader.kt Removes the remote/raw-audio short-circuit from maybeSendMediaInfo in favor of canProbeMediaInfo.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
frontend/src/main/kotlin/dev/twango/jetplay/editor/MediaLoader.kt (1)

136-142: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Guard looks correct; consider reusing canProbeMediaInfo in requestSpectrogram too.

The new gate correctly mirrors the "host-side, resolve-by-id, raw-audio excluded" pattern already used for spectrograms. However, requestSpectrogram() (Line 116) still inlines its own source.extension.lowercase() in MediaClassification.rawAudioExtensions check instead of the new canProbeMediaInfo property, which now expresses the exact same rule. Keeping two independent expressions of the same eligibility rule risks drift if the raw-audio set logic changes.

♻️ Proposed consolidation
     private fun requestSpectrogram() {
         if (!spectrogramRequested.compareAndSet(false, true)) return
-        // Headerless raw codecs lack the demuxer hints to decode cleanly, so skip them outright.
-        if (source.extension.lowercase() in MediaClassification.rawAudioExtensions) {
+        // Headerless raw codecs lack the demuxer hints to decode cleanly, so skip them outright.
+        if (!source.canProbeMediaInfo) {
             if (!bridge.disposed) bridge.sendSpectrogram(null)
             return
         }
🤖 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 `@frontend/src/main/kotlin/dev/twango/jetplay/editor/MediaLoader.kt` around
lines 136 - 142, `requestSpectrogram()` is still duplicating the media-info
eligibility rule instead of using the new `canProbeMediaInfo` property. Update
`MediaLoader.requestSpectrogram` to check `source.canProbeMediaInfo` the same
way `maybeSendMediaInfo()` does, so the host-side/raw-audio exclusion logic
lives in one place and stays consistent if
`MediaClassification.rawAudioExtensions` changes.
🤖 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.

Nitpick comments:
In `@frontend/src/main/kotlin/dev/twango/jetplay/editor/MediaLoader.kt`:
- Around line 136-142: `requestSpectrogram()` is still duplicating the
media-info eligibility rule instead of using the new `canProbeMediaInfo`
property. Update `MediaLoader.requestSpectrogram` to check
`source.canProbeMediaInfo` the same way `maybeSendMediaInfo()` does, so the
host-side/raw-audio exclusion logic lives in one place and stays consistent if
`MediaClassification.rawAudioExtensions` changes.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a55e2c7f-d16d-4de2-a3d1-accdec68489a

📥 Commits

Reviewing files that changed from the base of the PR and between 2b1f4dd and 6c92bae.

📒 Files selected for processing (3)
  • frontend/src/main/kotlin/dev/twango/jetplay/editor/MediaLoader.kt
  • frontend/src/main/kotlin/dev/twango/jetplay/media/EditorMediaSource.kt
  • frontend/src/test/kotlin/dev/twango/jetplay/media/EditorMediaSourceTest.kt

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Qodana for JVM

It seems all right 👌

No new problems were found according to the checks applied

💡 Qodana analysis was run in the pull request mode: only the changed files were checked

View the detailed Qodana report

To be able to view the detailed Qodana report, you can either:

To get *.log files or any other Qodana artifacts, run the action with upload-result option set to true,
so that the action will upload the files as the job artifacts:

      - name: 'Qodana Scan'
        uses: JetBrains/qodana-action@v2026.1.3
        with:
          upload-result: true
Contact Qodana team

Contact us at qodana-support@jetbrains.com

@twangodev twangodev merged commit 10ef25d into main Jul 1, 2026
16 checks passed
@twangodev twangodev deleted the fix/remote-media-details branch July 1, 2026 20:19
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.

2 participants