mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-08 23:18:16 -07:00
Merge pull request #785 from HaveAGitGat/streams
feat: update error message when no stream data
This commit is contained in:
commit
1d893f31e7
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
|
||||
args.inputs = lib.loadDefaultValues(args.inputs, details);
|
||||
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 = {
|
||||
init: true,
|
||||
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',
|
||||
"0:".concat(stream.index),
|
||||
], inputArgs: [], outputArgs: [] })); }),
|
||||
|
|
|
|||
|
|
@ -39,10 +39,20 @@ const plugin = (args:IpluginInputArgs):IpluginOutputArgs => {
|
|||
|
||||
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 = {
|
||||
init: true,
|
||||
inputFiles: [],
|
||||
streams: JSON.parse(JSON.stringify(args.inputFileObj.ffProbeData.streams)).map((stream:Istreams) => ({
|
||||
streams: streams.map((stream:Istreams) => ({
|
||||
...stream,
|
||||
removed: false,
|
||||
mapArgs: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue