From 3045ea5391b4bd3555086af5b7506346467cfc57 Mon Sep 17 00:00:00 2001 From: cinnaboot Date: Tue, 14 Apr 2020 18:41:13 -0400 Subject: [PATCH] add encodeURIComponent when sending rel_path from javascript --- video_metadata/static/file_listing.js | 2 +- video_metadata/views/tmdb.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/video_metadata/static/file_listing.js b/video_metadata/static/file_listing.js index 4e0acc7..6a25068 100644 --- a/video_metadata/static/file_listing.js +++ b/video_metadata/static/file_listing.js @@ -56,7 +56,7 @@ function addContents(node, json) { // NOTE: display an 'info card' for a path that has already been stored function openInfoCard(dataset, element) { - query_str = PATH_PATH + '?rel_path=' + dataset.rel_path; + query_str = PATH_PATH + '?rel_path=' + encodeURIComponent(dataset.rel_path); fetchJSON(query_str, function(json) { if (json.errors) { for (let e of json.errors) diff --git a/video_metadata/views/tmdb.py b/video_metadata/views/tmdb.py index 585b318..6da2ee4 100644 --- a/video_metadata/views/tmdb.py +++ b/video_metadata/views/tmdb.py @@ -234,6 +234,7 @@ def query_path_json(): cur.execute(q, (path, )) row = cur.fetchone() + current_app.logger.debug(f'path: {path}, row: {row}') if errors: for e in errors: