Exemplo n.º 1
0
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL && ~E_NOTICE);
date_default_timezone_set('Europe/Berlin');
require_once '../lib_helper.php';
require_once '../../config/config.inc.php';
require_once '../lib_mediaobject.php';
require_once '../lib_helper.php';
require_once '../lib_database.php';
require_once '../lib_directory.php';
require_once '../lib_options.php';
$helper = new LibHelper();
$db = new LibDatabase($dbs);
$options = new LibOptions();
# 3RD PARTY MODULE SETUP: TVDB #####################################
define('TVDB_URL', $options->get('tvdb_url'));
define('TVDB_API_KEY', $options->get('tvdb_api_key'));
include __DIR__ . '/../../3rd_party/Moinax/TvDb/CurlException.php';
include __DIR__ . '/../../3rd_party/Moinax/TvDb/Client.php';
include __DIR__ . '/../../3rd_party/Moinax/TvDb/Serie.php';
include __DIR__ . '/../../3rd_party/Moinax/TvDb/Banner.php';
include __DIR__ . '/../../3rd_party/Moinax/TvDb/Episode.php';
use Moinax\TvDb\Client;
$tvdb = new Client(TVDB_URL, TVDB_API_KEY);
$serverTime = $tvdb->getServerTime();
#####################################################################
$query = $_POST['q'];
$theme = $options->get('theme');
$basedir = $options->get('base_directory');
$themepath = $basedir . 'frontend/themes/' . $theme;
Exemplo n.º 2
0
<?php

ini_set('display_errors', 1);
error_reporting(E_ALL);
date_default_timezone_set('Europe/Berlin');
$basepath = __DIR__;
$param1 = $argv[1];
require_once $basepath . '/../config/config.inc.php';
require_once $basepath . '/../lib/lib_mediaobject.php';
require_once $basepath . '/../lib/lib_helper.php';
require_once $basepath . '/../lib/lib_database.php';
require_once $basepath . '/../lib/lib_directory.php';
require_once $basepath . '/../lib/lib_options.php';
$helper = new LibHelper();
$db = new LibDatabase($dbs);
$options = new LibOptions();
$media_objects = array();
$media_directory = $options->get('media_directory');
$md = new LibDirectory($media_directory);
$md->add_filetype('avi');
$md->add_filetype('mkv');
$md->load_all_files();
$filelist = $md->get_filelist();
$files_existing = 0;
$files_new = 0;
foreach ($filelist as $file) {
    $media_object = new LibMediaObject();
    $media_object->set_metadata('filename', $file['basename']);
    $media_object->set_metadata('filetype', $file['extension']);
    $media_object->set_metadata('path', $file['dirname']);
    if ($param1 != 'dryrun') {