<?php if (!$page->users->isLoggedIn()) { $page->show403(); } if (!isset($_REQUEST['id'])) { $page->show404(); } $re = new ReleaseExtra(); $redata = $re->getBriefByGuid($_REQUEST['id']); if (!$redata) { print 'No media info'; } else { print "<table>\n"; if ($redata["videocodec"] != "" && $redata["containerformat"] != "") { $redata["videocodec"] = $re->makeCodecPretty($redata["videocodec"]); print "<tr><th>Format:</th><td>" . htmlentities($redata["videocodec"], ENT_QUOTES) . " - " . htmlentities($redata["containerformat"], ENT_QUOTES) . "</td></tr>\n"; } if ($redata["videoduration"] != "") { print "<tr><th>Duration:</th><td>" . htmlentities($redata["videoduration"], ENT_QUOTES) . "</td></tr>\n"; } if ($redata["size"] != "") { print "<tr><th>Resolution:</th><td>" . htmlentities($redata["size"], ENT_QUOTES) . "</td></tr>\n"; } if ($redata["videoaspect"] != "") { print "<tr><th>Aspect Ratio:</th><td>" . htmlentities($redata["videoaspect"], ENT_QUOTES) . "</td></tr>\n"; } if ($redata["audio"] != "" && $redata["audio"] != ", ") { print "<tr><th>Audio Languages:</th><td>" . htmlentities($redata["audio"], ENT_QUOTES) . "</td></tr>\n"; } if ($redata["audioformat"] != "" && $redata["audioformat"] != ", ") {
<?php if (!$page->users->isLoggedIn()) { $page->show403(); } if (isset($_GET["id"])) { $releases = new Releases(['Settings' => $page->settings]); $rc = new ReleaseComments(); $re = new ReleaseExtra(); $data = $releases->getByGuid($_GET["id"]); if (!$data) { $page->show404(); } if ($page->isPostBack()) { $rc->addComment($data["id"], $data["gid"], $_POST["txtAddComment"], $page->users->currentUserId(), $_SERVER['REMOTE_ADDR']); } $nfo = $releases->getReleaseNfo($data["id"], false); $reVideo = $re->getVideo($data["id"]); $reAudio = $re->getAudio($data["id"]); $reSubs = $re->getSubs($data["id"]); $comments = $rc->getCommentsByGid($data["gid"]); $rage = ''; if ($data["rageid"] != '') { $tvrage = new TvAnger(); $rageinfo = $tvrage->getByRageID($data["rageid"]); if (count($rageinfo) > 0) { $seriesnames = $seriesdescription = $seriescountry = $seriesgenre = $seriesimg = $seriesid = array(); foreach ($rageinfo as $r) { $seriesnames[] = $r['releasetitle']; if (!empty($r['description'])) { $seriesdescription[] = $r['description'];
/** * Try to get media info xml from a video file. * * @param string $fileLocation * * @return bool */ protected function _getMediaInfo($fileLocation) { if (!$this->_processMediaInfo) { return false; } // Look for the video file. if (is_file($fileLocation)) { // Run media info on it. $xmlArray = Utility::runCmd($this->_killString . $this->pdo->getSetting('mediainfopath') . '" --Output=XML "' . $fileLocation . '"'); // Check if we got it. if (is_array($xmlArray)) { // Convert it to string. $xmlArray = implode("\n", $xmlArray); if (!preg_match('/<track type="(Audio|Video)">/i', $xmlArray)) { return false; } // Insert it into the DB. $this->_releaseExtra->addFull($this->_release['id'], $xmlArray); $this->_releaseExtra->addFromXml($this->_release['id'], $xmlArray); if ($this->_echoCLI) { $this->_echo('m', 'primaryOver', false); } return true; } } return false; }
/** * @param $id * @param bool $isGuid */ public function delete($id, $isGuid = false) { $users = new Users(); $s = new Settings(); $nfo = new Nfo(); $rf = new ReleaseFiles(); $re = new ReleaseExtra(); $rc = new ReleaseComments(); $ri = new ReleaseImage(); if (!is_array($id)) { $id = array($id); } foreach ($id as $identifier) { // // delete from disk. // $rel = $isGuid ? $this->getByGuid($identifier) : $this->getById($identifier); $nzbpath = ""; if ($isGuid) { $nzbpath = $s->getSetting('nzbpath') . substr($identifier, 0, 1) . "/" . $identifier . ".nzb.gz"; } elseif ($rel) { $nzbpath = $s->getSetting('nzbpath') . substr($rel["guid"], 0, 1) . "/" . $rel["guid"] . ".nzb.gz"; } if ($nzbpath != "" && file_exists($nzbpath)) { unlink($nzbpath); } $audiopreviewpath = ""; if ($isGuid) { $audiopreviewpath = WWW_DIR . 'covers/audio/' . $identifier . ".mp3"; } elseif ($rel) { $audiopreviewpath = WWW_DIR . 'covers/audio/' . $rel["guid"] . ".mp3"; } if ($audiopreviewpath && file_exists($audiopreviewpath)) { unlink($audiopreviewpath); } if ($rel) { $nfo->deleteReleaseNfo($rel['id']); $rc->deleteCommentsForRelease($rel['id']); $users->delCartForRelease($rel['id']); $users->delDownloadRequestsForRelease($rel['id']); $rf->delete($rel['id']); $re->delete($rel['id']); $re->deleteFull($rel['id']); $ri->delete($rel['guid']); $this->pdo->queryExec(sprintf("DELETE FROM releases WHERE id = %d", $rel['id'])); } } }
if (!$page->users->isLoggedIn()) { $page->show403(); } if (isset($_GET['id'])) { $releases = new Releases(['Settings' => $page->settings]); $data = $releases->getByGuid($_GET['id']); if (!$data) { $page->show404(); } $rc = new ReleaseComments($page->settings); if ($page->isPostBack()) { $rc->addComment($data['id'], $_POST['txtAddComment'], $page->users->currentUserId(), $_SERVER['REMOTE_ADDR']); } $nfo = $releases->getReleaseNfo($data['id'], false); $re = new ReleaseExtra($page->settings); $reVideo = $re->getVideo($data['id']); $reAudio = $re->getAudio($data['id']); $reSubs = $re->getSubs($data['id']); $comments = $rc->getComments($data['id']); $similars = $releases->searchSimilar($data['id'], $data['searchname'], 6, $page->userdata['categoryexclusions']); $rage = $ani = $mov = $mus = $con = $game = $xxx = $boo = ''; if ($data['rageid'] != '') { $tvrage = new TvRage(['Settings' => $page->settings]); $rageinfo = $tvrage->getByRageID($data['rageid']); if (count($rageinfo) > 0) { $seriesnames = $seriesdescription = $seriescountry = $seriesgenre = $seriesimg = $seriesid = array(); foreach ($rageinfo as $r) { $seriesnames[] = $r['releasetitle']; if (!empty($r['description'])) { $seriesdescription[] = $r['description'];
/** * Work out all files contained inside a rar */ public function getMediainfo($ramdrive, $mediainfo, $releaseID) { $retval = false; $mediafiles = glob($ramdrive . '*.*'); if (is_array($mediafiles)) { foreach ($mediafiles as $mediafile) { if (preg_match("/\\.(" . $this->mediafileregex . '|' . $this->audiofileregex . ")\$/i", $mediafile)) { $execstring = '"' . $mediainfo . '" --Output=XML "' . $mediafile . '"'; $xmlarray = Utility::runCmd($execstring); if (is_array($xmlarray)) { $xmlarray = implode("\n", $xmlarray); $re = new ReleaseExtra(); $re->addFull($releaseID, $xmlarray); $re->addFromXml($releaseID, $xmlarray); $retval = true; } else { echo "PostPrc : Failed to process mediainfo for " . $mediafile . " release (" . $releaseID . ")\n"; } } } } else { echo "PostPrc: Couldn't open temp drive " . $ramdrive . "\n"; } return $retval; }
<?php require_once dirname(__FILE__) . '/../../www/config.php'; use newznab\db\Settings; $r = new Releases(); $rv = new ReleaseExtra(); $db = new Settings(); $rels = $db->query("select releaseID, videowidth, videoheight from releasevideo where definition is null"); foreach ($rels as $rel) { $sql = sprintf("update releasevideo set definition = %d where releaseID = %d", $rv->determineVideoResolution($rel["videowidth"], $rel["videoheight"]), $rel["releaseID"]); $db->exec($sql); }
public function getMediainfo($ramdrive, $mediainfo, $releaseID) { $retval = false; $mediafiles = glob($ramdrive . '*.*'); if (is_array($mediafiles)) { foreach ($mediafiles as $mediafile) { if (preg_match("/\\.(" . $this->mediafileregex . ")\$/i", $mediafile)) { echo "Getting Mediainfo for {$mediafile}\n"; $execstring = '"' . $mediainfo . '" --Output=XML "' . $mediafile . '"'; $xmlarray = runCmd($execstring); if (is_array($xmlarray)) { echo "-Success\n"; $xmlarray = implode("\n", $xmlarray); $re = new ReleaseExtra(); $re->addFull($releaseID, $xmlarray); $re->addFromXml($releaseID, $xmlarray); $retval = true; } else { echo "-Failed\n"; } } } } else { echo "Couldn't open temp drive " . $ramdrive; } return $retval; }
public function delete($id, $isGuid = false) { $db = new DB(); $users = new Users(); $s = new Sites(); $nfo = new Nfo(); $site = $s->get(); $rf = new ReleaseFiles(); $re = new ReleaseExtra(); $rc = new ReleaseComments(); $ri = new ReleaseImage(); if (!is_array($id)) { $id = array($id); } foreach ($id as $identifier) { // // delete from disk. // $rel = $isGuid ? $this->getByGuid($identifier) : $this->getById($identifier); if ($rel && file_exists($site->nzbpath . $rel["guid"] . ".nzb.gz")) { unlink($site->nzbpath . $rel["guid"] . ".nzb.gz"); } $nfo->deleteReleaseNfo($rel['ID']); $rc->deleteCommentsForRelease($rel['ID']); $users->delCartForRelease($rel['ID']); $rf->delete($rel['ID']); $re->delete($rel['ID']); $re->deleteFull($rel['ID']); $ri->delete($rel['guid']); $db->query(sprintf("delete from releases where id = %d", $rel['ID'])); } }