Skip to content

Commit

Permalink
player: Load scripts in directories
Browse files Browse the repository at this point in the history
Fixes #946.
  • Loading branch information
gnome-mpv committed May 10, 2024
1 parent 7875de3 commit 3ad5989
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions src/celluloid-player.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,28 +1006,20 @@ load_scripts(CelluloidPlayer *player)

if(dir)
{
const gchar *name;
const gchar *name = g_dir_read_name(dir);

do
while(name)
{
gchar *full_path;

name = g_dir_read_name(dir);
full_path = g_build_filename(path, name, NULL);
gchar *full_path = g_build_filename(path, name, NULL);
const gchar *cmd[] = {"load-script", full_path, NULL};

if(g_file_test(full_path, G_FILE_TEST_IS_REGULAR))
{
const gchar *cmd[]
= {"load-script", full_path, NULL};
g_info("Loading script: %s", full_path);
celluloid_mpv_command(CELLULOID_MPV(player), cmd);

g_info("Loading script: %s", full_path);
celluloid_mpv_command
(CELLULOID_MPV(player), cmd);
}
name = g_dir_read_name(dir);

g_free(full_path);
}
while(name);

g_dir_close(dir);
}
Expand Down

0 comments on commit 3ad5989

Please sign in to comment.