Skip to content

Video storage location: crash-safe migration (builds on #54) - #68

Open
LukeNeedham wants to merge 11 commits into
mainfrom
claude/video-diary-pr-review-vfmgcm
Open

LukeNeedham wants to merge 11 commits into
mainfrom
claude/video-diary-pr-review-vfmgcm

Conversation

@LukeNeedham

Copy link
Copy Markdown
Owner

Summary

Builds on #54 (SD card / internal storage setting, closes #1) and fixes the problems found in review. This branch contains #54's commits plus one fix commit, so it can replace #54.

  • Cancellation / process death: the setting is now saved inside VideosDao.moveVideosTo, which keeps running if the caller is cancelled. Files and setting can no longer disagree.
  • Failed moves: new VideoFolderTransfer copies via temp files, verifies sizes, only deletes sources after everything is copied, and rolls back cleanly. Stale .moving files are cleaned up, so a failed attempt no longer blocks retries.
  • SD card removed: falls back to internal storage with a warning on the storage screen, and merges videos back when the card returns (also recovers from an interrupted move).
  • Stale availability: SD card availability is re-checked when the storage screen opens.
  • Concurrency: file mutations are lock-guarded, videosDir is @Volatile, and a move fails safely if the diary changed during the copy.
  • Tests: VideoFolderTransferTest covers commit, rollback, conflicts, stale temp files and change detection.
  • Tidy: Koin import instead of a fully qualified name, square progress indicator, failures logged.

Notes

  • main has moved on (shared common library logger); this branch is still based on Feature/change storage path #54, so it will need a merge from main before it can land. Not done here.
  • Only the JVM unit tests were run (:app:testDebugUnitTest, passing). The SD card flow itself was not tried on a device or emulator.

Generated by Claude Code

flohulo and others added 10 commits October 5, 2026 21:34
- Copy videos via VideoFolderTransfer: sources are only deleted after every copy is verified, and failures roll back cleanly (no leftover temp files, no partial moves)
- Save the storage setting inside the move and keep running if the caller is cancelled, so files and setting can't disagree
- Fall back to internal storage when the SD card is missing, warn in the UI, and merge videos back when it returns
- Re-check SD card availability when the storage screen opens
- Guard file changes with a lock and detect diary changes during a move
- Add unit tests; tidy Koin import and progress indicator size

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBqFYw2zBG9C9sT7ABYdMN
Uses the same header, uppercase section label, rounded AppSurface card with icon-box rows and dividers, accent-tinted notices, and radio buttons coloured like the Debug switches.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBqFYw2zBG9C9sT7ABYdMN
Resolves conflicts in VideosDao (shared common Logger) and NormalRouter.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBqFYw2zBG9C9sT7ABYdMN
@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

✅ Build succeeded

The Debug page gets a Storage section: a fake SD card (a folder in the app's files), a switch to insert/remove it, and an 8 second pause during video moves, so Video storage can be tested without a real SD card.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FBqFYw2zBG9C9sT7ABYdMN
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.

Option to change the storage path.

3 participants