<commit_before><?php

/*
 * This file is part of the Pondtunes package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Pond\Tunes;

use Pond\Tunes\ResultSet;
use Buzz\Browser;

abstract class Tunes
{
    /**
     * @var array
     */
    private $results = array();

    /**
     * @var integer
     */
    private $resultCount = 0;

    /**
     * Properties with default values
     *
     * @var array
     */
    private $defaultOptions = array(
        'country'   => 'us',
        'language'  => '',
        'mediaType' => '',
        'entity'    => array(self::MEDIATYPE_ALL => 'album'),
        'attribute' => '',
        'limit'     => 100,
        'callback'  => '',
        'version'   => 2,
        'explicit'  => 'yes'
    );

    /**
     * List of countries where the iTunes store is available
     *
     * @var array
     */
    protected static $countryList = array(
        'ai', 'ar', 'au', 'ao', 'at', 'ae', 'ag', 'az',
        'be', 'br', 'by', 'bs', 'bh', 'bb', 'bz', 'bm', 'bo', 'bw', 'bn', 'bg',
        'ca', 'cl', 'cn', 'co', 'cr', 'cz', 'ch', 'cy',
        'dk', 'do', 'dz', 'de', 'dm',
        'ec', 'eg', 'es', 'ee',
        'fi', 'fr',
        'gr', 'gt', 'gb', 'gh', 'gy',
        'hn', 'hk', 'hu', 'hr',
        'in', 'id', 'ie', 'il', 'it', 'is',
        'jm', 'jp', 'jo',
        'kz', 'kr', 'kw', 'ky', 'ke', 'kn', 'kh',
        'lv', 'lb', 'lt', 'lu', 'lk', 'lc',
        'mo', 'my', 'mt', 'mx', 'md', 'mk', 'mg', 'ml', 'mu', 'ms',
        'nl', 'nz', 'ni', 'no',
        'om',
        'pk', 'pa', 'py', 'pe', 'ph', 'pl', 'pt',
        'qa',
        'ro', 'ru',
        'sa', 'sg', 'sk', 'si', 'se', 'sv', 'sn', 'sr',
        'tw', 'th', 'tr', 'tz', 'tt', 'tn', 'tc',
        'us', 'uy', 'ug', 'uz',
        've', 'vn', 'vc', 'vg',
        'ye',
        'za',
    );

    /**
     * List of available languages for the result
     *
     * @var array
     */
    protected $languageList = array('en_us', 'ja_jp');

    const MEDIATYPE_ALL        = 'all';
    const MEDIATYPE_PODCAST    = 'podcast';
    const MEDIATYPE_MUSIC      = 'music';
    const MEDIATYPE_MUSICVIDEO = 'musicVideo';
    const MEDIATYPE_AUDIOBOOK  = 'audiobook';
    const MEDIATYPE_SHORTFILM  = 'shortFilm';
    const MEDIATYPE_SOFTWARE   = 'software';
    const MEDIATYPE_TVSHOW     = 'tvShow';
    const MEDIATYPE_MOVIE      = 'movie';
    const MEDIATYPE_EBOOK      = 'ebook';

    /**
     * List of available media types
     *
     * @var $_mediaTypes array
     */
    protected $mediaTypes = array(
        self::MEDIATYPE_ALL,
        self::MEDIATYPE_AUDIOBOOK,
        self::MEDIATYPE_MOVIE,
        self::MEDIATYPE_MUSIC,
        self::MEDIATYPE_MUSICVIDEO,
        self::MEDIATYPE_PODCAST,
        self::MEDIATYPE_SHORTFILM,
        self::MEDIATYPE_SOFTWARE,
        self::MEDIATYPE_TVSHOW
    );

    /**
     * List of all available entity types
     *
     * @var array
     */
    protected $entityList = array(
        self::MEDIATYPE_MOVIE => array(
            'movieArtist',
            'movie'
        ),
        self::MEDIATYPE_PODCAST => array(
            'podcastAuthor',
            'podcast'
        ),
        self::MEDIATYPE_MUSIC => array(
            'musicArtist',
            'musicTrack',
            'album',
            'musicVideo',
            'mix'
        ),
        self::MEDIATYPE_MUSICVIDEO => array(
            'musicArtist',
            'musicVideo'
        ),
        self::MEDIATYPE_AUDIOBOOK => array(
            'audiobookAuthor',
            'audiobook'
        ),
        self::MEDIATYPE_SHORTFILM => array(
            'shortFilmArtist',
            'shortFilm'
        ),
        self::MEDIATYPE_TVSHOW => array(
            'tvEpisode',
            'tvSeason'
        ),
        self::MEDIATYPE_SOFTWARE => array(
            'software',
            'iPadSoftware',
            'macSoftware'
        ),
        self::MEDIATYPE_EBOOK => array(
            'ebook'
        ),
        self::MEDIATYPE_ALL => array(
            'movie',
            'album',
            'allArtist',
            'podcast',
            'musicVideo',
            'mix',
            'audiobook',
            'tvSeason',
            'allTrack'
        ),
    );

    /**
     * List of possible attributes
     *
     * @var array
     */
    protected $attributesTypes = array(
        self::MEDIATYPE_MOVIE => array(
            'actorTerm',
            'genreIndex',
            'artistTerm',
            'shortFilmTerm',
            'producerTerm',
            'ratingTerm',
            'directorTerm',
            'releaseYearTerm',
            'featureFilmTerm',
            'movieArtistTerm',
            'movieTerm',
            'ratingIndex',
            'descriptionTerm'
        ),
        self::MEDIATYPE_PODCAST => array(<commit_msg>Added missing entity type for mediatype music.<commit_after><?php

/*
 * This file is part of the Pondtunes package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Pond\Tunes;

use Pond\Tunes\ResultSet;
use Buzz\Browser;

abstract class Tunes
{
    /**
     * @var array
     */
    private $results = array();

    /**
     * @var integer
     */
    private $resultCount = 0;

    /**
     * Properties with default values
     *
     * @var array
     */
    private $defaultOptions = array(
        'country'   => 'us',
        'language'  => '',
        'mediaType' => '',
        'entity'    => array(self::MEDIATYPE_ALL => 'album'),
        'attribute' => '',
        'limit'     => 100,
        'callback'  => '',
        'version'   => 2,
        'explicit'  => 'yes'
    );

    /**
     * List of countries where the iTunes store is available
     *
     * @var array
     */
    protected static $countryList = array(
        'ai', 'ar', 'au', 'ao', 'at', 'ae', 'ag', 'az',
        'be', 'br', 'by', 'bs', 'bh', 'bb', 'bz', 'bm', 'bo', 'bw', 'bn', 'bg',
        'ca', 'cl', 'cn', 'co', 'cr', 'cz', 'ch', 'cy',
        'dk', 'do', 'dz', 'de', 'dm',
        'ec', 'eg', 'es', 'ee',
        'fi', 'fr',
        'gr', 'gt', 'gb', 'gh', 'gy',
        'hn', 'hk', 'hu', 'hr',
        'in', 'id', 'ie', 'il', 'it', 'is',
        'jm', 'jp', 'jo',
        'kz', 'kr', 'kw', 'ky', 'ke', 'kn', 'kh',
        'lv', 'lb', 'lt', 'lu', 'lk', 'lc',
        'mo', 'my', 'mt', 'mx', 'md', 'mk', 'mg', 'ml', 'mu', 'ms',
        'nl', 'nz', 'ni', 'no',
        'om',
        'pk', 'pa', 'py', 'pe', 'ph', 'pl', 'pt',
        'qa',
        'ro', 'ru',
        'sa', 'sg', 'sk', 'si', 'se', 'sv', 'sn', 'sr',
        'tw', 'th', 'tr', 'tz', 'tt', 'tn', 'tc',
        'us', 'uy', 'ug', 'uz',
        've', 'vn', 'vc', 'vg',
        'ye',
        'za',
    );

    /**
     * List of available languages for the result
     *
     * @var array
     */
    protected $languageList = array('en_us', 'ja_jp');

    const MEDIATYPE_ALL        = 'all';
    const MEDIATYPE_PODCAST    = 'podcast';
    const MEDIATYPE_MUSIC      = 'music';
    const MEDIATYPE_MUSICVIDEO = 'musicVideo';
    const MEDIATYPE_AUDIOBOOK  = 'audiobook';
    const MEDIATYPE_SHORTFILM  = 'shortFilm';
    const MEDIATYPE_SOFTWARE   = 'software';
    const MEDIATYPE_TVSHOW     = 'tvShow';
    const MEDIATYPE_MOVIE      = 'movie';
    const MEDIATYPE_EBOOK      = 'ebook';

    /**
     * List of available media types
     *
     * @var $_mediaTypes array
     */
    protected $mediaTypes = array(
        self::MEDIATYPE_ALL,
        self::MEDIATYPE_AUDIOBOOK,
        self::MEDIATYPE_MOVIE,
        self::MEDIATYPE_MUSIC,
        self::MEDIATYPE_MUSICVIDEO,
        self::MEDIATYPE_PODCAST,
        self::MEDIATYPE_SHORTFILM,
        self::MEDIATYPE_SOFTWARE,
        self::MEDIATYPE_TVSHOW
    );

    /**
     * List of all available entity types
     *
     * @var array
     */
    protected $entityList = array(
        self::MEDIATYPE_MOVIE => array(
            'movieArtist',
            'movie',
        ),
        self::MEDIATYPE_PODCAST => array(
            'podcastAuthor',
            'podcast',
        ),
        self::MEDIATYPE_MUSIC => array(
            'musicArtist',
            'musicTrack',
            'album',
            'musicVideo',
            'mix',
            'song',
        ),
        self::MEDIATYPE_MUSICVIDEO => array(
            'musicArtist',
            'musicVideo',
        ),
        self::MEDIATYPE_AUDIOBOOK => array(
            'audiobookAuthor',
            'audiobook',
        ),
        self::MEDIATYPE_SHORTFILM => array(
            'shortFilmArtist',
            'shortFilm',
        ),
        self::MEDIATYPE_TVSHOW => array(
            'tvEpisode',
            'tvSeason',
        ),
        self::MEDIATYPE_SOFTWARE => array(
            'software',
            'iPadSoftware',
            'macSoftware',
        ),
        self::MEDIATYPE_EBOOK => array(
            'ebook',
        ),
        self::MEDIATYPE_ALL => array(
            'movie',
            'album',
            'allArtist',
            'podcast',
            'musicVideo',
            'mix',
            'audiobook',
            'tvSeason',
            'allTrack',
        ),
    );

    /**
     * List of possible attributes
     *
     * @var array
     */
    protected $attributesTypes = array(
        self::MEDIATYPE_MOVIE => array(
            'actorTerm',
            'genreIndex',
            'artistTerm',
            'shortFilmTerm',
            'producerTerm',
            'ratingTerm',
            'directorTerm',
            'releaseYearTerm',
            'featureFilmTerm',
            'movieArtistTerm',
            'movieTerm',
            'ratingIndex',
            'descriptionTerm'
        ),
        self::MEDIATYPE_PODCAST => array(
{'fraction_non_alphanumeric': 0.17015680323722812, 'fraction_numerical': 0.0010116337885685382, 'mean_word_length': 1.6596717783158461, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '780064', 'n_tokens_mistral': 3365, 'n_tokens_neox': 3298, 'n_words': 724}