summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2020-08-20 17:00:05 +0200
committerBastien Nocera <hadess@hadess.net>2020-08-20 17:00:05 +0200
commitfda52e8ed09f8f7df2247ae5f7a8409dba1b38df (patch)
treebbbb18cf012e4dca39a779e006465fd7d75bf3e0
parentf3f1b5fbd797c30093820d8fc81996c79a179910 (diff)
downloadtotem-pl-parser-wip/hadess/script-dir.tar.gz
videosite: Use envvar to change the videoscript dirwip/hadess/script-dir
Use TOTEM_PL_PARSER_VIDEOSITE_SCRIPT_DIR to override the default directory to find videosite scripts in.
-rw-r--r--plparse/totem-pl-parser-videosite.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/plparse/totem-pl-parser-videosite.c b/plparse/totem-pl-parser-videosite.c
index 456789e..13ffe17 100644
--- a/plparse/totem-pl-parser-videosite.c
+++ b/plparse/totem-pl-parser-videosite.c
@@ -69,13 +69,17 @@ static char *
find_helper_script (void)
{
GDir *dir;
- const char *name;
+ const char *name, *script_dir;
char *script_name = NULL;
if (g_getenv (SCRIPT_ENVVAR) != NULL)
return g_strdup (g_getenv (SCRIPT_ENVVAR));
- dir = g_dir_open (LIBEXECDIR "/totem-pl-parser", 0, NULL);
+ script_dir = g_getenv ("TOTEM_PL_PARSER_VIDEOSITE_SCRIPT_DIR");
+ if (!script_dir)
+ script_dir = LIBEXECDIR "/totem-pl-parser";
+
+ dir = g_dir_open (script_dir, 0, NULL);
if (!dir)
goto bail;
@@ -92,7 +96,7 @@ find_helper_script (void)
if (script_name != NULL) {
char *ret;
- ret = g_build_filename (LIBEXECDIR "/totem-pl-parser", script_name, NULL);
+ ret = g_build_filename (script_dir, script_name, NULL);
g_free (script_name);
return ret;
}