Remove library selection and default theme
This commit is contained in:
parent
75a413667d
commit
83c5780c57
@ -1,7 +1,6 @@
|
||||
{
|
||||
"theme": "light",
|
||||
"theme": "auto",
|
||||
"token": "",
|
||||
"server_url": "",
|
||||
"server_port": "32400",
|
||||
"library": ""
|
||||
"server_port": "32400"
|
||||
}
|
@ -32,13 +32,12 @@ async def login(
|
||||
user: str = Form(...),
|
||||
pw: str = Form(...),
|
||||
url: str = Form(...),
|
||||
port: str = Form("32400"),
|
||||
library: str = Form(...)
|
||||
port: str = Form("32400")
|
||||
):
|
||||
config = load_config()
|
||||
theme = config.get("theme", "auto")
|
||||
try:
|
||||
connect_plex(config, user, pw, url, port, library)
|
||||
connect_plex(config, user, pw, url, port)
|
||||
save_config(config)
|
||||
return templates.TemplateResponse(
|
||||
"login.html",
|
||||
|
@ -21,13 +21,6 @@
|
||||
<label for="port" class="form-label">端口</label>
|
||||
<input type="text" class="form-control" id="port" name="port" value="32400">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="library" class="form-label">选择库</label>
|
||||
<select class="form-select" id="library" name="library">
|
||||
<option>Music</option>
|
||||
<option>Podcast</option>
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">连接</button>
|
||||
</form>
|
||||
|
||||
|
@ -2,7 +2,7 @@ from plexapi.myplex import MyPlexAccount
|
||||
from plexapi.server import PlexServer
|
||||
|
||||
|
||||
def connect_plex(config, username, password, url, port="32400", library=""):
|
||||
def connect_plex(config, username, password, url, port="32400"):
|
||||
"""Return a connected PlexServer instance and update config with token and server info."""
|
||||
token = config.get("token")
|
||||
if not token:
|
||||
@ -12,5 +12,5 @@ def connect_plex(config, username, password, url, port="32400", library=""):
|
||||
|
||||
base_url = f"http://{url}:{port}"
|
||||
server = PlexServer(base_url, token)
|
||||
config.update({"server_url": url, "server_port": port, "library": library})
|
||||
config.update({"server_url": url, "server_port": port})
|
||||
return server
|
||||
|
Loading…
Reference in New Issue
Block a user