Skip to content

Commit

Permalink
add comments and readme badges
Browse files Browse the repository at this point in the history
Signed-off-by: Aadi Bajpai <me@aadibajpai.me>
  • Loading branch information
Aadi Bajpai committed Jan 28, 2020
1 parent 729a0d6 commit 8b5030c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 7 deletions.
5 changes: 5 additions & 0 deletions README.md
@@ -1,4 +1,9 @@
# swaglyrics-backend # 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 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. program encounters a song it can't fetch lyrics for.


Expand Down
20 changes: 13 additions & 7 deletions swaglyrics_backend/issue_maker.py
Expand Up @@ -53,9 +53,10 @@


SQLALCHEMY_DATABASE_URI = "mysql+mysqlconnector://{username}:{password}@{username}.mysql.pythonanywhere-services." \ SQLALCHEMY_DATABASE_URI = "mysql+mysqlconnector://{username}:{password}@{username}.mysql.pythonanywhere-services." \
"com/{username}${databasename}".format( "com/{username}${databasename}".format(
username=username, username=username,
password=os.environ['DB_PWD'], password=os.environ['DB_PWD'],
databasename="strippers") databasename="strippers"
)
app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI app.config["SQLALCHEMY_DATABASE_URI"] = SQLALCHEMY_DATABASE_URI
app.config["SQLALCHEMY_POOL_RECYCLE"] = 280 app.config["SQLALCHEMY_POOL_RECYCLE"] = 280
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
Expand Down Expand Up @@ -408,9 +409,6 @@ def github_webhook():
cnt = del_line(song, artist) cnt = del_line(song, artist)
return f'Deleted {cnt} instances from unsupported.txt' 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: else:
return json.dumps({'msg': 'Wrong event type'}) return json.dumps({'msg': 'Wrong event type'})


Expand Down Expand Up @@ -459,9 +457,13 @@ def latest_version():
return __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') @app.route('/test')
def swag(): 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'] return os.environ['BLAZEIT']




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


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

0 comments on commit 8b5030c

Please sign in to comment.