Ejemplo n.º 1
0
     $page->smarty->assign('releases', $reldata);
     $output = trim($page->smarty->fetch('apiresult.tpl'));
     printOutput($relData, $outputXML, $page, $offset);
     break;
     // Search movie releases.
 // Search movie releases.
 case 'm':
     verifyEmptyParameter('q');
     verifyEmptyParameter('imdbid');
     $maxAge = maxAge();
     $page->users->addApiRequest($uid, $_SERVER['REQUEST_URI'], $hosthash);
     $offset = offset();
     $imdbId = isset($_GET['imdbid']) ? $_GET['imdbid'] : '-1';
     $relData = $releases->searchbyImdbId($imdbId, $offset, limit(), isset($_GET['q']) ? $_GET['q'] : '', categoryid(), $maxAge);
     addCoverURL($relData, function ($release) {
         return Utility::getCoverURL(['type' => 'movies', 'id' => $release['imdbid']]);
     });
     addLanguage($relData, $page->settings);
     printOutput($relData, $outputXML, $page, $offset);
     break;
     // Get NZB.
 // Get NZB.
 case 'g':
     if (!isset($_GET['id'])) {
         showApiError(200, 'Missing parameter (id is required for downloading an NZB)');
     }
     $relData = $releases->getByGuid($_GET['id']);
     if ($relData) {
         header('Location:' . WWW_TOP . '/getnzb?i=' . $uid . '&r=' . $apiKey . '&id=' . $relData['guid'] . (isset($_GET['del']) && $_GET['del'] == '1' ? '&del=1' : ''));
     } else {
         showApiError(300, 'No such item (the guid you provided has no release in our database)');