示例#1
0
文件: backend.php 项目: cyrilix/rompr
function update_image_db($key, $notfound, $imagefile)
{
    $val = $notfound == 0 ? $imagefile : "";
    if ($stmt = sql_prepare_query("UPDATE Albumtable SET Image=?, Searched = 1 WHERE ImgKey=?", $val, $key)) {
        debuglog("    Database Image URL Updated", "MYSQL", 8);
    } else {
        debuglog("    Failed To Update Database Image URL", "MYSQL", 2);
    }
}
示例#2
0
function check_wishlist_doodads($ttids)
{
    global $uri, $albumartist, $album, $albumuri, $image, $date;
    $donesomething = false;
    if ($stmt = sql_prepare_query("SELECT Uri, Albumindex FROM Tracktable WHERE TTindex = ?", $ttids[0])) {
        while ($ttidobj = $stmt->fetch(PDO::FETCH_OBJ)) {
            if ($ttidobj->Uri == null) {
                if ($up1 = sql_prepare_query("UPDATE Tracktable SET Uri = ? WHERE TTindex = ?", $uri, $ttids[0])) {
                    debuglog("  .. Updated track URI for ex-wishlist item", "USERRATINGS", 5);
                    $donesomething = true;
                } else {
                    debuglog("  .. FAILED to update Track URI!", "USERRATINGS", 2);
                }
                if ($ttidobj->Albumindex == null) {
                    $albumai = check_artist($albumartist, true);
                    $albumindex = check_album($album, $albumai, $albumuri, $image, $date, "no", md5($albumartist . " " . $album), null, getDomain($uri), true);
                    if ($up2 = sql_prepare_query("UPDATE Tracktable SET Albumindex = ? WHERE TTindex = ?", $albumindex, $ttids[0])) {
                        debuglog("  .. Updated track album index for wishlist item", "USERRATINGS", 5);
                        $donesomething = true;
                    } else {
                        debuglog("  .. FAILED to update Track Album Index!", "USERRATINGS", 2);
                    }
                }
            }
        }
    }
    return $donesomething;
}