It will be used in the next commit.
Unified · Split
| @@ -0,0 +1 @@ | ||
| 1 | +add `current-watch-later-dir` property | |
| @@ -3753,6 +3753,11 @@ Property list · 3752 unmodified lines | ||
| 3753 | 3753 | The working directory of the mpv process. Can be useful for JSON IPC users, |
| 3754 | 3754 | because the command line player usually works with relative paths. |
| 3755 | 3755 | |
| 3756 | +``current-watch-later-dir`` | |
| 3757 | + The directory in which watch later config files are stored. This returns | |
| 3758 | + ``--watch-later-dir``, or the default directory if ``--watch-later-dir`` has | |
| 3759 | + not been modified, with tilde placeholders expanded. | |
| 3760 | + | |
| 3756 | 3761 | ``protocol-list`` |
| 3757 | 3762 | List of protocol prefixes potentially recognized by the player. They are |
| 3758 | 3763 | returned without trailing ``://`` suffix (which is still always required). |
| @@ -3528,6 +3528,13 @@ static int mp_property_cwd(void *ctx, struct m_property *prop, · 3527 unmodified lines | ||
| 3528 | 3528 | return M_PROPERTY_NOT_IMPLEMENTED; |
| 3529 | 3529 | } |
| 3530 | 3530 | |
| 3531 | +static int mp_property_current_watch_later_dir(void *ctx, struct m_property *prop, | |
| 3532 | + int action, void *arg) | |
| 3533 | +{ | |
| 3534 | + MPContext *mpctx = ctx; | |
| 3535 | + return m_property_strdup_ro(action, arg, mp_get_playback_resume_dir(mpctx)); | |
| 3536 | +} | |
| 3537 | + | |
| 3531 | 3538 | static int mp_property_protocols(void *ctx, struct m_property *prop, |
| 3532 | 3539 | int action, void *arg) |
| 3533 | 3540 | { |
| @@ -4388,6 +4395,7 @@ static const struct m_property mp_properties_base[] = { · 854 unmodified lines | ||
| 4388 | 4395 | {"ambient-light", mp_property_ambient_light}, |
| 4389 | 4396 | |
| 4390 | 4397 | {"working-directory", mp_property_cwd}, |
| 4398 | + {"current-watch-later-dir", mp_property_current_watch_later_dir}, | |
| 4391 | 4399 | |
| 4392 | 4400 | {"protocol-list", mp_property_protocols}, |
| 4393 | 4401 | {"decoder-list", mp_property_decoders}, |
| @@ -197,7 +197,7 @@ static bool copy_mtime(const char *f1, const char *f2) · 196 unmodified lines | ||
| 197 | 197 | return true; |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | −static char *mp_get_playback_resume_dir(struct MPContext *mpctx) | |
| 200 | +char *mp_get_playback_resume_dir(struct MPContext *mpctx) | |
| 201 | 201 | { |
| 202 | 202 | char *wl_dir = mpctx->opts->watch_later_dir; |
| 203 | 203 | if (wl_dir && wl_dir[0]) { |
| @@ -510,6 +510,7 @@ void audio_start_ao(struct MPContext *mpctx); · 509 unmodified lines | ||
| 510 | 510 | void mp_parse_cfgfiles(struct MPContext *mpctx); |
| 511 | 511 | void mp_load_auto_profiles(struct MPContext *mpctx); |
| 512 | 512 | bool mp_load_playback_resume(struct MPContext *mpctx, const char *file); |
| 513 | +char *mp_get_playback_resume_dir(struct MPContext *mpctx); | |
| 513 | 514 | void mp_write_watch_later_conf(struct MPContext *mpctx); |
| 514 | 515 | void mp_delete_watch_later_conf(struct MPContext *mpctx, const char *file); |
| 515 | 516 | struct playlist_entry *mp_check_playlist_resume(struct MPContext *mpctx, |