0.12.0-9 Fix Jobs

This commit is contained in:
2026-03-23 06:59:51 +00:00
parent 50d5fccd95
commit a87ba330b1
11 changed files with 29 additions and 17 deletions
+1 -1
View File
@@ -2968,7 +2968,7 @@ class HistoryService {
`
SELECT *
FROM jobs
WHERE status IN ('RIPPING', 'ENCODING', 'CD_ANALYZING', 'CD_RIPPING', 'CD_ENCODING')
WHERE status IN ('ANALYZING', 'RIPPING', 'ENCODING', 'MEDIAINFO_CHECK', 'READY_TO_ENCODE', 'CD_ANALYZING', 'CD_READY_TO_RIP', 'CD_RIPPING', 'CD_ENCODING')
ORDER BY updated_at ASC, id ASC
`
),
+4 -2
View File
@@ -5065,10 +5065,12 @@ class PipelineService extends EventEmitter {
'WAITING_FOR_USER_DECISION',
'READY_TO_START',
'MEDIAINFO_CHECK',
'READY_TO_ENCODE',
// READY_TO_ENCODE intentionally excluded: user has confirmed encoding,
// a new analyze must not silently delete a queued encode job.
'CD_ANALYZING',
'CD_METADATA_SELECTION',
'CD_READY_TO_RIP',
// CD_READY_TO_RIP intentionally excluded: user has confirmed track
// selection, a new analyze must not discard that.
'ERROR',
'CANCELLED'
]);
+11 -1
View File
@@ -28,12 +28,21 @@ function transliterateForFilename(input) {
function sanitizeFileName(input) {
return transliterateForFilename(String(input || 'untitled'))
.replace(/[\\/:*?"<>|]/g, '_')
.replace(/[^a-zA-Z0-9 ()[\]-]/g, '')
.replace(/\s+/g, ' ')
.trim()
.slice(0, 180);
}
function sanitizeFileNameWithExtension(input) {
const str = String(input || 'untitled');
const ext = path.extname(str);
const base = ext ? str.slice(0, -ext.length) : str;
const cleanBase = sanitizeFileName(base);
const cleanExt = ext.toLowerCase().replace(/[^a-z0-9.]/g, '');
return (cleanBase || 'untitled') + cleanExt;
}
function renderTemplate(template, values) {
return String(template || '${title} (${year})').replace(/\$\{([^}]+)\}/g, (_, key) => {
const val = values[key.trim()];
@@ -86,6 +95,7 @@ module.exports = {
ensureDir,
transliterateForFilename,
sanitizeFileName,
sanitizeFileNameWithExtension,
renderTemplate,
findLargestMediaFile,
findMediaFiles