mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-10 16:00:28 -07:00
Update methods (#233)
* Remove importFresh from methods * lint * Remove importFresh * Remove node_modules * Add import-fresh to community plugins download * Add import-fresh to actions and filters * Add intermediate fresh library loader
This commit is contained in:
parent
831c4b0372
commit
de7218cda5
26 changed files with 119 additions and 107 deletions
|
|
@ -1,6 +1,5 @@
|
|||
// eslint-disable-next-line import/no-extraneous-dependencies
|
||||
const importFresh = require('import-fresh');
|
||||
const loadDefaultValues = require('../methods/loadDefaultValues');
|
||||
const lib = require('../methods/library.js');
|
||||
|
||||
module.exports.dependencies = ['import-fresh'];
|
||||
const details = () => ({
|
||||
|
|
@ -34,7 +33,6 @@ module.exports.details = details;
|
|||
const plugin = (file, librarySettings, inputs, otherArguments) => {
|
||||
// eslint-disable-next-line no-unused-vars,no-param-reassign
|
||||
inputs = loadDefaultValues(inputs, details);
|
||||
const library = importFresh('../methods/library.js');
|
||||
const response = {
|
||||
// 320K selected over 384k intentionally
|
||||
// https://en.m.wikipedia.org/wiki/MPEG-1#Part_3:_Audio
|
||||
|
|
@ -48,8 +46,8 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
|||
|
||||
const { codecsToInclude } = inputs;
|
||||
|
||||
const filterByCodecInclude = library.filters.filterByCodec(file, 'include', codecsToInclude);
|
||||
const filterByCodecExclude = library.filters.filterByCodec(file, 'exclude', 'mp3');
|
||||
const filterByCodecInclude = lib.filters.filterByCodec(file, 'include', codecsToInclude);
|
||||
const filterByCodecExclude = lib.filters.filterByCodec(file, 'exclude', 'mp3');
|
||||
|
||||
response.infoLog += `${filterByCodecInclude.note} ${filterByCodecExclude.note}`;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,63 +1,53 @@
|
|||
/* eslint-disable */
|
||||
var fs = require('fs');
|
||||
var path = require('path');
|
||||
const loadDefaultValues = require('../methods/loadDefaultValues');
|
||||
if (fs.existsSync(path.join(process.cwd(), '/npm'))) {
|
||||
var rootModules = path.join(process.cwd(), '/npm/node_modules/')
|
||||
} else {
|
||||
var rootModules = ''
|
||||
}
|
||||
|
||||
const importFresh = require(rootModules + 'import-fresh');
|
||||
const library = importFresh('../methods/library.js')
|
||||
|
||||
const details = () => {
|
||||
return {
|
||||
id: "Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid",
|
||||
Stage: 'Pre-processing',
|
||||
Name: "Set file permissions for UnRaid",
|
||||
Type: "Video",
|
||||
Operation: "Transcode",
|
||||
Description: "Sets file permissions using chown nobody:users to prevent lock from root. Use at end of stack. ",
|
||||
Version: "",
|
||||
Tags: "post-processing",
|
||||
Inputs:[],
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const plugin = (file, librarySettings, inputs, otherArguments) => {
|
||||
// eslint-disable-next-line no-unused-vars,no-param-reassign
|
||||
inputs = loadDefaultValues(inputs, details);
|
||||
|
||||
//Must return this object at some point
|
||||
var response = {
|
||||
processFile: false,
|
||||
preset: '',
|
||||
container: '.mkv',
|
||||
handBrakeMode: false,
|
||||
FFmpegMode: true,
|
||||
reQueueAfter: true,
|
||||
infoLog: '',
|
||||
|
||||
}
|
||||
|
||||
response.infoLog += ""
|
||||
|
||||
if ((true) || file.forceProcessing === true) {
|
||||
|
||||
require("child_process").execSync(`chown nobody:users "${file._id}"`)
|
||||
response.preset = ''
|
||||
response.container = '.mkv'
|
||||
response.handBrakeMode = false
|
||||
response.FFmpegMode = true
|
||||
response.reQueueAfter = true;
|
||||
response.processFile = false
|
||||
response.infoLog += "File permissions set \n"
|
||||
return response
|
||||
}
|
||||
}
|
||||
|
||||
/* eslint-disable */
|
||||
const loadDefaultValues = require('../methods/loadDefaultValues');
|
||||
|
||||
const details = () => {
|
||||
return {
|
||||
id: "Tdarr_Plugin_O8O0dCTlb_Set_File_Permissions_For_UnRaid",
|
||||
Stage: 'Pre-processing',
|
||||
Name: "Set file permissions for UnRaid",
|
||||
Type: "Video",
|
||||
Operation: "Transcode",
|
||||
Description: "Sets file permissions using chown nobody:users to prevent lock from root. Use at end of stack. ",
|
||||
Version: "",
|
||||
Tags: "post-processing",
|
||||
Inputs:[],
|
||||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-unused-vars
|
||||
const plugin = (file, librarySettings, inputs, otherArguments) => {
|
||||
// eslint-disable-next-line no-unused-vars,no-param-reassign
|
||||
inputs = loadDefaultValues(inputs, details);
|
||||
|
||||
//Must return this object at some point
|
||||
var response = {
|
||||
processFile: false,
|
||||
preset: '',
|
||||
container: '.mkv',
|
||||
handBrakeMode: false,
|
||||
FFmpegMode: true,
|
||||
reQueueAfter: true,
|
||||
infoLog: '',
|
||||
|
||||
}
|
||||
|
||||
response.infoLog += ""
|
||||
|
||||
if ((true) || file.forceProcessing === true) {
|
||||
|
||||
require("child_process").execSync(`chown nobody:users "${file._id}"`)
|
||||
response.preset = ''
|
||||
response.container = '.mkv'
|
||||
response.handBrakeMode = false
|
||||
response.FFmpegMode = true
|
||||
response.reQueueAfter = true;
|
||||
response.processFile = false
|
||||
response.infoLog += "File permissions set \n"
|
||||
return response
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
module.exports.details = details;
|
||||
module.exports.plugin = plugin;
|
||||
Loading…
Add table
Add a link
Reference in a new issue