Jump to content


Photo

Spotifious: a natural Spotify controller for Alfred

spotify

  • Please log in to reply
50 replies to this topic

#1 citelao

citelao

    Member

  • Member
  • PipPip
  • 27 posts

Posted 30 March 2013 - 04:34 PM

Spotifious
a natural Spotify controller for Alfred
 
hero_shot.png
So, you’ve heard of Spotifious, eh? A natural Spotify controller for Alfred? Searchs Spotify, controls your music, generally rocks?
 
It’s built off a lot of other people’s work— PHPFunk and David Ferguson especially— and tries to match the functionality of Alfred’s integrated iTunes player. It’s not perfect, but it does the job. And I think it’s pretty cool.
 
Features
 
A quick rundown of its coolness:
 
A controller, not a workflow
Spotifious just feels fun to use, like a real plugin for Alfred, not a workflow. It can do in-depth, album-scouring searches and gives you useful information even if something goes wrong.

Not unlike the iTunes Mini Player.

 
Alfred-like
Spotifious is also especially Alfred-like. Just start typing to scour Spotify’s servers for music. Browse through artists and albums like nobody’s business and drill down through Queen’s huge anthologies with a snappy context-based search.
 
Smart
Spotifious uses Packal to make sure you always have the latest version. It gives you a heads-up about what’s going on with Spotify the moment you start it. And don’t worry about errors— we’ll handle those.
 
 
Download & Install
Latest version: v0.9.4 | Latest dev build: v0.9.4
 
Detailed instructions available on GitHub.

  • Download this repository. (Source)
  • Open spotifious.alfredworkflow by double-clicking it or dragging it into Alfred.
  • Bind the hotkey to ^⌘⏎.
  • Continue on with your merry day.

How to Use
So let's assume you've downloaded and installed the workflow. Now what?

  • Press ^⌘⏎

Good! You should briefly see a loading entry, then the main menu:

loading.png
main_menu.png

You can action the song title (press ⏎) to play or pause the song, action the album or artist to search for that album or artist, or just start typing to search for cool music.

compilation.png

Once you’ve searched for something, you can continue to browse albums and arists through Spotifious. Actioning an artist will bring up a list of their albums, and actioning an album will bring up the track list.
 
Note: You can always leave a menu and go back just by pressing ⌫.

 
Development & Acknowledgements

A lot of people helped out on this:

  • vdesabou and I trade ideas a ton
  • PHPfunk and his PHP Alfred workflow inspired much of OhAlfred
  • David Ferguson helped with some iffy Alfred glitches
  • a slightly modified version of Entypo icon font face for icons.
  • and many other people mentioned in the code.

Thanks to everyone who helped, and thanks to everyone who uses my work! Oh, and thanks for reading this whole README. I hope you enjoy Spotifious!

This is a personal project. I host it on Github. It is MIT licensed, except for the icons, which are owned by Spotify and Entypo. Be cool.
 
Another download link for your convenience: v0.9.4 (source)


Edited by citelao, 12 July 2014 - 11:01 PM.

  • Enhorn, vdesabou and DJay like this

#2 citelao

citelao

    Member

  • Member
  • PipPip
  • 27 posts

Posted 30 March 2013 - 04:35 PM

Version History

  • v0.9.4: actually implemented the aforementioned changes.
  • v0.9.3: more compatibility changes for PHP v5.3
  • v0.9.2: Compatibility with PHP v5.3
  • v0.9.1: Fixed no track playing bug.
  • v0.9: Added error reporting and context-based searching; restructrued app.
  • v0.81: Switched play/pause icons 
  • v0.8: Added new icons; set them as default
  • v0.7: General clean-up; added artist- and album-specific menus
  • v0.61: Hotfix UTF-8 support
  • v0.6: Added Alleyoop support
  • v0.5: Added a menu system
  • v0.1: Inital search system

Edited by citelao, 12 July 2014 - 11:01 PM.


#3 lmartins

lmartins

    Member

  • Member
  • PipPip
  • 89 posts

Posted 30 March 2013 - 04:52 PM

Really nice, thanks for sharing.


  • citelao likes this

#4 vdesabou

vdesabou

    Advanced Member

  • Member
  • PipPipPip
  • 332 posts
  • LocationParis

Posted 30 March 2013 - 05:16 PM

This is truly amazing!! Thanks for sharing this!


  • citelao likes this

#5 RBenschop

RBenschop

    Newbie

  • Member
  • Pip
  • 9 posts

Posted 01 April 2013 - 04:00 PM

I like the idea but it's really slow, even by Spotify's standard. It is also not really accurate with some artists. 

This is just a opinion based on comparing it with PHPFunks workflow. I also think that his workflow is too big with features, but it is faster and more accurate than yours.



#6 citelao

citelao

    Member

  • Member
  • PipPip
  • 27 posts

Posted 01 April 2013 - 05:02 PM

