From fc034528a101856cd8f8042f6c18bc7507def190 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Feb 2021 03:13:34 +0000 Subject: [PATCH 01/42] Bump aiohttp from 3.7.3 to 3.7.4 Bumps [aiohttp](https://github.com/aio-libs/aiohttp) from 3.7.3 to 3.7.4. - [Release notes](https://github.com/aio-libs/aiohttp/releases) - [Changelog](https://github.com/aio-libs/aiohttp/blob/master/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiohttp/compare/v3.7.3...v3.7.4) Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index deee423..2777d5e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ bookiesports bos-mint bos-incidents -aiohttp==3.7.3 +aiohttp==3.7.4 appdirs==1.4.4 asgiref==3.3.1 async-timeout==3.0.1 From b565eadc30c01c58adcc345dac096fcf5274d72d Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Thu, 4 Mar 2021 01:06:52 +0530 Subject: [PATCH 02/42] Manage thesportsdb feed with strStatus and Score None --- feed/feed.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/feed/feed.py b/feed/feed.py index 778fac6..0b28567 100644 --- a/feed/feed.py +++ b/feed/feed.py @@ -10,6 +10,7 @@ import time leagueIds = [4328, 4391, 4387, 4380, 4424, 4335, 4332, 4331] +# leagueIds = [4380] # 4380 : NHL # Ice Hockey # 4424 : MLB # Baseball # 4328 : EPL @@ -114,6 +115,9 @@ def Call(self, event, incident): incident["call"] = INCIDENT_CALLS[1] print('Second Half', "to in_progress", event["strFilename"]) + elif isinstance(event["strStatus"], type(None)): + print("Event strStatus None, discarded") + return incident else: self.failedEvents.append(event) print("Call Not Managed:") From 4c9c00a1d2ae5c58d5262051a31aec6cfda92d48 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Thu, 4 Mar 2021 18:32:03 +0530 Subject: [PATCH 03/42] Push bypassed if call not decided --- feed/feed.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/feed/feed.py b/feed/feed.py index 0b28567..3b264e8 100644 --- a/feed/feed.py +++ b/feed/feed.py @@ -116,7 +116,7 @@ def Call(self, event, incident): print('Second Half', "to in_progress", event["strFilename"]) elif isinstance(event["strStatus"], type(None)): - print("Event strStatus None, discarded") + print("Event strStatus None, discarded, call not decided") return incident else: self.failedEvents.append(event) @@ -186,13 +186,16 @@ def Push2Bos(self, events): time.sleep(60) event = events[k] toCp = self.ToCp(event) - try: - self.cp.Push2bosAll(toCp) - except Exception as e: - # self.failedEvents.append(toCp) - self.failedEvents.append(event) - print("Failed Event: ", k, toCp) - print(e) + if "call" in toCp.keys(): + try: + self.cp.Push2bosAll(toCp) + except Exception as e: + # self.failedEvents.append(toCp) + self.failedEvents.append(event) + print("Failed Event: ", k, toCp) + print(e) + else: + print("Call not decided") return def PushLeague(self, leagueid, call="create"): From 74882863a823d04ef6cc48afb6c7e8aebdefb415 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Fri, 5 Mar 2021 14:36:00 +0530 Subject: [PATCH 04/42] Q3 status managed --- feed/feed.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/feed/feed.py b/feed/feed.py index 3b264e8..c7183dd 100644 --- a/feed/feed.py +++ b/feed/feed.py @@ -44,6 +44,8 @@ apiAllLeagues = "all_leagues.php" +apiEventFromId = "lookupevent.php?id=" + class Feed: @@ -54,6 +56,12 @@ def __init__(self): self.maxOpenProposals = 1 pass + def EventFromId(self, eventId): + url = apiBase + apiEventFromId + str(eventId) + event = requests.get(url).text + event = json.loads(event) + return event + def Past15(self, leagueid): url = apiBase + apiEventsPastLeague + str(leagueid) schedule15 = requests.get(url) @@ -111,7 +119,8 @@ def Call(self, event, incident): incident["call"] = INCIDENT_CALLS[0] print("None elif case and event created") - elif (event["strStatus"] == "Second Half"): + elif (event["strStatus"] == "Second Half") or ( + event["strStaus"] == "Q3"): incident["call"] = INCIDENT_CALLS[1] print('Second Half', "to in_progress", event["strFilename"]) From 9940e6df8137da216c182280274d6bf1c14166ad Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Fri, 5 Mar 2021 15:01:58 +0530 Subject: [PATCH 05/42] Q3 status managed --- feed/feed.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/feed/feed.py b/feed/feed.py index c7183dd..433da78 100644 --- a/feed/feed.py +++ b/feed/feed.py @@ -120,7 +120,7 @@ def Call(self, event, incident): print("None elif case and event created") elif (event["strStatus"] == "Second Half") or ( - event["strStaus"] == "Q3"): + event["strStatus"] == "Q3"): incident["call"] = INCIDENT_CALLS[1] print('Second Half', "to in_progress", event["strFilename"]) From 923d074afcd5b31caa1759b5c91c1ed4a4dc29a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 Mar 2021 13:07:16 +0000 Subject: [PATCH 06/42] Bump django from 3.1.4 to 3.1.6 Bumps [django](https://github.com/django/django) from 3.1.4 to 3.1.6. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/3.1.4...3.1.6) Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index deee423..0cc159d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,7 +19,7 @@ click-datetime==0.2 colorlog==4.6.2 dateutils==0.6.12 decorator==4.4.2 -Django==3.1.4 +Django==3.1.6 djangorestframework==3.12.2 dnspython==2.0.0 ecdsa==0.13.3 From 28badaeed717178d2c4ded2045cca60f2a3357e2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Mar 2021 05:39:05 +0000 Subject: [PATCH 07/42] Bump jinja2 from 2.11.2 to 2.11.3 Bumps [jinja2](https://github.com/pallets/jinja) from 2.11.2 to 2.11.3. - [Release notes](https://github.com/pallets/jinja/releases) - [Changelog](https://github.com/pallets/jinja/blob/master/CHANGES.rst) - [Commits](https://github.com/pallets/jinja/compare/2.11.2...2.11.3) Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index deee423..7169e02 100644 --- a/requirements.txt +++ b/requirements.txt @@ -41,7 +41,7 @@ ipython ipython-genutils==0.2.0 itsdangerous==1.1.0 jedi==0.17.2 -Jinja2==2.11.2 +Jinja2==2.11.3 jsonschema==3.2.0 Markdown==3.3.3 MarkupSafe==1.1.1 From ed2b1d344beb5d464ae85d0b927e450cbd048a6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 Mar 2021 00:45:55 +0000 Subject: [PATCH 08/42] Bump pyyaml from 5.3.1 to 5.4 Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.3.1 to 5.4. - [Release notes](https://github.com/yaml/pyyaml/releases) - [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES) - [Commits](https://github.com/yaml/pyyaml/compare/5.3.1...5.4) Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 7513bd7..edea7ee 100644 --- a/requirements.txt +++ b/requirements.txt @@ -63,7 +63,7 @@ pymongo==3.11.2 pyrsistent==0.17.3 python-dateutil==2.8.1 pytz==2020.4 -PyYAML==5.3.1 +PyYAML==5.4 requests==2.22.0 scrypt==0.8.17 six==1.15.0 From bf83ae6198679f445d8b4b35ca94939203de0294 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Mar 2021 02:41:25 +0000 Subject: [PATCH 09/42] Bump pygments from 2.7.3 to 2.7.4 Bumps [pygments](https://github.com/pygments/pygments) from 2.7.3 to 2.7.4. - [Release notes](https://github.com/pygments/pygments/releases) - [Changelog](https://github.com/pygments/pygments/blob/master/CHANGES) - [Commits](https://github.com/pygments/pygments/compare/2.7.3...2.7.4) Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index edea7ee..5904efd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -57,7 +57,7 @@ prettytable==2.0.0 prompt-toolkit==3.0.8 ptyprocess==0.6.0 pycryptodome==3.9.9 -Pygments==2.7.3 +Pygments==2.7.4 pylibscrypt==1.8.0 pymongo==3.11.2 pyrsistent==0.17.3 From 952253070a1c1b6506b5d13dca02224b15226cd1 Mon Sep 17 00:00:00 2001 From: Bobinson K B Date: Thu, 1 Apr 2021 00:22:21 +0530 Subject: [PATCH 10/42] Create codeql-analysis.yml --- .github/workflows/codeql-analysis.yml | 67 +++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/codeql-analysis.yml diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml new file mode 100644 index 0000000..378d477 --- /dev/null +++ b/.github/workflows/codeql-analysis.yml @@ -0,0 +1,67 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +# +# ******** NOTE ******** +# We have attempted to detect the languages in your repository. Please check +# the `language` matrix defined below to confirm you have the correct set of +# supported CodeQL languages. +# +name: "CodeQL" + +on: + push: + branches: [ develop ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ develop ] + schedule: + - cron: '35 9 * * 6' + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + strategy: + fail-fast: false + matrix: + language: [ 'javascript', 'python' ] + # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ] + # Learn more: + # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v1 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v1 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v1 From e5d23acea0b8c67769006b89c80fb503ea49d270 Mon Sep 17 00:00:00 2001 From: Bobinson K B Date: Thu, 1 Apr 2021 00:22:41 +0530 Subject: [PATCH 11/42] Create ossar-analysis.yml --- .github/workflows/ossar-analysis.yml | 44 ++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 .github/workflows/ossar-analysis.yml diff --git a/.github/workflows/ossar-analysis.yml b/.github/workflows/ossar-analysis.yml new file mode 100644 index 0000000..513afd6 --- /dev/null +++ b/.github/workflows/ossar-analysis.yml @@ -0,0 +1,44 @@ +# This workflow integrates a collection of open source static analysis tools +# with GitHub code scanning. For documentation, or to provide feedback, visit +# https://github.com/github/ossar-action +name: OSSAR + +on: + push: + branches: [ develop ] + pull_request: + # The branches below must be a subset of the branches above + branches: [ develop ] + schedule: + - cron: '26 13 * * 4' + +jobs: + OSSAR-Scan: + # OSSAR runs on windows-latest. + # ubuntu-latest and macos-latest support coming soon + runs-on: windows-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + # Ensure a compatible version of dotnet is installed. + # The [Microsoft Security Code Analysis CLI](https://aka.ms/mscadocs) is built with dotnet v3.1.201. + # A version greater than or equal to v3.1.201 of dotnet must be installed on the agent in order to run this action. + # GitHub hosted runners already have a compatible version of dotnet installed and this step may be skipped. + # For self-hosted runners, ensure dotnet version 3.1.201 or later is installed by including this action: + # - name: Install .NET + # uses: actions/setup-dotnet@v1 + # with: + # dotnet-version: '3.1.x' + + # Run open source static analysis tools + - name: Run OSSAR + uses: github/ossar-action@v1 + id: ossar + + # Upload results to the Security tab + - name: Upload OSSAR results + uses: github/codeql-action/upload-sarif@v1 + with: + sarif_file: ${{ steps.ossar.outputs.sarifFile }} From 5487bcf46ea9d986d668a0f5a6a97a427efa014a Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Mon, 19 Apr 2021 13:28:22 +0530 Subject: [PATCH 12/42] Open proposals count --- couchpotato/couchpotato/settings.py | 2 +- couchpotato/game/views.py | 13 + couchpotato/home/templates/update_cp.html | 3 +- couchpotato/home/templates/update_debug.html | 459 +++++++++++++++++ couchpotato/home/templates/update_simple.html | 468 ++++++++++++++++++ couchpotato/home/views.py | 194 ++++++-- 6 files changed, 1099 insertions(+), 40 deletions(-) create mode 100644 couchpotato/home/templates/update_debug.html create mode 100644 couchpotato/home/templates/update_simple.html diff --git a/couchpotato/couchpotato/settings.py b/couchpotato/couchpotato/settings.py index cdef0d8..6ce311d 100644 --- a/couchpotato/couchpotato/settings.py +++ b/couchpotato/couchpotato/settings.py @@ -23,7 +23,7 @@ SECRET_KEY = '!fwkygc(zdgod8v934b9q(grdp7#(kd1vav4h)sdi6y_6p!oq6' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False ALLOWED_HOSTS = ['*'] diff --git a/couchpotato/game/views.py b/couchpotato/game/views.py index 71b6771..3938ea8 100644 --- a/couchpotato/game/views.py +++ b/couchpotato/game/views.py @@ -6,6 +6,17 @@ import cp_local cp = cp_local.Cp() +from feed import Feed +fd = Feed() + +def GetMatchingEvents(): + listDist = fd.MatchingEventsAll() + return listDist + +def GetOpenProposalsCount(): + openproposals , maxproposals = cp.OpenProposalsCount() + return [openproposals ,maxproposals ] + def GetEvents(params={}): rDict = dict() sport = None @@ -132,3 +143,5 @@ def UpdatePotato(record): # print(rDict) # print(e) return rDict + + diff --git a/couchpotato/home/templates/update_cp.html b/couchpotato/home/templates/update_cp.html index e431bdd..c8afa18 100644 --- a/couchpotato/home/templates/update_cp.html +++ b/couchpotato/home/templates/update_cp.html @@ -44,7 +44,8 @@
-

+

+

Proposals : {{ proposals.0 }} / {{ proposals.1 }}

diff --git a/couchpotato/home/templates/update_debug.html b/couchpotato/home/templates/update_debug.html new file mode 100644 index 0000000..1b8bf08 --- /dev/null +++ b/couchpotato/home/templates/update_debug.html @@ -0,0 +1,459 @@ + + + + + Couch Potato + + + + + + + + + + + + + + {% include "navbar.html" %} + +
+
+ +

+

Proposals : {{ proposals.0 }} / {{ proposals.1 }}

+ + + + +
+ + + + + + + + + + + + + + + + + + {% for a , b in data.items %} + + + + + + + + + + + + + + + + + + + + {% endfor %} + + + +
Event on ChainEventUpdate from FeedFeedScoresCallStart Time in Local Time
+ {{b.eventFromChain}} + +
    +
  • + {{b.eventFromChain.name.0.1}} +
  • +
  • + {{b.eventFromChain.start_time}} +
  • +
  • + {{b.eventFromChain.scores}} +
  • +
  • + {{b.eventFromChain.status}} +
  • +
  • + {{b.eventFromChain.event_group_name}} +
  • +
  • + {{b.eventFromChain.sport}} +
  • +
+ + +
+ {{b.eventFromFeed}} + + {% if b.eventFromFeed is not none%} +
    +
  • + {{b.eventFromFeed.id.sport}} +
  • +
  • + {{b.eventFromFeed.id.event_group_name}} +
  • +
  • + {{b.eventFromFeed.id.start_time}} +
  • +
  • + {{b.eventFromFeed.id.home}} +
  • +
  • + {{b.eventFromFeed.id.away}} +
  • +
  • + {{b.eventFromFeed.arguments.home_score}} +
  • +
  • + {{b.eventFromFeed.arguments.away_score}} +
  • +
  • + {{b.eventFromFeed.call}} +
  • +
+ {% endif %} +
+ Home Score : +

+ Away Score : +
+

+ +

+ +

+ + +
+ + + + + Return to Home + +
+ + +
+
+ + + + + + + + + + + + + + + + + + diff --git a/couchpotato/home/templates/update_simple.html b/couchpotato/home/templates/update_simple.html new file mode 100644 index 0000000..898dd84 --- /dev/null +++ b/couchpotato/home/templates/update_simple.html @@ -0,0 +1,468 @@ + + + + + Couch Potato + + + + + + + + + + + + + + {% include "navbar.html" %} + +
+
+ +

+

Proposals : {{ proposals.0 }} / {{ proposals.1 }}

+ + + + +
+ + + + + + + + + + + + + + + + {% for a , b in data.items %} + + + + + + + + + + + + + + + + + + + + {% endfor %} + + + +
EventEvent on ChainFeedUpdate from FeedScoresCallStart Time in Local Time
+ {{b.eventFromChain}} + +
    +
  • + {{b.eventFromChain.name.0.1}} +
  • +
  • + {{b.eventFromChain.start_time}} +
  • +
  • + {{b.eventFromChain.scores}} +
  • +
  • + {{b.eventFromChain.status}} +
  • +
  • + {{b.eventFromChain.event_group_name}} +
  • +
  • + {{b.eventFromChain.sport}} +
  • +
+ + +
+ {{b.eventFromFeed}} + + {% if b.eventFromFeed is not none%} +
    +
  • + {{b.eventFromFeed.id.sport}} +
  • +
  • + {{b.eventFromFeed.id.event_group_name}} +
  • +
  • + {{b.eventFromFeed.id.start_time}} +
  • +
  • + {{b.eventFromFeed.id.home}} +
  • +
  • + {{b.eventFromFeed.id.away}} +
  • +
  • + {{b.eventFromFeed.arguments.home_score}} +
  • +
  • + {{b.eventFromFeed.arguments.away_score}} +
  • +
  • + {{b.eventFromFeed.call}} +
  • +
+ {% endif %} +
+ Home Score : +

+ Away Score : +
+

+ +

+ +

+ + +
+ + + + + Return to Home + +
+ + +
+
+ + + + + + + + + + + + + + + + + + diff --git a/couchpotato/home/views.py b/couchpotato/home/views.py index 5cd75ab..388645c 100644 --- a/couchpotato/home/views.py +++ b/couchpotato/home/views.py @@ -1,17 +1,17 @@ - + # Create your views here. -from django.http import Http404 , JsonResponse , HttpResponseRedirect +from django.http import Http404 , JsonResponse , HttpResponseRedirect ,HttpResponse from django.shortcuts import render import json import requests import pytz, datetime from django.contrib.auth import login, authenticate from django.shortcuts import render, redirect -from home.forms import SignUpForm +from home.forms import SignUpForm ,LoginForm from django.contrib.auth.models import User from home.models import ApplicationFeatures from django.contrib.auth import logout -from game.views import GetEvents , CreatePotato , UpdatePotato +from game.views import GetEvents , CreatePotato , UpdatePotato , GetMatchingEvents , GetOpenProposalsCount from django.contrib.auth.decorators import login_required from django.core import serializers from home.utilities import index_page_permitted , register_login_page_permitted , allow_login , allow_register @@ -25,9 +25,10 @@ def AuthenticateUser(request): param: request description: Loads the login page and does the authentication. ''' - if request.method == 'POST': - form = AuthenticationForm(request=request, data=request.POST) + form = LoginForm(request=request, data=request.POST) + + if form.is_valid(): username = form.cleaned_data.get('username').strip() password = form.cleaned_data.get('password') @@ -35,17 +36,12 @@ def AuthenticateUser(request): if user is not None: login(request, user) return redirect('/') - else: - if username is None or username is '': - messages.error(request, 'Username cannot be blank') - else: - messages.error(request, "Invalid username or password.") + else: - username = request.POST.get('username').strip() - if username is None or username is '': - messages.error(request, 'Username cannot be blank') - else: - messages.error(request, "Invalid username or password.") + print("Invalid") + for key , value in form.errors.items(): + error = value + messages.error(request, error) return HttpResponseRedirect('/') @@ -72,24 +68,19 @@ def LogoutSwagger(request): def SignUp(request): ''' param: request - description : Loads the registration page and does the sign up and authentication. + description : Loads the registration page and does the sign up. + New user is set inactive intially before admin approval. ''' # print("In sign up ") # try: if allow_register(): - # print("in allow register " , request.method ) if request.method == 'POST': form = SignUpForm(request.POST) - # print(form) if form.is_valid(): - # print("Form is valid") - form.save() - username = form.cleaned_data.get('username') - raw_password = form.cleaned_data.get('password1') - user = authenticate(username=username, password=raw_password) - if user is not None: - login(request, user) - return redirect('/') + user = form.save() + user.is_active = False + user.save() + return redirect('/') else: form = SignUpForm() return render(request, 'register.html',{'form':form}) @@ -109,31 +100,79 @@ def UpdateList(request): if index_page_permitted(request): params = {'filter':'events'} events = GetEvents(params) + proposal_value = GetOpenProposalsCount() list_values = {} if events is not None: list_values = dict(enumerate(events , start=1)) - return render(request, 'update_cp.html',{"data": list_values}) + return render(request, 'update_cp.html',{"data": list_values,'proposals' : proposal_value}) else: return render(request, 'login.html') except: return render(request, '404.html') +def getstaticEvents(): + newDict = [{'eventFromChain': {'id': '1.22.602', 'name': [['en', 'Lazio v Crotone']], 'season': [['en', '']], 'start_time': '2021-03-12T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.534', 'name': [['en', 'Augsburg v Mönchengladbach']], 'season': [['en', '']], 'start_time': '2021-03-12T19:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.533', 'name': [['en', 'Augsburg v Mönchengladbach']], 'season': [['en', '']], 'start_time': '2021-03-12T19:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'finished', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.604', 'name': [['en', 'Atalanta v Spezia']], 'season': [['en', '']], 'start_time': '2021-03-12T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.603', 'name': [['en', 'Atalanta v Spezia']], 'season': [['en', '']], 'start_time': '2021-03-12T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'finished', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.490', 'name': [['en', 'Levante v Valencia']], 'season': [['en', '']], 'start_time': '2021-03-12T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.766', 'name': [['en', 'Vegas Golden Knights @ St. Louis Blues']], 'season': [['en', '']], 'start_time': '2021-03-13T01:00:00', 'event_group_id': '1.21.0', 'scores': [], 'status': 'finished', 'event_group_name': 'NHL Regular Season', 'sport': 'Ice Hockey'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.645', 'name': [['en', 'Denver Nuggets @ Memphis Grizzlies']], 'season': [['en', '']], 'start_time': '2021-03-13T01:00:00', 'event_group_id': '1.21.5', 'scores': [], 'status': 'finished', 'event_group_name': 'NBA Regular Season', 'sport': 'Basketball'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.646', 'name': [['en', 'Cleveland Cavaliers @ New Orleans Pelicans']], 'season': [['en', '']], 'start_time': '2021-03-13T01:00:00', 'event_group_id': '1.21.5', 'scores': [], 'status': 'finished', 'event_group_name': 'NBA Regular Season', 'sport': 'Basketball'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.763', 'name': [['en', 'Philadelphia 76ers @ Washington Wizards']], 'season': [['en', '']], 'start_time': '2021-03-13T01:00:00', 'event_group_id': '1.21.5', 'scores': [], 'status': 'finished', 'event_group_name': 'NBA Regular Season', 'sport': 'Basketball'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.767', 'name': [['en', 'Los Angeles Kings @ Colorado Avalanche']], 'season': [['en', '']], 'start_time': '2021-03-13T02:00:00', 'event_group_id': '1.21.0', 'scores': [], 'status': 'finished', 'event_group_name': 'NHL Regular Season', 'sport': 'Ice Hockey'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.764', 'name': [['en', 'Miami Heat @ Chicago Bulls']], 'season': [['en', '']], 'start_time': '2021-03-13T02:00:00', 'event_group_id': '1.21.5', 'scores': [], 'status': 'finished', 'event_group_name': 'NBA Regular Season', 'sport': 'Basketball'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.768', 'name': [['en', 'Ottawa Senators @ Edmonton Oilers']], 'season': [['en', '']], 'start_time': '2021-03-13T02:00:00', 'event_group_id': '1.21.0', 'scores': [], 'status': 'finished', 'event_group_name': 'NHL Regular Season', 'sport': 'Ice Hockey'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.769', 'name': [['en', 'San Jose Sharks @ Anaheim Ducks']], 'season': [['en', '']], 'start_time': '2021-03-13T03:00:00', 'event_group_id': '1.21.0', 'scores': [], 'status': 'finished', 'event_group_name': 'NHL Regular Season', 'sport': 'Ice Hockey'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.491', 'name': [['en', 'Alaves v Cadiz']], 'season': [['en', '']], 'start_time': '2021-03-13T13:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.634', 'name': [['en', 'Sassuolo v Verona']], 'season': [['en', '']], 'start_time': '2021-03-13T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.653', 'name': [['en', 'Werder Bremen v Bayern Munich']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'finished', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-13T14:30:00Z', 'home': 'Werder Bremen', 'away': 'Bayern Munich'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:55.104013Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.540', 'name': [['en', 'Union Berlin v FC Koln']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-13T14:30:00Z', 'home': 'Union Berlin', 'away': 'FC Koln'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:55.188676Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.539', 'name': [['en', 'Union Berlin v FC Koln']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'finished', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-13T14:30:00Z', 'home': 'Union Berlin', 'away': 'FC Koln'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:55.270535Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.537', 'name': [['en', 'Wolfsburg v Schalke 04']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'finished', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.538', 'name': [['en', 'Wolfsburg v Schalke 04']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.541', 'name': [['en', 'Mainz v Freiburg']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-13T14:30:00Z', 'home': 'Mainz', 'away': 'Freiburg'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:55.493435Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.542', 'name': [['en', 'Mainz v Freiburg']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-13T14:30:00Z', 'home': 'Mainz', 'away': 'Freiburg'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:55.575429Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.652', 'name': [['en', 'Real Madrid v Elche']], 'season': [['en', '']], 'start_time': '2021-03-13T15:15:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.606', 'name': [['en', 'Benevento v Fiorentina']], 'season': [['en', '']], 'start_time': '2021-03-13T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.605', 'name': [['en', 'Benevento v Fiorentina']], 'season': [['en', '']], 'start_time': '2021-03-13T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.535', 'name': [['en', 'Dortmund v Hertha']], 'season': [['en', '']], 'start_time': '2021-03-13T17:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'finished', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.536', 'name': [['en', 'Dortmund v Hertha']], 'season': [['en', '']], 'start_time': '2021-03-13T17:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.494', 'name': [['en', 'Osasuna v Valladolid']], 'season': [['en', '']], 'start_time': '2021-03-13T17:30:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.607', 'name': [['en', 'Genoa v Udinese']], 'season': [['en', '']], 'start_time': '2021-03-13T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'finished', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.608', 'name': [['en', 'Genoa v Udinese']], 'season': [['en', '']], 'start_time': '2021-03-13T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.493', 'name': [['en', 'Getafe v Ath Madrid']], 'season': [['en', '']], 'start_time': '2021-03-13T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.492', 'name': [['en', 'Getafe v Ath Madrid']], 'season': [['en', '']], 'start_time': '2021-03-13T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'finished', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.727', 'name': [['en', 'Bologna v Sampdoria']], 'season': [['en', '']], 'start_time': '2021-03-14T11:30:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T11:30:00Z', 'home': 'Bologna', 'away': 'Sampdoria'}, 'arguments': {'home_score': '3', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:56.397061Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.726', 'name': [['en', 'Bologna v Sampdoria']], 'season': [['en', '']], 'start_time': '2021-03-14T11:30:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T11:30:00Z', 'home': 'Bologna', 'away': 'Sampdoria'}, 'arguments': {'home_score': '3', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:56.460689Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.687', 'name': [['en', 'Southampton v Brighton']], 'season': [['en', '']], 'start_time': '2021-03-14T12:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'finished', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-14T12:00:00Z', 'home': 'Southampton', 'away': 'Brighton'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:56.464189Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.688', 'name': [['en', 'Southampton v Brighton']], 'season': [['en', '']], 'start_time': '2021-03-14T12:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'upcoming', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-14T12:00:00Z', 'home': 'Southampton', 'away': 'Brighton'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:56.467013Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.673', 'name': [['en', 'Leverkusen v Bielefeld']], 'season': [['en', '']], 'start_time': '2021-03-14T12:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T12:30:00Z', 'home': 'Leverkusen', 'away': 'Bielefeld'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:56.540579Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.672', 'name': [['en', 'Leverkusen v Bielefeld']], 'season': [['en', '']], 'start_time': '2021-03-14T12:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T12:30:00Z', 'home': 'Leverkusen', 'away': 'Bielefeld'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:56.61041Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.660', 'name': [['en', 'Celta Vigo v Ath Bilbao']], 'season': [['en', '']], 'start_time': '2021-03-14T13:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.684', 'name': [['en', 'Leicester v Sheffield United']], 'season': [['en', '']], 'start_time': '2021-03-14T14:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-14T14:00:00Z', 'home': 'Leicester', 'away': 'Sheffield United'}, 'arguments': {'home_score': '5', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:56.692313Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.725', 'name': [['en', 'Parma Calcio 1913 v Roma']], 'season': [['en', '']], 'start_time': '2021-03-14T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T14:00:00Z', 'home': 'Parma Calcio 1913', 'away': 'Roma'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:56.757793Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.724', 'name': [['en', 'Torino v Inter']], 'season': [['en', '']], 'start_time': '2021-03-14T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.723', 'name': [['en', 'Torino v Inter']], 'season': [['en', '']], 'start_time': '2021-03-14T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.671', 'name': [['en', 'RasenBallsport Leipzig v Ein Frankfurt']], 'season': [['en', '']], 'start_time': '2021-03-14T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T14:30:00Z', 'home': 'RasenBallsport Leipzig', 'away': 'Ein Frankfurt'}, 'arguments': {'home_score': '1', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:56.97345Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.670', 'name': [['en', 'RasenBallsport Leipzig v Ein Frankfurt']], 'season': [['en', '']], 'start_time': '2021-03-14T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T14:30:00Z', 'home': 'RasenBallsport Leipzig', 'away': 'Ein Frankfurt'}, 'arguments': {'home_score': '1', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:57.060972Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.664', 'name': [['en', 'Granada v Sociedad']], 'season': [['en', '']], 'start_time': '2021-03-14T15:15:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T15:15:00Z', 'home': 'Granada', 'away': 'Sociedad'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.114467Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.663', 'name': [['en', 'Granada v Sociedad']], 'season': [['en', '']], 'start_time': '2021-03-14T15:15:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T15:15:00Z', 'home': 'Granada', 'away': 'Sociedad'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.164568Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.681', 'name': [['en', 'Arsenal v Tottenham']], 'season': [['en', '']], 'start_time': '2021-03-14T16:30:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-14T16:30:00Z', 'home': 'Arsenal', 'away': 'Tottenham'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:57.169648Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.682', 'name': [['en', 'Arsenal v Tottenham']], 'season': [['en', '']], 'start_time': '2021-03-14T16:30:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'upcoming', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-14T16:30:00Z', 'home': 'Arsenal', 'away': 'Tottenham'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:57.17497Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.667', 'name': [['en', 'Cagliari v Juventus']], 'season': [['en', '']], 'start_time': '2021-03-14T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T17:00:00Z', 'home': 'Cagliari', 'away': 'Juventus'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:57.251487Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.668', 'name': [['en', 'Cagliari v Juventus']], 'season': [['en', '']], 'start_time': '2021-03-14T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T17:00:00Z', 'home': 'Cagliari', 'away': 'Juventus'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:57.32255Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.734', 'name': [['en', 'Stuttgart v Hoffenheim']], 'season': [['en', '']], 'start_time': '2021-03-14T17:00:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T17:00:00Z', 'home': 'Stuttgart', 'away': 'Hoffenheim'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.401101Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.735', 'name': [['en', 'Stuttgart v Hoffenheim']], 'season': [['en', '']], 'start_time': '2021-03-14T17:00:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T17:00:00Z', 'home': 'Stuttgart', 'away': 'Hoffenheim'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.474476Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.661', 'name': [['en', 'Eibar v Villarreal']], 'season': [['en', '']], 'start_time': '2021-03-14T17:30:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T17:30:00Z', 'home': 'Eibar', 'away': 'Villarreal'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:57.523987Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.662', 'name': [['en', 'Eibar v Villarreal']], 'season': [['en', '']], 'start_time': '2021-03-14T17:30:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T17:30:00Z', 'home': 'Eibar', 'away': 'Villarreal'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:57.583102Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.669', 'name': [['en', 'Milan v Napoli']], 'season': [['en', '']], 'start_time': '2021-03-14T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T19:45:00Z', 'home': 'Milan', 'away': 'Napoli'}, 'arguments': {'home_score': '0', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:57.653676Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.666', 'name': [['en', 'Sevilla v Betis']], 'season': [['en', '']], 'start_time': '2021-03-14T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T20:00:00Z', 'home': 'Sevilla', 'away': 'Betis'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.702612Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.665', 'name': [['en', 'Sevilla v Betis']], 'season': [['en', '']], 'start_time': '2021-03-14T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T20:00:00Z', 'home': 'Sevilla', 'away': 'Betis'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.750823Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.715', 'name': [['en', 'Barcelona v Huesca']], 'season': [['en', '']], 'start_time': '2021-03-15T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-15T20:00:00Z', 'home': 'Barcelona', 'away': 'Huesca'}, 'arguments': {'home_score': '4', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:57.796495Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.728', 'name': [['en', 'Torino v Sassuolo']], 'season': [['en', '']], 'start_time': '2021-03-17T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-17T14:00:00Z', 'home': 'Torino', 'away': 'Sassuolo'}, 'arguments': {'home_score': '3', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:57.860354Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.729', 'name': [['en', 'Torino v Sassuolo']], 'season': [['en', '']], 'start_time': '2021-03-17T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-17T14:00:00Z', 'home': 'Torino', 'away': 'Sassuolo'}, 'arguments': {'home_score': '3', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:57.925802Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.716', 'name': [['en', 'Sevilla v Elche']], 'season': [['en', '']], 'start_time': '2021-03-17T18:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-17T18:00:00Z', 'home': 'Sevilla', 'away': 'Elche'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.970711Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.717', 'name': [['en', 'Sevilla v Elche']], 'season': [['en', '']], 'start_time': '2021-03-17T18:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-17T18:00:00Z', 'home': 'Sevilla', 'away': 'Elche'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:58.027846Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.674', 'name': [['en', 'Bielefeld v RasenBallsport Leipzig']], 'season': [['en', '']], 'start_time': '2021-03-19T19:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-19T19:30:00Z', 'home': 'Bielefeld', 'away': 'RasenBallsport Leipzig'}, 'arguments': {'home_score': '0', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:58.149687Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.675', 'name': [['en', 'Bielefeld v RasenBallsport Leipzig']], 'season': [['en', '']], 'start_time': '2021-03-19T19:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-19T19:30:00Z', 'home': 'Bielefeld', 'away': 'RasenBallsport Leipzig'}, 'arguments': {'home_score': '0', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:58.235135Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.730', 'name': [['en', 'Parma Calcio 1913 v Genoa']], 'season': [['en', '']], 'start_time': '2021-03-19T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-19T19:45:00Z', 'home': 'Parma Calcio 1913', 'away': 'Genoa'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.298623Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.718', 'name': [['en', 'Betis v Levante']], 'season': [['en', '']], 'start_time': '2021-03-19T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-19T20:00:00Z', 'home': 'Betis', 'away': 'Levante'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:58.344717Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.719', 'name': [['en', 'Betis v Levante']], 'season': [['en', '']], 'start_time': '2021-03-19T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-19T20:00:00Z', 'home': 'Betis', 'away': 'Levante'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:58.403064Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.692', 'name': [['en', 'Fulham v Leeds']], 'season': [['en', '']], 'start_time': '2021-03-19T20:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'upcoming', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-19T20:00:00Z', 'home': 'Fulham', 'away': 'Leeds'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.405637Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.691', 'name': [['en', 'Fulham v Leeds']], 'season': [['en', '']], 'start_time': '2021-03-19T20:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-19T20:00:00Z', 'home': 'Fulham', 'away': 'Leeds'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.409635Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.720', 'name': [['en', 'Ath Bilbao v Eibar']], 'season': [['en', '']], 'start_time': '2021-03-20T13:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-20T13:00:00Z', 'home': 'Ath Bilbao', 'away': 'Eibar'}, 'arguments': {'home_score': '1', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:58.460529Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.721', 'name': [['en', 'Ath Bilbao v Eibar']], 'season': [['en', '']], 'start_time': '2021-03-20T13:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-20T13:00:00Z', 'home': 'Ath Bilbao', 'away': 'Eibar'}, 'arguments': {'home_score': '1', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:58.507307Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.731', 'name': [['en', 'Crotone v Bologna']], 'season': [['en', '']], 'start_time': '2021-03-20T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-20T14:00:00Z', 'home': 'Crotone', 'away': 'Bologna'}, 'arguments': {'home_score': '2', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:58.566822Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.762', 'name': [['en', 'Werder Bremen v Wolfsburg']], 'season': [['en', '']], 'start_time': '2021-03-20T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T14:30:00Z', 'home': 'Werder Bremen', 'away': 'Wolfsburg'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.630686Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.678', 'name': [['en', 'Ein Frankfurt v Union Berlin']], 'season': [['en', '']], 'start_time': '2021-03-20T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T14:30:00Z', 'home': 'Ein Frankfurt', 'away': 'Union Berlin'}, 'arguments': {'home_score': '5', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.768115Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.677', 'name': [['en', 'Bayern Munich v Stuttgart']], 'season': [['en', '']], 'start_time': '2021-03-20T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T14:30:00Z', 'home': 'Bayern Munich', 'away': 'Stuttgart'}, 'arguments': {'home_score': '4', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:58.84996Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.738', 'name': [['en', 'FC Koln v Dortmund']], 'season': [['en', '']], 'start_time': '2021-03-20T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T14:30:00Z', 'home': 'FC Koln', 'away': 'Dortmund'}, 'arguments': {'home_score': '2', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.917591Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.676', 'name': [['en', 'Bayern Munich v Stuttgart']], 'season': [['en', '']], 'start_time': '2021-03-20T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T14:30:00Z', 'home': 'Bayern Munich', 'away': 'Stuttgart'}, 'arguments': {'home_score': '4', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:58.986362Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.758', 'name': [['en', 'Celta Vigo v Real Madrid']], 'season': [['en', '']], 'start_time': '2021-03-20T15:15:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-20T15:15:00Z', 'home': 'Celta Vigo', 'away': 'Real Madrid'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:59.029494Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.733', 'name': [['en', 'Spezia v Cagliari']], 'season': [['en', '']], 'start_time': '2021-03-20T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-20T17:00:00Z', 'home': 'Spezia', 'away': 'Cagliari'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:59.088149Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.732', 'name': [['en', 'Spezia v Cagliari']], 'season': [['en', '']], 'start_time': '2021-03-20T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-20T17:00:00Z', 'home': 'Spezia', 'away': 'Cagliari'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:59.143532Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.759', 'name': [['en', 'Huesca v Osasuna']], 'season': [['en', '']], 'start_time': '2021-03-20T17:30:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-20T17:30:00Z', 'home': 'Huesca', 'away': 'Osasuna'}, 'arguments': {'home_score': '0', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:59.185056Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.760', 'name': [['en', 'Huesca v Osasuna']], 'season': [['en', '']], 'start_time': '2021-03-20T17:30:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-20T17:30:00Z', 'home': 'Huesca', 'away': 'Osasuna'}, 'arguments': {'home_score': '0', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:59.226237Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.736', 'name': [['en', 'Schalke 04 v Mönchengladbach']], 'season': [['en', '']], 'start_time': '2021-03-20T17:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T17:30:00Z', 'home': 'Schalke 04', 'away': 'Mönchengladbach'}, 'arguments': {'home_score': '0', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:59.293945Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.737', 'name': [['en', 'Schalke 04 v Mönchengladbach']], 'season': [['en', '']], 'start_time': '2021-03-20T17:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T17:30:00Z', 'home': 'Schalke 04', 'away': 'Mönchengladbach'}, 'arguments': {'home_score': '0', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:59.364111Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.761', 'name': [['en', 'Inter v Sassuolo']], 'season': [['en', '']], 'start_time': '2021-03-20T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-20T19:45:00Z', 'home': 'Inter', 'away': 'Sassuolo'}, 'arguments': {'whistle_start_time': '2021-03-20T19:45:00Z', 'season': ''}, 'timestamp': '2021-03-29T06:47:59.419867Z', 'call': 'canceled'}}, {'eventFromChain': {'id': '1.22.693', 'name': [['en', 'Brighton v Newcastle']], 'season': [['en', '']], 'start_time': '2021-03-20T20:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-20T20:00:00Z', 'home': 'Brighton', 'away': 'Newcastle'}, 'arguments': {'home_score': '3', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:59.42212Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.694', 'name': [['en', 'Brighton v Newcastle']], 'season': [['en', '']], 'start_time': '2021-03-20T20:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'upcoming', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-20T20:00:00Z', 'home': 'Brighton', 'away': 'Newcastle'}, 'arguments': {'home_score': '3', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:59.423875Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.747', 'name': [['en', 'West Ham v Arsenal']], 'season': [['en', '']], 'start_time': '2021-03-21T15:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'upcoming', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-21T15:00:00Z', 'home': 'West Ham', 'away': 'Arsenal'}, 'arguments': {'home_score': '3', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:59.4243Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.746', 'name': [['en', 'West Ham v Arsenal']], 'season': [['en', '']], 'start_time': '2021-03-21T15:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-21T15:00:00Z', 'home': 'West Ham', 'away': 'Arsenal'}, 'arguments': {'home_score': '3', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:59.424729Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.745', 'name': [['en', 'Aston Villa v Tottenham']], 'season': [['en', '']], 'start_time': '2021-03-21T19:30:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-21T19:30:00Z', 'home': 'Aston Villa', 'away': 'Tottenham'}, 'arguments': {'home_score': '0', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:59.425529Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.772', 'name': [['en', 'Utah Jazz @ Golden State Warriors']], 'season': [['en', '']], 'start_time': '2021-03-23T10:30:00', 'event_group_id': '1.21.5', 'scores': [], 'status': 'in_progress', 'event_group_name': 'NBA Regular Season', 'sport': 'Basketball'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.773', 'name': [['en', 'Denver Broncos @ Cincinnati Bengals']], 'season': [['en', '']], 'start_time': '2021-03-23T16:30:00', 'event_group_id': '1.21.16', 'scores': [], 'status': 'in_progress', 'event_group_name': 'NFL Regular Season', 'sport': 'AmericanFootball'}, 'eventFromFeed': None}] + return newDict + -def Home(request): +def UpdateListForDebug(request): ''' param : request - description : To load home page + description : To load update page ''' + try: + if index_page_permitted(request): + params = {'filter':'events'} + # events = getstaticEvents() + events = GetMatchingEvents() + proposal_value = GetOpenProposalsCount() + list_values = {} + if events is not None: + list_values = dict(enumerate(events , start=1)) + return render(request, 'update_debug.html',{"data": list_values,'proposals' : proposal_value}) + else: + return render(request, 'login.html') + except: + return render(request, '404.html') + + +def UpdateListSimple(request): + ''' + param : request + description : To load update page + ''' try: if index_page_permitted(request): - return render(request, 'index.html') - elif register_login_page_permitted(): + params = {'filter':'events'} + # events = getstaticEvents() + proposal_value = GetOpenProposalsCount() + events = GetMatchingEvents() + list_values = {} + if events is not None: + list_values = dict(enumerate(events , start=1)) + return render(request, 'update_simple.html',{"data": list_values,'proposals' : proposal_value}) + else: return render(request, 'login.html') except: return render(request, '404.html') + +def Home(request): + ''' + param : request + description : To load home page + ''' + + # try: + if index_page_permitted(request): + return render(request, 'index.html') + elif register_login_page_permitted(): + return render(request, 'login.html') + # except: + # return render(request, '404.html') + def CreateList(request,num=1): ''' param-1 : request @@ -146,6 +185,8 @@ def CreateList(request,num=1): start_val = 1 heading = '' is_last = False + proposal_value = GetOpenProposalsCount() + # print("Proposal value " ,proposal_value) if num == 1: games = GetEvents() list_values = dict(enumerate(games , start=start_val)) @@ -168,12 +209,75 @@ def CreateList(request,num=1): if num == 5: heading = "Time" is_last = True - return render(request, 'create.html', {"list" : list_values , 'heading' : heading , "islast":is_last,'question_id':num}) + return render(request, 'create.html', {"list" : list_values , 'heading' : heading , "islast":is_last,'question_id':num,'proposals' : proposal_value}) elif register_login_page_permitted(): return render(request, 'login.html') + +def LoadSelectOptions(request): + ''' + param-1 : request + param-2 : The values needed are posted from create_cp html page + num - represents game , group , home , away and time in integer representation + ''' + + num = request.POST.get("num") + if num == None: + num = 1 # Fisrt page loading the num is set as 1 + else: + num = int(num) + + if index_page_permitted(request): + list_values = {} + start_val = 1 + heading = '' + is_last = False + if num == 1: + games = GetEvents() + proposal_value = GetOpenProposalsCount() + print("Proposal value " ,proposal_value) + list_values = dict(enumerate(games , start=start_val)) + heading = "Select Games" + return render(request, 'create_cp.html', {"list" : list_values , 'heading' : heading , "islast":is_last,'question_id':num , 'proposals' : proposal_value}) + # return render(request, 'create_cp.html', {"list" : list_values , 'heading' : heading , "islast":is_last,'question_id':num }) + if num == 2: + request.session['sport'] = request.POST.get("sport").strip() + + params = {'sport':request.session['sport']} + sport = GetEvents(params) + heading = "Select Event Groups" + list_values = dict(enumerate(sport , start=start_val)) + return JsonResponse({"list" :list_values,"islast":is_last,'question_id':num }) + if num == 3: + request.session['sport'] = request.POST.get("sport").strip() + request.session['eventGroup'] = request.POST.get('eventGroup').strip() + + params = {"sport":request.POST.get("sport").strip(),"eventGroup":request.POST.get('eventGroup').strip()} + teams = GetEvents(params) + heading = "Home" + list_values = dict(enumerate(teams , start=start_val)) + return JsonResponse({"list" :list_values,"islast":is_last,'question_id':num }) + if num == 4: + request.session['sport'] = request.POST.get("sport").strip() + request.session['eventGroup'] = request.POST.get('eventGroup').strip() + request.session['home'] = request.POST.get('home').strip() + + params ={"sport":request.POST.get("sport").strip(),"eventGroup":request.POST.get('eventGroup').strip()} + teams = GetEvents(params) + heading = "Away" + list_values = dict(enumerate(teams , start=start_val)) + return JsonResponse({"list" :list_values,"islast":is_last,'question_id':num }) + if num == 5: + heading = "Time" + is_last = True + request.session['away'] = request.POST.get('away').strip() + return JsonResponse({"list" :list_values,"islast":is_last,'question_id':num }) + + elif register_login_page_permitted(): + return render(request, 'login.html') + def CreatePost(request): ''' param : request @@ -199,9 +303,8 @@ def CreatePost(request): "username":username} print("Data " , data) result = CreatePotato(data) - if(len(result) > 0 and 'error' not in result): - return JsonResponse({'success':'Posted'}) + return JsonResponse({'success':'Posted' , 'message':json.dumps(result)}) else: JsonResponse({'success':'Error','message':result['error']}) return JsonResponse({'success':True,'message':'success'}) @@ -220,9 +323,11 @@ def UpdatePost(request): away_score = request.POST.get("awayScore") username = request.user.username data = {'event':eval(event),'call':call,'homeScore':home_score,'awayScore':away_score,'username':username} + print(data) + # result={} result = UpdatePotato(data) if(len(result) == 0) : - return JsonResponse({'success':'Update Done as ' + call}) + return JsonResponse({'success':event + " : " + call}) else: return JsonResponse({'success':'Error'}) @@ -246,6 +351,19 @@ def admin(request): return render(request, 'login.html') +def DeleteUser(request): + ''' + param : request + description : Delete user + ''' + + user_id = request.POST.get("user_id") + print("User Id " , user_id) + user = User.objects.get(id=user_id) + user.delete() + return JsonResponse({'success':'Success'}) + + def SaveApplicationFeatures(request): ''' param : request @@ -258,12 +376,12 @@ def SaveApplicationFeatures(request): try: value_sign = None value_user_limit = None - if req_signup is not '': + if req_signup != '': if(req_signup == 'true'):value_sign = True else:value_sign = False signup, created = ApplicationFeatures.objects.update_or_create(id=1, defaults={'signup':value_sign}) - if req_limit_users is not '': + if req_limit_users != '': if(req_limit_users == 'true'):value_user_limit = True else:value_user_limit = False limit_users, created = ApplicationFeatures.objects.update_or_create(id=1, defaults={'limit_user_signup':value_user_limit}) From ff265195760e59b1b91cd2d9c04b38179cfe9f7d Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Mon, 19 Apr 2021 13:49:30 +0530 Subject: [PATCH 13/42] Login form missing --- couchpotato/feed.py | 411 ++++++++++++++++++++++++++++++++++++++ couchpotato/home/forms.py | 45 +++++ 2 files changed, 456 insertions(+) create mode 100644 couchpotato/feed.py diff --git a/couchpotato/feed.py b/couchpotato/feed.py new file mode 100644 index 0000000..2c6c4ba --- /dev/null +++ b/couchpotato/feed.py @@ -0,0 +1,411 @@ +import yaml +from dateutil.parser import parse +import requests +from bos_incidents.datestring import date_to_string, string_to_date +from datetime import datetime, timezone +import json +# import pandas as pd +from cp_local import Cp, rpc, config, normalize, substitution +import _thread +import time + +# leagueIds = [4328, 4391, 4387, 4380, 4424, 4335, 4332, 4331] +leagueIds = [4328, 4391, 4387, 4380, 4335, 4332, 4331] +# 4380 : NHL # Ice Hockey +# 4424 : MLB # Baseball +# 4328 : EPL +# 4391 : NFL +# 4387 : NBA +# 4335 : LaLiga +# 4332 : Serie A +# 4562 : Friendly International : International Friendlies +# 4482 : FA Cup +# 4481 : UEFA Europa Lague +# 4480 : UEFA Champions League +# 4331 : Bundesliga + + +INCIDENT_CALLS = [ + "create", # 0 + "in_progress", # 1 + "finish", # 2 + "result", # 3 + "canceled", # 4 + "dynamic_bmgs", # 5 +] + +# https://www.thesportsdb.com/api/v1/json/1/eventspastleague.php?id=4391 +# apiBase = "https://www.thesportsdb.com/api/v1/json/1/" +apiBase = "https://www.thesportsdb.com/api/v1/json/" +apiBase = apiBase + str(config["token"][0]) + "/" +apiEventsNextLeague = "eventsnextleague.php?id=" +apiEventsPastLeague = "eventspastleague.php?id=" +apiTeamsFromLeagueId = "lookup_all_teams.php?id=" + +apiAllLeagues = "all_leagues.php" + + +class Feed: + + def __init__(self): + self.cp = Cp() + self.failedEvents = [] + self.constCheckPeriod = 60 * 60 * 24 # in seconds + self.maxOpenProposals = 1 + pass + + def Past15(self, leagueid): + url = apiBase + apiEventsPastLeague + str(leagueid) + schedule15 = requests.get(url) + schedule15 = schedule15.text + schedule15 = json.loads(schedule15) + events = schedule15["events"] + # return(schedule15) + # def CreateForApi(self, sport, eventGroup, home, away, startTime): + return events + + def Schedule15(self, leagueid): + url = apiBase + apiEventsNextLeague + str(leagueid) + schedule15 = requests.get(url) + self._schedule15 = schedule15 + schedule15 = schedule15.text + schedule15 = json.loads(schedule15) + events = schedule15["events"] + # return(schedule15) + # def CreateForApi(self, sport, eventGroup, home, away, startTime): + return events + + def Call(self, event, incident): + + startTime = string_to_date(incident["id"]["start_time"]) + now = datetime.now(timezone.utc) + self.now = now + self.startTime = startTime + + if (event["strPostponed"] == "yes") or ( + event["strStatus"] == "POST"): + incident["call"] = INCIDENT_CALLS[4] + # print("Postponed Event") + + elif ( + event["strStatus"] == "FT") or ( + event["strStatus"] == "Match Finished") or ( + event["strStatus"] == "AP") or ( + event["strStatus"] == "AOT") or ( + (now - startTime).days > 1): + incident["call"] = INCIDENT_CALLS[3] + incident["arguments"] = dict() + incident["arguments"]["home_score"] = event["intHomeScore"] + incident["arguments"]["away_score"] = event["intAwayScore"] + # print("Match Finished") + + elif ( + event["strStatus"] == "Not Started") or ( + event["strStatus"] == "NS"): + incident["call"] = INCIDENT_CALLS[0] + # print("Not started or NS") + + elif ( + startTime - now).days >= 1 and isinstance( + event["strStatus"], type(None)): + incident["call"] = INCIDENT_CALLS[0] + # print("None elif case and event created") + + elif (event["strStatus"] == "Second Half"): + incident["call"] = INCIDENT_CALLS[1] + # print('Second Half', "to in_progress", event["strFilename"]) + + else: + self.failedEvents.append(event) + print("Call Not Managed:") + return incident + + def ToCp(self, event): + sport = None + eventGroup = None + home = None + away = None + startTime = None + # strEvent = event["strEvent"] + # home, away = strEvent.split(" vs ") + sport = event["strSport"] + eventGroup = event["strLeague"] + home = event["strHomeTeam"] + away = event["strAwayTeam"] + dateEvent = event["dateEvent"] + strTime = event["strTime"] + # if len(strTime.split(":")[0]) == 1: + # strTime = "0" + strTime + startTime = dateEvent + "T" + strTime + "Z" + # print(startTime, type(startTime)) + startTime = date_to_string(parse(startTime)) + incident = self.CreateIncident( + sport, eventGroup, home, away, startTime) + + incident = self.Call(event, incident) + return incident + + def CreateIncident(self, sport, eventGroup, home, away, startTime): + incident = dict() + # incident["call"] = INCIDENT_CALLS[0] + + incident["id"] = dict() + incident["id"]["sport"] = sport + # eventGroupIdentifier = self.bookiesports[sport][ + # "eventgroups"][eventGroup]["identifier"] + # incident["id"]["event_group_name"] = eventGroupIdentifier + incident["id"]["event_group_name"] = eventGroup + # incident["id"]["event_group_name"] = self._eventGroup + # startTime = date_to_string(startTime) + incident["id"]["start_time"] = startTime + incident["arguments"] = {"whistle_start_time": startTime} + incident["id"]["home"] = home + incident["id"]["away"] = away + incident["timestamp"] = date_to_string(datetime.now(tz=timezone.utc)) + incident["arguments"]["season"] = "" + return incident + + def ForLeague(self, leagueId): + events = self.Schedule15(leagueId) + self.Push2Bos(events) + events = self.Past15(leagueId) + self.Push2Bos(events) + + def Push2Bos(self, events): + if isinstance(events, type(None)): + return + for k in range(len(events)): + while True: + proposalsOpen = rpc.get_proposed_transactions("1.2.1") + print("Len proposalsOpen: ", len(proposalsOpen)) + if len(proposalsOpen) <= self.maxOpenProposals: + break + else: + time.sleep(60) + event = events[k] + toCp = self.ToCp(event) + try: + self.cp.Push2bosAll(toCp) + except Exception as e: + # self.failedEvents.append(toCp) + self.failedEvents.append(event) + print("Failed Event: ", k, toCp) + print(e) + return + + def PushLeague(self, leagueid, call="create"): + if call == "create": + events = self.Schedule15(leagueid) + elif call == "result": + events = self.Past15(leagueid) + else: + print("Wrong call") + return + for k in range(len(events)): + event = events[k] + toCp = self.ToCp(event) + # print(k, "/", len(events), "-------event------: ", toCp) + print(k, "/", len(events)) + try: + self.cp.Push2bosAll(toCp) + except Exception as e: + print(e) + print("FAILED: ", event) + + def PushAll(self): + for leagueId in leagueIds: + self.ForLeague(leagueId) + # self.PushLeague(leagueId) + + def WhileForThread(self): + while self.flagWhileForThread == "run": + print('WhileForThreadStarted') + self.PushAll() + print('WhileForThreadOver') + time.sleep(self.constCheckPeriod) + print("WhileForThred EXITED") + + def Timed(self): + self.flagWhileForThread = "run" + _thread.start_new_thread(self.WhileForThread, ()) + + def EventsToDf(self, events): + pass + + def MatchingEvent(self, eventsFromFeed, eventFromChain): + for eventFromFeed in eventsFromFeed: + self._eventFromFeed = eventFromFeed + toCp = self.ToCp(eventFromFeed) + toCp = normalize(toCp) + if toCp["id"]["start_time"][:-1] == eventFromChain["start_time"]: + eventScheme = self.cp.EventScheme(toCp["id"]["sport"], toCp[ + "id"]["event_group_name"]) + home = toCp["id"]["home"] + away = toCp["id"]["away"] + homeAway = substitution([home, away], eventScheme) + if homeAway == eventFromChain["name"][0][1]: + return toCp + return None + + def MatchingEvents(self, leagueIds): + eventsFromFeed = [] + for leagueId in leagueIds: + # print(leagueId) + eventsFromFeed = eventsFromFeed + self.Past15(leagueId) + eventsFromChain = self.cp.EventsAllSortedForApi() + matchingEvents = [] + for k in range(len(eventsFromChain)): + # eventFromChain = eventsFromChain.iloc[k] + eventFromChain = eventsFromChain[k] + # for eventFromChain in eventsFromChain: + toCp = self.MatchingEvent(eventsFromFeed, eventFromChain) + # if not isinstance(toCp, type(None)): + matchingEvent = dict() + matchingEvent["eventFromChain"] = eventFromChain + matchingEvent["eventFromFeed"] = toCp + matchingEvents.append(matchingEvent) + return matchingEvents + + def MatchingEventsAll(self): + matchingEventsAll = self.MatchingEvents(leagueIds) + return matchingEventsAll + + +class Updater: + + def __init__(self): + self.cp = Cp() + self.delayMax = 3600 + self.delay = 60 + self.flagWhileForThread = "stop" + pass + + def Update(self): + eventsAllSorted = self.cp.EventsAllSorted() + self.eventsAllSorted = eventsAllSorted + for k in range(len(eventsAllSorted)): + event = eventsAllSorted.iloc[k] + self.event = event + print(k, "/", len(eventsAllSorted), event["start_time"]) + startTime = event["start_time"] + "Z" + startTime = string_to_date(startTime) + nowInUtc = datetime.now(startTime.tzinfo) + if startTime <= nowInUtc: + if event["status"] == "upcoming": + self.cp.UpdateForApi( + event, "in_progress") + else: + time2nextEvent = startTime - nowInUtc + time2nextEvent = time2nextEvent.total_seconds() + print("Wait Started at:", nowInUtc) + if time2nextEvent > self.delayMax: + time.sleep(self.delayMax) + else: + time.sleep(time2nextEvent) + break + + def WhileForUpdate(self): + while self.flagWhileForThread == "run": + self.Update() + print("WhileForUpdateThred EXITED") + + def UpdateInThread(self): + self.flagWhileForThread = "run" + _thread.start_new_thread(self.WhileForUpdate, ()) + + +class Compare: + + def __init__(self): + pass + + +class FeedDetails: + + def __init__(self): + pass + + def Leagues(self): + leagues = requests.get(apiBase + apiAllLeagues) + leagues = leagues.text + leagues = json.loads(leagues) + leagues = leagues["leagues"] + return leagues + + def FindLeague(self): + leagues = self.Leagues() + while True: + query = input("Enter Search String For Leagues: ") + for k in range(len(leagues)): + # print(k, "/", len(leagues)) + if query in str(leagues[k]): + print(leagues[k]) + + def TeamsFromLeagueId(self, leagueid): + url = apiBase + apiTeamsFromLeagueId + str(leagueid) + teams = requests.get(url) + teams = teams.text + teams = json.loads(teams) + teams = teams["teams"] + # teamsShort = [] + for k in range(len(teams)): + team = teams[k] + print( + team[ + "strTeam"], "|", team[ + "strTeamShort"], "|", team["strAlternate"]) + # teamShort = dict() + # teamShort["str"] + # team["strTeam"] = + return teams + + def TeamsToDict(self, teams): + participants = [] + for i in teams: + participant = dict() + strTeam = i["strTeam"] + strAlternate = i["strAlternate"] + strTeamShort = i["strTeamShort"] + if isinstance(strAlternate, type(None)): + strAlternate = strTeam + elif len(strAlternate) == 0: + strAlternate = strTeam + if isinstance(strTeamShort, type(None)): + strTeamShort = strTeam + elif len(strTeamShort) == 0: + strTeamShort = strTeam + participant["identifier"] = strTeam + participant["aliases"] = [] + participant["aliases"].append(strTeam) + strAlternates = strAlternate.split(", ") + for item in strAlternates: + participant["aliases"].append(item) + # participant["aliases"].append(strAlternate) + participant["aliases"].append(strTeamShort) + participant["name"] = dict() + participant["name"]["en"] = strTeam + participant["name"]["sen"] = strTeamShort + participants.append(participant) + return participants + + def TeamsToYaml(self, leagueId, filename): + teams = self.TeamsFromLeagueId(leagueId) + participants = self.TeamsToDict(teams) + toFile = dict() + toFile["participants"] = participants + with open(filename, "w") as f: + f.write(yaml.dump(toFile)) + return toFile + + +if __name__ == "__main__": + feed = Feed() + self = feed + feedDetails = FeedDetails() + updater = Updater() + # leagues = feedDetails.Leagues() + # leagues = leagues["leagues"] + # print(leagues) + + # self = feed + string_to_date() diff --git a/couchpotato/home/forms.py b/couchpotato/home/forms.py index 183c7fc..a1d4add 100644 --- a/couchpotato/home/forms.py +++ b/couchpotato/home/forms.py @@ -1,7 +1,52 @@ from django import forms from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User +from django.contrib.auth import login, authenticate +from django.contrib.auth.forms import AuthenticationForm + + +class LoginForm(AuthenticationForm): + def confirm_login_allowed(self, user): + if not user.is_active: + raise forms.ValidationError( + 'The user is awating admin approval', + code='inactive', + ) + elif self.user_cache is None: + raise forms.ValidationError( + self.error_messages['invalid_login'], + code='invalid_login', + params={'username': self.username_field.verbose_name}, + ) + def clean(self): + username = self.cleaned_data.get('username') + password = self.cleaned_data.get('password') + if username is None or username is '': + raise forms.ValidationError( + 'Username cannot be left blank', + code='invalid_login', + params={'username': self.username_field.verbose_name}, + ) + elif username is not None and password: + self.user_cache = authenticate(self.request, username=username, password=password) + print(self.user_cache) + if self.user_cache is None: + try: + user_temp = User.objects.get(username=username) + except: + user_temp = None + + if user_temp is not None: + self.confirm_login_allowed(user_temp) + else: + raise forms.ValidationError( + self.error_messages['invalid_login'], + code='invalid_login', + params={'username': self.username_field.verbose_name}, + ) + + return self.cleaned_data class SignUpForm(UserCreationForm): # first_name = forms.CharField(label='First Name') From fe8cda4a99175197fa13e6d6f203093637dd4a11 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Mon, 19 Apr 2021 14:05:51 +0530 Subject: [PATCH 14/42] urls fix --- couchpotato/home/templates/admin.html | 36 ++- couchpotato/home/templates/create.html | 3 +- couchpotato/home/templates/create_cp.html | 286 ++++++++++++++++++ couchpotato/home/templates/index.html | 4 +- couchpotato/home/templates/login.html | 14 +- couchpotato/home/templates/update_simple.html | 2 +- couchpotato/home/urls.py | 4 + couchpotato/home/utilities.py | 1 + feed/cp_local.py | 45 ++- 9 files changed, 374 insertions(+), 21 deletions(-) create mode 100644 couchpotato/home/templates/create_cp.html diff --git a/couchpotato/home/templates/admin.html b/couchpotato/home/templates/admin.html index 6963ccf..d259186 100644 --- a/couchpotato/home/templates/admin.html +++ b/couchpotato/home/templates/admin.html @@ -81,13 +81,14 @@

User Settings

Last Name Email Address Active + Delete {% for u in users %} - {{ u.username }} + {{ u.username }} {{ u.first_name}} {{u.last_name}} {{u.email}} @@ -102,6 +103,10 @@

User Settings

{%endif%} + + + + @@ -153,6 +158,33 @@

User Settings

}); + $(".btn").click(function() { + // alert((this).id) + console.log((this).id) + var r = confirm("Do you need to delete the user " + $(this).closest('tr').find('.name').text()); + if (r == true) { + + // $(this).closest('tr').remove() + var row = $(this).closest('tr') + + $.post("/delete_user", + { + user_id: (this).id, + csrfmiddlewaretoken: '{{ csrf_token }}' , + }, + function(data){ + // $(this).closest('tr').remove() + row.remove() + alert(data.success) + + }); + + + + } + + }); + $( "#autoSizingCheck" ).click(function() { console.log($('#autoSizingCheck').is(":checked")) @@ -209,7 +241,7 @@

User Settings

- } ); + } ); diff --git a/couchpotato/home/templates/create.html b/couchpotato/home/templates/create.html index 211c7e5..c93a134 100644 --- a/couchpotato/home/templates/create.html +++ b/couchpotato/home/templates/create.html @@ -30,7 +30,8 @@
-

