vdesabou Posted July 11, 2014 Posted July 11, 2014 (edited) Hi Andrew, I noticed this strange behavior: If I use empty UID, it displays results in same order as results in XML (expected), except for the last result.. See example below, I have the following xml (complete output here https://i.cloudup.com/sBu1xdxFRP.xml): <items> <item uid="" valid="yes" autocomplete=""> <arg> a:18:{i:0;s:0:"";i:1;s:0:"";i:2;s:0:"";i:3;s:0:"";i:4;s:0:"";i:5;s:0:"";i:6;s:0:"";i:7;s:20:"update_playlist_list";i:8;s:0:"";i:9;s:0:"";i:10;s:0:"";i:11;s:0:"";i:12;s:0:"";i:13;s:0:"";i:14;s:0:"";i:15;s:0:"";i:16;s:0:"";i:17;s:0:"";} </arg> <title> Update Playlist List (use it when you have added or removed a playlist) </title> <subtitle> when done you'll receive a notification. you can check progress by invoking the workflow again </subtitle> <icon>./images/new/update.png</icon> <text/> </item> <item uid="" valid="no" autocomplete="Playlist▹spotify:user:vdesabou:starred▹"> <arg/> <title> Sélection (569 tracks)</title> <subtitle>by Vincent de Saboulin (vdesabou)</subtitle> <icon> /Users/vdesabou/Library/Application Support/Alfred 2/Workflow Data/com.vdesabou.spotify.mini.player/artwork/90badeb4076d291bd08c6c20ffe79625/vdesabou_starred.png </icon> <text/> </item> <item uid="" valid="no" autocomplete="Playlist▹spotify:user:trickyofficial:playlist:1u5vQfIxo8X1zoOInXxSGn▹"> <arg/> <title> Tricky’s Choice (95 tracks)</title> <subtitle>by trickyofficial (trickyofficial)</subtitle> <icon> /Users/vdesabou/Library/Application Support/Alfred 2/Workflow Data/com.vdesabou.spotify.mini.player/artwork/defe5e40d4c85e72406c0e6ac416942b/trickyofficial_1u5vQfIxo8X1zoOInXxSGn.png </icon> <text/> </item> <snip> <item uid="" valid="no" autocomplete="Playlist▹spotify:user:chibulls23:playlist:3e1ufHxVFft35akWPnXgEq▹"> <arg/> <title> Music from and inspired by the film DRIVE (115 tracks) </title> <subtitle>by chibulls23 (chibulls23)</subtitle> <icon> /Users/vdesabou/Library/Application Support/Alfred 2/Workflow Data/com.vdesabou.spotify.mini.player/artwork/65d1017e31390a2b57c23c9ca03b010f/chibulls23_3e1ufHxVFft35akWPnXgEq.png </icon> <text/> </item> </items> As you can see the playlist " Music from and inspired by the film DRIVE (115 tracks)" is at the end and has UID empty, but I get the following: This was not the case before and I had to apply a workaround on May 29th (see https://github.com/vdesabou/alfred-spotify-mini-player/commit/0393575ad65f923951a7a8a9d4c42c22de518ae0 ) so that must appeared in one of the last versions of Alfred? Is this a bug ? Alfred 2.3 (264). Reproducible: yes Edited July 11, 2014 by vdesabou
Tyler Eich Posted July 12, 2014 Posted July 12, 2014 Why is there a <snip> tag in the middle of your XML?
vdesabou Posted July 12, 2014 Author Posted July 12, 2014 Why is there a <snip> tag in the middle of your XML? It just means I've truncated the results here for displaying just a subset of the XML results. The XML is valid, you can find it in the link of my post
vdesabou Posted July 13, 2014 Author Posted July 13, 2014 If that helps, if I clear knowledge, after that the very first time I get it working, but once I select a result, then the other times I get same behavior as explained in my first post, see screencast http://quick.as/b7Vocr62
Andrew Posted July 19, 2014 Posted July 19, 2014 If that helps, if I clear knowledge, after that the very first time I get it working, but once I select a result, then the other times I get same behavior as explained in my first post, see screencast http://quick.as/b7Vocr62 You are in fact setting a UID of '' in your XML... For Alfred to generate a random UID, you need to miss the UID field altogether... <item valid="no" autocomplete="Playlist▹spotify:user:trickyofficial:playlist:1u5vQfIxo8X1zoOInXxSGn▹"> This should fix the sorting issue you're seeing. The code / behaviour around this hasn't changed for quite some time, so it may have just been lucky that having all UIDs set to the same empty string would have sorted them arbitrarily correctly for you. Moving to [closed], but do let me know if this fixes your issue or not. Cheers, Andrew xilopaint 1
vdesabou Posted July 19, 2014 Author Posted July 19, 2014 (edited) You are in fact setting a UID of '' in your XML... For Alfred to generate a random UID, you need to miss the UID field altogether... <item valid="no" autocomplete="Playlist▹spotify:user:trickyofficial:playlist:1u5vQfIxo8X1zoOInXxSGn▹"> This should fix the sorting issue you're seeing. The code / behaviour around this hasn't changed for quite some time, so it may have just been lucky that having all UIDs set to the same empty string would have sorted them arbitrarily correctly for you. Moving to [closed], but do let me know if this fixes your issue or not. Cheers, Andrew Thanks Andrew, I figured out I was using an old version of David's Workflows.php that's why UID was set to '' My bad Thanks for your support Edited July 19, 2014 by vdesabou
Andrew Posted July 19, 2014 Posted July 19, 2014 Thanks Andrew, I figured out I was using an old version of David's Workflows.php that's why UID was set to '' My bad Thanks for your support Great, glad you are sorted
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now