Skip to content

fix(resolve): resolve PLS paths against its folder - #661

Open
jayhemnani9910 wants to merge 1 commit into
bjarneo:mainfrom
jayhemnani9910:fix/pls-relative-paths
Open

jayhemnani9910 wants to merge 1 commit into
bjarneo:mainfrom
jayhemnani9910:fix/pls-relative-paths

Conversation

@jayhemnani9910

@jayhemnani9910 jayhemnani9910 commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

A local PLS kept relative entries as written, so File1=song.mp3 was looked up in the current directory instead of next to the playlist. M3U files already resolve them against their folder. With ~/lib/playlists/mix.pls:

[playlist]
File1=song.mp3
File2=../music/other.mp3
NumberOfEntries=2

run from another directory:

$ cliamp playlist import ~/lib/playlists/mix.pls && cliamp playlist doctor
main:    [mix] missing: song.mp3
         [mix] missing: ../music/other.mp3
branch:  No missing local files found.

The same two entries in an .m3u beside it import fine on main. resolveLocalPLS now passes every entry through resolveM3UPath with the PLS folder, as the M3U path does, so file:// URIs, absolute paths and stream URLs are handled as before. Remote PLS playlists are unchanged.

How to test

  • go test ./resolve -run TestResolveLocalPLSRelativePaths (fails on main).
  • Import a PLS with relative entries from another directory and run cliamp playlist doctor, as above.

Checklist

  • make check passes (62 ok, same as main)

Summary by CodeRabbit

  • Bug Fixes
    • Local PLS playlist entries now resolve relative to the playlist’s directory, including paths that refer to its parent directory. Absolute paths and HTTP URLs remain unchanged.

A local PLS kept relative entries as they were, so File1=song.mp3 was
looked up in the current directory instead of next to the playlist, and
playlist import stored paths that playlist doctor then reported missing.
Resolve each entry the way M3U entries are (resolveM3UPath with the PLS
folder), which also covers file:// URIs. Tested with a new resolve test and
by importing a PLS from another directory.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Repository UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 225b0e83-5913-4310-9b70-d5da3e6dfd70
Commits

Reviewing files that changed from the base of the PR and between 02309c9 and cb09863.

Files selected for processing: 2
  • resolve/pls.go
  • resolve/pls_test.go

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

resolveLocalPLS now resolves each PLS entry against the playlist directory. A new test checks relative, parent-relative, absolute, and HTTP entries.

Changes: PLS Path Resolution

Layer / File(s) Summary
Resolve and test PLS entries
resolve/pls.go, resolve/pls_test.go
resolveLocalPLS uses resolveM3UPath to resolve entries against the playlist directory. The test checks the results for relative, parent-relative, absolute, and HTTP entries.

Priority: Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: bjarneo

Merge Risk: Minimal · up to cb098

Local PLS entries now resolve relative to the playlist folder. No merge-blocking regression was identified; the change is ready to merge after normal checks.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 2 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 and concisely describes the main change: resolving PLS paths relative to the playlist folder.
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.
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

This branch has not been deployed

No deployments
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