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

Add a plugin to update a Kodi music library #2411

Merged
merged 6 commits into from
Mar 3, 2017

Conversation

Pauligrinder
Copy link
Contributor

I created one for an older version before, but it didn't work since the change to Python 3. So I created a new one that works.

I created one for an older version before, but it didn't work since the change to Python 3. So I created a new one that works.
json and requests.BasicAuthentication
@sampsyo
Copy link
Member

sampsyo commented Jan 23, 2017

Cool; looks good so far! We should include this alongside our other *update plugins. ✨

It looks like this needs a few changes to be ready to merge:

  • The code needs the standard license header at the top.
  • Travis is reporting some style issues—you might try running flake8 on the new code.
  • We'll need documentation for the new plugin.

u'host': u'localhost',
u'port': 8080,
u'user': u'kodi',
u'pwd': u'kodi'})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should set

config['kodi']['pwd'].redact = True

here to hide the password from beet config output.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do!

@Pauligrinder
Copy link
Contributor Author

Sorry for the delay! I'm not using github very actively so I didn't notice the comments :) I'll see what I can do about the travis build failing, it's probably something really stupid since I'm not that familiar with Python. I'll deal with the header and documentation once I get that build sorted.

@sampsyo
Copy link
Member

sampsyo commented Feb 28, 2017

Awesome; thank you for looking into it!

For what it's worth, it's pretty easy to run the style checker locally. You can just run pip install flake8 to get the tool and then type flake8 beets beetsplug to run the checker over the whole codebase.

Also added config['kodi']['pwd'].redact = True as suggested.
@Pauligrinder
Copy link
Contributor Author

Hmm, I didn't know python is this picky with all sorts of things :) Nice learning experience.

@Pauligrinder
Copy link
Contributor Author

Pauligrinder commented Mar 1, 2017

Yay, it works :) I added the documentation now too.

@Pauligrinder
Copy link
Contributor Author

Pauligrinder commented Mar 1, 2017

By the way! Since I'm an Android developer, I was thinking about making a beets remote control app. I don't know how useful that'd actually be, but it would be cool for sure ;) It would require a jsonrpc or similar plugin for beets first, though.
Any ideas on what features such an app might have apart from browsing the library? Editing would be pretty convenient compared to using the cli at least!

@Pauligrinder
Copy link
Contributor Author

And now it's failing thanks to the documentation file. How do I make it not check that file?

@sampsyo
Copy link
Member

sampsyo commented Mar 2, 2017

Hey, thanks again for the revisions! The right fix here for that docs issue, listed here:

/home/travis/build/beetbox/beets/docs/plugins/kodiupdate.rst:: WARNING: document isn't included in any toctree

is to add the new document to the table of contents for plugin documentation. I'll do that now…

@sampsyo
Copy link
Member

sampsyo commented Mar 2, 2017

OK, changes pushed. Let's see what the CI says!

An Android or other non-CLI frontend for beets is a really interesting idea, and it's something that we toss around from time to time. I even noticed this effort on GitHub a while back. You're right that what we need is an API—and there's a larger effort at foot there too. Specifically, take a look at the AURA project, where we're trying to define what a standard API for beets would look like. Currently, it's read-only, but I'd love to hear your input about how to make it capable of supporting editing too!

@Pauligrinder
Copy link
Contributor Author

That looks like a pretty good spec already!
I'd say it just needs PUT calls for /tracks/:id (or /albums/:id or /artists/:id, don't know if it's reasonable to change entire albums or artists though), taking in json data with something like { "artist":"some band", "title":"some song title", "genre" : "some genre", ...}.

@sampsyo
Copy link
Member

sampsyo commented Mar 3, 2017

Cool! I'd be interested to collaborate on making this into a real API if you ever want to get started on that Android client.

@sampsyo sampsyo merged commit a0cbba9 into beetbox:master Mar 3, 2017
sampsyo added a commit that referenced this pull request Mar 3, 2017
Add a plugin to update a Kodi music library
sampsyo added a commit that referenced this pull request Mar 3, 2017
sampsyo added a commit that referenced this pull request Mar 3, 2017
@sampsyo
Copy link
Member

sampsyo commented Mar 3, 2017

This plugin is all merged up! ✨ Thanks again for writing it.

@Pauligrinder
Copy link
Contributor Author

Awesome, glad I could contribute :)

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.

3 participants