+

+

Number of Open Proposals: {{ proposals.0 }} / {{ proposals.1 }}

diff --git a/couchpotato/home/templates/create_cp.html b/couchpotato/home/templates/create_cp.html new file mode 100644 index 0000000..1f5fbb0 --- /dev/null +++ b/couchpotato/home/templates/create_cp.html @@ -0,0 +1,286 @@ + + + + + + + + + + + + + + + + + Couch Potato + + + + + + {% include "navbar.html" %} + + + +
+ +

+ +

Number of Open Proposals: {{ proposals.0 }} / {{ proposals.1 }}

+ +
+ +

+ +
+ +
+

Select Sport

+ +
+
+ + +
+

Select League

+ +
+
+ +
+

Home

+ +
+
+ +
+

Away

+ +
+
+ + + +
+

Start Time

+ + + +
+ +
+ + + + +
+
+ +
+ + + + + +
+ + + + + + + + Return to Home + + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + diff --git a/couchpotato/home/templates/index.html b/couchpotato/home/templates/index.html index 4363ec4..ebf0fe1 100644 --- a/couchpotato/home/templates/index.html +++ b/couchpotato/home/templates/index.html @@ -30,8 +30,8 @@

-->
diff --git a/couchpotato/home/templates/login.html b/couchpotato/home/templates/login.html index e9e595f..c38e352 100644 --- a/couchpotato/home/templates/login.html +++ b/couchpotato/home/templates/login.html @@ -71,12 +71,16 @@
{% if messages %} -
    - {% for message in messages %} + + + + {% for message in messages %} + {{message}} + + {% endfor %} + -
  • {{ message }}
  • - {% endfor %} -
+ {% endif %} diff --git a/couchpotato/home/templates/update_simple.html b/couchpotato/home/templates/update_simple.html index 898dd84..e2a2921 100644 --- a/couchpotato/home/templates/update_simple.html +++ b/couchpotato/home/templates/update_simple.html @@ -53,7 +53,7 @@

-

Proposals : {{ proposals.0 }} / {{ proposals.1 }}

+

Number of Open Proposals: {{ proposals.0 }} / {{ proposals.1 }}

diff --git a/couchpotato/home/urls.py b/couchpotato/home/urls.py index 71319c3..989743b 100644 --- a/couchpotato/home/urls.py +++ b/couchpotato/home/urls.py @@ -12,9 +12,13 @@ urlpatterns = [ path('', views.Home, name='index'), path('create/', views.CreateList, name='create'), + path('select/', views.LoadSelectOptions, name='createselect'), path('u/', views.UpdateList, name='update_new'), + path('udebug/', views.UpdateListForDebug, name='udebug'), + path('usimple/', views.UpdateListSimple, name='udebug'), path('settingspanel/', views.admin, name='admin'), path('save_features', views.SaveApplicationFeatures, name='savefeatures'), + path('delete_user', views.DeleteUser, name='delete_user'), path('save_user_status', views.SaveUserStatus, name='savefeatures'), path('logout/', views.LogoutUser, name='logout'), path('login/', views.AuthenticateUser, name='login'), diff --git a/couchpotato/home/utilities.py b/couchpotato/home/utilities.py index 201698a..52ae7c5 100644 --- a/couchpotato/home/utilities.py +++ b/couchpotato/home/utilities.py @@ -1,5 +1,6 @@ from home.models import ApplicationFeatures +#limit_user_signup is the feature added to prevent the create account option in the software. def index_page_permitted(request): app_feature = ApplicationFeatures.objects.filter(id=1).first() diff --git a/feed/cp_local.py b/feed/cp_local.py index 53c9df0..e0d1db7 100644 --- a/feed/cp_local.py +++ b/feed/cp_local.py @@ -46,6 +46,8 @@ "dynamic_bmgs", ] +STATUSES = ["upcoming", "in_progress", "finished"] + # normalizer = IncidentsNormalizer(chain="elizabeth") normalizer = IncidentsNormalizer(chain=chainName) normalize = normalizer.normalize @@ -66,6 +68,7 @@ class Teams: class Cp(): def __init__(self): + self.maxOpenProposals = 2 self.delayBetweenBosPushes = 1 # in seconds self.bookiesports = BookieSports(chainName) pass @@ -101,7 +104,7 @@ def GetEventGroupsList(self, sport): def GetParticipants(self, sport, participantKey): participants = self.bookiesports[sport]["participants"][ - participantKey]["participants"] + participantKey]["participants"] particpantIdentifiers = [] participantDisplays = [] for participant in participants: @@ -121,9 +124,9 @@ def GetForCreate(self, sport=None, eventGroup=None): # self._eventGroupIdentifier = self.bookiesports[sport][ # "eventgroups"][eventGroup]["identifier"] self._participantKey = self.bookiesports[sport]["eventgroups"][ - eventGroup]["participants"] + eventGroup]["participants"] self._participants, participantDisplays = self.GetParticipants( - sport, self._participantKey) + sport, self._participantKey) return self._participants def CreateForApi(self, sport, eventGroup, home, away, startTime): @@ -133,7 +136,7 @@ def CreateForApi(self, sport, eventGroup, home, away, startTime): incident["id"] = dict() incident["id"]["sport"] = sport eventGroupIdentifier = self.bookiesports[sport][ - "eventgroups"][eventGroup]["identifier"] + "eventgroups"][eventGroup]["identifier"] incident["id"]["event_group_name"] = eventGroupIdentifier # incident["id"]["event_group_name"] = self._eventGroup startTime = date_to_string(startTime) @@ -158,7 +161,7 @@ def CreateForApiWithPotato( incident["id"] = dict() incident["id"]["sport"] = sport eventGroupIdentifier = self.bookiesports[sport][ - "eventgroups"][eventGroup]["identifier"] + "eventgroups"][eventGroup]["identifier"] incident["id"]["event_group_name"] = eventGroupIdentifier # incident["id"]["event_group_name"] = self._eventGroup startTime = date_to_string(startTime) @@ -184,13 +187,13 @@ def CliManufactureCreateIncident(self): print("Select Event Group") self._eventGroup = self.GetKey(self._eventGroupsList) self._eventGroupIdentifier = self.bookiesports[self._sport][ - "eventgroups"][self._eventGroup]["identifier"] + "eventgroups"][self._eventGroup]["identifier"] # self._eventGroupIdentifier = self.bookiesports[self._sport][ # "eventgroups"][self._eventGroup]["aliases"][0] self._participantKey = self.bookiesports[self._sport]["eventgroups"][ self._eventGroup]["participants"] self._participants, participantDisplays = self.GetParticipants( - self._sport, self._participantKey) + self._sport, self._participantKey) print("") print("Select Home Team") self._home = self.GetKeyParticipant( @@ -249,14 +252,22 @@ def EventsAllSortedForApi(self): eventsAllList = [] for k in range(len(eventsAll)): eventsAllList.append(dict(eventsAll.iloc[k])) + eventsAllList = self.EventsAllWithEventGroupName(eventsAllList) return eventsAllList def EventsAllWithEventGroupName(self, eventsAll): - # resEvents = [] for event in eventsAll: event_group_id = event["event_group_id"] - event["event_group_name"] = rpc.get_object( - event_group_id)["name"][1][1] + # event["event_group_name"] = rpc.get_object( + # event_group_id)["name"][1][1] + eventGroup = rpc.get_object(event_group_id) + + event["event_group_name"] = dict(eventGroup["name"])["identifier"] + # event["event_group_name"] = eventGroup["name"][1][1] + sport = rpc.get_object(eventGroup["sport_id"]) + sport = dict(sport["name"])["identifier"] + event["sport"] = sport + # sport = normalizer._get_sport_identifier(sport, True) return eventsAll def Event2Update(self): @@ -656,6 +667,15 @@ def Push2bosMethod(self, incident, providerName): self._incident = incident logger.info(str(incident)) + while True: + proposalsOpen = rpc.get_proposed_transactions("1.2.1") + print("Len proposalsOpen: ", + len(proposalsOpen), " / ", self.maxOpenProposals) + if len(proposalsOpen) <= self.maxOpenProposals: + break + else: + time.sleep(60) + # r = requests.post(url=bos["local"], json=incident) rng = np.random.default_rng() lBosApis = len(bosApis) @@ -675,6 +695,11 @@ def Push2bosMethod(self, incident, providerName): print("thread finished") return + def OpenProposalsCount(self): + openProposalsCount = len(rpc.get_proposed_transactions("1.2.1")) + return openProposalsCount, self.maxOpenProposals + + def Push2bosBetter(self, incident, providerNames): string = incident_to_string(incident) self._string = string From 33a92cbe40ee9500f65c226f3fd92f12f3637d2d Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Tue, 20 Apr 2021 16:54:55 +0530 Subject: [PATCH 15/42] History API --- feed/cp_local.py | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/feed/cp_local.py b/feed/cp_local.py index e0d1db7..22417ab 100644 --- a/feed/cp_local.py +++ b/feed/cp_local.py @@ -1,3 +1,5 @@ +from bos_incidents import factory, exceptions + import _thread import time import numpy as np @@ -52,6 +54,9 @@ normalizer = IncidentsNormalizer(chain=chainName) normalize = normalizer.normalize +# Incident Storage +storage = factory.get_incident_storage() + def substitution(teams, scheme): class Teams: @@ -692,6 +697,16 @@ def Push2bosMethod(self, incident, providerName): print(e) logger.warning(api + ": failed") time.sleep(self.delayBetweenBosPushes) + try: + # FIXME, remove copy() + storage.insert_incident(incident.copy()) + except exceptions.DuplicateIncidentException as e: + print(e) + # We merely pass here since we have the incident already + # alerting anyone won't do anything + # traceback.print_exc() + pass + print("thread finished") return @@ -699,6 +714,15 @@ def OpenProposalsCount(self): openProposalsCount = len(rpc.get_proposed_transactions("1.2.1")) return openProposalsCount, self.maxOpenProposals + def History(self, providerName): + collection = storage._get_collection(collection_name="incident") + historyGen = collection.find({"provider_info.name": { + "$eq": providerName}}) + + history = [] + for doc in historyGen: + history.append(doc) + return history def Push2bosBetter(self, incident, providerNames): string = incident_to_string(incident) From e217d11fad6db3a1dfcfe85edc6273d75d010ab5 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Wed, 21 Apr 2021 04:48:12 +0530 Subject: [PATCH 16/42] History of events, frontend --- couchpotato/couchpotato/settings.py | 2 +- couchpotato/game/views.py | 3 + couchpotato/home/templates/history.html | 230 ++++++++++++++++++++++++ couchpotato/home/templates/index.html | 1 + couchpotato/home/urls.py | 1 + couchpotato/home/views.py | 25 ++- 6 files changed, 260 insertions(+), 2 deletions(-) create mode 100644 couchpotato/home/templates/history.html diff --git a/couchpotato/couchpotato/settings.py b/couchpotato/couchpotato/settings.py index 6ce311d..cdef0d8 100644 --- a/couchpotato/couchpotato/settings.py +++ b/couchpotato/couchpotato/settings.py @@ -23,7 +23,7 @@ SECRET_KEY = '!fwkygc(zdgod8v934b9q(grdp7#(kd1vav4h)sdi6y_6p!oq6' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = False +DEBUG = True ALLOWED_HOSTS = ['*'] diff --git a/couchpotato/game/views.py b/couchpotato/game/views.py index 3938ea8..dbdb1b2 100644 --- a/couchpotato/game/views.py +++ b/couchpotato/game/views.py @@ -17,6 +17,9 @@ def GetOpenProposalsCount(): openproposals , maxproposals = cp.OpenProposalsCount() return [openproposals ,maxproposals ] +def GetHistory(providername): + return cp.History(providername) + def GetEvents(params={}): rDict = dict() sport = None diff --git a/couchpotato/home/templates/history.html b/couchpotato/home/templates/history.html new file mode 100644 index 0000000..d95807e --- /dev/null +++ b/couchpotato/home/templates/history.html @@ -0,0 +1,230 @@ + + + + + Couch Potato + + + + + + + + + + + + + + {% include "navbar.html" %} + +
+
+ +

+

Number of Open Proposals: {{ proposals.0 }} / {{ proposals.1 }}

+ + + + +
+ + + + + + + + + + + + + + + + + + + + {% for a in data.items %} + + + + + + + + + + + + + + + + + + + + + + + + {% endfor %} + + + +
Start TimeSportEvent Group NameHomeAwayHome ScoreAway ScoreTimestampUnique StringId stringName
+ {{ a.1.id.start_time }} + + {{ a.1.id.sport }} + + {{ a.1.id.event_group_name }} + + {{ a.1.id.home }} + + {{ a.1.id.away }} + + {{ a.1.arguments.home_score }} + + {{ a.1.arguments.away_score }} + + {{ a.1.timestamp }} + + {{ a.1.unique_string }} + + {{ a.1.id_string }} + + {{ a.1.provider_info.name }} +
+ + + + + Return to Home + +
+ + +
+
+ + + + + + + + + + + + + + + + + + diff --git a/couchpotato/home/templates/index.html b/couchpotato/home/templates/index.html index ebf0fe1..a774141 100644 --- a/couchpotato/home/templates/index.html +++ b/couchpotato/home/templates/index.html @@ -32,6 +32,7 @@

diff --git a/couchpotato/home/urls.py b/couchpotato/home/urls.py index 989743b..dd8a13a 100644 --- a/couchpotato/home/urls.py +++ b/couchpotato/home/urls.py @@ -16,6 +16,7 @@ path('u/', views.UpdateList, name='update_new'), path('udebug/', views.UpdateListForDebug, name='udebug'), path('usimple/', views.UpdateListSimple, name='udebug'), + path('history/', views.History, name='history'), path('settingspanel/', views.admin, name='admin'), path('save_features', views.SaveApplicationFeatures, name='savefeatures'), path('delete_user', views.DeleteUser, name='delete_user'), diff --git a/couchpotato/home/views.py b/couchpotato/home/views.py index 388645c..ddef629 100644 --- a/couchpotato/home/views.py +++ b/couchpotato/home/views.py @@ -11,7 +11,7 @@ from django.contrib.auth.models import User from home.models import ApplicationFeatures from django.contrib.auth import logout -from game.views import GetEvents , CreatePotato , UpdatePotato , GetMatchingEvents , GetOpenProposalsCount +from game.views import GetEvents , CreatePotato , UpdatePotato , GetMatchingEvents , GetOpenProposalsCount, GetHistory from django.contrib.auth.decorators import login_required from django.core import serializers from home.utilities import index_page_permitted , register_login_page_permitted , allow_login , allow_register @@ -159,6 +159,29 @@ def UpdateListSimple(request): return render(request, '404.html') + +def History(request): + ''' + param : request + description : To load update page + ''' + # try: + if index_page_permitted(request): + print(request.user.username) + # events = getstaticEvents() + events = GetHistory(request.user.username) + # print(events) + proposal_value = GetOpenProposalsCount() + list_values = {} + if events is not None: + list_values = dict(enumerate(events , start=1)) + return render(request, 'history.html',{"data": list_values,'proposals' : proposal_value}) + else: + return render(request, 'login.html') + # except: + # return render(request, '404.html') + + def Home(request): ''' param : request From 458b828e65126074f60ce2b6497af80fa805f0ee Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Thu, 22 Apr 2021 15:05:34 +0530 Subject: [PATCH 17/42] TLS --- couchpotato/couchpotato/settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/couchpotato/couchpotato/settings.py b/couchpotato/couchpotato/settings.py index cdef0d8..e0f257f 100644 --- a/couchpotato/couchpotato/settings.py +++ b/couchpotato/couchpotato/settings.py @@ -39,8 +39,9 @@ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', - 'drf_yasg', - 'rest_framework', + 'drf_yasg', + 'rest_framework', + 'sslserver', #'rest_framework_swagger', ] From e87afcceee03bc21f731cae75db0c2101e359519 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Thu, 22 Apr 2021 15:58:16 +0530 Subject: [PATCH 18/42] Documentation minimal and requirements.txt changes --- README.md | 11 +++++++++++ requirements.txt | 1 + 2 files changed, 12 insertions(+) diff --git a/README.md b/README.md index 2b1b2f4..a809700 100644 --- a/README.md +++ b/README.md @@ -41,4 +41,15 @@ openAPI 2.0 documentation is available at /swagger and /redoc ## Uninsallation Delete the python-cp-gui folder +## TLS +To run development cerver with TLS +python3 manage.py runsslserver 0.0.0.0:9020 + +To generate self signed certificates +sudo openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout tls.key -out tls.crt + +To run with certificates +python3 manage.py runsslserver 0.0.0.0:9020 --certificate tls.crt --key tls.key + + diff --git a/requirements.txt b/requirements.txt index deee423..ffe6c8e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +django-sslserver bookiesports bos-mint bos-incidents From d700d56f930b44c434c831e087b0d26bb75b2c6b Mon Sep 17 00:00:00 2001 From: Roshan Syed Date: Fri, 23 Apr 2021 18:35:08 -0300 Subject: [PATCH 19/42] version bump --- __version__ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/__version__ b/__version__ index 0ea3a94..0d91a54 100644 --- a/__version__ +++ b/__version__ @@ -1 +1 @@ -0.2.0 +0.3.0 From f573c4b8a4bd6ed48dcf8cd75b63645e53d07fdf Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Mon, 26 Apr 2021 16:38:41 +0530 Subject: [PATCH 20/42] minor --- couchpotato/cp_local.py | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/couchpotato/cp_local.py b/couchpotato/cp_local.py index 09cf5be..22417ab 100644 --- a/couchpotato/cp_local.py +++ b/couchpotato/cp_local.py @@ -1,3 +1,5 @@ +from bos_incidents import factory, exceptions + import _thread import time import numpy as np @@ -52,6 +54,9 @@ normalizer = IncidentsNormalizer(chain=chainName) normalize = normalizer.normalize +# Incident Storage +storage = factory.get_incident_storage() + def substitution(teams, scheme): class Teams: @@ -692,13 +697,32 @@ def Push2bosMethod(self, incident, providerName): print(e) logger.warning(api + ": failed") time.sleep(self.delayBetweenBosPushes) + try: + # FIXME, remove copy() + storage.insert_incident(incident.copy()) + except exceptions.DuplicateIncidentException as e: + print(e) + # We merely pass here since we have the incident already + # alerting anyone won't do anything + # traceback.print_exc() + pass + print("thread finished") return def OpenProposalsCount(self): - openProposalsCount = rpc.get_proposed_transactions("1.2.1") + openProposalsCount = len(rpc.get_proposed_transactions("1.2.1")) return openProposalsCount, self.maxOpenProposals + def History(self, providerName): + collection = storage._get_collection(collection_name="incident") + historyGen = collection.find({"provider_info.name": { + "$eq": providerName}}) + + history = [] + for doc in historyGen: + history.append(doc) + return history def Push2bosBetter(self, incident, providerNames): string = incident_to_string(incident) From 473a3f00728a6285cacf58f3da75d8363ab0e70c Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Fri, 7 May 2021 16:53:03 +0530 Subject: [PATCH 21/42] Calendar view of events along with change in the main landing page --- .gitignore | 1 + couchpotato/calender/__init__.py | 0 couchpotato/calender/admin.py | 3 + couchpotato/calender/apps.py | 5 + couchpotato/calender/migrations/__init__.py | 0 couchpotato/calender/models.py | 3 + couchpotato/calender/templates/calender.html | 246 + couchpotato/calender/tests.py | 3 + couchpotato/calender/urls.py | 16 + couchpotato/calender/views.py | 18 + couchpotato/couchpotato/settings.py | 2 + couchpotato/couchpotato/urls.py | 3 + couchpotato/home/templates/admin.html | 5 +- couchpotato/home/templates/index.html | 40 +- couchpotato/home/templates/navbar.html | 6 +- .../home/templates/update_match_events.html | 452 - couchpotato/home/urls.py | 2 + couchpotato/home/views.py | 10 + couchpotato/static/calender/css/main.css | 1429 ++ couchpotato/static/calender/css/main.min.css | 1 + couchpotato/static/calender/css/styles.css | 1313 ++ couchpotato/static/calender/js/main.js | 14352 ++++++++++++++++ couchpotato/static/calender/js/main.min.js | 6 + .../static/calender/js/theme-chooser.js | 141 + 24 files changed, 17597 insertions(+), 460 deletions(-) create mode 100644 couchpotato/calender/__init__.py create mode 100644 couchpotato/calender/admin.py create mode 100644 couchpotato/calender/apps.py create mode 100644 couchpotato/calender/migrations/__init__.py create mode 100644 couchpotato/calender/models.py create mode 100644 couchpotato/calender/templates/calender.html create mode 100644 couchpotato/calender/tests.py create mode 100644 couchpotato/calender/urls.py create mode 100644 couchpotato/calender/views.py delete mode 100644 couchpotato/home/templates/update_match_events.html create mode 100644 couchpotato/static/calender/css/main.css create mode 100644 couchpotato/static/calender/css/main.min.css create mode 100644 couchpotato/static/calender/css/styles.css create mode 100644 couchpotato/static/calender/js/main.js create mode 100644 couchpotato/static/calender/js/main.min.js create mode 100644 couchpotato/static/calender/js/theme-chooser.js diff --git a/.gitignore b/.gitignore index 620be43..d9cd019 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.git env dump config-bos-mint.yaml diff --git a/couchpotato/calender/__init__.py b/couchpotato/calender/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/couchpotato/calender/admin.py b/couchpotato/calender/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/couchpotato/calender/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/couchpotato/calender/apps.py b/couchpotato/calender/apps.py new file mode 100644 index 0000000..811332c --- /dev/null +++ b/couchpotato/calender/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class CalenderConfig(AppConfig): + name = 'calender' diff --git a/couchpotato/calender/migrations/__init__.py b/couchpotato/calender/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/couchpotato/calender/models.py b/couchpotato/calender/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/couchpotato/calender/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/couchpotato/calender/templates/calender.html b/couchpotato/calender/templates/calender.html new file mode 100644 index 0000000..7d8aade --- /dev/null +++ b/couchpotato/calender/templates/calender.html @@ -0,0 +1,246 @@ +{% load static %} + + + + + + + + + + + + + + + + + + + + + + + + + + + {% include "navbar.html" %} + + +
+ +
loading...
+
+ + + + +
+ + + + + + diff --git a/couchpotato/calender/tests.py b/couchpotato/calender/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/couchpotato/calender/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/couchpotato/calender/urls.py b/couchpotato/calender/urls.py new file mode 100644 index 0000000..272ca0b --- /dev/null +++ b/couchpotato/calender/urls.py @@ -0,0 +1,16 @@ + +from django.urls import path ,re_path +from . import views +from django.conf.urls.static import static +from django.contrib.staticfiles.urls import staticfiles_urlpatterns +from django.views.static import serve +from django.urls import path, include + + +urlpatterns = [ + + path('',views.index,name= 'calender.html'), + +] + +urlpatterns += staticfiles_urlpatterns() \ No newline at end of file diff --git a/couchpotato/calender/views.py b/couchpotato/calender/views.py new file mode 100644 index 0000000..1bbf249 --- /dev/null +++ b/couchpotato/calender/views.py @@ -0,0 +1,18 @@ +from django.shortcuts import render + +# Create your views here. +from home.utilities import index_page_permitted + + +def index(request): + + # render function takes argument - request + # and return HTML as response + try: + if index_page_permitted(request): + return render(request, "calender.html") + else: + return render(request, 'login.html') + except: + return render(request, '404.html') + \ No newline at end of file diff --git a/couchpotato/couchpotato/settings.py b/couchpotato/couchpotato/settings.py index e0f257f..2991591 100644 --- a/couchpotato/couchpotato/settings.py +++ b/couchpotato/couchpotato/settings.py @@ -33,6 +33,7 @@ INSTALLED_APPS = [ 'home', 'game', + 'calender', 'django.contrib.admin', 'django.contrib.auth', 'django.contrib.contenttypes', @@ -42,6 +43,7 @@ 'drf_yasg', 'rest_framework', 'sslserver', + #'rest_framework_swagger', ] diff --git a/couchpotato/couchpotato/urls.py b/couchpotato/couchpotato/urls.py index d61d32e..ccc13be 100644 --- a/couchpotato/couchpotato/urls.py +++ b/couchpotato/couchpotato/urls.py @@ -44,7 +44,10 @@ urlpatterns = [ path('', include('home.urls')), path('openapi/' , include('game.urls')), + path('calendar/', include('calender.urls')), path('admin/', admin.site.urls), + + re_path(r'^swagger(?P\.json|\.yaml)$', schema_view.without_ui(cache_timeout=0), name='schema-json'), path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'), path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema-redoc'), diff --git a/couchpotato/home/templates/admin.html b/couchpotato/home/templates/admin.html index d259186..8cae738 100644 --- a/couchpotato/home/templates/admin.html +++ b/couchpotato/home/templates/admin.html @@ -19,7 +19,7 @@
-

Application Settings

+

Application Settings


+ @@ -29,11 +40,30 @@

- + +
+
+
+ CREATE +
+
+ UPDATE +
+
+ +
+
+ HISTORY +
+
+ CALENDAR +
+
+
+ +
+ +
diff --git a/couchpotato/home/templates/navbar.html b/couchpotato/home/templates/navbar.html index d42b253..de04818 100644 --- a/couchpotato/home/templates/navbar.html +++ b/couchpotato/home/templates/navbar.html @@ -4,9 +4,13 @@ .rounded-circle{ width: 40px; } + body{background-color: beige;} + nav{ + background-color: beige !important; + } -
- - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/couchpotato/home/templates/login.html b/couchpotato/home/templates/login.html index c38e352..572f187 100644 --- a/couchpotato/home/templates/login.html +++ b/couchpotato/home/templates/login.html @@ -18,12 +18,7 @@ - - - + @@ -52,8 +47,7 @@
- -
+
@@ -70,9 +64,7 @@
- {% if messages %} - - + {% if messages %} {% for message in messages %} {{message}} @@ -80,8 +72,7 @@ {% endfor %} - - {% endif %} + {% endif %} @@ -97,20 +88,7 @@
- +
@@ -122,29 +100,14 @@

...or login with:

- - + - + diff --git a/couchpotato/home/templates/navbar.html b/couchpotato/home/templates/navbar.html index de04818..7d35aa5 100644 --- a/couchpotato/home/templates/navbar.html +++ b/couchpotato/home/templates/navbar.html @@ -37,10 +37,7 @@ - - + - + diff --git a/couchpotato/home/templates/test.html b/couchpotato/home/templates/test.html deleted file mode 100644 index 72470c2..0000000 --- a/couchpotato/home/templates/test.html +++ /dev/null @@ -1,182 +0,0 @@ - - - - - - Block Chain - - - - - - - - - - - - - - - - - - - - - - - - - - {% include "navbar.html" %} - -
-
- - - - - - - - - - - - - - - - - - - - - - - {% for a , b in data.items %} - - - - - - - - - - - - - - - - - - - {% endfor %} - - -
IdNameSeasonStart TimeEvent Group IDScoresStatusIn ProgressFinishResultCancelledEvent
{{b.id}} - {% for i in b.name %} - {{i.1}} - {%endfor%} - - {% for i in b.season %} - {{i.1}} - {%endfor%} - {{b.start_time}}{{b.event_group_id}}{{b.scores}}{{b.status}} - - - - - - - - - - {{b}} -
-
-
- - - \ No newline at end of file diff --git a/couchpotato/home/templates/update.html b/couchpotato/home/templates/update.html deleted file mode 100644 index 0550243..0000000 --- a/couchpotato/home/templates/update.html +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {% for a , b in data.items %} - - - - - - - - - - - - - - - - - {% endfor %} - - - - - - - - - - - - - - - - - -
IdNameSeasonStart TimeEvent Group IDScoresStatusIn ProgressFinishResultCancelled
{{b.id}} - {% for i in b.name %} - {{i.1}} - {%endfor%} - - {% for i in b.season %} - {{i.1}} - {%endfor%} - {{b.start_time}}{{b.event_group_id}}{{b.scores}}{{b.status}} - - - - - - - -
IdNameSeasonStart TimeEvent Group IDScoresStatusIn ProgressFinishResultCancelled
- - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/couchpotato/home/templates/update_cp.html b/couchpotato/home/templates/update_cp.html deleted file mode 100644 index c8afa18..0000000 --- a/couchpotato/home/templates/update_cp.html +++ /dev/null @@ -1,400 +0,0 @@ - - - - - Couch Potato - - - - - - - - - - - - - - {% include "navbar.html" %} - -
- - - - - - - - - - - - - - - - - - diff --git a/couchpotato/home/templates/update_debug.html b/couchpotato/home/templates/update_debug.html deleted file mode 100644 index 1b8bf08..0000000 --- a/couchpotato/home/templates/update_debug.html +++ /dev/null @@ -1,459 +0,0 @@ - - - - - Couch Potato - - - - - - - - - - - - - - {% include "navbar.html" %} - -
-
- -

-

Proposals : {{ proposals.0 }} / {{ proposals.1 }}

- - - - -
- - - - - - - - - - - - - - - - - - {% for a , b in data.items %} - - - - - - - - - - - - - - - - - - - - {% endfor %} - - - -
Event on ChainEventUpdate from FeedFeedScoresCallStart Time in Local Time
- {{b.eventFromChain}} - -
    -
  • - {{b.eventFromChain.name.0.1}} -
  • -
  • - {{b.eventFromChain.start_time}} -
  • -
  • - {{b.eventFromChain.scores}} -
  • -
  • - {{b.eventFromChain.status}} -
  • -
  • - {{b.eventFromChain.event_group_name}} -
  • -
  • - {{b.eventFromChain.sport}} -
  • -
- - -
- {{b.eventFromFeed}} - - {% if b.eventFromFeed is not none%} -
    -
  • - {{b.eventFromFeed.id.sport}} -
  • -
  • - {{b.eventFromFeed.id.event_group_name}} -
  • -
  • - {{b.eventFromFeed.id.start_time}} -
  • -
  • - {{b.eventFromFeed.id.home}} -
  • -
  • - {{b.eventFromFeed.id.away}} -
  • -
  • - {{b.eventFromFeed.arguments.home_score}} -
  • -
  • - {{b.eventFromFeed.arguments.away_score}} -
  • -
  • - {{b.eventFromFeed.call}} -
  • -
- {% endif %} -
- Home Score : -

- Away Score : -
-

- -

- -

- - -
- - - - - Return to Home - -
- - -
-
- - - - - - - - - - - - - - - - - - diff --git a/couchpotato/home/tests.py b/couchpotato/home/tests.py deleted file mode 100644 index 3d796b2..0000000 --- a/couchpotato/home/tests.py +++ /dev/null @@ -1,13 +0,0 @@ -from django.test import TestCase - -# Create your tests here. -import json -from django.shortcuts import render - - -def Test(request): - # events = requests.get('http://s3.jemshid.com:8001/sports/api/game/?filter=events') - # list_values = dict(enumerate(eval(events.text) , start=1)) - f = open('home/events.json',) - data = json.load(f) - return render(request, 'test.html',{"data": data}) \ No newline at end of file diff --git a/couchpotato/home/urls.py b/couchpotato/home/urls.py index 4c2f6b6..91999bc 100644 --- a/couchpotato/home/urls.py +++ b/couchpotato/home/urls.py @@ -7,16 +7,11 @@ from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns -from home.tests import Test from django.views.static import serve urlpatterns = [ path('', views.Home, name='index'), - path('create/', views.CreateList, name='create'), path('select/', views.LoadSelectOptions, name='createselect'), - url(r'^events/$', views.GetEventsForCalender, name='events'), - path('u/', views.UpdateList, name='update_new'), - path('udebug/', views.UpdateListForDebug, name='udebug'), path('usimple/', views.UpdateListSimple, name='udebug'), path('history/', views.History, name='history'), path('settingspanel/', views.admin, name='admin'), @@ -29,9 +24,7 @@ path('post_create', views.CreatePost, name='post_create'), path('post_update', views.UpdatePost, name='post_update'), path('accounts/logout/', views.LogoutSwagger, name='swagger_logout') , - - - # path('t/', Test, name='test'), + url(r'^events/$', views.GetEventsForCalender, name='events'), re_path(r'^static/(?P.*)$', serve,{'document_root': settings.STATIC_ROOT}), diff --git a/couchpotato/home/utilities.py b/couchpotato/home/utilities.py index 52ae7c5..dea3f45 100644 --- a/couchpotato/home/utilities.py +++ b/couchpotato/home/utilities.py @@ -1,24 +1,57 @@ from home.models import ApplicationFeatures -#limit_user_signup is the feature added to prevent the create account option in the software. def index_page_permitted(request): + ''' + Description : + + limit_user_signup is the feature added to prevent the create account option in the software. + + if + user feature is present , + then it looks for authentication + and if logged in then load the index page + else if + signup feature is not at all + present then load the index page + ''' app_feature = ApplicationFeatures.objects.filter(id=1).first() allowed = request.user.is_authenticated or (app_feature.signup is False) return allowed def register_login_page_permitted(): + ''' + Description : + + if + user feature is present , + then it looks for authentication + and if logged in then load the index page + + ''' app_feature = ApplicationFeatures.objects.filter(id=1).first() allowed = app_feature.signup return allowed def allow_login(request, user): + ''' + Description : + + check if the app allows login feature from index pafe. This is provided by admin + + + ''' app_feature = ApplicationFeatures.objects.filter(id=1).first() allowed = (app_feature.signup is True and user.is_active) or (app_feature.signup is False and user.is_superuser) - # print("in allow login" , allowed) return allowed def allow_register(): + ''' + Description : + + check if the app allows register feature from index pafe. This is provided by admin + + ''' app_feature = ApplicationFeatures.objects.filter(id=1).first() allowed = (app_feature.signup is True and app_feature.limit_user_signup is False) return allowed \ No newline at end of file diff --git a/couchpotato/home/views.py b/couchpotato/home/views.py index 68edb65..c4c4f30 100644 --- a/couchpotato/home/views.py +++ b/couchpotato/home/views.py @@ -28,7 +28,6 @@ def AuthenticateUser(request): if request.method == 'POST': form = LoginForm(request=request, data=request.POST) - if form.is_valid(): username = form.cleaned_data.get('username').strip() password = form.cleaned_data.get('password') @@ -36,7 +35,7 @@ def AuthenticateUser(request): if user is not None: login(request, user) return redirect('/') - + else: print("Invalid") for key , value in form.errors.items(): @@ -71,8 +70,7 @@ def SignUp(request): description : Loads the registration page and does the sign up. New user is set inactive intially before admin approval. ''' - # print("In sign up ") - # try: + if allow_register(): if request.method == 'POST': form = SignUpForm(request.POST) @@ -87,8 +85,6 @@ def SignUp(request): else: return render(request, '403.html') - # except: - # return render(request, '404.html') def UpdateList(request): @@ -117,34 +113,17 @@ def getstaticEvents(): def GetEventsForCalender(request): - # events = getstaticEvents() + ''' + param : request + description : To load events in a calender + ''' events = GetMatchingEvents() events_to_display = [] for e in events: events_to_display.append({'title':e['eventFromChain']['name'][0][1],'start':e['eventFromChain']['start_time'],'description':json.dumps(e['eventFromChain'])}) - # print(events_to_display) return JsonResponse(events_to_display , safe = False) -def UpdateListForDebug(request): - ''' - param : request - description : To load update page - ''' - try: - if index_page_permitted(request): - params = {'filter':'events'} - # events = getstaticEvents() - events = GetMatchingEvents() - proposal_value = GetOpenProposalsCount() - list_values = {} - if events is not None: - list_values = dict(enumerate(events , start=1)) - return render(request, 'update_debug.html',{"data": list_values,'proposals' : proposal_value}) - else: - return render(request, 'login.html') - except: - return render(request, '404.html') @@ -155,8 +134,6 @@ def UpdateListSimple(request): ''' try: if index_page_permitted(request): - params = {'filter':'events'} - # events = getstaticEvents() proposal_value = GetOpenProposalsCount() events = GetMatchingEvents() list_values = {} @@ -175,12 +152,10 @@ def History(request): param : request description : To load update page ''' - # try: + if index_page_permitted(request): print(request.user.username) - # events = getstaticEvents() events = GetHistory(request.user.username) - # print(events) proposal_value = GetOpenProposalsCount() list_values = {} if events is not None: @@ -188,8 +163,6 @@ def History(request): return render(request, 'history.html',{"data": list_values,'proposals' : proposal_value}) else: return render(request, 'login.html') - # except: - # return render(request, '404.html') def Home(request): @@ -198,54 +171,11 @@ def Home(request): description : To load home page ''' - # try: if index_page_permitted(request): return render(request, 'index.html') elif register_login_page_permitted(): return render(request, 'login.html') - # except: - # return render(request, '404.html') - -def CreateList(request,num=1): - ''' - param-1 : request - param-2 : num , represents which question to load. - description : To load list of options during create of a page - ''' - - if index_page_permitted(request): - list_values = {} - start_val = 1 - heading = '' - is_last = False - proposal_value = GetOpenProposalsCount() - # print("Proposal value " ,proposal_value) - if num == 1: - games = GetEvents() - list_values = dict(enumerate(games , start=start_val)) - heading = "Select Games" - if num == 2: - params = {'sport':request.session['sport'].strip()} - sport = GetEvents(params) - heading = "Select Event Groups" - list_values = dict(enumerate(sport , start=start_val)) - if num == 3: - params = {"sport":request.session['sport'].strip(),"eventGroup":request.session['eventGroup'].strip()} - teams = GetEvents(params) - heading = "Home" - list_values = dict(enumerate(teams , start=start_val)) - if num == 4: - params ={"sport":request.session['sport'].strip(),"eventGroup":request.session['eventGroup'].strip()} - teams = GetEvents(params) - heading = "Away" - list_values = dict(enumerate(teams , start=start_val)) - if num == 5: - heading = "Time" - is_last = True - return render(request, 'create.html', {"list" : list_values , 'heading' : heading , "islast":is_last,'question_id':num,'proposals' : proposal_value}) - - elif register_login_page_permitted(): - return render(request, 'login.html') + @@ -258,7 +188,8 @@ def LoadSelectOptions(request): num = request.POST.get("num") if num == None: - num = 1 # Fisrt page loading the num is set as 1 + # Fisrt page loading the num is set as 1 + num = 1 else: num = int(num) @@ -274,10 +205,8 @@ def LoadSelectOptions(request): list_values = dict(enumerate(games , start=start_val)) heading = "Select Games" return render(request, 'create_cp.html', {"list" : list_values , 'heading' : heading , "islast":is_last,'question_id':num , 'proposals' : proposal_value}) - # return render(request, 'create_cp.html', {"list" : list_values , 'heading' : heading , "islast":is_last,'question_id':num }) if num == 2: request.session['sport'] = request.POST.get("sport").strip() - params = {'sport':request.session['sport']} sport = GetEvents(params) heading = "Select Event Groups" @@ -286,7 +215,6 @@ def LoadSelectOptions(request): if num == 3: request.session['sport'] = request.POST.get("sport").strip() request.session['eventGroup'] = request.POST.get('eventGroup').strip() - params = {"sport":request.POST.get("sport").strip(),"eventGroup":request.POST.get('eventGroup').strip()} teams = GetEvents(params) heading = "Home" @@ -296,7 +224,6 @@ def LoadSelectOptions(request): request.session['sport'] = request.POST.get("sport").strip() request.session['eventGroup'] = request.POST.get('eventGroup').strip() request.session['home'] = request.POST.get('home').strip() - params ={"sport":request.POST.get("sport").strip(),"eventGroup":request.POST.get('eventGroup').strip()} teams = GetEvents(params) heading = "Away" @@ -356,8 +283,6 @@ def UpdatePost(request): away_score = request.POST.get("awayScore") username = request.user.username data = {'event':eval(event),'call':call,'homeScore':home_score,'awayScore':away_score,'username':username} - print(data) - # result={} result = UpdatePotato(data) if(len(result) == 0) : return JsonResponse({'success':event + " : " + call}) diff --git a/couchpotato/uwsgi.ini b/couchpotato/uwsgi.ini deleted file mode 100644 index ef5c165..0000000 --- a/couchpotato/uwsgi.ini +++ /dev/null @@ -1,9 +0,0 @@ -[uwsgi] -module = couchpotato.wsgi:application -master = true -callable = application -processes = 5 -socket = /tmp/cp.sock -chmod-socket = 666 -vacuum = true -die-on-term = true \ No newline at end of file From a6bb819c14a8053dac657dcb3e173629ecf24f65 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Thu, 20 May 2021 12:06:49 +0530 Subject: [PATCH 28/42] Witness based filtering of CP users --- couchpotato/config-bos-mint.yaml | 79 ++++++++++++++++++++++++++++++++ couchpotato/cp_local.py | 14 +++--- couchpotato/home/views.py | 21 ++++----- 3 files changed, 97 insertions(+), 17 deletions(-) create mode 100755 couchpotato/config-bos-mint.yaml diff --git a/couchpotato/config-bos-mint.yaml b/couchpotato/config-bos-mint.yaml new file mode 100755 index 0000000..bee0199 --- /dev/null +++ b/couchpotato/config-bos-mint.yaml @@ -0,0 +1,79 @@ +debug: FALSE +project_name: PYTHON COUCH POTATO +project_sub_name: The Python Couch Potato project +secret_key: THINK CLOCK SMOG FLAG SMACK TINKER FLUNK # enter any random string +advanced_features: True + +sql_database: "sqlite:///{cwd}/bookied-local.db" + +connection: + use: hercules # enter your desired chain + + hercules: + node: + - wss://hercules.peerplays.download/api + nobroadcast: False + num_retries: 1 + + elizabeth: + node: + - https://elizabeth.peerplays.download/api + nobroadcast: False + num_retries: 1 + + + alice: + node: + - wss://node.peerblock.trade:8090 + - wss://ppyapi.spacemx.tech + - wss://api-ppy.blckchnd.com + - wss://pma.blockveritas.co/ws + - wss://ppyws.roelandp.nl/ws + - wss://api.eifos.org + - wss://peerplaysblockchain.net/mainnet/api + - wss://api.ppy.alex-pu.info + - wss://api.ppy.blockoperations.com + nobroadcast: False + num_retries: 1 + + beatrice: + node: + - wss://pta.blockveritas.co/ws + - wss://peerplaysblockchain.net/testnet/api + - wss://api-ppy-beatrice.blckchnd.com + - wss://api-beatrice01.eifos.org + - wss://api-testnet.ppy.alex-pu.info + - wss://node.testnet.peerblock.trade + - wss://testnet-ppyapi.spacemx.tech + nobroadcast: False + num_retries: 1 + +allowed_assets: + - BTFUN + - PPY + - TEST + - BTF + +potatoNames: + - cpx + - cpy + +bosApis: + - http://hercules.peerplays.download:8010/trigger: + - cpi + - cp2 + - http://1.hercules.peerplays.download:8010/trigger: + - cp2 + - j + - http://2.hercules.peerplays.download:8010/trigger: + - cp3 + - http://3.hercules.peerplays.download:8010/trigger: + - cp4 + +token: + - 4013017 + +token_telegram: '1788336903:AAE_y0beDflEG00-UVABjt4kOH2_XdU3GcI' + +telegram_chat_ids: + - "990772424" diff --git a/couchpotato/cp_local.py b/couchpotato/cp_local.py index 22417ab..e5501b5 100644 --- a/couchpotato/cp_local.py +++ b/couchpotato/cp_local.py @@ -1,5 +1,5 @@ -from bos_incidents import factory, exceptions +from bos_incidents import factory, exceptions import _thread import time import numpy as np @@ -14,14 +14,12 @@ import yaml import logging - with open("config-bos-mint.yaml", "r") as f: config = yaml.safe_load(f) chainName = config["connection"]["use"] bosApis = config["bosApis"] potatoNames = config["potatoNames"] - # Create and configure logger # logging.basicConfig(filename="za.log", # format='%(asctime)s %(message)s', @@ -38,7 +36,6 @@ ppy = node.get_node() rpc = ppy.rpc - INCIDENT_CALLS = [ "create", "in_progress", @@ -689,10 +686,15 @@ def Push2bosMethod(self, incident, providerName): for k in ks: # for api in bosApis: print("inthread:", k) - api = bosApis[k] + api = list(bosApis[k].keys())[0] + acceptedProviderNames = list(bosApis[k].values())[0] # print(api) try: - requests.post(url=api, json=incident) + if providerName in acceptedProviderNames: + print("providername in acepted list:", providerName) + requests.post(url=api, json=incident) + else: + print("providername NOT in acepted list:", providerName) except Exception as e: print(e) logger.warning(api + ": failed") diff --git a/couchpotato/home/views.py b/couchpotato/home/views.py index c4c4f30..4061344 100644 --- a/couchpotato/home/views.py +++ b/couchpotato/home/views.py @@ -1,17 +1,18 @@ # Create your views here. -from django.http import Http404 , JsonResponse , HttpResponseRedirect ,HttpResponse -from django.shortcuts import render +# from django.http import Http404, HttpResponse +from django.http import JsonResponse, HttpResponseRedirect import json -import requests -import pytz, datetime +# import requests +# import pytz, datetime from django.contrib.auth import login, authenticate +# from django.shortucts import render from django.shortcuts import render, redirect -from home.forms import SignUpForm ,LoginForm +from home.forms import SignUpForm, LoginForm from django.contrib.auth.models import User -from home.models import ApplicationFeatures +from home.models import ApplicationFeatures from django.contrib.auth import logout -from game.views import GetEvents , CreatePotato , UpdatePotato , GetMatchingEvents , GetOpenProposalsCount, GetHistory +from game.views import GetEvents, CreatePotato, UpdatePotato, GetMatchingEvents, GetOpenProposalsCount, GetHistory from django.contrib.auth.decorators import login_required from django.core import serializers from home.utilities import index_page_permitted , register_login_page_permitted , allow_login , allow_register @@ -19,7 +20,6 @@ from django.contrib.auth.forms import AuthenticationForm - def AuthenticateUser(request): ''' param: request @@ -109,8 +109,8 @@ def UpdateList(request): def getstaticEvents(): newDict = [{'eventFromChain': {'id': '1.22.602', 'name': [['en', 'Lazio v Crotone']], 'season': [['en', '']], 'start_time': '2021-03-12T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.534', 'name': [['en', 'Augsburg v Mönchengladbach']], 'season': [['en', '']], 'start_time': '2021-03-12T19:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.533', 'name': [['en', 'Augsburg v Mönchengladbach']], 'season': [['en', '']], 'start_time': '2021-03-12T19:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'finished', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.604', 'name': [['en', 'Atalanta v Spezia']], 'season': [['en', '']], 'start_time': '2021-03-12T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.603', 'name': [['en', 'Atalanta v Spezia']], 'season': [['en', '']], 'start_time': '2021-03-12T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'finished', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.490', 'name': [['en', 'Levante v Valencia']], 'season': [['en', '']], 'start_time': '2021-03-12T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.766', 'name': [['en', 'Vegas Golden Knights @ St. Louis Blues']], 'season': [['en', '']], 'start_time': '2021-03-13T01:00:00', 'event_group_id': '1.21.0', 'scores': [], 'status': 'finished', 'event_group_name': 'NHL Regular Season', 'sport': 'Ice Hockey'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.645', 'name': [['en', 'Denver Nuggets @ Memphis Grizzlies']], 'season': [['en', '']], 'start_time': '2021-03-13T01:00:00', 'event_group_id': '1.21.5', 'scores': [], 'status': 'finished', 'event_group_name': 'NBA Regular Season', 'sport': 'Basketball'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.646', 'name': [['en', 'Cleveland Cavaliers @ New Orleans Pelicans']], 'season': [['en', '']], 'start_time': '2021-03-13T01:00:00', 'event_group_id': '1.21.5', 'scores': [], 'status': 'finished', 'event_group_name': 'NBA Regular Season', 'sport': 'Basketball'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.763', 'name': [['en', 'Philadelphia 76ers @ Washington Wizards']], 'season': [['en', '']], 'start_time': '2021-03-13T01:00:00', 'event_group_id': '1.21.5', 'scores': [], 'status': 'finished', 'event_group_name': 'NBA Regular Season', 'sport': 'Basketball'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.767', 'name': [['en', 'Los Angeles Kings @ Colorado Avalanche']], 'season': [['en', '']], 'start_time': '2021-03-13T02:00:00', 'event_group_id': '1.21.0', 'scores': [], 'status': 'finished', 'event_group_name': 'NHL Regular Season', 'sport': 'Ice Hockey'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.764', 'name': [['en', 'Miami Heat @ Chicago Bulls']], 'season': [['en', '']], 'start_time': '2021-03-13T02:00:00', 'event_group_id': '1.21.5', 'scores': [], 'status': 'finished', 'event_group_name': 'NBA Regular Season', 'sport': 'Basketball'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.768', 'name': [['en', 'Ottawa Senators @ Edmonton Oilers']], 'season': [['en', '']], 'start_time': '2021-03-13T02:00:00', 'event_group_id': '1.21.0', 'scores': [], 'status': 'finished', 'event_group_name': 'NHL Regular Season', 'sport': 'Ice Hockey'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.769', 'name': [['en', 'San Jose Sharks @ Anaheim Ducks']], 'season': [['en', '']], 'start_time': '2021-03-13T03:00:00', 'event_group_id': '1.21.0', 'scores': [], 'status': 'finished', 'event_group_name': 'NHL Regular Season', 'sport': 'Ice Hockey'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.491', 'name': [['en', 'Alaves v Cadiz']], 'season': [['en', '']], 'start_time': '2021-03-13T13:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.634', 'name': [['en', 'Sassuolo v Verona']], 'season': [['en', '']], 'start_time': '2021-03-13T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.653', 'name': [['en', 'Werder Bremen v Bayern Munich']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'finished', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-13T14:30:00Z', 'home': 'Werder Bremen', 'away': 'Bayern Munich'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:55.104013Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.540', 'name': [['en', 'Union Berlin v FC Koln']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-13T14:30:00Z', 'home': 'Union Berlin', 'away': 'FC Koln'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:55.188676Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.539', 'name': [['en', 'Union Berlin v FC Koln']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'finished', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-13T14:30:00Z', 'home': 'Union Berlin', 'away': 'FC Koln'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:55.270535Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.537', 'name': [['en', 'Wolfsburg v Schalke 04']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'finished', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.538', 'name': [['en', 'Wolfsburg v Schalke 04']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.541', 'name': [['en', 'Mainz v Freiburg']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-13T14:30:00Z', 'home': 'Mainz', 'away': 'Freiburg'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:55.493435Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.542', 'name': [['en', 'Mainz v Freiburg']], 'season': [['en', '']], 'start_time': '2021-03-13T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-13T14:30:00Z', 'home': 'Mainz', 'away': 'Freiburg'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:55.575429Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.652', 'name': [['en', 'Real Madrid v Elche']], 'season': [['en', '']], 'start_time': '2021-03-13T15:15:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.606', 'name': [['en', 'Benevento v Fiorentina']], 'season': [['en', '']], 'start_time': '2021-03-13T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.605', 'name': [['en', 'Benevento v Fiorentina']], 'season': [['en', '']], 'start_time': '2021-03-13T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.535', 'name': [['en', 'Dortmund v Hertha']], 'season': [['en', '']], 'start_time': '2021-03-13T17:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'finished', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.536', 'name': [['en', 'Dortmund v Hertha']], 'season': [['en', '']], 'start_time': '2021-03-13T17:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.494', 'name': [['en', 'Osasuna v Valladolid']], 'season': [['en', '']], 'start_time': '2021-03-13T17:30:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.607', 'name': [['en', 'Genoa v Udinese']], 'season': [['en', '']], 'start_time': '2021-03-13T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'finished', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.608', 'name': [['en', 'Genoa v Udinese']], 'season': [['en', '']], 'start_time': '2021-03-13T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.493', 'name': [['en', 'Getafe v Ath Madrid']], 'season': [['en', '']], 'start_time': '2021-03-13T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.492', 'name': [['en', 'Getafe v Ath Madrid']], 'season': [['en', '']], 'start_time': '2021-03-13T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'finished', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.727', 'name': [['en', 'Bologna v Sampdoria']], 'season': [['en', '']], 'start_time': '2021-03-14T11:30:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T11:30:00Z', 'home': 'Bologna', 'away': 'Sampdoria'}, 'arguments': {'home_score': '3', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:56.397061Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.726', 'name': [['en', 'Bologna v Sampdoria']], 'season': [['en', '']], 'start_time': '2021-03-14T11:30:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T11:30:00Z', 'home': 'Bologna', 'away': 'Sampdoria'}, 'arguments': {'home_score': '3', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:56.460689Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.687', 'name': [['en', 'Southampton v Brighton']], 'season': [['en', '']], 'start_time': '2021-03-14T12:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'finished', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-14T12:00:00Z', 'home': 'Southampton', 'away': 'Brighton'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:56.464189Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.688', 'name': [['en', 'Southampton v Brighton']], 'season': [['en', '']], 'start_time': '2021-03-14T12:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'upcoming', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-14T12:00:00Z', 'home': 'Southampton', 'away': 'Brighton'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:56.467013Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.673', 'name': [['en', 'Leverkusen v Bielefeld']], 'season': [['en', '']], 'start_time': '2021-03-14T12:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T12:30:00Z', 'home': 'Leverkusen', 'away': 'Bielefeld'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:56.540579Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.672', 'name': [['en', 'Leverkusen v Bielefeld']], 'season': [['en', '']], 'start_time': '2021-03-14T12:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T12:30:00Z', 'home': 'Leverkusen', 'away': 'Bielefeld'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:56.61041Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.660', 'name': [['en', 'Celta Vigo v Ath Bilbao']], 'season': [['en', '']], 'start_time': '2021-03-14T13:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.684', 'name': [['en', 'Leicester v Sheffield United']], 'season': [['en', '']], 'start_time': '2021-03-14T14:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-14T14:00:00Z', 'home': 'Leicester', 'away': 'Sheffield United'}, 'arguments': {'home_score': '5', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:56.692313Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.725', 'name': [['en', 'Parma Calcio 1913 v Roma']], 'season': [['en', '']], 'start_time': '2021-03-14T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T14:00:00Z', 'home': 'Parma Calcio 1913', 'away': 'Roma'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:56.757793Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.724', 'name': [['en', 'Torino v Inter']], 'season': [['en', '']], 'start_time': '2021-03-14T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.723', 'name': [['en', 'Torino v Inter']], 'season': [['en', '']], 'start_time': '2021-03-14T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.671', 'name': [['en', 'RasenBallsport Leipzig v Ein Frankfurt']], 'season': [['en', '']], 'start_time': '2021-03-14T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T14:30:00Z', 'home': 'RasenBallsport Leipzig', 'away': 'Ein Frankfurt'}, 'arguments': {'home_score': '1', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:56.97345Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.670', 'name': [['en', 'RasenBallsport Leipzig v Ein Frankfurt']], 'season': [['en', '']], 'start_time': '2021-03-14T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T14:30:00Z', 'home': 'RasenBallsport Leipzig', 'away': 'Ein Frankfurt'}, 'arguments': {'home_score': '1', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:57.060972Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.664', 'name': [['en', 'Granada v Sociedad']], 'season': [['en', '']], 'start_time': '2021-03-14T15:15:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T15:15:00Z', 'home': 'Granada', 'away': 'Sociedad'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.114467Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.663', 'name': [['en', 'Granada v Sociedad']], 'season': [['en', '']], 'start_time': '2021-03-14T15:15:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T15:15:00Z', 'home': 'Granada', 'away': 'Sociedad'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.164568Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.681', 'name': [['en', 'Arsenal v Tottenham']], 'season': [['en', '']], 'start_time': '2021-03-14T16:30:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-14T16:30:00Z', 'home': 'Arsenal', 'away': 'Tottenham'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:57.169648Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.682', 'name': [['en', 'Arsenal v Tottenham']], 'season': [['en', '']], 'start_time': '2021-03-14T16:30:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'upcoming', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-14T16:30:00Z', 'home': 'Arsenal', 'away': 'Tottenham'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:57.17497Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.667', 'name': [['en', 'Cagliari v Juventus']], 'season': [['en', '']], 'start_time': '2021-03-14T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T17:00:00Z', 'home': 'Cagliari', 'away': 'Juventus'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:57.251487Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.668', 'name': [['en', 'Cagliari v Juventus']], 'season': [['en', '']], 'start_time': '2021-03-14T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T17:00:00Z', 'home': 'Cagliari', 'away': 'Juventus'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:57.32255Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.734', 'name': [['en', 'Stuttgart v Hoffenheim']], 'season': [['en', '']], 'start_time': '2021-03-14T17:00:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T17:00:00Z', 'home': 'Stuttgart', 'away': 'Hoffenheim'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.401101Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.735', 'name': [['en', 'Stuttgart v Hoffenheim']], 'season': [['en', '']], 'start_time': '2021-03-14T17:00:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-14T17:00:00Z', 'home': 'Stuttgart', 'away': 'Hoffenheim'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.474476Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.661', 'name': [['en', 'Eibar v Villarreal']], 'season': [['en', '']], 'start_time': '2021-03-14T17:30:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T17:30:00Z', 'home': 'Eibar', 'away': 'Villarreal'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:57.523987Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.662', 'name': [['en', 'Eibar v Villarreal']], 'season': [['en', '']], 'start_time': '2021-03-14T17:30:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T17:30:00Z', 'home': 'Eibar', 'away': 'Villarreal'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:57.583102Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.669', 'name': [['en', 'Milan v Napoli']], 'season': [['en', '']], 'start_time': '2021-03-14T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-14T19:45:00Z', 'home': 'Milan', 'away': 'Napoli'}, 'arguments': {'home_score': '0', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:57.653676Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.666', 'name': [['en', 'Sevilla v Betis']], 'season': [['en', '']], 'start_time': '2021-03-14T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T20:00:00Z', 'home': 'Sevilla', 'away': 'Betis'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.702612Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.665', 'name': [['en', 'Sevilla v Betis']], 'season': [['en', '']], 'start_time': '2021-03-14T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-14T20:00:00Z', 'home': 'Sevilla', 'away': 'Betis'}, 'arguments': {'home_score': '1', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.750823Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.715', 'name': [['en', 'Barcelona v Huesca']], 'season': [['en', '']], 'start_time': '2021-03-15T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-15T20:00:00Z', 'home': 'Barcelona', 'away': 'Huesca'}, 'arguments': {'home_score': '4', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:57.796495Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.728', 'name': [['en', 'Torino v Sassuolo']], 'season': [['en', '']], 'start_time': '2021-03-17T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-17T14:00:00Z', 'home': 'Torino', 'away': 'Sassuolo'}, 'arguments': {'home_score': '3', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:57.860354Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.729', 'name': [['en', 'Torino v Sassuolo']], 'season': [['en', '']], 'start_time': '2021-03-17T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-17T14:00:00Z', 'home': 'Torino', 'away': 'Sassuolo'}, 'arguments': {'home_score': '3', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:57.925802Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.716', 'name': [['en', 'Sevilla v Elche']], 'season': [['en', '']], 'start_time': '2021-03-17T18:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-17T18:00:00Z', 'home': 'Sevilla', 'away': 'Elche'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:57.970711Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.717', 'name': [['en', 'Sevilla v Elche']], 'season': [['en', '']], 'start_time': '2021-03-17T18:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-17T18:00:00Z', 'home': 'Sevilla', 'away': 'Elche'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:58.027846Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.674', 'name': [['en', 'Bielefeld v RasenBallsport Leipzig']], 'season': [['en', '']], 'start_time': '2021-03-19T19:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-19T19:30:00Z', 'home': 'Bielefeld', 'away': 'RasenBallsport Leipzig'}, 'arguments': {'home_score': '0', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:58.149687Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.675', 'name': [['en', 'Bielefeld v RasenBallsport Leipzig']], 'season': [['en', '']], 'start_time': '2021-03-19T19:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-19T19:30:00Z', 'home': 'Bielefeld', 'away': 'RasenBallsport Leipzig'}, 'arguments': {'home_score': '0', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:58.235135Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.730', 'name': [['en', 'Parma Calcio 1913 v Genoa']], 'season': [['en', '']], 'start_time': '2021-03-19T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-19T19:45:00Z', 'home': 'Parma Calcio 1913', 'away': 'Genoa'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.298623Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.718', 'name': [['en', 'Betis v Levante']], 'season': [['en', '']], 'start_time': '2021-03-19T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-19T20:00:00Z', 'home': 'Betis', 'away': 'Levante'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:58.344717Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.719', 'name': [['en', 'Betis v Levante']], 'season': [['en', '']], 'start_time': '2021-03-19T20:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-19T20:00:00Z', 'home': 'Betis', 'away': 'Levante'}, 'arguments': {'home_score': '2', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:58.403064Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.692', 'name': [['en', 'Fulham v Leeds']], 'season': [['en', '']], 'start_time': '2021-03-19T20:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'upcoming', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-19T20:00:00Z', 'home': 'Fulham', 'away': 'Leeds'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.405637Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.691', 'name': [['en', 'Fulham v Leeds']], 'season': [['en', '']], 'start_time': '2021-03-19T20:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-19T20:00:00Z', 'home': 'Fulham', 'away': 'Leeds'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.409635Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.720', 'name': [['en', 'Ath Bilbao v Eibar']], 'season': [['en', '']], 'start_time': '2021-03-20T13:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-20T13:00:00Z', 'home': 'Ath Bilbao', 'away': 'Eibar'}, 'arguments': {'home_score': '1', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:58.460529Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.721', 'name': [['en', 'Ath Bilbao v Eibar']], 'season': [['en', '']], 'start_time': '2021-03-20T13:00:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-20T13:00:00Z', 'home': 'Ath Bilbao', 'away': 'Eibar'}, 'arguments': {'home_score': '1', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:58.507307Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.731', 'name': [['en', 'Crotone v Bologna']], 'season': [['en', '']], 'start_time': '2021-03-20T14:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-20T14:00:00Z', 'home': 'Crotone', 'away': 'Bologna'}, 'arguments': {'home_score': '2', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:58.566822Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.762', 'name': [['en', 'Werder Bremen v Wolfsburg']], 'season': [['en', '']], 'start_time': '2021-03-20T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T14:30:00Z', 'home': 'Werder Bremen', 'away': 'Wolfsburg'}, 'arguments': {'home_score': '1', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.630686Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.678', 'name': [['en', 'Ein Frankfurt v Union Berlin']], 'season': [['en', '']], 'start_time': '2021-03-20T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T14:30:00Z', 'home': 'Ein Frankfurt', 'away': 'Union Berlin'}, 'arguments': {'home_score': '5', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.768115Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.677', 'name': [['en', 'Bayern Munich v Stuttgart']], 'season': [['en', '']], 'start_time': '2021-03-20T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T14:30:00Z', 'home': 'Bayern Munich', 'away': 'Stuttgart'}, 'arguments': {'home_score': '4', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:58.84996Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.738', 'name': [['en', 'FC Koln v Dortmund']], 'season': [['en', '']], 'start_time': '2021-03-20T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T14:30:00Z', 'home': 'FC Koln', 'away': 'Dortmund'}, 'arguments': {'home_score': '2', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:58.917591Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.676', 'name': [['en', 'Bayern Munich v Stuttgart']], 'season': [['en', '']], 'start_time': '2021-03-20T14:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T14:30:00Z', 'home': 'Bayern Munich', 'away': 'Stuttgart'}, 'arguments': {'home_score': '4', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:58.986362Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.758', 'name': [['en', 'Celta Vigo v Real Madrid']], 'season': [['en', '']], 'start_time': '2021-03-20T15:15:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-20T15:15:00Z', 'home': 'Celta Vigo', 'away': 'Real Madrid'}, 'arguments': {'home_score': '1', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:59.029494Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.733', 'name': [['en', 'Spezia v Cagliari']], 'season': [['en', '']], 'start_time': '2021-03-20T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'upcoming', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-20T17:00:00Z', 'home': 'Spezia', 'away': 'Cagliari'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:59.088149Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.732', 'name': [['en', 'Spezia v Cagliari']], 'season': [['en', '']], 'start_time': '2021-03-20T17:00:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-20T17:00:00Z', 'home': 'Spezia', 'away': 'Cagliari'}, 'arguments': {'home_score': '2', 'away_score': '1'}, 'timestamp': '2021-03-29T06:47:59.143532Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.759', 'name': [['en', 'Huesca v Osasuna']], 'season': [['en', '']], 'start_time': '2021-03-20T17:30:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'in_progress', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-20T17:30:00Z', 'home': 'Huesca', 'away': 'Osasuna'}, 'arguments': {'home_score': '0', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:59.185056Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.760', 'name': [['en', 'Huesca v Osasuna']], 'season': [['en', '']], 'start_time': '2021-03-20T17:30:00', 'event_group_id': '1.21.9', 'scores': [], 'status': 'upcoming', 'event_group_name': 'LaLiga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'LaLiga', 'start_time': '2021-03-20T17:30:00Z', 'home': 'Huesca', 'away': 'Osasuna'}, 'arguments': {'home_score': '0', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:59.226237Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.736', 'name': [['en', 'Schalke 04 v Mönchengladbach']], 'season': [['en', '']], 'start_time': '2021-03-20T17:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'in_progress', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T17:30:00Z', 'home': 'Schalke 04', 'away': 'Mönchengladbach'}, 'arguments': {'home_score': '0', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:59.293945Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.737', 'name': [['en', 'Schalke 04 v Mönchengladbach']], 'season': [['en', '']], 'start_time': '2021-03-20T17:30:00', 'event_group_id': '1.21.23', 'scores': [], 'status': 'upcoming', 'event_group_name': 'Bundesliga', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'Bundesliga', 'start_time': '2021-03-20T17:30:00Z', 'home': 'Schalke 04', 'away': 'Mönchengladbach'}, 'arguments': {'home_score': '0', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:59.364111Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.761', 'name': [['en', 'Inter v Sassuolo']], 'season': [['en', '']], 'start_time': '2021-03-20T19:45:00', 'event_group_id': '1.21.14', 'scores': [], 'status': 'in_progress', 'event_group_name': 'SerieA', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'SerieA', 'start_time': '2021-03-20T19:45:00Z', 'home': 'Inter', 'away': 'Sassuolo'}, 'arguments': {'whistle_start_time': '2021-03-20T19:45:00Z', 'season': ''}, 'timestamp': '2021-03-29T06:47:59.419867Z', 'call': 'canceled'}}, {'eventFromChain': {'id': '1.22.693', 'name': [['en', 'Brighton v Newcastle']], 'season': [['en', '']], 'start_time': '2021-03-20T20:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-20T20:00:00Z', 'home': 'Brighton', 'away': 'Newcastle'}, 'arguments': {'home_score': '3', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:59.42212Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.694', 'name': [['en', 'Brighton v Newcastle']], 'season': [['en', '']], 'start_time': '2021-03-20T20:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'upcoming', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-20T20:00:00Z', 'home': 'Brighton', 'away': 'Newcastle'}, 'arguments': {'home_score': '3', 'away_score': '0'}, 'timestamp': '2021-03-29T06:47:59.423875Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.747', 'name': [['en', 'West Ham v Arsenal']], 'season': [['en', '']], 'start_time': '2021-03-21T15:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'upcoming', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-21T15:00:00Z', 'home': 'West Ham', 'away': 'Arsenal'}, 'arguments': {'home_score': '3', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:59.4243Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.746', 'name': [['en', 'West Ham v Arsenal']], 'season': [['en', '']], 'start_time': '2021-03-21T15:00:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-21T15:00:00Z', 'home': 'West Ham', 'away': 'Arsenal'}, 'arguments': {'home_score': '3', 'away_score': '3'}, 'timestamp': '2021-03-29T06:47:59.424729Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.745', 'name': [['en', 'Aston Villa v Tottenham']], 'season': [['en', '']], 'start_time': '2021-03-21T19:30:00', 'event_group_id': '1.21.8', 'scores': [], 'status': 'in_progress', 'event_group_name': 'EPL', 'sport': 'Soccer'}, 'eventFromFeed': {'id': {'sport': 'Soccer', 'event_group_name': 'EPL', 'start_time': '2021-03-21T19:30:00Z', 'home': 'Aston Villa', 'away': 'Tottenham'}, 'arguments': {'home_score': '0', 'away_score': '2'}, 'timestamp': '2021-03-29T06:47:59.425529Z', 'call': 'result'}}, {'eventFromChain': {'id': '1.22.772', 'name': [['en', 'Utah Jazz @ Golden State Warriors']], 'season': [['en', '']], 'start_time': '2021-03-23T10:30:00', 'event_group_id': '1.21.5', 'scores': [], 'status': 'in_progress', 'event_group_name': 'NBA Regular Season', 'sport': 'Basketball'}, 'eventFromFeed': None}, {'eventFromChain': {'id': '1.22.773', 'name': [['en', 'Denver Broncos @ Cincinnati Bengals']], 'season': [['en', '']], 'start_time': '2021-03-23T16:30:00', 'event_group_id': '1.21.16', 'scores': [], 'status': 'in_progress', 'event_group_name': 'NFL Regular Season', 'sport': 'AmericanFootball'}, 'eventFromFeed': None}] + ''' ## Dummy line for VIM Python IDE syntax highlighting fix required due to above long line''' return newDict - def GetEventsForCalender(request): ''' @@ -126,7 +126,6 @@ def GetEventsForCalender(request): - def UpdateListSimple(request): ''' param : request @@ -261,7 +260,7 @@ def CreatePost(request): request.session['startTime'] = option_text data = {"sport":request.session['sport'].strip() ,"eventGroup":request.session['eventGroup'].strip(),"home":request.session['home'].strip(),"away":request.session['away'].strip(),"startTime":request.session['startTime'].strip(),\ "username":username} - print("Data " , data) + # print("Data " , data) result = CreatePotato(data) if(len(result) > 0 and 'error' not in result): return JsonResponse({'success':'Posted' , 'message':json.dumps(result)}) From b317397003799bd9dac32ca7101fd9926d7ee534 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Tue, 25 May 2021 15:56:16 +0530 Subject: [PATCH 29/42] UI fixes --- couchpotato/calender/templates/calender.html | 2 +- couchpotato/home/templates/create_cp.html | 125 ++++++++++-------- couchpotato/home/templates/history.html | 1 + couchpotato/home/templates/update_simple.html | 47 +++++-- 4 files changed, 109 insertions(+), 66 deletions(-) diff --git a/couchpotato/calender/templates/calender.html b/couchpotato/calender/templates/calender.html index 4a2a403..43c3aea 100644 --- a/couchpotato/calender/templates/calender.html +++ b/couchpotato/calender/templates/calender.html @@ -42,7 +42,7 @@ // initialDate: '2020-09-12', weekNumbers: true, navLinks: true, // can click day/week names to navigate views - editable: true, + // editable: true, selectable: true, nowIndicator: true, dayMaxEvents: true, // allow "more" link when too many events diff --git a/couchpotato/home/templates/create_cp.html b/couchpotato/home/templates/create_cp.html index 1b5871e..7350169 100644 --- a/couchpotato/home/templates/create_cp.html +++ b/couchpotato/home/templates/create_cp.html @@ -17,11 +17,14 @@ Couch Potato @@ -46,7 +49,7 @@

Select Sport

- +
-

Home

+

Home Team


-

Away

+

Away Team


@@ -96,6 +99,12 @@

Start Time

+ +
+
+ +
+

@@ -173,17 +182,14 @@

Start Time

new_next_select_id = id + 1 if (id == 1 || id == 2){ - $('#3').html('') - $('#4').html('') + $('#3').html('') + $('#4').html('') } sport = $('.games').find("option:selected").text() groups = $('.groups').find("option:selected").text() home = $('.home').find("option:selected").text() away = $('.away').find("option:selected").text() - // console.log(sport) - // console.log(groups) - // console.log(home) - // console.log(away) + @@ -198,13 +204,11 @@

Start Time

}, function(data, status){ - // console.log(data) - var obj = data.list - $('#'+new_next_select_id).html('') + var obj = data.list + $('#'+new_next_select_id).html('') if (data.list[1] != 'status'){ Object.keys(obj).forEach(function(key) { - // console.log(key, obj[key]); - + $('#'+new_next_select_id).append("") }); } @@ -214,7 +218,44 @@

Start Time

}); - + function validate(){ + + var sport = $('.games').find("option:selected").val() + var groups = $('.groups').find("option:selected").val() + var home = $('.home').find("option:selected").val() + var away = $('.away').find("option:selected").val() + var date_val = $('#datetimepicker1 input').val() + + + if(parseInt(sport) === 999){ + $('#error_msg').html('Please select a sport') + return false + } + else if(parseInt(groups) === 999){ + $('#error_msg').html('Please select a league') + return false + } + else if(parseInt(home) === 999){ + $('#error_msg').html('Please select a home team') + return false + } + else if(parseInt(away) === 999){ + $('#error_msg').html('Please select a away team') + return false + } + else if(typeof date_val === 'undefined' || date_val === ""){ + $('#error_msg').html('Please select a date time') + return false + } + else{ + $('#error_msg').html('') + return true + } + + + + + } $("#create_submit").click(function(){ @@ -222,11 +263,13 @@

Start Time

var selectedtext = $("form input[type='radio']:checked").next('label:first').html() var next_num = parseInt($("form").attr("id")) + 1 + var date_val = $('#datetimepicker1 input').val() var d = new Date(date_val) question_id = 5 - - if (typeof date_val !== 'undefined' & date_val !== ""){ + + if (validate()){ + $.post("/post_create", { id: question_id, @@ -240,46 +283,14 @@

Start Time

window.location.href = '/' } - // console.log(data.message) - // console.log(data.message.id) + }); } }) - // $("#next").click(function(){ - - - // var selected = $("form input[type='radio']:checked"); - // var selectedtext = $("form input[type='radio']:checked").next('label:first').html() - - // var next_num = parseInt($("form").attr("id")) + 1 - // // console.log(selectedtext) - - // if (typeof selectedtext !== 'undefined'){ - // $.post("/post_create", - // { - // id: $("form").attr("id"), - // optionvalue: selected.val(), - // optiontext : selectedtext, - // csrfmiddlewaretoken: '{{ csrf_token }}' , - // }, - // function(data, status){ - // window.location.href = '/create/'+next_num - // }); - // } - - - // }); - - // $("#back").click(function(){ - - - // var next_num = parseInt($("form").attr("id")) - 1 - // window.location.href = '/create/'+next_num - - // }); + diff --git a/couchpotato/home/templates/history.html b/couchpotato/home/templates/history.html index d95807e..e53202f 100644 --- a/couchpotato/home/templates/history.html +++ b/couchpotato/home/templates/history.html @@ -21,6 +21,7 @@ table th { display: table-cell !important; + text-align: center; } .modal table td{ diff --git a/couchpotato/home/templates/update_simple.html b/couchpotato/home/templates/update_simple.html index e2a2921..620e5b2 100644 --- a/couchpotato/home/templates/update_simple.html +++ b/couchpotato/home/templates/update_simple.html @@ -142,6 +142,13 @@

Number of Open Proposals: {{ proposals.0 }} / {{ proposals.1 }}

Home Score :

Away Score : +

+
+
+ +
+
+ @@ -278,6 +285,12 @@

Number of Open Proposals: {{ proposals.0 }} / {{ proposals.1 }}

}); } + + function isNumeric(str) { + if (typeof str != "string") return false // we only process strings! + return !isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)... + !isNaN(parseFloat(str)) // ...and ensure strings of whitespace fail + } function result(e){ @@ -285,8 +298,7 @@

Number of Open Proposals: {{ proposals.0 }} / {{ proposals.1 }}

var call = 'result' if($(".modal").css('display') == undefined || $(".modal").css('display') == 'none'){ - // .append('
Home Score
Away Score
') - + var row = $(e).closest('tr'); var data = $('#example').dataTable().fnGetData(row); var event = data[0] @@ -307,14 +319,27 @@

Number of Open Proposals: {{ proposals.0 }} / {{ proposals.1 }}

} - console.log("event ", event) - console.log("home score ", homeScore) - console.log("away score " , awayScore) + // console.log("event ", event) + // console.log("home score ", homeScore) + // console.log("away score " , awayScore) + // console.log("Away " ,isNumeric(awayScore)) + // console.log("Home " , isNumeric(homeScore)) + + var error_obj = $(e).closest('tr').find("h5.error_msg") + if (!isNumeric(homeScore)){ + + error_obj.html("Home score cannot be empty") + // return false + } + else if(!isNumeric(awayScore)){ + error_obj.html("Away score cannot be empty") + // return false + } + else{ + error_obj.html('') + // console.log("post") - // $( "#submit_result" ).bind( "click", function() { - - $.post("/post_update", { event : event, @@ -326,6 +351,12 @@

Number of Open Proposals: {{ proposals.0 }} / {{ proposals.1 }}

function(data, status){ alert(data.success) }); + } + + + + + From 038103164ad3cbb506797b1af42d8aedd066e00b Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Tue, 8 Jun 2021 15:13:08 +0530 Subject: [PATCH 30/42] New config file template --- couchpotato/example-config-bos-mint.yaml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/couchpotato/example-config-bos-mint.yaml b/couchpotato/example-config-bos-mint.yaml index 197984f..5505b6d 100644 --- a/couchpotato/example-config-bos-mint.yaml +++ b/couchpotato/example-config-bos-mint.yaml @@ -27,6 +27,8 @@ potatoNames: bosApis: - http://hercules.peerplays.download:8010/trigger + - cpi + - cp2 token: - 1111111 @@ -34,4 +36,4 @@ token: token_telegram: '' telegram_chat_ids: - - '' \ No newline at end of file + - '' From d35748dac29199ad68f41dcc43dbaa345239d4ac Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Wed, 9 Jun 2021 03:53:22 +0530 Subject: [PATCH 31/42] Witness filter --- couchpotato/cp_local.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/couchpotato/cp_local.py b/couchpotato/cp_local.py index 22417ab..12eaf3a 100644 --- a/couchpotato/cp_local.py +++ b/couchpotato/cp_local.py @@ -689,10 +689,16 @@ def Push2bosMethod(self, incident, providerName): for k in ks: # for api in bosApis: print("inthread:", k) - api = bosApis[k] + api = list(bosApis[k].keys())[0] + acceptedProviderNames = list(bosApis[k].values())[0] # print(api) try: - requests.post(url=api, json=incident) + if providerName in acceptedProviderNames: + print("providername in acepted list:", providerName) + requests.post(url=api, json=incident) + else: + print("providername NOT in acepted list:", providerName) + except Exception as e: print(e) logger.warning(api + ": failed") From 201f678de2316f521507dce5b13966bad7aa650e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 10 Jun 2021 18:11:33 +0000 Subject: [PATCH 32/42] Bump django from 3.2.3 to 3.2.4 Bumps [django](https://github.com/django/django) from 3.2.3 to 3.2.4. - [Release notes](https://github.com/django/django/releases) - [Commits](https://github.com/django/django/compare/3.2.3...3.2.4) --- updated-dependencies: - dependency-name: django dependency-type: direct:production ... Signed-off-by: dependabot[bot] --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 79fc5bf..83298a5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,7 +4,7 @@ bos_incidents==0.4.1 bos_mint==0.5.4 click==8.0.0 colorlog==5.0.1 -Django==3.2.3 +Django==3.2.4 djangorestframework==3.12.4 drf_yasg==1.20.0 jsonschema==3.2.0 From 220c32370c62d65d9d5e8cfd9daca342f9b9007d Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Fri, 11 Jun 2021 03:13:10 +0530 Subject: [PATCH 33/42] Removed config file with pivate data --- couchpotato/config-bos-mint.yaml | 79 -------------------------------- 1 file changed, 79 deletions(-) delete mode 100755 couchpotato/config-bos-mint.yaml diff --git a/couchpotato/config-bos-mint.yaml b/couchpotato/config-bos-mint.yaml deleted file mode 100755 index bee0199..0000000 --- a/couchpotato/config-bos-mint.yaml +++ /dev/null @@ -1,79 +0,0 @@ -debug: FALSE -project_name: PYTHON COUCH POTATO -project_sub_name: The Python Couch Potato project -secret_key: THINK CLOCK SMOG FLAG SMACK TINKER FLUNK # enter any random string -advanced_features: True - -sql_database: "sqlite:///{cwd}/bookied-local.db" - -connection: - use: hercules # enter your desired chain - - hercules: - node: - - wss://hercules.peerplays.download/api - nobroadcast: False - num_retries: 1 - - elizabeth: - node: - - https://elizabeth.peerplays.download/api - nobroadcast: False - num_retries: 1 - - - alice: - node: - - wss://node.peerblock.trade:8090 - - wss://ppyapi.spacemx.tech - - wss://api-ppy.blckchnd.com - - wss://pma.blockveritas.co/ws - - wss://ppyws.roelandp.nl/ws - - wss://api.eifos.org - - wss://peerplaysblockchain.net/mainnet/api - - wss://api.ppy.alex-pu.info - - wss://api.ppy.blockoperations.com - nobroadcast: False - num_retries: 1 - - beatrice: - node: - - wss://pta.blockveritas.co/ws - - wss://peerplaysblockchain.net/testnet/api - - wss://api-ppy-beatrice.blckchnd.com - - wss://api-beatrice01.eifos.org - - wss://api-testnet.ppy.alex-pu.info - - wss://node.testnet.peerblock.trade - - wss://testnet-ppyapi.spacemx.tech - nobroadcast: False - num_retries: 1 - -allowed_assets: - - BTFUN - - PPY - - TEST - - BTF - -potatoNames: - - cpx - - cpy - -bosApis: - - http://hercules.peerplays.download:8010/trigger: - - cpi - - cp2 - - http://1.hercules.peerplays.download:8010/trigger: - - cp2 - - j - - http://2.hercules.peerplays.download:8010/trigger: - - cp3 - - http://3.hercules.peerplays.download:8010/trigger: - - cp4 - -token: - - 4013017 - -token_telegram: '1788336903:AAE_y0beDflEG00-UVABjt4kOH2_XdU3GcI' - -telegram_chat_ids: - - "990772424" From 3c843921f43dbc2709a1b9e488cddcd45fea38c4 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Fri, 11 Jun 2021 03:18:20 +0530 Subject: [PATCH 34/42] Example config file --- couchpotato/example-config-bos-mint.yaml | 39 ++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 couchpotato/example-config-bos-mint.yaml diff --git a/couchpotato/example-config-bos-mint.yaml b/couchpotato/example-config-bos-mint.yaml new file mode 100644 index 0000000..f3cec4f --- /dev/null +++ b/couchpotato/example-config-bos-mint.yaml @@ -0,0 +1,39 @@ +debug: FALSE +project_name: PYTHON COUCH POTATO +project_sub_name: The Python Couch Potato project +secret_key: THINK CLOCK SMOG FLAG SMACK TINKER FLUNK # enter any random string +advanced_features: True + +sql_database: "sqlite:///{cwd}/bookied-local.db" + +connection: + use: hercules # enter your desired chain + + hercules: + node: + - wss://hercules.peerplays.download/api + nobroadcast: False + num_retries: 1 + +allowed_assets: + - BTFUN + - PPY + - TEST + - BTF +potatoNames: + - cpx + - cpy + +bosApis: + - http://hercules.peerplays.download:8010/trigger: + - cpi + - cp2 + +token: + - + +token_telegram: '' + +telegram_chat_ids: + - "" + From d30d55cf2e68e39efd392f9e30c4b1be09397f4c Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Fri, 11 Jun 2021 03:24:07 +0530 Subject: [PATCH 35/42] History in ascending order of date --- couchpotato/cp_local.py | 1 + 1 file changed, 1 insertion(+) diff --git a/couchpotato/cp_local.py b/couchpotato/cp_local.py index e5501b5..168b544 100644 --- a/couchpotato/cp_local.py +++ b/couchpotato/cp_local.py @@ -724,6 +724,7 @@ def History(self, providerName): history = [] for doc in historyGen: history.append(doc) + history = history[::-1] return history def Push2bosBetter(self, incident, providerNames): From a4b7bd18e7d8ca3f609820be3c519a3c5a7323e1 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Thu, 17 Jun 2021 11:44:05 +0530 Subject: [PATCH 36/42] enable static for SSL --- couchpotato/couchpotato/settings.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/couchpotato/couchpotato/settings.py b/couchpotato/couchpotato/settings.py index 2991591..6cbf247 100644 --- a/couchpotato/couchpotato/settings.py +++ b/couchpotato/couchpotato/settings.py @@ -23,7 +23,8 @@ SECRET_KEY = '!fwkygc(zdgod8v934b9q(grdp7#(kd1vav4h)sdi6y_6p!oq6' # SECURITY WARNING: don't run with debug turned on in production! -DEBUG = True +DEBUG = False +BOOL_SSLSERVER = True ALLOWED_HOSTS = ['*'] @@ -138,7 +139,7 @@ STATIC_URL = '/static/' -if DEBUG: +if DEBUG or BOOL_SSLSERVER: STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static') ] From 05ed3fe03308ecdb706354d15daec5802287bed0 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Thu, 26 Aug 2021 23:18:26 +0530 Subject: [PATCH 37/42] Remove debug log --- .gitignore | 97 ++----------------- couchpotato/home/templates/update_simple.html | 12 +-- 2 files changed, 13 insertions(+), 96 deletions(-) diff --git a/.gitignore b/.gitignore index d9cd019..1cfc82f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,37 +1,28 @@ -.git -env -dump -config-bos-mint.yaml - -config-bos-mint.yaml - +.idea/ # Byte-compiled / optimized / DLL files __pycache__/ *.py[cod] -*$py.class # C extensions *.so # Distribution / packaging .Python +env/ build/ develop-eggs/ dist/ downloads/ eggs/ -.eggs/ lib/ lib64/ parts/ sdist/ var/ -wheels/ -share/python-wheels/ *.egg-info/ .installed.cfg *.egg -MANIFEST +*.eggs # PyInstaller # Usually these files are written by a python script from a template @@ -46,17 +37,10 @@ pip-delete-this-directory.txt # Unit test / coverage reports htmlcov/ .tox/ -.nox/ .coverage -.coverage.* .cache nosetests.xml coverage.xml -*.cover -*.py,cover -.hypothesis/ -.pytest_cache/ -cover/ # Translations *.mo @@ -64,82 +48,15 @@ cover/ # Django stuff: *.log -local_settings.py -db.sqlite3 -db.sqlite3-journal - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy # Sphinx documentation docs/_build/ +docs/html # PyBuilder -.pybuilder/ target/ -# Jupyter Notebook -.ipynb_checkpoints - -# IPython -profile_default/ -ipython_config.py - -# pyenv -# For a library or package, you might want to ignore these files since the code is -# intended to run in multiple environments; otherwise, check them in: -# .python-version - -# pipenv -# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. -# However, in case of collaboration, if having platform-specific dependencies or dependencies -# having no cross-platform support, pipenv may install dependencies that don't work, or not -# install all needed dependencies. -#Pipfile.lock - -# PEP 582; used by e.g. github.com/David-OConnor/pyflow -__pypackages__/ - -# Celery stuff -celerybeat-schedule -celerybeat.pid - -# SageMath parsed files -*.sage.py - -# Environments -.env -.venv -env/ -venv/ -ENV/ -env.bak/ -venv.bak/ - -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - -# mypy -.mypy_cache/ -.dmypy.json -dmypy.json - -# Pyre type checker -.pyre/ - -# pytype static type analyzer -.pytype/ +# Vim temp files +*.swp -# Cython debug symbols -cython_debug/ +.ropeproject/ diff --git a/couchpotato/home/templates/update_simple.html b/couchpotato/home/templates/update_simple.html index 620e5b2..a0e5fd2 100644 --- a/couchpotato/home/templates/update_simple.html +++ b/couchpotato/home/templates/update_simple.html @@ -231,7 +231,7 @@
} - console.log(event) + //console.log(event) $.post("/post_update", @@ -270,7 +270,7 @@
var event =$('.modal table').find('tr:eq(0) td:eq(1)').text(); } - console.log(event) + //console.log(event) $.post("/post_update", { @@ -305,9 +305,9 @@
var homeScore = $(e).closest('tr').find("input.home").val() var awayScore = $(e).closest('tr').find("input.away").val() - console.log("event ", event) - console.log("home score ", homeScore) - console.log("away score " , awayScore) + //console.log("event ", event) + //console.log("home score ", homeScore) + //console.log("away score " , awayScore) } else{ @@ -383,7 +383,7 @@
var event =$('.modal table').find('tr:eq(0) td:eq(1)').text(); } - console.log("event ", event) + //console.log("event ", event) $.post("/post_update", { From e745f04da2208e6fde1c4f2481e8c83b881cd06c Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Thu, 26 Aug 2021 23:24:36 +0530 Subject: [PATCH 38/42] minor --- couchpotato/home/templates/update_simple.html | 1 - 1 file changed, 1 deletion(-) diff --git a/couchpotato/home/templates/update_simple.html b/couchpotato/home/templates/update_simple.html index a0e5fd2..055666c 100644 --- a/couchpotato/home/templates/update_simple.html +++ b/couchpotato/home/templates/update_simple.html @@ -383,7 +383,6 @@
var event =$('.modal table').find('tr:eq(0) td:eq(1)').text(); } - //console.log("event ", event) $.post("/post_update", { From 7c36d9c13fd4865a4e7fc3df0dd5f2c2f0687ffd Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Thu, 26 Aug 2021 23:27:03 +0530 Subject: [PATCH 39/42] minor --- couchpotato/home/templates/update_simple.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/couchpotato/home/templates/update_simple.html b/couchpotato/home/templates/update_simple.html index 055666c..c6004da 100644 --- a/couchpotato/home/templates/update_simple.html +++ b/couchpotato/home/templates/update_simple.html @@ -383,6 +383,7 @@
var event =$('.modal table').find('tr:eq(0) td:eq(1)').text(); } + //console.log("event ", event) $.post("/post_update", { @@ -392,9 +393,9 @@
awayScore : awayScore, csrfmiddlewaretoken: '{{ csrf_token }}' , }, - function(data, status){ - alert(data.success) - }); + //function(data, status){ + // alert(data.success) + // }); } From 05b9a4e4b161fe4ceb8cea54c634fdce506919a5 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Fri, 27 Aug 2021 10:59:04 +0530 Subject: [PATCH 40/42] minor --- couchpotato/home/templates/update_simple.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/couchpotato/home/templates/update_simple.html b/couchpotato/home/templates/update_simple.html index c6004da..a0e5fd2 100644 --- a/couchpotato/home/templates/update_simple.html +++ b/couchpotato/home/templates/update_simple.html @@ -393,9 +393,9 @@
awayScore : awayScore, csrfmiddlewaretoken: '{{ csrf_token }}' , }, - //function(data, status){ - // alert(data.success) - // }); + function(data, status){ + alert(data.success) + }); } From 567dcd8f6d6ae9cbf098c6d9cb8ddedeffd11e40 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Fri, 27 Aug 2021 11:01:45 +0530 Subject: [PATCH 41/42] minor --- couchpotato/home/templates/update_simple.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/couchpotato/home/templates/update_simple.html b/couchpotato/home/templates/update_simple.html index a0e5fd2..08a7c90 100644 --- a/couchpotato/home/templates/update_simple.html +++ b/couchpotato/home/templates/update_simple.html @@ -393,9 +393,10 @@
awayScore : awayScore, csrfmiddlewaretoken: '{{ csrf_token }}' , }, - function(data, status){ - alert(data.success) - }); + //function(data, status){ + // alert(data.success) + // } + ); } From 4806f2938e8ffd12ba5fffb39ca7579c0583a357 Mon Sep 17 00:00:00 2001 From: Jemshid KK Date: Fri, 27 Aug 2021 11:06:25 +0530 Subject: [PATCH 42/42] minor --- couchpotato/home/templates/update_simple.html | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/couchpotato/home/templates/update_simple.html b/couchpotato/home/templates/update_simple.html index 08a7c90..bfa7b4c 100644 --- a/couchpotato/home/templates/update_simple.html +++ b/couchpotato/home/templates/update_simple.html @@ -242,9 +242,10 @@
awayScore : awayScore, csrfmiddlewaretoken: '{{ csrf_token }}' , }, - function(data, status){ - alert(data.success) - }); + //function(data, status){ + //alert(data.success) + // } + ); } function finish(e){ @@ -280,9 +281,10 @@
awayScore : awayScore, csrfmiddlewaretoken: '{{ csrf_token }}' , }, - function(data, status){ - alert(data.success) - }); + //function(data, status){ + //alert(data.success) + // } + ); } @@ -348,9 +350,10 @@
awayScore : awayScore, csrfmiddlewaretoken: '{{ csrf_token }}' , }, - function(data, status){ - alert(data.success) - }); + //function(data, status){ + //alert(data.success) + //} + ); }