mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-07-02 21:44:56 +02:00
Remove fluent-ffmpeg dependency
This commit is contained in:
parent
8562b8d1b3
commit
b61ecefce4
35 changed files with 4405 additions and 50 deletions
41
server/libs/fluentFfmpeg/options/misc.js
Normal file
41
server/libs/fluentFfmpeg/options/misc.js
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*jshint node:true*/
|
||||
'use strict';
|
||||
|
||||
var path = require('path');
|
||||
|
||||
/*
|
||||
*! Miscellaneous methods
|
||||
*/
|
||||
|
||||
module.exports = function(proto) {
|
||||
/**
|
||||
* Use preset
|
||||
*
|
||||
* @method FfmpegCommand#preset
|
||||
* @category Miscellaneous
|
||||
* @aliases usingPreset
|
||||
*
|
||||
* @param {String|Function} preset preset name or preset function
|
||||
*/
|
||||
proto.usingPreset =
|
||||
proto.preset = function(preset) {
|
||||
if (typeof preset === 'function') {
|
||||
preset(this);
|
||||
} else {
|
||||
try {
|
||||
var modulePath = path.join(this.options.presets, preset);
|
||||
var module = require(modulePath);
|
||||
|
||||
if (typeof module.load === 'function') {
|
||||
module.load(this);
|
||||
} else {
|
||||
throw new Error('preset ' + modulePath + ' has no load() function');
|
||||
}
|
||||
} catch (err) {
|
||||
throw new Error('preset ' + modulePath + ' could not be loaded: ' + err.message);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
};
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue