mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-16 02:35:54 -07:00
feat: update error message when no stream data
This commit is contained in:
parent
41ec36673b
commit
0f82b5826f
2 changed files with 21 additions and 2 deletions
|
|
@ -43,10 +43,19 @@ var plugin = function (args) {
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars,no-param-reassign
|
||||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||||
var container = (0, fileUtils_1.getContainer)(args.inputFileObj._id);
|
var container = (0, fileUtils_1.getContainer)(args.inputFileObj._id);
|
||||||
|
var streams = [];
|
||||||
|
try {
|
||||||
|
streams = JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams));
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
var message = "Error parsing FFprobe streams, it seems FFprobe could not scan the file: ".concat(JSON.stringify(err));
|
||||||
|
args.jobLog(message);
|
||||||
|
throw new Error(message);
|
||||||
|
}
|
||||||
var ffmpegCommand = {
|
var ffmpegCommand = {
|
||||||
init: true,
|
init: true,
|
||||||
inputFiles: [],
|
inputFiles: [],
|
||||||
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map(function (stream) { return (__assign(__assign({}, stream), { removed: false, mapArgs: [
|
streams: streams.map(function (stream) { return (__assign(__assign({}, stream), { removed: false, mapArgs: [
|
||||||
'-map',
|
'-map',
|
||||||
"0:".concat(stream.index),
|
"0:".concat(stream.index),
|
||||||
], inputArgs: [], outputArgs: [] })); }),
|
], inputArgs: [], outputArgs: [] })); }),
|
||||||
|
|
|
||||||
|
|
@ -39,10 +39,20 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
||||||
|
|
||||||
const container = getContainer(args.inputFileObj._id);
|
const container = getContainer(args.inputFileObj._id);
|
||||||
|
|
||||||
|
let streams = [];
|
||||||
|
|
||||||
|
try {
|
||||||
|
streams = JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams));
|
||||||
|
} catch (err) {
|
||||||
|
const message = `Error parsing FFprobe streams, it seems FFprobe could not scan the file: ${JSON.stringify(err)}`;
|
||||||
|
args.jobLog(message);
|
||||||
|
throw new Error(message);
|
||||||
|
}
|
||||||
|
|
||||||
const ffmpegCommand = {
|
const ffmpegCommand = {
|
||||||
init: true,
|
init: true,
|
||||||
inputFiles: [],
|
inputFiles: [],
|
||||||
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map((stream:Istreams) => ({
|
streams: streams.map((stream:Istreams) => ({
|
||||||
...stream,
|
...stream,
|
||||||
removed: false,
|
removed: false,
|
||||||
mapArgs: [
|
mapArgs: [
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue