<commit_before><?php
/**
 * @package plugins.yahooDistribution
 * @subpackage api.objects
 */
class KalturaYahooDistributionJobProviderData extends KalturaConfigurableDistributionJobProviderData
{
	/**
	 * @var string
	 */
	public $smallThumbPath;
	
	/**
	 * @var string
	 */
	public $largeThumbPath;
	
	/**
	 * @var string
	 */
	public $videoAssetFilePath;
	
	public function __construct(KalturaDistributionJobData $distributionJobData = null)
	{		
	    parent::__construct($distributionJobData);
	    
		if(!$distributionJobData)
			return;
			
		if(!($distributionJobData->distributionProfile instanceof KalturaYahooDistributionProfile))
			return;
		//Flavor Assets
		$flavorAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds));
		if(count($flavorAssets)) {
			$videoAssetFilePathArray = array();
			foreach ($flavorAssets as $flavorAsset)
			{
				if($flavorAsset) 
				{
					/* @var $flavorAsset flavorAsset */
					$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
					if(kFileSyncUtils::fileSync_exists($syncKey)){
						$id = $flavorAsset->getId();
					    //$this->videoAssetFilePath[$id] = kFileSyncUtils::getLocalFilePathForKey($syncKey, true);
						$videoAssetFilePathArray[$id] = kFileSyncUtils::getLocalFilePathForKey($syncKey, true);
					}
				}
			}
			$this->videoAssetFilePath = serialize($videoAssetFilePathArray);	
		}
		//Thumbnails		
		$c = new Criteria();
		$c->addAnd(assetPeer::ID, explode(',', $distributionJobData->entryDistribution->thumbAssetIds), Criteria::IN);
		$c->addAscendingOrderByColumn(assetPeer::ID);
		$thumbAssets = assetPeer::doSelect($c);		
		//$thumbAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->thumbAssetIds));
		//TODO: erase
		KalturaLog::debug('NOGAAAAA -'.print_r($thumbAssets, true));
		KalturaLog::debug('NOGAAAAA -'.print_r($distributionJobData->entryDistribution, true));
		
		
		if(count($thumbAssets)>=2)
		{			
			if ($thumbAssets[0]->getWidth() <= $thumbAssets[1]->getWidth()){
				$smallThumbAsset = $thumbAssets[0];	
				$largeThumbAsset = $thumbAssets[1];							
			}
			else{
				$smallThumbAsset = $thumbAssets[1];	
				$largeThumbAsset = $thumbAssets[0];		
			}
			$syncKey = $smallThumbAsset->getSyncKey(thumbAsset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
			if(kFileSyncUtils::fileSync_exists($syncKey)){<commit_msg>PS: removing log prints<commit_after><?php
/**
 * @package plugins.yahooDistribution
 * @subpackage api.objects
 */
class KalturaYahooDistributionJobProviderData extends KalturaConfigurableDistributionJobProviderData
{
	/**
	 * @var string
	 */
	public $smallThumbPath;
	
	/**
	 * @var string
	 */
	public $largeThumbPath;
	
	/**
	 * @var string
	 */
	public $videoAssetFilePath;
	
	public function __construct(KalturaDistributionJobData $distributionJobData = null)
	{		
	    parent::__construct($distributionJobData);
	    
		if(!$distributionJobData)
			return;
			
		if(!($distributionJobData->distributionProfile instanceof KalturaYahooDistributionProfile))
			return;
		//Flavor Assets
		$flavorAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->flavorAssetIds));
		if(count($flavorAssets)) {
			$videoAssetFilePathArray = array();
			foreach ($flavorAssets as $flavorAsset)
			{
				if($flavorAsset) 
				{
					/* @var $flavorAsset flavorAsset */
					$syncKey = $flavorAsset->getSyncKey(flavorAsset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
					if(kFileSyncUtils::fileSync_exists($syncKey)){
						$id = $flavorAsset->getId();
					    //$this->videoAssetFilePath[$id] = kFileSyncUtils::getLocalFilePathForKey($syncKey, true);
						$videoAssetFilePathArray[$id] = kFileSyncUtils::getLocalFilePathForKey($syncKey, true);
					}
				}
			}
			$this->videoAssetFilePath = serialize($videoAssetFilePathArray);	
		}
		//Thumbnails		
		$c = new Criteria();
		$c->addAnd(assetPeer::ID, explode(',', $distributionJobData->entryDistribution->thumbAssetIds), Criteria::IN);
		$c->addAscendingOrderByColumn(assetPeer::ID);
		$thumbAssets = assetPeer::doSelect($c);		
		//$thumbAssets = assetPeer::retrieveByIds(explode(',', $distributionJobData->entryDistribution->thumbAssetIds));
		
		
		if(count($thumbAssets)>=2)
		{			
			if ($thumbAssets[0]->getWidth() <= $thumbAssets[1]->getWidth()){
				$smallThumbAsset = $thumbAssets[0];	
				$largeThumbAsset = $thumbAssets[1];							
			}
			else{
				$smallThumbAsset = $thumbAssets[1];	
				$largeThumbAsset = $thumbAssets[0];		
			}
			$syncKey = $smallThumbAsset->getSyncKey(thumbAsset::FILE_SYNC_ASSET_SUB_TYPE_ASSET);
			if(kFileSyncUtils::fileSync_exists($syncKey)){
{'fraction_non_alphanumeric': 0.1439312567132116, 'fraction_numerical': 0.0030075187969924814, 'mean_word_length': 4.946360153256705, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 38, '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': '7396827', 'n_tokens_mistral': 1793, 'n_tokens_neox': 1508, 'n_words': 194}