lambda/src/index.js
/** Handles Apple Music, Spotify, Deezer, library, or presets. The default can be specified in options.js or changed if advanced mode is turned on */
Handles Apple Music, Spotify, Deezer, library, or presets. The default can be specified in options.js or changed if advanced mode is turned on
Handles Apple Music Spotify Deezer library or presets . The default can be specified in options . js or changed if advanced mode is turned on
function musicHandler(roomValue, service, cmdpath, name, response) {
    if (service == 'presets') {
        options.path = '/preset/' + encodeURIComponent(name);
        httpreq(options, function(error) {
        	genericResponse(error, response);
        });
    } else { 
        var skillPath = '/musicsearch/' + service.toLowerCase() + cmdpath + encodeURIComponent(name);
        var msgStart = (cmdpath.startsWith('/station'))?'Started ':'Queued and started ';
        var msgEnd = (cmdpath.startsWith('/station'))?' radio':'';
        actOnCoordinator(options, skillPath, roomValue, function(error, responseBodyJson) {
        	if (error) {
            	response.tell(error.message);
          	} else {
            	response.tell(msgStart + name + msgEnd);
            }
        });
    }
}
function musicHandler ( roomValue , service , cmdpath , name , response ) { if ( service == 'presets' ) { options . path = '/preset/' + encodeURIComponent ( name ) ; httpreq ( options , function ( error ) { genericResponse ( error , response ) ; } ) ; } else { var skillPath = '/musicsearch/' + service . toLowerCase ( ) + cmdpath + encodeURIComponent ( name ) ; var msgStart = ( cmdpath . startsWith ( '/station' ) ) ? 'Started ' : 'Queued and started ' ; var msgEnd = ( cmdpath . startsWith ( '/station' ) ) ? ' radio' : '' ; actOnCoordinator ( options , skillPath , roomValue , function ( error , responseBodyJson ) { if ( error ) { response . tell ( error . message ) ; } else { response . tell ( msgStart + name + msgEnd ) ; } } ) ; } }
Handles Apple Music, Spotify, Deezer, library, or presets.
Handles Apple Music Spotify Deezer library or presets .