Skip to content

Commit

Permalink
Merge pull request #96 from DuckBoss/development
Browse files Browse the repository at this point in the history
Updates for v2.3.1
  • Loading branch information
Jason (제이슨) authored May 3, 2019
2 parents 6631d0d + 2921ac3 commit f85028b
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion helpers/global_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class GlobalMods:
# JJMumbleBot Data
version = "v2.3.0"
version = "v2.3.1"
jjmumblebot = None
# Whisper Target
whisper_target = None
Expand Down
6 changes: 6 additions & 0 deletions helpers/templates/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ <h2>Command History</h2>
</form>
</center>
<br>
<center>
<form method="post" action="/clear_history">
<button type="submit" class="btn btn-outline-success">Clear History</button>
</form>
</center>
<br>
{% if cmd_strings %}
<table class="table table-hover">
<thead>
Expand Down
6 changes: 6 additions & 0 deletions helpers/templates/youtube.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ <h2>Youtube Queue</h2>
</form>
</center>
<br>
<center>
<form method="post" action="/clear_youtube">
<button type="submit" class="btn btn-outline-success">Clear Queue</button>
</form>
</center>
<br>
{% if cur_playing %}
<table class="table table-hover">
<thead>
Expand Down
15 changes: 15 additions & 0 deletions helpers/web_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
from wtforms import Form, validators, StringField
from helpers.global_access import GlobalMods as GM
from plugins.youtube.youtube_helper import YoutubeHelper as YH
from plugins.youtube.youtube_helper import clear_queue
import utils
from shutil import copyfile
from cheroot.wsgi import Server as WsgiServer, PathInfoDispatcher
Expand Down Expand Up @@ -38,6 +39,20 @@ def cmd_history():
return render_template('history.html', cmd_strings=cmd_strings)


@web_app.route("/clear_history", methods=['GET', 'POST'])
def cmd_clear_history():
GM.cmd_history.clear()
cmd_strings = list(GM.cmd_history.queue_storage)
return render_template('history.html', cmd_strings=cmd_strings)


@web_app.route("/clear_youtube", methods=['GET', 'POST'])
def cmd_clear_youtube():
clear_queue()
cmd_strings = list(YH.queue_instance.queue_storage)
return render_template('youtube.html', cmd_strings=cmd_strings, cur_playing=YH.current_song_info)


@web_app.route("/youtube", methods=['GET', 'POST'])
def cmd_youtube():
cmd_strings = list(YH.queue_instance.queue_storage)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def setUp(self):

def test_version(self):
bot_version = GM.version
self.assertEqual(bot_version, "v2.3.0")
self.assertEqual(bot_version, "v2.3.1")

def test_server_ip(self):
server_ip = GM.cfg['Connection_Settings']['ServerIP']
Expand Down

0 comments on commit f85028b

Please sign in to comment.