better queue render

This commit is contained in:
sorlinv
2026-02-27 18:01:00 +01:00
parent de40d2b6af
commit bf05c62feb
10 changed files with 537 additions and 67 deletions

View File

@@ -6,6 +6,8 @@ const { Notification } = require("electron");
const STR_STATUS_IDLE = "idle";
const STR_STATUS_RUNNING = "running";
const STR_STATUS_PAUSED = "paused";
const STR_PLACEHOLDER_CONTENT = "RENDERING";
const NB_PLACEHOLDER_MAX_SIZE = 64;
class QueueManager {
constructor(obj_window) {
@@ -37,6 +39,8 @@ class QueueManager {
this.nb_last_render_ms = 0;
this.str_last_image_path = null;
this.str_overwrite_mode = obj_config.str_overwrite_mode || "overwrite";
this.list_collections = obj_config.list_collections || [];
this.obj_render_settings = obj_config.obj_render_settings || null;
this._send_log("File de rendu construite : " + this.list_queue.length + " elements.");
this._send_progress();
@@ -209,7 +213,6 @@ class QueueManager {
break;
}
if (nb_size === 0) {
this._send_log("Placeholder vide detecte, re-rendu : " + obj_check.str_camera_name + " F" + obj_check.nb_frame);
break;
}
obj_check.str_status = "skipped";
@@ -261,7 +264,7 @@ class QueueManager {
if (!fs.existsSync(str_dir)) {
fs.mkdirSync(str_dir, { recursive: true });
}
fs.writeFileSync(obj_item.str_expected_file, "");
fs.writeFileSync(obj_item.str_expected_file, STR_PLACEHOLDER_CONTENT);
} catch (obj_file_err) {
this._send_log("ERREUR creation placeholder : " + obj_file_err.message);
}
@@ -280,6 +283,8 @@ class QueueManager {
nb_resolution_y: obj_item.nb_resolution_y,
str_format: obj_item.str_format,
str_output_path: obj_item.str_output_path,
list_collections: this.list_collections,
obj_render_settings: this.obj_render_settings,
fn_on_stdout: (str_data) => {
this._send_log(str_data.trim());
},
@@ -316,7 +321,7 @@ class QueueManager {
if (this.str_overwrite_mode === "skip" && fs.existsSync(obj_item.str_expected_file)) {
try {
let obj_stats = fs.statSync(obj_item.str_expected_file);
if (obj_stats.size === 0) {
if (obj_stats.size <= NB_PLACEHOLDER_MAX_SIZE) {
fs.unlinkSync(obj_item.str_expected_file);
}
} catch (obj_cleanup_err) {