Working on rewrite version 3. Focus on caching and opening after download.
This commit is contained in:
@@ -69,8 +69,8 @@ exports.load_config = function () {
|
||||
}
|
||||
|
||||
|
||||
exports.check_file_cache_v3 = async function (host_file_cache_path, event_file_id, hash) {
|
||||
console.log('**** *** ** * FUNCTION: check_file_cache_v3 * ** *** ****');
|
||||
exports.check_file_cache = async function (host_file_cache_path, event_file_id, hash) {
|
||||
console.log('**** *** ** * FUNCTION: check_file_cache (v3) * ** *** ****');
|
||||
console.log('Checking the local file cache against the remote server.');
|
||||
|
||||
event_file_id; // NOTE: This is the event_file.id_random or event_file.event_file_id_random
|
||||
@@ -80,9 +80,9 @@ exports.check_file_cache_v3 = async function (host_file_cache_path, event_file_i
|
||||
console.log(save_path);
|
||||
|
||||
if (fs.existsSync(save_path)) {
|
||||
console.log('Local file already exists: '+save_path);
|
||||
console.log('Hashed file cache already exists: '+save_path);
|
||||
} else {
|
||||
console.log('File not found locally. Downloading file: '+save_path);
|
||||
console.log('Hashed file not found in local cache. Downloading file: '+save_path);
|
||||
let endpoint = `/event/file/${event_file_id}/download`;
|
||||
ipcRenderer.send('download_file', api_base_url, endpoint, save_path); // Must download file using main node.js thread.
|
||||
}
|
||||
@@ -91,7 +91,7 @@ exports.check_file_cache_v3 = async function (host_file_cache_path, event_file_i
|
||||
}
|
||||
|
||||
|
||||
exports.check_file_cache = async function () {
|
||||
exports.check_file_cache_v1 = async function () {
|
||||
console.log('**** *** ** * FUNCTION: check_file_cache * ** *** ****');
|
||||
console.log('Checking the local file cache against the remote server.');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user