<commit_before>"use strict";
var Promise = require('mpromise');
var app = require('../app');
var kodiService = require(app.dir + '/api/kodi-service.js').create({ host : process.env.KODI_HOST});

function alexaPostRequest(req,response,done){
    console.log(req.body);
    var intent = req.body.request.intent.name;

    if (intent == "PLAY"){
        kodiService.play().then(function(x){
            sendMessage(response, x.message);
        });
    }
    else if (intent == "PAUSE"){
        kodiService.pause().then(function(x){
            sendMessage(response, x.message);
        });
    }
    else if (intent == "STOP"){
        kodiService.stop().then(function(x){
            sendMessage(response, x.message);
        });
    }
    else if (intent == "PLAYING"){
        kodiService.info().then(function(x){
            sendMessage(response, x.currentlyPlaying);
        });
    }
    else if (intent === "PLAYRANDOM"){
        console.log(req.body.request.intent.slots[0].Show.value);
        kodiService.searchTVShows({label : req.body.request.intent.slots[0].Show.value})<commit_msg>Need to enable debugging eventually...<commit_after>"use strict";
var Promise = require('mpromise');
var app = require('../app');
var kodiService = require(app.dir + '/api/kodi-service.js').create({ host : process.env.KODI_HOST});

function alexaPostRequest(req,response,done){
    console.log(req.body);
    var intent = req.body.request.intent.name;

    if (intent == "PLAY"){
        kodiService.play().then(function(x){
            sendMessage(response, x.message);
        });
    }
    else if (intent == "PAUSE"){
        kodiService.pause().then(function(x){
            sendMessage(response, x.message);
        });
    }
    else if (intent == "STOP"){
        kodiService.stop().then(function(x){
            sendMessage(response, x.message);
        });
    }
    else if (intent == "PLAYING"){
        kodiService.info().then(function(x){
            sendMessage(response, x.currentlyPlaying);
        });
    }
    else if (intent === "PLAYRANDOM"){
        console.log(req.body.request.intent.slots.Show.value);
        kodiService.searchTVShows({label : req.body.request.intent.slots.Show.value})
{'fraction_non_alphanumeric': 0.16900770276393295, 'fraction_numerical': 0.0009062075215224287, 'mean_word_length': 2.7551020408163267, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4078489', 'n_tokens_mistral': 691, 'n_tokens_neox': 677, 'n_words': 111}