mirror of
https://github.com/NNTmux/newznab-tmux.git
synced 2026-08-29 01:08:56 +00:00
Fix MGR processing
This commit is contained in:
@@ -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,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
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user