Update for better reports

master
Laurent 2 years ago
parent 51212f2c93
commit a5e6233696
  1. 4
      TournamentStats.xcodeproj/project.pbxproj
  2. 12
      TournamentStats/AppDelegate.swift
  3. 5
      TournamentStats/NotablePlayers.swift
  4. 8
      TournamentStats/report/structures/TournamentWinner.swift
  5. 49
      TournamentStats/scrapper/Downloader.swift

@ -630,7 +630,7 @@
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 526E96RFNP; DEVELOPMENT_TEAM = 526E96RFNP;
INFOPLIST_FILE = TournamentStats/Info.plist; INFOPLIST_FILE = TournamentStats/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0; IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
@ -652,7 +652,7 @@
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 526E96RFNP; DEVELOPMENT_TEAM = 526E96RFNP;
INFOPLIST_FILE = TournamentStats/Info.plist; INFOPLIST_FILE = TournamentStats/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 14.0; IPHONEOS_DEPLOYMENT_TARGET = 15.0;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",

@ -39,12 +39,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
// launchReports() // launchReports()
// let realm = try! Realm() let realm = try! Realm()
// try! realm.write { try! realm.write {
// realm.deleteAll() realm.deleteAll()
// } }
//
// Downloader.downloadWSOPResults() Downloader.downloadWSOPResults()
let generator = ReportGenerator() let generator = ReportGenerator()
generator.generate() generator.generate()

@ -117,7 +117,10 @@ class NotablePlayers {
"John Hennigan", "John Hennigan",
"Kristen Foxen", "Kristen Foxen",
"Espen Jorstad", "Espen Jorstad",
"Greg Raymer" "Greg Raymer",
"Patrick Leonard",
"Benny Glaser",
"Allen Kessler"
] ]
} }

@ -26,7 +26,9 @@ struct TournamentWinner : HTMLRepresentable {
return [ return [
ColumnDescriptor(header: "Buy-in", number: true, widthWeight: 0.5), ColumnDescriptor(header: "Buy-in", number: true, widthWeight: 0.5),
ColumnDescriptor(header: "Event", number: false, widthWeight: 3.0), ColumnDescriptor(header: "Event", number: false, widthWeight: 3.0),
ColumnDescriptor(header: "Prizepool", number: true, widthWeight: 1.0)] ColumnDescriptor(header: "Prizepool", number: true, widthWeight: 1.0),
ColumnDescriptor(header: "Entries", number: true, widthWeight: 1.0),
]
} }
} }
@ -43,7 +45,8 @@ struct TournamentWinner : HTMLRepresentable {
return [ return [
tournament.buyin.currencyFormatted, tournament.buyin.currencyFormatted,
tournament.name, tournament.name,
tournament.prizepool.currencyFormatted tournament.prizepool.currencyFormatted,
tournament.entries.formatted()
] ]
} }
} }
@ -57,6 +60,7 @@ struct TournamentWinner : HTMLRepresentable {
header.append("<td width=\"130\">Prize</td>") header.append("<td width=\"130\">Prize</td>")
} else { } else {
header.append("<td width=\"130\">Prizepool</td>") header.append("<td width=\"130\">Prizepool</td>")
header.append("<td width=\"100\">Entries</td>")
} }
return "<tr class=\"table-header\">\(header)</tr>" return "<tr class=\"table-header\">\(header)</tr>"
} }

@ -19,29 +19,38 @@ class Downloader {
static func downloadWSOPResults() { static func downloadWSOPResults() {
let ids = [ let ids = [
// "21666", // 1 "21666", // 1
// "21667", // 2 "21667", // 2
// "21670", // 5 "21670", // 5
// "21671", // 6 "21671", // 6
// "21669", // 4 "21669", // 4
// "21672", // 7 "21672", // 7
// "21673", // 8 "21673", // 8
// "21674", // 9 "21674", // 9
// "21668", // 3 "21668", // 3
// "21675", // 10 "21675", // 10
// "21676", // 11 "21676", // 11
// "21677", // 12 "21677", // 12
// "21678", // 13 "21678", // 13
// "21679", // 14 "21679", // 14
// "21680", // 15 "21680", // 15
// "21681", // 16 "21681", // 16
// "21682", // 17 "21682", // 17
// "21684", // 19 "21684", // 19
// "21685", // 20 "21685", // 20
// "21686", // 21 "21686", // 21
"21687", // 22 "21687", // 22
"21688", // 23 "21688", // 23
"21689", // 24 "21689", // 24
"21690", // 25
"21691", // 26
"21692", // 27
"21693", // 28
"21694", // 29
"21695", // 30
"21696", // 31
"21697", // 32
] ]
for id in ids { for id in ids {

Loading…
Cancel
Save