Keep CSV-exported paths that contain "; " intact [patch] - #177
Merged
Merged
Conversation
Export joined an entry's known paths with "; " and Import split on it, so a folder such as "Smith; Jones wedding" came back as two bogus paths, or the row was dropped. Export now ends every path with a line break, which the quoted field already round-trips and no path contains. Import still reads older exports that have no line break in the field as "; "-joined. Fixes #158 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Kj95GdQsZpSCcND7LqacT1
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Fixes #158
What was wrong
Export.BuildCsvjoined an entry'sKnownPathswith"; ", andImport.ParseCsvsplit the field on the same string. A path such as…/Photos/Smith; Jones wedding/IMG_001.jpgcame back as two bogus paths. Depending on how the second fragment parsed, the row could also be dropped entirely.Change
\n. The field is already quoted (CSV export → import loses data: multi-paragraph descriptions are truncated and names with commas drop the row #149), so the line break round-trips, and no path contains one. Terminating every path rather than joining them means a single-path entry also carries the marker, so Import can tell the two formats apart.Import.SplitKnownPathshandles the field:\r\nand dropping empty entries."; "split, so CSVs exported before this change still import as before.Tests
In
ImportTests:CsvExportThenImportKeepsPathsThatContainTheOldSeparator:BuildCsv→ParseCsvround trip with two paths underSmith; Jones wedding/, one of them also namedIMG_002; copy.jpg.SplitKnownPathsReadsBothTheCurrentAndTheLegacyFormat: covers LF, CRLF, the legacy"; "format and an empty field.With the
Export.cschange reverted,CsvExportThenImportKeepsPathsThatContainTheOldSeparatorfails. With the change, the full suite passes: 60 tests, 1 skipped as before because the root user can read every folder.🤖 Generated with Claude Code
https://claude.ai/code/session_01Kj95GdQsZpSCcND7LqacT1
Generated by Claude Code