Jump to content

Search API command not working


papete

Recommended Posts

I think I posted in the wrong place so I'm starting a new thread. 

I used to use the search API command with Tasker using this action:


Send Intent [ 
    Action:com.maxmpz.audioplayer.API_COMMAND 
    Cat:None 
    Mime Type: 
    Data:content://com.maxmpz.audioplayer.data/files?flt=search string
    Extra: cmd:20
    Extra: 
    Package: 
    Class: 
    Target:Service ] 
It used to work like a charm, but since I don't know when this command does not work anymore. I checked the API documentation and it seems that the command changed. Accordingly, I updated my Tasker action to the following:

Send Intent [ 
    Action:com.maxmpz.audioplayer.API_COMMAND 
    Cat:None 
    Mime Type: 
    Data:content://com.maxmpz.audioplayer.data/search?flt=search string
    Extra: cmd:20
    Extra: 
    Package: 
    Class: 
    Target:Service ] 

But the above command does nothing. Looking at the forums, I found that I can use an Android intent for the same purpose:



Send Intent [ 
    Action:android.media.action.MEDIA_PLAY_FROM_SEARCH 
    Cat:None 
    Mime Type: 
    Data:
    Extra: query: YOUR SEARCH STRING HERE
    Extra: android.intent.extra.user_query: shuffle
    Package: com.maxmpz.audioplayer
    Class: com.maxmpz.audioplayer.ListActivity
    Target:Activity ] 

 

And the above intent works, however it is way slower and does bring Poweramp to the front, which is a behavior that I don't want for the situation I'll be using it (while driving).

 

Is the native Poweramp API search command not working or am I doing something wrong?

 

Thanks

Link to comment
Share on other sites

content://com.maxmpz.audioplayer.data/files?flt=search string

this won't work anymore as there is no filtering anymore

The correct approach is to use standard intents like android.media.action.MEDIA_PLAY_FROM_SEARCH, but it's sent to activity, so activity popups.

Alternatively, you can send intent as previously to the service. The intent is standard android.provider.MediaStore.INTENT_ACTION_MEDIA_PLAY_FROM_SEARCH (=="android.media.action.MEDIA_PLAY_FROM_SEARCH"), so it's like your last intent code, but you send it to the service instead of the activity.

See doc comments here for the details: https://github.com/maxmpz/powerampapi/blob/master/poweramp_api_lib/src/com/maxmpz/poweramp/player/PowerampAPI.java#L36

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...