My workflow makes three API calls versus PHPFunk's one call. I'm considering including a narrowing option but once I clean up the code for version 0.7 it should run a little bit faster. 

 

Most of the slowness is on Alfred's end, though— I can't asynchronously load images or add results so everything has to be done before— and the problems with accuracy have to do with execution lag on Alfred's part as well.

 

I'd appreciate a DM telling me what artists are innaccurate, as I might be able to weight things a little to give better results. Let me know!



#7 David Ferguson

David Ferguson

    Alfred Guru

  • Staff
  • 1,888 posts
  • LocationHuntsville, AL

Posted 01 April 2013 - 05:34 PM

My workflow makes three API calls versus PHPFunk's one call. I'm considering including a narrowing option but once I clean up the code for version 0.7 it should run a little bit faster. 

 

Most of the slowness is on Alfred's end, though— I can't asynchronously load images or add results so everything has to be done before— and the problems with accuracy have to do with execution lag on Alfred's part as well.

 

I'd appreciate a DM telling me what artists are innaccurate, as I might be able to weight things a little to give better results. Let me know!

 

Alfred shouldn't be creating any sort of lag or delay. If there is a delay, it would more than likely be caused by delay in the scripts ability to produce results for Alfred.


Twitter: jdfwarrior | Blog: dferg.us

#8 citelao

citelao

    Member

  • Member
  • PipPip
  • 27 posts

Posted 01 April 2013 - 05:51 PM

Alfred shouldn't be creating any sort of lag or delay. If there is a delay, it would more than likely be caused by delay in the scripts ability to produce results for Alfred.

 

I agree; the delay is due to the slowness of the search.

 

However, if I trigger an API search with Alfred (for Spotifious, more than three characters as an argument), Alfred completes the search before starting a new one. So if I type `Death Cab for Cutie`, Alfred will search Spotify for `Dea` before repeating the search for `Death Cab for Cutie`. 

 

I'm not sure if this is the lag RBenschop was referring to, but if it is, it is partly Alfred's fault. I think some people were asking that Alfred only submit a search when the user stops typing— this is the exact use-case.



#9 fxv

fxv

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 03 April 2013 - 11:01 PM

i have a "to listen to later" playlist with albums suggested by friends that i sometimes listen, then STAR the ones I like and REMOVE all the songs i already heard a couple of times.

 

i tried to modify a cocoalibspotify sample app to star the current track+remove from a playlist or just remove it and skip to the next track, with some stupid limitations, like that it has to be the first playlist (at the top) and has to be called "testPlaylist" until now. and because it uses cocoalibspotify you obviously need a premium account. (stores username/mail and credential(not pw!) in a plist in your library after first login, spotify says that's fine, so you don't really "see" anything of the app exept the login window at 1st launch)

 

to just star the current track without modifying a playlist, the only limitation is that you need to have a premium account

 

i don't have time anymore and no motivation to finish this thing, so if someone wants to do this, just copy this sloppy, ugly code : https://github.com/b...laylistControls
alfred workflow: https://www.dropbox.....alfredworkflow


Edited by fxv, 05 April 2013 - 12:57 PM.


#10 tschoof

tschoof

    Member

  • Member
  • PipPip
  • 77 posts

Posted 05 April 2013 - 11:18 AM

Hi citelao, great work, like it a lot :)

 

I have a feature request: After searching for sth and hitting return, having the focus on Spotify is a nobrainer, I like that.

 

But when I just play/pause a track, I don't need the focus switching to Spotify afterwards, that kinda defeats the purpose, in my view.

 

Just my tow cents :)



#11 citelao

citelao

    Member

  • Member
  • PipPip
  • 27 posts

Posted 05 April 2013 - 04:56 PM

But when I just play/pause a track, I don't need the focus switching to Spotify afterwards, that kinda defeats the purpose, in my view.

 

It's not supposed to switch focus :)

 

That's a bug. Here's the issue I created.



#12 vdesabou

vdesabou

    Advanced Member

  • Member
  • PipPipPip
  • 332 posts
  • LocationParis

Posted 09 April 2013 - 07:16 PM

Hi Citelao,

 

I was so fan of your workflow that I created a different version (but not aimed to replace yours), with a different approach. See here Spotify Mini Player

I've used a lot of your code, so thank you :-) . I've also "kinda" integrated your workflow in mine, so that if the user want to search in the complete Spotify catalog (instead of his playlists only), he can call yours directly from my workflow. I hope you don't mind. As I said, these 2 workflows are complementary, and I am using both all the time :-)

 

Let me know what you think of it

Cheers



#13 citelao

citelao

    Member

  • Member
  • PipPip
  • 27 posts

Posted 13 April 2013 - 05:55 AM

Hi Citelao,

 

I was so fan of your workflow that I created a different version (but not aimed to replace yours), with a different approach. See here Spotify Mini Player

