Skip to content

Fix .dms.json not found when working directory differs from media path - #188

Merged
anacrolix merged 2 commits into
masterfrom
copilot/fix-dms-json-not-found-issue
Aug 12, 2026
Merged

anacrolix merged 2 commits into
masterfrom
copilot/fix-dms-json-not-found-issue

Conversation

Copilot AI commented Aug 7, 2026 •

Copy link
Copy Markdown
Contributor

After Init(), RootObjectPath is reset to "./" while FS is rooted at the actual media path. readDynamicStream was using ioutil.ReadFile which resolves relative to the process working directory — so .dms.json files were only found when the working directory happened to match the media root.

Changes

  • readDynamicStream: accepts an fs.FS parameter; uses fs.ReadFile(fsys, path) instead of ioutil.ReadFile(path)
  • cds.go / dms.go: pass me.FS / server.FS at each call site — this FS is always rooted at the correct media directory regardless of working directory
  • Removes now-unused io/ioutil import from cds.go

Co-authored-by: anacrolix <988750+anacrolix@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix .dms.json not found when working directory is not media path Fix .dms.json not found when working directory differs from media path Aug 7, 2026
Copilot AI requested a review from anacrolix August 7, 2026 23:19
@anacrolix
anacrolix marked this pull request as ready for review August 12, 2026 01:11
@anacrolix
anacrolix merged commit a893078 into master Aug 12, 2026
1 check passed
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.

.dms.json not found if working directory != media path

2 participants