Match production FFprobe selection in program regression fixture
This commit is contained in:
@ -151,7 +151,7 @@ function initSchema() {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Column already exists, ignore
|
// Column already exists, ignore
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[SQLite] Schema initialized');
|
console.log('[SQLite] Schema initialized');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -278,7 +278,7 @@ class SyncService {
|
|||||||
const stmt = db.prepare(`
|
const stmt = db.prepare(`
|
||||||
INSERT INTO playlist_items (
|
INSERT INTO playlist_items (
|
||||||
id, source_id, item_id, type, name, category_id,
|
id, source_id, item_id, type, name, category_id,
|
||||||
stream_icon, stream_url, program, container_extension,
|
stream_icon, stream_url, program, container_extension,
|
||||||
rating, year, added_at, data
|
rating, year, added_at, data
|
||||||
)
|
)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||||
|
|||||||
@ -147,7 +147,8 @@ test('real FFmpeg probes, remuxes and transcodes only the requested MPEG-TS prog
|
|||||||
const media = fs.readFileSync(source);
|
const media = fs.readFileSync(source);
|
||||||
const probe = routeFixture('probe.js');
|
const probe = routeFixture('probe.js');
|
||||||
const app = express();
|
const app = express();
|
||||||
app.locals.ffprobePath = require('@ffprobe-installer/ffprobe').path;
|
app.locals.ffprobePath = spawnSync('ffprobe', ['-version'], { stdio: 'ignore' }).status === 0
|
||||||
|
? 'ffprobe' : require('@ffprobe-installer/ffprobe').path;
|
||||||
app.locals.ffmpegPath = binary;
|
app.locals.ffmpegPath = binary;
|
||||||
app.get('/multi.ts', (req, res) => res.end(media));
|
app.get('/multi.ts', (req, res) => res.end(media));
|
||||||
app.use('/api/probe', probe.router); app.use('/api/remux', routeFixture('remux.js').router);
|
app.use('/api/probe', probe.router); app.use('/api/remux', routeFixture('remux.js').router);
|
||||||
@ -159,7 +160,7 @@ test('real FFmpeg probes, remuxes and transcodes only the requested MPEG-TS prog
|
|||||||
for (const [program, width, audio] of [['102', 96, 'aac'], ['101', 64, 'mp3'], ['102', 96, 'aac']]) {
|
for (const [program, width, audio] of [['102', 96, 'aac'], ['101', 64, 'mp3'], ['102', 96, 'aac']]) {
|
||||||
const response = await fetch(`${base}/api/probe?url=${url}&program=${program}`);
|
const response = await fetch(`${base}/api/probe?url=${url}&program=${program}`);
|
||||||
assert.equal(response.status, 200);
|
assert.equal(response.status, 200);
|
||||||
const info = await response.json(); assert.equal(info.width, width); assert.deepEqual(info.audioCodecs, [audio]);
|
const info = await response.json(); assert.equal(info.width, width, JSON.stringify(info)); assert.deepEqual(info.audioCodecs, [audio]);
|
||||||
const remux = await fetch(`${base}/api/remux?url=${url}&program=${program}&audioCodecs=${audio}`);
|
const remux = await fetch(`${base}/api/remux?url=${url}&program=${program}&audioCodecs=${audio}`);
|
||||||
assert.equal(remux.status, 200);
|
assert.equal(remux.status, 200);
|
||||||
const output = path.join(dir, `program${program}.mp4`); fs.writeFileSync(output, Buffer.from(await remux.arrayBuffer()));
|
const output = path.join(dir, `program${program}.mp4`); fs.writeFileSync(output, Buffer.from(await remux.arrayBuffer()));
|
||||||
|
|||||||
Reference in New Issue
Block a user