I've used a lot of your code, so thank you :-) . I've also "kinda" integrated your workflow in mine, so that if the user want to search in the complete Spotify catalog (instead of his playlists only), he can call yours directly from my workflow. I hope you don't mind. As I said, these 2 workflows are complementary, and I am using both all the time :-)

 

Let me know what you think of it

Cheers

 

That's really awesome! I've been working on my own menu system as well— it's almost done.

 

The local cache is an excellent idea, I've seen a lot of clamor for something like it. I'd love to try and roll the two together eventually.



#14 citelao

citelao

    Member

  • Member
  • PipPip
  • 27 posts

Posted 04 June 2013 - 04:55 PM

Version 0.8 released!

 

I like the idea but it's really slow, even by Spotify's standard. It is also not really accurate with some artists. 

This is just a opinion based on comparing it with PHPFunks workflow. I also think that his workflow is too big with features, but it is faster and more accurate than yours.

 

It should fix your issue because it no longer loads album art by default.



#15 patrickmcd

patrickmcd

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 05 June 2013 - 06:40 PM

90% of the time I'm using this to toggle play/pause, but it appears this option is only available after the (now quicker) api load. Could that functionality be immediately available? Could it communicate directly to the Spotify app, or does it rely on the api?



#16 citelao

citelao

    Member

  • Member
  • PipPip
  • 27 posts

Posted 06 June 2013 - 02:26 PM

90% of the time I'm using this to toggle play/pause, but it appears this option is only available after the (now quicker) api load. Could that functionality be immediately available? Could it communicate directly to the Spotify app, or does it rely on the api?

 

I actually have a couple options for this one. Currently it relies on completely local Applescript queries (the "Harnessing the API" text is default for the entire workflow and I cannot modify it based on context) to pull song info.

 

However, someone has already forked my code and done some modifications that I kinda like— typing `n` (next), `p` (previous), `t` (track), or `s` (stop) immediately shows a specific control for use.

 

Alternatively, I can include separate hotkeys that you can bind to whatever you want for next, play/pause, previous, etc.

 

Finally, I can make typing `c` show a control panel with filterable content, so `cn` would immediately display `Next` as the first item.

 

Which do you like best? I don't think altering the main menu is a good idea because those queries basically make the workflow unique.



#17 patrickmcd

patrickmcd

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 06 June 2013 - 03:46 PM

If it takes a half second to load before any controls are available, I guess I'll just have to live with it (sarcasm, great work thus far). It would just be nice to hit the hotkey to bring it up, and then immediately hit Enter to toggle play/pause, rather than visually watching and waiting for the menu to appear.

 

Now that I look at it, I think you have the play/pause icons reversed. Play and pause icons usually represent what you want to happen after selected, not the current state of the player.

 

"n" and "p" controls are a good addition.

 

As for separate hotkeys, you mean something like shift+command+return (or whatever user choice) could bypass the menu and directly toggle play/pause? Shift+command+right arrow for next, left arrow for previous. That sounds pretty cool. I think I'd lean toward this.



#18 patrickmcd

patrickmcd

    Newbie

  • Member
  • Pip
  • 4 posts

Posted 06 June 2013 - 03:56 PM

Now that I'm thinking of these hotkeys and arrow keys, arrow up and arrow down for thumbs up and thumbs down would by nice too.



#19 kwehner57

kwehner57

    Newbie

  • Member
  • Pip
  • 2 posts

Posted 24 June 2013 - 01:27 PM

Is there a way to make it play an entire album? When I open an album it shows all the tracks and when I action a track, it just plays that track and then stops.



#20 citelao

citelao

    Member

  • Member
  • PipPip
  • 27 posts

Posted 25 June 2013 - 01:23 PM

Now that I'm thinking of these hotkeys and arrow keys, arrow up and arrow down for thumbs up and thumbs down would by nice too.

 

I'm going to work on a hotkey + control center approach. You'll be able to choose hotkeys for previous and next track in Alfred's settings but will also be able to access the commands by typing `c` + command or just the command (`cn` or `n` for next track).

 

Unfortunately, I cannot create a workflow for thumbs up/down, as Spotify does not have an accessible app for use with AppleScript. If there are workarounds, I'm game, though.

 

Oh, and BTW, I'll switch out the icons  :D.

 

Is there a way to make it play an entire album? When I open an album it shows all the tracks and when I action a track, it just plays that track and then stops.

 

Not without a lot of work. Spotify has very poor AppleScript support so I am extremely limited in what I can do. If you want it, though, I can implement a local-queue option that basically creates it's own queue outside of Spotify (ie in a text file read by Spotifious) and queues the songs manually. Would be tricky and buggy, though.

 

If you really want thumbs up/down and queueing, I urge you to bug Spotify about it. Not only will better AppleScript support help me, but it will also help other developers create awesome Spotify apps.





Also tagged with one or more of these keywords: spotify

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users