mirror of
https://github.com/gabehf/Tdarr_Plugins.git
synced 2026-03-16 10:45:53 -07:00
Use file.ffProbeData?.format?.duration if available
This commit is contained in:
parent
db3fecab6a
commit
fbed3a0a84
9 changed files with 54 additions and 11 deletions
|
|
@ -139,7 +139,9 @@ const plugin = (file, librarySettings, inputs, otherArguments) => {
|
|||
|
||||
// Check if duration info is filled, if so times it by 0.0166667 to get time in minutes.
|
||||
// If not filled then get duration of stream 0 and do the same.
|
||||
if (typeof file.meta.Duration !== 'undefined') {
|
||||
if (parseFloat(file.ffProbeData?.format?.duration) > 0) {
|
||||
duration = parseFloat(file.ffProbeData?.format?.duration) * 0.0166667;
|
||||
} else if (typeof file.meta.Duration !== 'undefined') {
|
||||
duration = file.meta.Duration * 0.0166667;
|
||||
} else {
|
||||
duration = file.ffProbeData.streams[0].duration * 0.0166667;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue