Exemple #1
0
<?php

define('FS_ROOT', realpath(dirname(__FILE__)));
require_once FS_ROOT . "/../../www/config.php";
require_once FS_ROOT . "/../../www/lib/framework/db.php";
require_once FS_ROOT . "/../../www/lib/music.php";
require_once FS_ROOT . "/../../www/lib/category.php";
$music = new Music(true);
$db = new Db();
$limit = 10;
$testSpecificRel = 'Joy - Touch By Touch 2011-CDM-2010-RQS';
//make this string empty to check last $limit releases
if (empty($testSpecificRel)) {
    $res = $db->queryDirect(sprintf("SELECT searchname, ID from releases where musicinfoID IS NULL and categoryID in ( select ID from category where parentID = %d ) ORDER BY id DESC LIMIT %d", Category::CAT_PARENT_MUSIC, $limit));
    foreach ($res as $album) {
        $artist = $music->parseArtist($album);
        doTest($artist);
    }
} else {
    $artist = $music->parseArtist($testSpecificRel);
    doTest($artist);
}
function doTest($relInfo)
{
    echo $relInfo['releasename'] . '<br />';
    $result = updateMusicInfo($relInfo['artist'], $relInfo['album'], $relInfo['year']);
    if ($result !== false) {
        echo '<pre>';
        print_r($result);
        echo '</pre><br /><br />';
    }
Exemple #2
0
<?php

//This script will update all records in the movieinfo table
define('FS_ROOT', realpath(dirname(__FILE__)));
require_once FS_ROOT . "/../../www/config.php";
require_once FS_ROOT . "/../../www/lib/framework/db.php";
require_once FS_ROOT . "/../../www/lib/music.php";
$music = new Music(true);
$db = new Db();
$albums = results();
shuffle($albums);
foreach ($albums as $album) {
    $artist = $music->parseArtist($album);
    echo $artist['releasename'] . '<br />';
    $result = $music->updateMusicInfo($artist['artist'], $artist['album'], $artist['year']);
    if ($result !== false) {
        echo '<pre>';
        print_r($result);
        echo '</pre><br /><br />';
    }
    die;
}
function results()
{
    $str = 'Processing 260 music releases
Looking up: Disintegration [The Cure-Disintegration-3CD-Deluxe Edition-2010-EOS]
Looking up: Build And Destroy Euro Retail 2CD [Royce Da 59-Build And Destroy Euro Retail 2CD-2003-FTD]
Looking up: Dream Dance Vol 48 [VA - Dream Dance Vol 48-2CD-2011-QMI]
Looking up: Electro House Alarm Vol 8 [VA - Electro House Alarm Vol 8-2CD-2010-QMI]
Looking up: Om Himlen Och Osterlen [Danne Strahed-Om Himlen Och Osterlen-2CD-SE-2010-LoKET]
Looking up: Walk On Water Spacesynth Odyssey [Galaxy Hunter-Walk On Water Spacesynth Odyssey-(Rerip)-2CD-2010-BFHMP3]