path-win: add subdirectory for cache

To not polute %LOCALAPPDATA%/mpv as it may be used for other things too.
This commit is contained in:
Kacper Michajłow 2023-07-26 21:24:18 +02:00 committed by Dudemanguy
parent 089a8480a2
commit aa05c06873
2 changed files with 2 additions and 2 deletions

View File

@ -1653,7 +1653,7 @@ You can find the exact path by running ``echo %APPDATA%\mpv\mpv.conf`` in cmd.ex
Other config files (such as ``input.conf``) are in the same directory. See the Other config files (such as ``input.conf``) are in the same directory. See the
`FILES`_ section above. `FILES`_ section above.
The cache directory is located at ``%LOCALAPPDATA%/mpv``. The cache directory is located at ``%LOCALAPPDATA%/mpv/cache``.
The environment variable ``$MPV_HOME`` completely overrides these, like on The environment variable ``$MPV_HOME`` completely overrides these, like on
UNIX. UNIX.

View File

@ -98,7 +98,7 @@ const char *mp_get_platform_path_win(void *talloc_ctx, const char *type)
if (strcmp(type, "home") == 0) if (strcmp(type, "home") == 0)
return mp_get_win_app_dir(talloc_ctx); return mp_get_win_app_dir(talloc_ctx);
if (strcmp(type, "cache") == 0) if (strcmp(type, "cache") == 0)
return mp_get_win_local_app_dir(talloc_ctx); return mp_path_join(talloc_ctx, mp_get_win_local_app_dir(talloc_ctx), "cache");
if (strcmp(type, "exe_dir") == 0) if (strcmp(type, "exe_dir") == 0)
return mp_get_win_exe_dir(talloc_ctx); return mp_get_win_exe_dir(talloc_ctx);
// Not really true, but serves as a way to return a lowest-priority dir. // Not really true, but serves as a way to return a lowest-priority dir.