Fix MGR processing

This commit is contained in:
DariusIII
2017-01-06 19:58:23 +01:00
parent abaf80e6b1
commit e8a51436d4
4 changed files with 19 additions and 5 deletions
+13
View File
@@ -0,0 +1,13 @@
<?php
require_once realpath(dirname(dirname(dirname(__DIR__))) . DIRECTORY_SEPARATOR . 'bootstrap.php');
use nntmux\ReleasesMultiGroup;
use nntmux\utility\Utility;
$poster = 'mmmq@meh.com';
$relMgrp = new ReleasesMultiGroup();
$posters = Utility::convertMultiArray($relMgrp->getAllPosters(), "','");
var_dump($posters);
-2
View File
@@ -2,12 +2,10 @@
namespace nntmux;
use ApaiIO\Request\Util;
use app\models\ReleasesGroups;
use app\models\Settings;
use nntmux\db\DB;
use nntmux\processing\ProcessReleases;
use nntmux\utility\Utility;
class ReleasesMultiGroup
+1 -1
View File
@@ -771,7 +771,7 @@ class ProcessReleases
$this->pdo->log->doEcho($this->pdo->log->header("Process Releases -> Create the NZB, delete collections/binaries/parts."));
}
$relMgrp = new ReleasesMultiGroup();
$posters = Utility::convertMultiArray($relMgrp->getAllPosters());
$posters = Utility::convertMultiArray($relMgrp->getAllPosters(), "','");
$releases = $this->pdo->queryDirect(
sprintf("
SELECT SQL_NO_CACHE CONCAT(COALESCE(cp.title,'') , CASE WHEN cp.title IS NULL THEN '' ELSE ' > ' END , c.title) AS title,
+5 -2
View File
@@ -1112,14 +1112,17 @@ class Utility
}
/**
* Convert multi to single dimensional array
* Code taken from http://stackoverflow.com/a/12309103
*
* @param $array
*
* @param $separator
*
* @return string
*/
public static function convertMultiArray($array)
public static function convertMultiArray($array, $separator)
{
return implode(",",array_map(function($a) {return implode(",",$a);},$array));
return implode("$separator",array_map(function($a) {return implode(",",$a);},$array));
}
}