Work on checking data and cache.
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
console.log('Using app_idb.js');
|
||||
|
||||
async function load_idb_tables() {
|
||||
console.log('****************** Load IDB Tables ******************');
|
||||
console.log('Loading IDB tables...');
|
||||
|
||||
@@ -75,7 +75,7 @@ exports.load_config = function () {
|
||||
// Updated 2022-03-10
|
||||
exports.check_local_file = async function ({local_file_path, filename}) {
|
||||
console.log('*** Electron framework export: check_local_file() ***');
|
||||
console.log('Check for local file');
|
||||
// console.log('Check for local file');
|
||||
console.log(`Local File Path: ${local_file_path}; Filename: ${filename}`);
|
||||
|
||||
let full_local_file_path = path.join(local_file_path, filename);
|
||||
@@ -94,7 +94,7 @@ exports.check_local_file = async function ({local_file_path, filename}) {
|
||||
// Updated 2022-03-09
|
||||
exports.check_hash_file_cache = async function ({host_file_cache_path, hash}) {
|
||||
console.log('*** Electron framework export: check_hash_file_cache() ***');
|
||||
console.log('Check local hash file cache');
|
||||
// console.log('Check local hash file cache');
|
||||
console.log(`Host File Cache Path: ${host_file_cache_path}; Hash: ${hash}`);
|
||||
|
||||
let hash_filename = `${hash}.file`;
|
||||
@@ -116,7 +116,7 @@ exports.check_hash_file_cache = async function ({host_file_cache_path, hash}) {
|
||||
// Updated 2022-03-09
|
||||
exports.download_hash_file_to_cache = async function ({host_file_cache_path, event_file_id=null, hash=null}) {
|
||||
console.log('*** Electron framework export: download_hash_file_to_cache() ***');
|
||||
console.log('Download hash file to cache');
|
||||
// console.log('Download hash file to cache');
|
||||
console.log(`Host File Cache Path: ${host_file_cache_path}; Event File ID: ${event_file_id}; Hash: ${hash}`);
|
||||
|
||||
let endpoint = `/event/file/${event_file_id}/download`;
|
||||
@@ -131,8 +131,8 @@ exports.download_hash_file_to_cache = async function ({host_file_cache_path, eve
|
||||
return true;
|
||||
});
|
||||
|
||||
console.log(download_file_result);
|
||||
console.log('End: download_hash_file_to_cache()');
|
||||
// console.log(download_file_result);
|
||||
// console.log('End: download_hash_file_to_cache()');
|
||||
if (download_file_result) {
|
||||
console.log('File downloaded successfully');
|
||||
return true;
|
||||
@@ -147,7 +147,7 @@ exports.download_hash_file_to_cache = async function ({host_file_cache_path, eve
|
||||
// Updated 2022-03-09
|
||||
exports.open_hash_file_to_temp = async function ({host_file_cache_path, hash, host_file_temp_path, filename}) {
|
||||
console.log('*** Electron framework export: open_hash_file_to_temp() ***');
|
||||
console.log('Open cached hash file after copying to temp directory');
|
||||
// console.log('Open cached hash file after copying to temp directory');
|
||||
console.log(`Host File Cache Path: ${host_file_cache_path}; Hash: ${hash}; Host File Temp Path: ${host_file_temp_path}; Filename: ${filename}`);
|
||||
|
||||
let open_hash_file_to_temp_result = await ipcRenderer.invoke('open_hash_file_to_temp', host_file_cache_path, hash, host_file_temp_path, filename).then((result) => {
|
||||
@@ -175,7 +175,7 @@ exports.open_hash_file_to_temp = async function ({host_file_cache_path, hash, ho
|
||||
// Updated 2022-03-10
|
||||
exports.open_local_file = async function ({local_file_path, filename}) {
|
||||
console.log('*** Electron framework export: open_local_file() ***');
|
||||
console.log('Open local file');
|
||||
// console.log('Open local file');
|
||||
console.log(`Local File Path: ${local_file_path}; Filename: ${filename}`);
|
||||
|
||||
// let full_local_file_path = path.join(local_file_path, filename);
|
||||
@@ -213,7 +213,7 @@ exports.open_local_file = async function ({local_file_path, filename}) {
|
||||
// exports.check_file_cache = async function ({host_file_cache_path, event_file_id, hash}) {
|
||||
exports.check_file_cache = async function ({host_file_cache_path, event_file_id, hash}) {
|
||||
console.log('*** Electron framework export: check_file_cache() ***');
|
||||
console.log('Check local file cache and download from server if needed.');
|
||||
// console.log('Check local file cache and download from server if needed.');
|
||||
console.log(`Host File Cache Path: ${host_file_cache_path}; Event File ID: ${event_file_id}; Hash: ${hash}`);
|
||||
|
||||
// NOTE: event_file_id is the event_file.id_random or event_file.event_file_id_random
|
||||
@@ -269,7 +269,7 @@ exports.check_file_cache = async function ({host_file_cache_path, event_file_id,
|
||||
// Updated 2022-03-09
|
||||
async function check_file_cache({host_file_cache_path, event_file_id, hash}) {
|
||||
console.log('*** Electron framework: check_file_cache() ***');
|
||||
console.log('Check local file cache and download from server if needed.');
|
||||
// console.log('Check local file cache and download from server if needed.');
|
||||
console.log(`Host File Cache Path: ${host_file_cache_path}; Event File ID: ${event_file_id}; Hash: ${hash}`);
|
||||
|
||||
// NOTE: event_file_id is the event_file.id_random or event_file.event_file_id_random
|
||||
@@ -323,7 +323,7 @@ async function check_file_cache({host_file_cache_path, event_file_id, hash}) {
|
||||
// Updated 2022-03-09
|
||||
async function open_local_file({host_file_cache_path, hash, host_file_temp_path, filename}) {
|
||||
console.log('*** Electron framework: open_local_file() ***');
|
||||
console.log('Open local file cache if available. Copy to temp directory with given filename first.');
|
||||
// console.log('Open local file cache if available. Copy to temp directory with given filename first.');
|
||||
console.log(`Host File Cache Path: ${host_file_cache_path}; Hash: ${hash}; Host File Temp Path: ${host_file_temp_path}; Filename: ${filename}`);
|
||||
|
||||
console.log(host_file_cache_path);
|
||||
|
||||
Reference in New Issue
Block a user