-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
adds new plugin #266
base: master
Are you sure you want to change the base?
adds new plugin #266
Conversation
d005da7
to
3b17c08
Compare
Fixed some errors so should be working fine now. |
0dc94f5
to
54f3d2d
Compare
Hey @HaveAGitGat Sorry for Force pushing after your updates but I've made a lot of changes over the last few dates and did not pushed them... Please have a look at it now. |
@HaveAGitGat Hello, I've finally finalized the plugin and added a new one. Could you take a look at it now please? :) Thanks |
@DavidReinberger sorry missed this. Seems when running the |
Thanks, will have a look through this tomorrow. |
Added some fixes from the checkPlugins test. I've tried I've run it on a bunch of h264, hevc and vp9 files (default settings) and it only seems to be changing the audio. Even when setting |
const isAlreadyProcessed = file.ffProbeData.tags[CUSTOM_TAG] === 'YES'; | ||
|
||
if (isAlreadyProcessed) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can be merged together
const isAlreadyProcessed = file.ffProbeData.tags[CUSTOM_TAG] === 'YES'; | ||
|
||
if (isAlreadyProcessed) { | ||
response.processFile = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary processFile
} | ||
|
||
if (file.fileMedium !== 'video') { | ||
response.processFile = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary processFile
// eslint-disable-next-line max-len | ||
if (!supportedResolutions.includes(resolution)) throw new Error(`Unsupported Resolution: ${resolution}, supported are only ${supportedResolutions.join(', ')}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can just encase it in brackets, should get rid of the max length issue.
// eslint-disable-next-line max-len | ||
Description: '[Contains built-in filter] Single-pass transcoder to optimize a media file to be used with Plex/Emby etc.', | ||
Version: '1.0', | ||
Tags: 'pre-processing,ffmpeg,hevc,x264,vaapi,nvenc,configurable,audi,video,subtitles', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const dispositionMap = { | ||
forced: 'forced', | ||
hearing_impaired: 'sdh', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only used once, can be hardcoded on line 109 and 110.
id: 'Tdarr_Plugin_dt0y_DaveThe0nly_Subtitle_Extractor', | ||
Stage: 'Pre-processing', | ||
Name: 'Extract Subtitles from video', | ||
Type: 'Video', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say this is a Subtitle
plugin and not Video
// This takes the first stream as the best stream to derive new ones from | ||
const [ | ||
{ | ||
index: bestStreamOriginalIndex, channels: bestStreamChannels, codec: bestAudioStreamCodec, ...bestAudioStream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Objects should have all their properties on new lines
if (file.fileMedium !== 'video') { | ||
response.processFile = false; | ||
response.infoLog += 'File is not a video. Exiting \n'; | ||
return response; | ||
} | ||
|
||
if (!file.ffProbeData.streams.length) { | ||
response.processFile = false; | ||
response.infoLog += 'No streams to process!! \n'; | ||
return response; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In these cases the file should probably just error out instead of silently fail like it does now.
defaultValue: '.mp4', | ||
inputUI: { | ||
type: 'dropdown', | ||
options: ['.mp4', '.mkv', 'keep'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep all options on separate lines like you did for the true/false dropdown :D
FYI will merge this when I've caught up on the new plugins tests and had time to do some for this one, you can see the tests for other plugins here: https://github.com/HaveAGitGat/Tdarr_Plugins/tree/master/tests/Community Run using |
Added some more tests and caught a few things on Tdarr_Plugin_dt0y_DaveThe0nly_HWACCEL_SINGLE_TRANSCODER So first thing like you say is the macos hardware acceleration. Next thing is the remove commentary track isn't working: Tdarr_Plugins/tests/Community/Tdarr_Plugin_dt0y_DaveThe0nly_HWACCEL_SINGLE_TRANSCODER.js Line 241 in e58e8a0
For some reason coming back as Maybe you can take a look? Then will need to add some tests for the other inputs too |
No description provided.