add_a_to(td_present, "yes", "/{{page_names.download}}/{{file.yt_id}}");
add_text_to(td_present, " ");
add_player_btn_to(td_present, 'add as next', `inject_${file_data.digest}`);
+ add_player_btn_to(td_present, 'add and play', `injectplay_${file_data.digest}`);
} else {
td_present.textContent = "no";
}
add_child_to('td', tr, {textContent: file.duration});
const td_inject = add_child_to('td', tr);
add_player_btn_to(td_inject, 'add as next', `inject_${file.digest}`, !file.present)
+ add_player_btn_to(td_inject, 'add as play', `injectplay_${file.digest}`, !file.present)
add_tag_links_to(add_child_to('td', tr), file.tags_showable);
add_a_to(add_child_to('td', tr), file.rel_path, `${PATH_PREFIX_FILE}${file.digest}`);
}
self.server.player.move_entry(int(command.split('_')[1]), False)
elif command.startswith('rm_'):
self.server.player.remove_by_idx(int(command.split('_')[1]))
- elif command.startswith('inject_'):
+ elif command.startswith('inject_') or command.startswith('injectplay_'):
+ command, digest = command.split('_', 1)
with DbConn() as conn:
- file = VideoFile.get_one(
- conn, Hash.from_b64(command.split('_', 1)[1]))
+ file = VideoFile.get_one(conn, Hash.from_b64(digest))
self.server.player.inject(file)
+ if 'injectplay' == command:
+ self.server.player.next()
self.send_http(b'OK')
def _purge_deleted_files(self) -> None: