1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

update voice

This commit is contained in:
Luke Pulverenti 2016-07-20 09:56:24 -04:00
parent 9ff21cf7b8
commit 79240b1a24
8 changed files with 90 additions and 125 deletions

View file

@ -23,24 +23,27 @@
/// <returns> . </returns>
function processTranscript(text) {
if (text) {
var processor = grammarprocessor(commandgroups, text);
if (processor && processor.command) {
console.log("Command from Grammar Processor", processor);
return voicecommands(processor)
.then(function (result) {
console.log("Result of executed command", result);
if (result.item.actionid === 'show' && result.item.sourceid === 'group') {
return Promise.resolve({ error: "group", item: result.item, groupName: result.name, fn: result.fn });
} else {
return Promise.resolve({ item: result.item, fn: result.fn });
}
}, function () {
return Promise.reject({ error: "unrecognized-command", text: text });
});
} else {
return Promise.reject({ error: "unrecognized-command", text: text });
}
return getCommandGroups().then(function (commandgroups) {
var processor = grammarprocessor(commandgroups, text);
if (processor && processor.command) {
console.log("Command from Grammar Processor", processor);
return voicecommands(processor)
.then(function (result) {
console.log("Result of executed command", result);
if (result.item.actionid === 'show' && result.item.sourceid === 'group') {
return Promise.resolve({ error: "group", item: result.item, groupName: result.name, fn: result.fn });
} else {
return Promise.resolve({ item: result.item, fn: result.fn });
}
}, function () {
return Promise.reject({ error: "unrecognized-command", text: text });
});
} else {
return Promise.reject({ error: "unrecognized-command", text: text });
}
});
} else {
return Promise.reject({ error: "empty" });