mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Removed a couple of unnecessary imports
json and requests.BasicAuthentication
This commit is contained in:
parent
77d155cdea
commit
ca8832809d
1 changed files with 1 additions and 3 deletions
|
|
@ -12,8 +12,6 @@ Put something like the following in your config.yaml to configure:
|
||||||
from __future__ import division, absolute_import, print_function
|
from __future__ import division, absolute_import, print_function
|
||||||
|
|
||||||
import requests
|
import requests
|
||||||
import json
|
|
||||||
from requests.auth import HTTPBasicAuth
|
|
||||||
from beets import config
|
from beets import config
|
||||||
from beets.plugins import BeetsPlugin
|
from beets.plugins import BeetsPlugin
|
||||||
|
|
||||||
|
|
@ -27,7 +25,7 @@ def update_kodi(host, port, user, password):
|
||||||
headers = {'Content-Type': 'application/json'}
|
headers = {'Content-Type': 'application/json'}
|
||||||
# Create the payload. Id seems to be mandatory.
|
# Create the payload. Id seems to be mandatory.
|
||||||
payload = {'jsonrpc': '2.0', 'method':'AudioLibrary.Scan', 'id':1}
|
payload = {'jsonrpc': '2.0', 'method':'AudioLibrary.Scan', 'id':1}
|
||||||
r = requests.post(url, auth=HTTPBasicAuth(user, password), json=payload, headers=headers)
|
r = requests.post(url, auth=(user, password), json=payload, headers=headers)
|
||||||
return r
|
return r
|
||||||
|
|
||||||
class KodiUpdate(BeetsPlugin):
|
class KodiUpdate(BeetsPlugin):
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue