|
|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
/* eslint-disable max-len */
|
|
|
|
|
|
|
|
|
|
import { promises as fsp } from 'fs';
|
|
|
|
|
import { getPluginWorkDir } from '../../../../FlowHelpers/1.0.0/fileUtils';
|
|
|
|
|
import {
|
|
|
|
|
@ -27,6 +29,23 @@ const details = (): IpluginDetails => ({
|
|
|
|
|
defaultValue: `
|
|
|
|
|
module.exports = async (args) => {
|
|
|
|
|
|
|
|
|
|
// see args object data here https://github.com/HaveAGitGat/Tdarr_Plugins/blob/master/FlowPluginsTs/FlowHelpers/1.0.0/interfaces/interfaces.ts
|
|
|
|
|
// example setting flow variable: https://github.com/HaveAGitGat/Tdarr/issues/1147#issuecomment-2593348443
|
|
|
|
|
// example reading ffmpeg metadata: https://github.com/HaveAGitGat/Tdarr_Plugins/issues/737#issuecomment-2581536112
|
|
|
|
|
|
|
|
|
|
// some example file data:
|
|
|
|
|
console.log(args.inputFileObj._id)
|
|
|
|
|
console.log(args.inputFileObj.file_size)
|
|
|
|
|
console.log(args.inputFileObj.ffProbeData.streams[0].codec_name)
|
|
|
|
|
console.log(args.inputFileObj.mediaInfo.track[0].BitRate)
|
|
|
|
|
|
|
|
|
|
// access global variable:
|
|
|
|
|
console.log(args.userVariables.global.test)
|
|
|
|
|
// access library variable:
|
|
|
|
|
console.log(args.userVariables.library.test)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// do something here
|
|
|
|
|
|
|
|
|
|
return {
|
|
|
|
|
|