Skip to content

fix: points android videos dir to ExternalStorage movies directory (#15562) - #15563

Merged
Legend-Master merged 2 commits into
tauri-apps:devfrom
onehumandev:onehumandev/video-dir
Jul 6, 2026
Merged

fix: points android videos dir to ExternalStorage movies directory (#15562)#15563
Legend-Master merged 2 commits into
tauri-apps:devfrom
onehumandev:onehumandev/video-dir

Conversation

@onehumandev

Copy link
Copy Markdown
Contributor

Summary

Fixes #15562: on Android, PathResolver::video_dir() / $VIDEO pointed at externalCacheDir instead of app-specific Movies storage.

PathPlugin.getVideoDir used activity.externalCacheDir, same location as $CACHE via getExternalCacheDir.

Other media helpers (getAudioDir, getPictureDir, getDocumentDir, getDownloadDir) already use activity.getExternalFilesDir(Environment.DIRECTORY_*).

Change getVideoDir to:

resolvePath(invoke, activity.getExternalFilesDir(Environment.DIRECTORY_MOVIES)?.absolutePath)
Typical path: /storage/emulated/0/Android/data/<package>/files/Movies

Why it matters

Wrong directory — cache is ephemeral; $VIDEO should not alias $CACHE.
FS scope broken — apps saving videos under Movies could not grant access via $VIDEO / $VIDEO/** because scope resolved to cache, not Movies.
Rust unchanged — PathResolver::video_dir() on Android still calls getVideoDir; only Kotlin resolution fixed.

Breaking change

$VIDEO / video_dir() on Android moves from external cache → app-specific Movies. Apps that wrote videos via the old $VIDEO path may need migration or path updates.

Test plan

  1. On Android device/emulator, call app.path().videoDir() (or equivalent) and confirm path ends in .../Android/data//files/Movies, not .../cache.
  2. Confirm $VIDEO differs from $CACHE / cache_dir().
  3. With FS scope allowing $VIDEO and $VIDEO/**, read/write a file under the resolved Movies path succeeds.
  4. Smoke other path helpers ($AUDIO, $PICTURE, etc.) — no regression expected.

@onehumandev
onehumandev requested a review from a team as a code owner June 18, 2026 18:12
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Package Changes Through 5676965

There are 14 changes which include tauri with minor, tauri-bundler with minor, tauri-cli with minor, @tauri-apps/cli with minor, tauri-utils with minor, tauri-build with minor, tauri-macos-sign with minor, tauri-runtime-wry with minor, tauri-runtime with minor, tauri-codegen with minor, tauri-macros with minor, tauri-plugin with minor, tauri-driver with minor, @tauri-apps/api with minor

Planned Package Versions

The following package releases are the planned based on the context of changes in this pull request.

package current next
@tauri-apps/api 2.11.1 2.12.0
tauri-utils 2.9.3 2.10.0
tauri-macos-sign 2.3.4 2.4.0
tauri-bundler 2.9.4 2.10.0
tauri-runtime 2.11.3 2.12.0
tauri-runtime-wry 2.11.4 2.12.0
tauri-codegen 2.6.3 2.7.0
tauri-macros 2.6.3 2.7.0
tauri-plugin 2.6.3 2.7.0
tauri-build 2.6.3 2.7.0
tauri 2.11.5 2.12.0
@tauri-apps/cli 2.11.4 2.12.0
tauri-cli 2.11.4 2.12.0
tauri-driver 2.0.6 2.1.0

Add another change file through the GitHub UI by following this link.


Read about change files or the docs at github.com/jbolda/covector

@velocitysystems

Copy link
Copy Markdown
Contributor

Thanks for this @onehumandev! The fix looks good and I agree it's the right direction—getVideoDir was the last outlier still using externalCacheDir, while the other media helpers already use getExternalFilesDir(Environment.DIRECTORY_*).

A few things to address before we merge:

  1. Add a change file
    Since this changes a returned path on a stable platform, we need a .changes/*.md entry to drive the version bump and changelog.

  2. Version classification
    I'd lean minor rather than patch. This is a behavioral breaking change, not a fix for something that was previously non-functional. The old path (.../cache) was valid and writable, so applications calling videoDir() may already have files there. After this change, $VIDEO resolves to .../files/Movies, which means existing files won't be discovered and any path-based assumptions may break.

  3. Migration note
    Please include a migration note in the change file (and optionally in the Rust video_dir() doc comment), for example:

Android: $VIDEO now resolves to the app-specific Movies directory instead of external cache storage. Files previously written to the old location will need to be migrated or paths updated accordingly.

Any thoughts @FabianLars @lucasfernog?

…5562)

This brings in the fix to point the movies directory on android to the correct path.
@onehumandev
onehumandev force-pushed the onehumandev/video-dir branch from fb71614 to 6a06bd2 Compare June 23, 2026 13:09
@onehumandev

Copy link
Copy Markdown
Contributor Author

A few things to address before we merge:

  1. Add a change file
    Since this changes a returned path on a stable platform, we need a .changes/*.md entry to drive the version bump and changelog.
  2. Version classification
    I'd lean minor rather than patch. This is a behavioral breaking change, not a fix for something that was previously non-functional. The old path (.../cache) was valid and writable, so applications calling videoDir() may already have files there. After this change, $VIDEO resolves to .../files/Movies, which means existing files won't be discovered and any path-based assumptions may break.
  3. Migration note
    Please include a migration note in the change file (and optionally in the Rust video_dir() doc comment), for example:

Android: $VIDEO now resolves to the app-specific Movies directory instead of external cache storage. Files previously written to the old location will need to be migrated or paths updated accordingly.

Good call; updated with recommendations.

@FabianLars

Copy link
Copy Markdown
Member

none other from what you said. i would have been fine with a patch but the next release will be a minor anyway. Will add this to the milestone, not sure if we're in the merge window already

@FabianLars FabianLars added this to the 2.12 milestone Jun 23, 2026

@Legend-Master Legend-Master left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Normally we should not do this type of breaking changes in minor bumps, but it was a bit too broken before I guess this is fine

@Legend-Master
Legend-Master requested a review from FabianLars July 6, 2026 11:23
@Legend-Master
Legend-Master merged commit 26cb3d6 into tauri-apps:dev Jul 6, 2026
22 checks passed
@onehumandev
onehumandev deleted the onehumandev/video-dir branch July 23, 2026 19:12
Proksima pushed a commit to Proksima/tauri that referenced this pull request Aug 5, 2026
…5562) (tauri-apps#15563)

This brings in the fix to point the movies directory on android to the correct path.
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.

bug(android): PathResolver::video_dir / $VIDEO resolves to external cache instead of Movies directory

4 participants