Esempio n. 1
0
function musicCollectionSpotifyPlaylistHack($monitor)
{
    $dirs = array();
    $playlists = do_mpd_command("listplaylists", true, true);
    if (array_key_exists('playlist', $playlists)) {
        foreach ($playlists['playlist'] as $pl) {
            debuglog("Scanning Playlist " . $pl, "COLLECTION", 8);
            fwrite($monitor, "\nScanning Playlist " . $pl);
            doMpdParse('listplaylistinfo "' . format_for_mpd($pl) . '"', $dirs, array("spotify"));
        }
    }
}
Esempio n. 2
0
function musicCollectionUpdate()
{
    $monitor = fopen('prefs/monitor', 'w');
    $dirs = array("/");
    while (count($dirs) > 0) {
        $dir = array_shift($dirs);
        fwrite($monitor, "\nScanning Directory " . $dir);
        doMpdParse('lsinfo "' . format_for_mpd($dir) . '"', $dirs, null);
    }
    fwrite($monitor, "\nUpdating Database");
    fclose($monitor);
}
Esempio n. 3
0
function doCollection($command, $domains = null)
{
    global $connection, $collection;
    $collection = new musicCollection();
    debuglog("Starting Collection Scan " . $command, "MPD", 4);
    if ($command == "listallinfo") {
        // Forget listallinfo and try to do this in a mopidy and mpd compatible way
        // Also the mpd guys say "don't use listallinfo" and it's disabled in mopidy
        musicCollectionUpdate();
    } else {
        $dirs = array();
        doMpdParse($command, $dirs, $domains);
    }
}