Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List Albums, Tracks, Artists; and set Playback Device #13

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

aakropotkin
Copy link

@aakropotkin aakropotkin commented Jun 28, 2018

The only relevant changes are to main.go and ctl.go

I added functions to dump data from a user's saved library. I wanted this for myself so that I could use it with FZF to search my saved music; but it will surely be useful for others. It basically dumps a cache for each one.

you may now :
'spotctl albums'
'spotctl artists'
'spotctl tracks'

Extensions: It would be nice to utilize this functionality to have "search and play" prefer a user's saved lists by default, and then fall back to searching the entire Spotify database. This would prevent searching for a song that you like and winding up with some other random version of it or one with a similar name.

I added the ability to change playback device using 'setdevice' which takes the device name as input. (use 'spotctl devices' to find device name and use that as input)

'spotctl setdevice "Brian's iPhone"'

ps. This is my first time writing "go lang", I kind of just figured out enough to make this stuff work. There are surely small fixes to be made.

@aakropotkin
Copy link
Author

NOTE:
I just realized there is some buggy behavior with "setdevice"
It does correctly transfer playback, but if you then try to choose a new track it returns back to the original playback device.
I think there is something that I do not understand about "deviceNameFlag" which I believe is likely causing this behavior.

@aakropotkin
Copy link
Author

aakropotkin commented Jun 28, 2018

Removing the "deviceNameFlag" portions from the existing code base seemed to fix the issue.
I'm not sure exactly how that was meant to function. The issue is that when it is left as an empty param it will automatically select the first device in the "devices" list which is problematic.
Most likely I am misunderstanding what it's intended purpose was.
Removing them has made the "spotctl -t album foo", or any "-t" argument act funny. I'm assuming I fucked up how the arguments are read.
I keep getting a "Error: Command failed: Not paused"
Which I'm assuming is not an accurate error message.

@aakropotkin
Copy link
Author

aakropotkin commented Jun 28, 2018

If a search result fails the program seg faults. Would be nicer to have an error message. I thought something was really broken for a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant