Skip to content

Comments

migrator: update Sonarr/Whisparr RelativePath tables during root-folder migration#220

Open
nicholaskurjo wants to merge 1 commit intoNotifiarr:mainfrom
nicholaskurjo:fix/214-sonarr-relativepath-migration
Open

migrator: update Sonarr/Whisparr RelativePath tables during root-folder migration#220
nicholaskurjo wants to merge 1 commit intoNotifiarr:mainfrom
nicholaskurjo:fix/214-sonarr-relativepath-migration

Conversation

@nicholaskurjo
Copy link

Summary

  • add Sonarr/Whisparr migration coverage for:
    • EpisodeFiles.RelativePath
    • MetadataFiles.RelativePath
    • SubtitleFiles.RelativePath
  • keep existing absolute-path behavior for Path columns
  • add targeted RelativePath rewrite logic to normalize path separators when migrating between Windows and Linux style roots

Why

Issue #214 reports that root-folder migration alone leaves additional Sonarr tables with mismatched separator styles in RelativePath, causing re-scan churn and related DB/log issues after cross-OS migration.

Implementation

  • updated AppTables("Sonarr") and AppTables("Whisparr") in pkg/starrs/migrator.go to include the three RelativePath tables
  • introduced rewritePathForTable(...):
    • Path columns: prefix replace (existing behavior)
    • RelativePath columns: separator normalization based on old/new root style
  • updateFilesRootFolder(...) now routes updates through this helper

Tests

Added pkg/starrs/migrator_test.go with coverage for:

  • existing Path rewrite behavior
  • RelativePath rewrite Win -> Linux
  • RelativePath rewrite Linux -> Win
  • Sonarr/Whisparr table map includes the new RelativePath tables

Ran:

  • go test ./pkg/starrs
  • go test ./... (with temporary local frontend/dist placeholder for embed during test run)

Closes #214

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.

Additional Path changes needed when using Toolbarr DB Editor

1 participant