Пример #1
0
/**
 * playUriWithMopidy function.
 *
 * @access public
 * @param mixed $w
 * @param mixed $uri
 * @return void
 */
function playUriWithMopidy($w, $uri)
{
    invokeMopidyMethod($w, "core.tracklist.clear", array());
    playUriWithMopidyWithoutClearing($w, $uri);
}
Пример #2
0
     // start now playing if needed
     $mopidy_arg = "";
     if ($use_mopidy) {
         $mopidy_arg = "MOPIDY";
     }
     exec("./src/spotify_mini_player_notifications.ksh -d \"" . $w->data() . "\" -a start -m \"" . $mopidy_arg . "\"  >> \"" . $w->cache() . "/action.log\" 2>&1 & ");
     if (!$use_mopidy) {
         exec("./src/track_info.ksh 2>&1", $retArr, $retVal);
         if ($retVal != 0) {
             displayNotificationWithArtwork('AppleScript Exception: ' . htmlspecialchars($retArr[0]) . ' use spot_mini_debug command', './images/warning.png', 'Error!');
             exec("osascript -e 'tell application \"Alfred 2\" to search \"spot_mini_debug AppleScript Exception: " . htmlspecialchars($retArr[0]) . "\"'");
             return;
         }
     }
     if ($use_mopidy) {
         playUriWithMopidyWithoutClearing($w, $track_uri);
     } else {
         exec("osascript -e 'tell application \"Spotify\" to play track \"{$track_uri}\"'");
     }
     if ($now_playing_notifications == false) {
         displayNotificationForCurrentTrack($w);
     }
     if ($userid != 'vdesabou') {
         stathat_ez_count('AlfredSpotifyMiniPlayer', 'play', 1);
     }
     addTrackToPlayQueue($w, $track_uri, $track_name, $artist_name, $album_name, $duration, $country_code);
     return;
 } else {
     if ($other_action == "random_album") {
         list($album_uri, $album_name, $theartistname) = getRandomAlbum($w);
         // start now playing if needed