File tree Expand file tree Collapse file tree 4 files changed +50
-3
lines changed Expand file tree Collapse file tree 4 files changed +50
-3
lines changed Original file line number Diff line number Diff line change
1
+ name : Generate and Publish Database
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ workflow_dispatch :
8
+
9
+ jobs :
10
+ build :
11
+ runs-on : ubuntu-latest
12
+
13
+ steps :
14
+ - name : Checkout repository
15
+ uses : actions/checkout@v2
16
+
17
+ - name : Set up Python
18
+ uses : actions/setup-python@v2
19
+ with :
20
+ python-version : ' 3.9'
21
+
22
+ - name : Install dependencies
23
+ run : |
24
+ python -m pip install --upgrade pip
25
+ pip install -r requirements.txt
26
+
27
+ - name : Download XML zip file
28
+ run : |
29
+ curl -O http://ratings.fide.com/download/players_list_xml.zip
30
+
31
+ - name : Unzip XML file
32
+ run : |
33
+ unzip players_list_xml.zip -d ./
34
+ mv players_list.xml players.xml
35
+
36
+ - name : Generate SQLite database
37
+ run : |
38
+ python players.py players.xml players.db
39
+
40
+ - name : Deploy to Fly.io using Datasette
41
+ env :
42
+ FLY_API_TOKEN : ${{ secrets.FLY_API_TOKEN }}
43
+ run : |
44
+ datasette publish fly players.db --app="fide-players" -m metadata.json --token $FLY_API_TOKEN
Original file line number Diff line number Diff line change 106
106
</ div >
107
107
< script src ="main.js "> </ script >
108
108
</ body >
109
- </ html >
109
+ </ html >
Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ function fideSelector() {
56
56
57
57
// Convert URLs to HTTPS
58
58
convertToHttps ( url ) {
59
- if ( url . startsWith ( "http:" ) ) {
59
+ if ( url && url . startsWith ( "http:" ) ) {
60
60
return url . replace ( "http://" , "https://" ) ;
61
61
}
62
62
return url ;
@@ -116,7 +116,7 @@ function fideSelector() {
116
116
url . searchParams . append ( "country__exact" , this . selectedCountry ) ;
117
117
}
118
118
if ( this . playerSearch ) {
119
- url . searchParams . append ( "name__contains " , this . playerSearch ) ;
119
+ url . searchParams . append ( "_search " , this . playerSearch ) ;
120
120
}
121
121
if ( this . sortAsc ) {
122
122
url . searchParams . append ( "_sort" , this . sortKey ) ;
Original file line number Diff line number Diff line change 1
1
tqdm == 4.66.4
2
+ datasette
3
+ datasette-publish-fly
4
+
You can’t perform that action at this time.
0 commit comments