Compare commits
2 Commits
ff2991cabd
...
1f3559ab22
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1f3559ab22 | ||
|
|
35334e365f |
@ -27,6 +27,7 @@ const DEFAULTS = {
|
|||||||
alwaysOnTop: false,
|
alwaysOnTop: false,
|
||||||
shutdownAfterFinish: 'nothing', // nothing | sleep | shutdown | restart
|
shutdownAfterFinish: 'nothing', // nothing | sleep | shutdown | restart
|
||||||
logFilePath: '',
|
logFilePath: '',
|
||||||
|
sessionLog: false,
|
||||||
resumeQueueOnLaunch: true,
|
resumeQueueOnLaunch: true,
|
||||||
parallelUploadCount: 0, // 0 = use per-hoster limits only
|
parallelUploadCount: 0, // 0 = use per-hoster limits only
|
||||||
scaleParallelUploads: false,
|
scaleParallelUploads: false,
|
||||||
|
|||||||
24
main.js
24
main.js
@ -68,7 +68,7 @@ function getDefaultLogFilePath() {
|
|||||||
return path.join(baseDir, 'fileuploader.log');
|
return path.join(baseDir, 'fileuploader.log');
|
||||||
}
|
}
|
||||||
|
|
||||||
function getLogFilePath() {
|
function getBaseLogFilePath() {
|
||||||
const config = configStore.load();
|
const config = configStore.load();
|
||||||
const customPath = config && config.globalSettings
|
const customPath = config && config.globalSettings
|
||||||
? String(config.globalSettings.logFilePath || '').trim()
|
? String(config.globalSettings.logFilePath || '').trim()
|
||||||
@ -76,6 +76,28 @@ function getLogFilePath() {
|
|||||||
return customPath || getDefaultLogFilePath();
|
return customPath || getDefaultLogFilePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Session log: one file per app session, created lazily on first upload
|
||||||
|
let sessionLogPath = null;
|
||||||
|
|
||||||
|
function getLogFilePath() {
|
||||||
|
const config = configStore.load();
|
||||||
|
const useSessionLog = config && config.globalSettings && config.globalSettings.sessionLog;
|
||||||
|
if (!useSessionLog) return getBaseLogFilePath();
|
||||||
|
|
||||||
|
// Lazy: generate session log path on first call
|
||||||
|
if (!sessionLogPath) {
|
||||||
|
const base = getBaseLogFilePath();
|
||||||
|
const dir = path.dirname(base);
|
||||||
|
const ext = path.extname(base);
|
||||||
|
const name = path.basename(base, ext);
|
||||||
|
const now = new Date();
|
||||||
|
const pad = (n) => String(n).padStart(2, '0');
|
||||||
|
const ts = `${now.getFullYear()}-${pad(now.getMonth() + 1)}-${pad(now.getDate())}_${pad(now.getHours())}-${pad(now.getMinutes())}-${pad(now.getSeconds())}`;
|
||||||
|
sessionLogPath = path.join(dir, `${name}-${ts}${ext}`);
|
||||||
|
}
|
||||||
|
return sessionLogPath;
|
||||||
|
}
|
||||||
|
|
||||||
function appendUploadLog(hoster, link, fileName) {
|
function appendUploadLog(hoster, link, fileName) {
|
||||||
try {
|
try {
|
||||||
const logPath = getLogFilePath();
|
const logPath = getLogFilePath();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "multi-hoster-uploader",
|
"name": "multi-hoster-uploader",
|
||||||
"version": "1.8.1",
|
"version": "1.8.2",
|
||||||
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
"description": "Upload files to doodstream, voe, vidmoly, byse simultaneously",
|
||||||
"main": "main.js",
|
"main": "main.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@ -1591,6 +1591,10 @@ function renderSettings() {
|
|||||||
<input type="text" class="key-input settings-autosave" id="logFilePathInput" value="${escapeAttr(globalSettings.logFilePath || '')}" placeholder="Standardpfad verwenden">
|
<input type="text" class="key-input settings-autosave" id="logFilePathInput" value="${escapeAttr(globalSettings.logFilePath || '')}" placeholder="Standardpfad verwenden">
|
||||||
<button class="btn btn-xs btn-secondary" id="chooseLogFilePathBtn">Ordner wählen</button>
|
<button class="btn btn-xs btn-secondary" id="chooseLogFilePathBtn">Ordner wählen</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="settings-row">
|
||||||
|
<label>Neues Log pro Session</label>
|
||||||
|
<input type="checkbox" class="settings-autosave" id="sessionLogInput" ${globalSettings.sessionLog ? 'checked' : ''}>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
container.appendChild(generalPanel);
|
container.appendChild(generalPanel);
|
||||||
@ -1693,6 +1697,7 @@ async function saveSettings(options = {}) {
|
|||||||
const globalSettings = {
|
const globalSettings = {
|
||||||
...(config.globalSettings || {}),
|
...(config.globalSettings || {}),
|
||||||
logFilePath: (document.getElementById('logFilePathInput')?.value || '').trim(),
|
logFilePath: (document.getElementById('logFilePathInput')?.value || '').trim(),
|
||||||
|
sessionLog: !!document.getElementById('sessionLogInput')?.checked,
|
||||||
resumeQueueOnLaunch: !!document.getElementById('resumeQueueOnLaunchInput')?.checked,
|
resumeQueueOnLaunch: !!document.getElementById('resumeQueueOnLaunchInput')?.checked,
|
||||||
parallelUploadCount: Math.max(0, Math.min(100, parseInt(document.getElementById('parallelUploadCountInput')?.value || '0', 10) || 0)),
|
parallelUploadCount: Math.max(0, Math.min(100, parseInt(document.getElementById('parallelUploadCountInput')?.value || '0', 10) || 0)),
|
||||||
scaleParallelUploads: !!document.getElementById('scaleParallelUploadsInput')?.checked,
|
scaleParallelUploads: !!document.getElementById('scaleParallelUploadsInput')?.checked,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user