Installation now asks for both API keys

This commit is contained in:
Krateng 2019-05-05 12:53:21 +02:00
parent 1caf274020
commit 80d65963e5
2 changed files with 16 additions and 2 deletions

View File

@ -25,7 +25,8 @@ There are only two scrobblers (YouTube Music and Plex, both for Chromium), but a
* [python3](https://www.python.org/) - [GitHub](https://github.com/python/cpython) * [python3](https://www.python.org/) - [GitHub](https://github.com/python/cpython)
* [bottle.py](https://bottlepy.org/) - [GitHub](https://github.com/bottlepy/bottle) * [bottle.py](https://bottlepy.org/) - [GitHub](https://github.com/bottlepy/bottle)
* [waitress](https://docs.pylonsproject.org/projects/waitress/) - [GitHub](https://github.com/Pylons/waitress) * [waitress](https://docs.pylonsproject.org/projects/waitress/) - [GitHub](https://github.com/Pylons/waitress)
* [doreah](https://pypi.org/project/doreah/) - [GitHub](https://github.com/krateng/doreah) (at least Version 0.5.1) * [doreah](https://pypi.org/project/doreah/) - [GitHub](https://github.com/krateng/doreah) (at least Version 0.6.1)
* If you'd like to display images, you will need API keys for Last.fm and Fanart.tv. These are free of charge!
## How to install ## How to install

15
maloja
View File

@ -55,7 +55,7 @@ def setup():
# LASTFM API KEY # LASTFM API KEY
key = settings.get_settings("LASTFM_API_KEY") key = settings.get_settings("LASTFM_API_KEY")
if key is None: if key is None:
print("Currently not using an API key for image display. Only local images will be used.") print("Currently not using a Last.fm API key for image display. Only local images will be used.")
elif key == "ASK": elif key == "ASK":
print("Please enter your Last.FM API key. If you do not want to display artist and track images, simply leave this empty and press Enter.") print("Please enter your Last.FM API key. If you do not want to display artist and track images, simply leave this empty and press Enter.")
key = input() key = input()
@ -65,6 +65,19 @@ def setup():
else: else:
print("Last.FM API key found.") print("Last.FM API key found.")
# FANART.TV API KEY
key = settings.get_settings("FANARTTV_API_KEY")
if key is None:
print("Currently not using a Fanart.tv API key for image display. Only local images will be used for artists.")
elif key == "ASK":
print("Please enter your Fanart.tv API key. If you do not want to display artist and track images, simply leave this empty and press Enter.")
key = input()
if key == "": key = None
settings.update_settings("settings/settings.ini",{"FANARTTV_API_KEY":key},create_new=True)
else:
print("Fanart.tv API key found.")
# OWN API KEY # OWN API KEY
if os.path.exists("./clients/authenticated_machines.tsv"): if os.path.exists("./clients/authenticated_machines.tsv"):
pass pass