server: fix converter weighting

This commit is contained in:
Koushik Dutta
2022-03-16 10:44:03 -07:00
parent 175edc4d70
commit 406f1d078a
3 changed files with 8 additions and 4 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/server",
"version": "0.0.156",
"version": "0.0.157",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/server",
"version": "0.0.156",
"version": "0.0.157",
"license": "ISC",
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.8",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/server",
"version": "0.0.156",
"version": "0.0.157",
"description": "",
"dependencies": {
"@mapbox/node-pre-gyp": "^1.0.8",

View File

@@ -320,9 +320,13 @@ export abstract class MediaManagerBase implements MediaManager {
}
}
// edge matches
if (mimeMatches(mediaMime, inputMime)) {
mediaNode[targetId] = 1;
// catch all converters should be heavily weighted so as not to use them.
mediaNode[targetId] = inputMime.essence === '*/*' ? 1000 : 1;
}
// target output matches
if (mimeMatches(outputMime, convertedMime) || converter.toMimeType === ScryptedMimeTypes.MediaObject) {
node['output'] = 1;
}