<commit_before>import React from 'react';
import { findDOMNode } from 'react-dom';
import PropTypes from 'prop-types';
import ReactPlayer from 'react-player';
import { merge, get, throttle } from 'lodash';
import screenfull from 'screenfull';
import moment from 'moment';
import { connect } from 'react-redux';
import IconButton from '../IconButton';
import Slider from '../Slider';
import Switch from '../Switch';
import Icon from '../Icon';
import Text from '../Text';
import getFileInDirection from '../../lib/getFileInDirection';
import { settingsReplace } from '../../actions/settings';
import { filesGetUrl } from '../../actions/files';
import { colors, fontSizes } from '../../lib/styling';
import styles from './styles';

const prepareFile = throttle(callback => callback(), 10000, { leading: true });

class Player extends React.Component {
  static getDerivedStateFromProps(nextProps, prevState) {
    const oldPath = get(prevState, 'path');
    const path = get(nextProps, 'settings.player.file.path');

    if (oldPath !== path) {
      return {
        played: 0,
        playedSeconds: 0,<commit_msg>fix player<commit_after>import React from 'react';
import { findDOMNode } from 'react-dom';
import PropTypes from 'prop-types';
import ReactPlayer from 'react-player';
import { merge, get, throttle } from 'lodash';
import screenfull from 'screenfull';
import moment from 'moment';
import { connect } from 'react-redux';
import IconButton from '../IconButton';
import Slider from '../Slider';
import Switch from '../Switch';
import Icon from '../Icon';
import Text from '../Text';
import getFileInDirection from '../../lib/get-file-in-direction';
import { settingsReplace } from '../../actions/settings';
import { filesGetUrl } from '../../actions/files';
import { colors, fontSizes } from '../../lib/styling';
import styles from './styles';

const prepareFile = throttle(callback => callback(), 10000, { leading: true });

class Player extends React.Component {
  static getDerivedStateFromProps(nextProps, prevState) {
    const oldPath = get(prevState, 'path');
    const path = get(nextProps, 'settings.player.file.path');

    if (oldPath !== path) {
      return {
        played: 0,
        playedSeconds: 0,
{'fraction_non_alphanumeric': 0.15215439856373428, 'fraction_numerical': 0.0062836624775583485, 'mean_word_length': 4.031602708803612, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4522467', 'n_tokens_mistral': 617, 'n_tokens_neox': 604, 'n_words': 210}