Browse Source

add play link to file listing 'info card'

master
cinnaboot 7 years ago
parent
commit
7705a6baa2
  1. 11
      video_metadata/static/file_listing.js

11
video_metadata/static/file_listing.js

@ -4,6 +4,7 @@ const FOLDER_CONTENTS_PATH = '/pvdb/file_listing/folder_contents_json/';
const QUERY_PATH = '/pvdb/tmdb/query_movie_json';
const CREATE_MAPPING_PATH = '/pvdb/tmdb/create_mapping';
const PATH_PATH = '/pvdb/tmdb/query_path_json';
const VIDEO_PREFIX = '/video/';
// NOTE: create links for folder contents
@ -59,6 +60,15 @@ function openInfoCard(dataset, element) {
// NOTE: don't need the mapping link here
let p = blurb.querySelector('.mapping_link').parentNode;
p.parentNode.removeChild(p);
// NOTE: add play link
let a = document.createElement('a');
a.classList.add('play_link');
a.href = VIDEO_PREFIX + dataset.rel_path;
a.appendChild(document.createTextNode('play'));
let div = blurb.querySelector('.search_result');
div.insertBefore(a, div.firstChild);
element.parentNode.appendChild(blurb);
}
});
@ -96,7 +106,6 @@ function openQueryDialog(dataset, element) {
}
function createBlurb(details) {
console.log(details);
let qt = document.querySelector('#query_result');
let qtclone = document.importNode(qt.content, true);

Loading…
Cancel
Save