songs2slides

A tool that automatically finds song lyrics and creates lyric slideshows
git clone https://git.ashermorgan.net/songs2slides/
Log | Files | Refs | README

commit 7577b9cdb9f78f952f30ef35dea15217a9ebf0ba
parent 2fb49c0849af22e7491b6eb0f5c825e0d656795d
Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com>
Date:   Sat, 11 Jul 2020 20:33:33 -0700

Fix new user settings bug.
New users couldn't load lyrics until they visited the settings page.

Diffstat:
MSongs2Slides/routes.py | 11+++++++----
1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Songs2Slides/routes.py b/Songs2Slides/routes.py @@ -1,4 +1,5 @@ # Import dependencies +from copy import deepcopy from flask import render_template, request, send_file, url_for, jsonify import io import json @@ -65,10 +66,12 @@ def pptx(): @app.route("/lyrics", methods=["POST"]) def lyrics(): # Get settings - if "settings" in request.json: - settings = request.json["settings"] - else: - settings = defaultSettings + settings = deepcopy(defaultSettings) + try: + for setting in request.json["settings"]: + settings[setting] = request.json["settings"][setting] + except: + pass # Get lyrics lyrics = []