dotson / dj-pedro Goto Github PK
View Code? Open in Web Editor NEWAlfred Workflow to create an iTunes playlist based on Last.fm similar artists.
Alfred Workflow to create an iTunes playlist based on Last.fm similar artists.
Research ways to smooth out playback start-up of of DJ Pedro's playlist for all use cases:
Notes:
Because of the way iTunes 11 handles playlists, there's currently a pause/un-pause coded into DJ Pedro at the start of playback. If Apple ever provides a better way to deal with Up Next, besides GUI scripting, this will be updated.
Possible results on initial search:
Investigate how Alfred 2 uses Up Next and try to implement this method.
Possibly reach out to Workflow Help forum.
The NotFoundList script seems to fail silently when using the qWorkflow notification to OSX Notification Center.
Need to confirm the cause of this error and correct in the code.
Possibly reach out to qWorkflow author?
If DJ Pedro matches more than zero artists from "simList" within the user Library, but not enough to eventually fill a playlist, the workflow times out, throws an error, and does not complete.
Add additional recursion to begin adding more than one track per artist from "addedList" so that the workflow can complete without error.
(Consider adding notification that this has occurred so user knows to buy more music.)
Check internal code to verify this.
Add method for removing artists from "simList" as they are randomly chosen and added to the "addedList" or "notFoundList"
on remove_item(itemNumber, oldList)
set newList to {}
repeat with i from 1 to (itemNumber - 1)
set the end of newList to item i of oldList
end repeat
repeat with i from (itemNumber + 1) to (count of oldList)
set the end of newList to item i of oldList
end repeat
set oldList to newList
return oldList
end remove_itemrepeat while (count of simList) is greater then 0 set newItem to random number from 1 to (count of simList) set newArtist to item newItem of simList set newArtist to my replace_chars(newArtist as string, "&", "+") set simList to my remove_item(newItem, simList) tell application "iTunes" etc etc
Hi,
I don't know if you officially support Alfred 3 at this stage. I'm hoping you do. I've got a brand new clean install of Alfred running with only one workflow: DJ-Pedro (of course).
For some reason after setting preferences (the first thing I did), I can't seem to properly start up the workflow with the dj keyword. It appears as if DJ-Pedro is fighting for supremacy with the default google search as I type. On occasion, mostly when I get between 1 and 3 characters into the artist name, I can manage to launch it but then it miserably fails.
Below is a log of the shortest failure path which didn't end in a google search:
[2016-06-13 20:19:05][ERROR: input.scriptfilter] Code 1: 2857:2910: execution error: iTunes got an error: File Macintosh HD:Users:lesparents:Music:iTunes:Alfred Album Artwork:Grateful Dead_American Beauty.jpg wasn’t found. (-43) [2016-06-13 20:19:09][input.scriptfilter] <?xml version="1.0"?> <items> <item arg=""> <title>DJ Pedro</title> <subtitle>Search for an artist to start the mix!</subtitle> <icon>icon.png</icon> </item> </items> [2016-06-13 20:19:10][input.scriptfilter] Processing output of 'action.script' with arg '' [2016-06-13 20:19:11][action.script] Processing output of 'output.notification' with arg 'Step 2 Error: Can’t get item 1 of {}. '
If it makes a difference, I'm running iTunes 12.4 on El Capitan.
I'm happy to provide any further assistance or support you may need.
Rgds,
A
Need to create a test workflow that simply caches artwork in order to speed up testing process.
Change keyword to djprefs - COMPLETED
Fix the descriptor text
Add un-actionable Title Row to explain that this is where you adjust settings.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.