forslund / spotify-skill

Mycroft Skill to control spotify using the Spotify Connect API
Apache License 2.0
72 stars 38 forks source link

Docker instructions #165

Closed vallard closed 3 years ago

vallard commented 3 years ago

Is your feature request related to a problem? Please describe. I want to run this plugin in a mycroft docker environment.

Describe the solution you'd like Thanks for the wonderful project, I would like to understand how I can modify where the credentials for spotify are accessed. When I run the auth.py tool it saves the credentials in ~/.config/spotipy/token.json and ~/.config/spotipy/auth. I'd like to change the app to find the credentials with a CREDENTIALS_DIR variable or something.

Describe alternatives you've considered

Additional context I don't need any code to be modified, I'm happy if you just tell me how it could be done. I think I just modify the code in spotify.py and add an env variable to it. Any guidance would be appreciated!

forslund commented 3 years ago

Hi, the XDG_CONFIG_DIRS variable can be used to shift it to a location of your choice but that would affect the rest of mycroft (which will start using the XDG paths as well), your idea of an env variable is a good idea!

In auth.py you can probably change L21 to

auth_dir = os.environ.get('SPOTIFY_SKILL_CREDS_DIR') or BaseDirectory.save_config_path('spotipy')

You need to import os at the top somewhere and do a similar change in spotify.py on L69 to match.

Would love a PR for that, otherwise I can probably get time to add it this weekend.

vallard commented 3 years ago

yeah, I can work on it next weekend. (not this one) Will send a PR. Thank you!

forslund commented 3 years ago

Hi @vallard, did you do any work on this already or should I tackle it?

vallard commented 3 years ago

I haven’t been able to get to it. All you!

On Aug 6, 2021, at 12:52 AM, Åke @.***> wrote:

 Hi @vallard, did you do any work on this already or should I tackle it?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe. Triage notifications on the go with GitHub Mobile for iOS or Android.

forslund commented 3 years ago

The addition has been merged and readme has been updated with brief info. Closing this issue now.