songs2slides

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

commit ed5032617f423e0e1f5810701f1e3a1129ccb365
parent 8873af858c9bb79fb21abdda058e5cd0047216de
Author: AsherMorgan <59518073+AsherMorgan@users.noreply.github.com>
Date:   Mon, 24 Aug 2020 13:35:34 -0700

Improve user edited lyrics parsing.

Diffstat:
MSongs2Slides/static/home.js | 2+-
Mcliapp.py | 4++--
2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Songs2Slides/static/home.js b/Songs2Slides/static/home.js @@ -101,7 +101,7 @@ async function ReviewLyrics() { // Gets the powerpoint by submitting lyrics async function SubmitLyrics() { // Get lyrics - let lyrics = document.getElementById("rawLyrics").value.split(/\n *\n/); + let lyrics = document.getElementById("rawLyrics").value.split(/\n\s*\n/); // Set hidden form values document.getElementById("pptxSettingsField").value = localStorage.getItem("settings"); diff --git a/cliapp.py b/cliapp.py @@ -1,6 +1,6 @@ # Import dependencies -import json import os +import re from Songs2Slides import core from Songs2Slides.config import defaultSettings import subprocess @@ -52,7 +52,7 @@ if (__name__ == "__main__"): rawLines = f.read() # Parse lyrics - lyrics = rawLines.split("\n\n") + lyrics = re.split("\n\s*\n", rawLines) except: print("There was an error while reviewing the lyrics. The unrevised lyrics will be used instead.") finally: