Example #1
0
function createAlbumsList()
{
    global $collection, $transaction_open, $numdone, $doing_search;
    debuglog("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", "TIMINGS", 4);
    debuglog("Starting Database Update From Collection", "TIMINGS", 4);
    $now = time();
    foreach (array_keys($collection->artists) as $artistkey) {
        do_artist_database_stuff($artistkey, false);
    }
    $dur = format_time(time() - $now);
    debuglog("Database Update From Collection Took " . $dur, "TIMINGS", 4);
    debuglog("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", "TIMINGS", 4);
    // Find tracks that have been removed
    if (!$doing_search) {
        debuglog("Starting Cruft Removal", "TIMINGS", 4);
        $now = time();
        debuglog("Finding tracks that have been deleted", "MYSQL", 7);
        generic_sql_query("DELETE FROM Tracktable WHERE LastModified IS NOT NULL AND TTindex NOT IN\n\t    \t(SELECT TTindex FROM Foundtracks) AND Hidden = 0", true);
        remove_cruft();
        update_stat('ListVersion', ROMPR_COLLECTION_VERSION);
        update_track_stats();
        $dur = format_time(time() - $now);
        debuglog("Cruft Removal Took " . $dur, "TIMINGS", 4);
        debuglog("~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~", "TIMINGS", 4);
    }
    close_transaction();
}
Example #2
0
        $charts = array();
        $charts['Artists'] = get_artist_charts();
        $charts['Albums'] = get_album_charts();
        $charts['Tracks'] = get_track_charts();
        print json_encode($charts);
        break;
    case 'geturis':
        $uris = getItemsToAdd($uri, "");
        print json_encode($uris);
        break;
    case 'geturisfordir':
        $uris = getDirItems($uri);
        print json_encode($uris);
        break;
}
close_transaction();
close_mpd();
debuglog("---------------------------END----------------------", "USERRATING", 4);
function forcedUriOnly($u, $d)
{
    // Some mopidy backends - YouTube and SoundCloud - can return the same artist/album/track info
    // for multiple different tracks.
    // This gives us a problem because find_item will think they're the same.
    // So for those backends we always force urionly to be true
    debuglog("Checking the spanner monkey : " . $d, "USERRATINGS", 9);
    if ($u || $d == "youtube" || $d == "soundcloud") {
        return true;
    } else {
        return false;
    }
}