From 72cad2ab51e3b02c99a8965341dc06d17fdc68be Mon Sep 17 00:00:00 2001 From: Mel Miller Date: Sat, 16 Jan 2021 13:37:12 -0500 Subject: [PATCH] Fixed some typos and reworded a couple parts; About page no longer overwrites the count db; Added brief print statements to those try sections until I can remove them --- app.py | 14 ++++++++++---- templates/about.html | 5 +++-- templates/calc.html | 2 +- 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/app.py b/app.py index 1c15572..34a2577 100644 --- a/app.py +++ b/app.py @@ -11,7 +11,6 @@ app.config['SQLALCHEMY_DATABASE_URI'] = os.environ['DATABASE_URL'] app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False db = SQLAlchemy(app) -# db.create_all() LAST_CALC_DATE = datetime.fromtimestamp(1563736200) @@ -48,9 +47,12 @@ def decompose_url(url): def increment_count(db): count = Count.query.get(1) + + # TODO: Fix this try: count.total_reports = count.total_reports + 1 except: + print('Count db error') count = Count(count_id = 1, total_reports = 1) db.session.add(count) db.session.commit() @@ -80,13 +82,15 @@ def homepage(): @app.route('/about') def about(): + # TODO: Fix this try: count = Count.query.get(1) except: - db.create_all() + print('Count db error.') + # db.create_all() + # db.session.add(count) + # db.session.commit() count = Count(count_id = 1, total_reports = 1) - db.session.add(count) - db.session.commit() return render_template('about.html', report_count=count.total_reports) @@ -101,9 +105,11 @@ def calc(report_id, fight_id): if len(report_id) != 16: return redirect(url_for('homepage')) + # TODO: Fix this try: report = Report.query.filter_by(report_id=report_id, fight_id=fight_id).first() except: + print('Report db error') db.create_all() report = Report.query.filter_by(report_id=report_id, fight_id=fight_id).first() diff --git a/templates/about.html b/templates/about.html index fb6d5da..bc4b649 100644 --- a/templates/about.html +++ b/templates/about.html @@ -10,13 +10,14 @@

Does it account for...

Generally, yes. Specifically it accounts for these commonly asked things:

How it works

@@ -43,7 +44,7 @@

Current limitations

  • Look for whether a card overwrote another
  • Look at whether a Lord/Lady usage should have been swapped with a normal card usage elsewhere in the same Divination window
  • Look at whether you should have tried to Redraw for a card of the opposite melee/ranged type
  • -
  • There is no consideration of what seals you have currently or ned for your next Divination
  • +
  • There is no consideration of what seals you have currently or need for your next Divination
  • If multiple cards are active at the same time players that have cards are ignored for the later card plays without checking if an alternative play order would have been more optimal
  • diff --git a/templates/calc.html b/templates/calc.html index 2b2f02a..9b35c53 100644 --- a/templates/calc.html +++ b/templates/calc.html @@ -27,7 +27,7 @@
    {{ report.enc_time }}
    Player Job - Damage + Adjusted Damage Raw Damage