<commit_before>import { emitAPIRequest } from './api.actions';

import {
    VP_CHANGE_STATE
} from './actionTypes';

export function isVideoRunning(){
    return (dispatch)=>{
        setTimeout(()=>{
            const endpoint = 'videoplayer.cmd.isRunning';
            dispatch(emitAPIRequest(endpoint, {}, videoRunningChangeState));
            isVideoRunning();
        }, 200);
    }
}

function videoRunningChangeState(playerState){
    return {
        type: VP_CHANGE_STATE,
        playerState
    }
}<commit_msg>Added video info actions.<commit_after>import { emitAPIRequest } from './api.actions';

import {
    VP_CHANGE_STATE,
    VP_RECEIVED_INFO
} from './actionTypes';

export function isPlayerRunning(){
    return (dispatch)=>{
        setTimeout(()=>{
            const endpoint = 'videoplayer.cmd.isRunning';
            dispatch(emitAPIRequest(endpoint, {}, playerRunningChangeState));
            isPlayerRunning();
        }, 200);
    }
}

function playerRunningChangeState(playerState){
    return {
        type: VP_CHANGE_STATE,
        playerState
    }
}

export function getVideoInfo(){
    return (dispatch)=>{
        const endpoint = 'videoplayer.cmd.info';
        dispatch(emitAPIRequest(endpoint, {}, videoReceivedInfo));
    }
}

function videoReceivedInfo(videoInfo){
    return {
        type: VP_RECEIVED_INFO,
        videoInfo
    }
}
{'fraction_non_alphanumeric': 0.11837327523602033, 'fraction_numerical': 0.004357298474945534, 'mean_word_length': 2.8599439775910365, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '2877479', 'n_tokens_mistral': 398, 'n_tokens_neox': 387, 'n_words': 74}