<commit_before>import React, {Component, PropTypes } from 'react';
import MainHeaderBackground from '../MainHeader/MainHeaderBackground';
import TimeDuration from '../Utilities/TimeDuration';
import BuyFromJumbotronPlaylist from '../Buttons/BuyFromJumbotronPlaylist';
import {apiEndPoint} from '../../helpers/ApiClient';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {addTrackToCart} from 'redux/modules/cart';

@connect(
    null,
    dispatch => bindActionCreators({addTrackToCart}, dispatch))


export default class ReleaseJumbotron extends Component {
  static propTypes = {
    addTrackToCart: PropTypes.func.isRequired,
    release: PropTypes.object
  };


  constructor(props) {
    super(props);
    this.handleAddTrack = this.handleAddTrack.bind(this);
  }

  handleAddTrack(id) {
    this.props.addTrackToCart(id);
  }

  render() {
    const release = this.props.release; // eslint-disable-line no-shadow
    if (!release || !release.Tracks) {
      return (<div></div>);
    }
    const height = Math.max(570, 400 + (release.Tracks.length * 40));
    const uniqueArtists = [];
    let imd = 0;
    for (const track of release.Tracks) {
      for (const artist of track.Producer) {
        imd = imd + 1;
        if (!uniqueArtists[artist.id]) {
          // The artist doesn't exists.
          uniqueArtists[artist.id] = { artist: artist, counter: 1};
        } else {
          // The artist exists, increment the counter
          uniqueArtists[artist.id].counter = uniqueArtists[artist.id].counter + 1;
        }
      }
    }
    return (
      <div className="releaseJumbotron">
      <MainHeaderBackground image={apiEndPoint() + '/images/' + release.cover} height={height}/>
      <div className="headerContent" style={{height: height + 'px'}} >
        <div className="row trackJumbotronContainer">
        <div className="col-sub-xs-10 col-sub-xs-offset-4 col-sub-sm-offset-0 hidden-sm col-sub-sm-6 col-sub-md-5 col-sub-lg-4 overflowHidden">
          <img className="cover" src={apiEndPoint() + '/images/' + release.cover} />
        </div>
        <div className="col-sub-xs-18 col-sub-sm-18 col-sub-md-13 col-sub-lg-14">
          <div className="row hidden-xs">
          <div className="col-lg-6 text-left trackDescriptionSpace">
            <div className="labelContainer">
            Label: <strong>{release.Labels[0].displayName}</strong>
            </div>
            <div>
            Artist
            </div>
          </div>
          <div className="col-lg-6 text-right">
            Album
          </div>
          <div className="col-lg-12 titleContainer"><commit_msg>Updating image endpoint called in Release Jumbotron<commit_after>import React, {Component, PropTypes } from 'react';
import MainHeaderBackground from '../MainHeader/MainHeaderBackground';
import TimeDuration from '../Utilities/TimeDuration';
import BuyFromJumbotronPlaylist from '../Buttons/BuyFromJumbotronPlaylist';
import {apiEndPoint} from '../../helpers/ApiClient';
import {bindActionCreators} from 'redux';
import {connect} from 'react-redux';
import {addTrackToCart} from 'redux/modules/cart';

@connect(
    null,
    dispatch => bindActionCreators({addTrackToCart}, dispatch))


export default class ReleaseJumbotron extends Component {
  static propTypes = {
    addTrackToCart: PropTypes.func.isRequired,
    release: PropTypes.object
  };


  constructor(props) {
    super(props);
    this.handleAddTrack = this.handleAddTrack.bind(this);
  }

  handleAddTrack(id) {
    this.props.addTrackToCart(id);
  }

  render() {
    const release = this.props.release; // eslint-disable-line no-shadow
    if (!release || !release.Tracks) {
      return (<div></div>);
    }
    const height = Math.max(570, 400 + (release.Tracks.length * 40));
    const uniqueArtists = [];
    let imd = 0;
    for (const track of release.Tracks) {
      for (const artist of track.Producer) {
        imd = imd + 1;
        if (!uniqueArtists[artist.id]) {
          // The artist doesn't exists.
          uniqueArtists[artist.id] = { artist: artist, counter: 1};
        } else {
          // The artist exists, increment the counter
          uniqueArtists[artist.id].counter = uniqueArtists[artist.id].counter + 1;
        }
      }
    }
    return (
      <div className="releaseJumbotron">
      <MainHeaderBackground image={apiEndPoint() + '/releases/' + release.id + '/cover/small'} height={height}/>
      <div className="headerContent" style={{height: height + 'px'}} >
        <div className="row trackJumbotronContainer">
        <div className="col-sub-xs-10 col-sub-xs-offset-4 col-sub-sm-offset-0 hidden-sm col-sub-sm-6 col-sub-md-5 col-sub-lg-4 overflowHidden">
          <img className="cover" src={apiEndPoint() + '/releases/' + release.id + '/cover/small'} />
        </div>
        <div className="col-sub-xs-18 col-sub-sm-18 col-sub-md-13 col-sub-lg-14">
          <div className="row hidden-xs">
          <div className="col-lg-6 text-left trackDescriptionSpace">
            <div className="labelContainer">
            Label: <strong>{release.Labels[0].displayName}</strong>
            </div>
            <div>
            Artist
            </div>
          </div>
          <div className="col-lg-6 text-right">
            Album
          </div>
          <div className="col-lg-12 titleContainer">
{'fraction_non_alphanumeric': 0.14014163250093178, 'fraction_numerical': 0.011926947446887812, 'mean_word_length': 2.7348643006263047, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 49, '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': '3303919', 'n_tokens_mistral': 1646, 'n_tokens_neox': 1609, 'n_words': 353}