Jump to content
Sign in to follow this  
papete

Search API command not working

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

Share this post


Link to post
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

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...