Skip to content
Permalink
Browse files

add comments and readme badges

Signed-off-by: Aadi Bajpai <me@aadibajpai.me>
  • Loading branch information
aadibajpai committed Jan 28, 2020
1 parent 729a0d6 commit 8b5030c854c8baf46ba620443a46e1f3b49d719e
Showing with 18 additions and 7 deletions.
  1. +5 −0 README.md
  2. +13 −7 swaglyrics_backend/issue_maker.py
@@ -1,4 +1,9 @@
# swaglyrics-backend

[![Discord Server](https://badgen.net/badge/discord/join%20chat/7289DA?icon=discord)](https://discord.gg/DSUZGK4)
[![Build Status](https://travis-ci.com/SwagLyrics/swaglyrics-backend.svg?branch=master)](https://travis-ci.com/SwagLyrics/swaglyrics-backend)
[![codecov](https://codecov.io/gh/SwagLyrics/swaglyrics-backend/branch/master/graph/badge.svg)](https://codecov.io/gh/SwagLyrics/swaglyrics-backend)

Server side code to make an issue on the [main repo](https://github.com/SwagLyrics/SwagLyrics-For-Spotify) when the
program encounters a song it can't fetch lyrics for.

@@ -53,9 +53,10 @@

SQLALCHEMY_DATABASE_URI = "mysql+mysqlconnector://{username}:{password}@{username}.mysql.pythonanywhere-services." \
"com/{username}${databasename}".format(
username=username,
password=os.environ['DB_PWD'],
databasename="strippers")
username=username,
password=os.environ['DB_PWD'],
databasename="strippers"
)
app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI
app.config["SQLALCHEMY_POOL_RECYCLE"] = 280
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
@@ -408,9 +409,6 @@ def github_webhook():
cnt = del_line(song, artist)
return f'Deleted {cnt} instances from unsupported.txt'

# Respond to star event by posting on discord in #gh-activity on SwagLyrics guild
elif event == "star":
pass
else:
return json.dumps({'msg': 'Wrong event type'})

@@ -459,9 +457,13 @@ def latest_version():
return __version__


# test path to assist in testing of server
# test path to check if changes propagate and env variables work
@app.route('/test')
def swag():
"""
there are two env vars configured to test this route, BLAZEIT and SWAG.
the values are changed and this route is checked to see if changes are live.
"""
return os.environ['BLAZEIT']


@@ -479,3 +481,7 @@ def hello():
with open('unsupported.txt', 'r', encoding="utf-8") as f:
data = f.readlines()
return render_template('hello.html', unsupported_songs=data)


if __name__ == "__main__":
app.run()

0 comments on commit 8b5030c

Please sign in to comment.
You can’t perform that action at this time.