History

command: add current-watch-later-dir property

It will be used in the next commit.

Guido Cella committed 1 year ago

Commit b530b401 parent 0c3c4a35 files · +16 −1Browse files

Unified · Split

5 files
  1. DOCS/interface-changes/current-watch-later-dir.txt +1 −0
  2. DOCS/man/input.rst +5 −0
  3. player/command.c +8 −0
  4. player/configfiles.c +1 −1
  5. player/core.h +1 −0
DOCS/interface-changes/current-watch-later-dir.txt+1−0
@@ -0,0 +1 @@
1add `current-watch-later-dir` property
DOCS/man/input.rst+5−0
@@ -3753,6 +3753,11 @@ Property list · 3752 unmodified lines
3753 The working directory of the mpv process. Can be useful for JSON IPC users,3753 The working directory of the mpv process. Can be useful for JSON IPC users,
3754 because the command line player usually works with relative paths.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``protocol-list``3761``protocol-list``
3757 List of protocol prefixes potentially recognized by the player. They are3762 List of protocol prefixes potentially recognized by the player. They are
3758 returned without trailing ``://`` suffix (which is still always required).3763 returned without trailing ``://`` suffix (which is still always required).
player/command.c+8−0
@@ -3528,6 +3528,13 @@ static int mp_property_cwd(void *ctx, struct m_property *prop, · 3527 unmodified lines
3528 return M_PROPERTY_NOT_IMPLEMENTED;3528 return M_PROPERTY_NOT_IMPLEMENTED;
3529}3529}
3530 3530
3531static 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
3531static int mp_property_protocols(void *ctx, struct m_property *prop,3538static int mp_property_protocols(void *ctx, struct m_property *prop,
3532 int action, void *arg)3539 int action, void *arg)
3533{3540{
@@ -4388,6 +4395,7 @@ static const struct m_property mp_properties_base[] = { · 854 unmodified lines
4388 {"ambient-light", mp_property_ambient_light},4395 {"ambient-light", mp_property_ambient_light},
4389 4396
4390 {"working-directory", mp_property_cwd},4397 {"working-directory", mp_property_cwd},
4398 {"current-watch-later-dir", mp_property_current_watch_later_dir},
4391 4399
4392 {"protocol-list", mp_property_protocols},4400 {"protocol-list", mp_property_protocols},
4393 {"decoder-list", mp_property_decoders},4401 {"decoder-list", mp_property_decoders},
player/configfiles.c+1−1
@@ -197,7 +197,7 @@ static bool copy_mtime(const char *f1, const char *f2) · 196 unmodified lines
197 return true;197 return true;
198}198}
199 199
200static char *mp_get_playback_resume_dir(struct MPContext *mpctx)200char *mp_get_playback_resume_dir(struct MPContext *mpctx)
201{201{
202 char *wl_dir = mpctx->opts->watch_later_dir;202 char *wl_dir = mpctx->opts->watch_later_dir;
203 if (wl_dir && wl_dir[0]) {203 if (wl_dir && wl_dir[0]) {
player/core.h+1−0
@@ -510,6 +510,7 @@ void audio_start_ao(struct MPContext *mpctx); · 509 unmodified lines
510void mp_parse_cfgfiles(struct MPContext *mpctx);510void mp_parse_cfgfiles(struct MPContext *mpctx);
511void mp_load_auto_profiles(struct MPContext *mpctx);511void mp_load_auto_profiles(struct MPContext *mpctx);
512bool mp_load_playback_resume(struct MPContext *mpctx, const char *file);512bool mp_load_playback_resume(struct MPContext *mpctx, const char *file);
513char *mp_get_playback_resume_dir(struct MPContext *mpctx);
513void mp_write_watch_later_conf(struct MPContext *mpctx);514void mp_write_watch_later_conf(struct MPContext *mpctx);
514void mp_delete_watch_later_conf(struct MPContext *mpctx, const char *file);515void mp_delete_watch_later_conf(struct MPContext *mpctx, const char *file);
515struct playlist_entry *mp_check_playlist_resume(struct MPContext *mpctx,516struct playlist_entry *mp_check_playlist_resume(struct MPContext *mpctx,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t