From a5e62336964d58b4cfa2c193da8ae0e66902e425 Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 15 Jun 2023 15:14:44 +0200 Subject: [PATCH] Update for better reports --- TournamentStats.xcodeproj/project.pbxproj | 4 +- TournamentStats/AppDelegate.swift | 12 ++--- TournamentStats/NotablePlayers.swift | 5 +- .../report/structures/TournamentWinner.swift | 8 ++- TournamentStats/scrapper/Downloader.swift | 49 +++++++++++-------- 5 files changed, 47 insertions(+), 31 deletions(-) diff --git a/TournamentStats.xcodeproj/project.pbxproj b/TournamentStats.xcodeproj/project.pbxproj index 95eda49..f29c208 100644 --- a/TournamentStats.xcodeproj/project.pbxproj +++ b/TournamentStats.xcodeproj/project.pbxproj @@ -630,7 +630,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 526E96RFNP; INFOPLIST_FILE = TournamentStats/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -652,7 +652,7 @@ CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = 526E96RFNP; INFOPLIST_FILE = TournamentStats/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 14.0; + IPHONEOS_DEPLOYMENT_TARGET = 15.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/TournamentStats/AppDelegate.swift b/TournamentStats/AppDelegate.swift index c4c90e4..cf7262a 100644 --- a/TournamentStats/AppDelegate.swift +++ b/TournamentStats/AppDelegate.swift @@ -39,12 +39,12 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele // launchReports() -// let realm = try! Realm() -// try! realm.write { -// realm.deleteAll() -// } -// -// Downloader.downloadWSOPResults() + let realm = try! Realm() + try! realm.write { + realm.deleteAll() + } + + Downloader.downloadWSOPResults() let generator = ReportGenerator() generator.generate() diff --git a/TournamentStats/NotablePlayers.swift b/TournamentStats/NotablePlayers.swift index cca5a74..d6ef2f1 100644 --- a/TournamentStats/NotablePlayers.swift +++ b/TournamentStats/NotablePlayers.swift @@ -117,7 +117,10 @@ class NotablePlayers { "John Hennigan", "Kristen Foxen", "Espen Jorstad", - "Greg Raymer" + "Greg Raymer", + "Patrick Leonard", + "Benny Glaser", + "Allen Kessler" ] } diff --git a/TournamentStats/report/structures/TournamentWinner.swift b/TournamentStats/report/structures/TournamentWinner.swift index a7aca0e..c4cdb81 100644 --- a/TournamentStats/report/structures/TournamentWinner.swift +++ b/TournamentStats/report/structures/TournamentWinner.swift @@ -26,7 +26,9 @@ struct TournamentWinner : HTMLRepresentable { return [ ColumnDescriptor(header: "Buy-in", number: true, widthWeight: 0.5), 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 [ tournament.buyin.currencyFormatted, tournament.name, - tournament.prizepool.currencyFormatted + tournament.prizepool.currencyFormatted, + tournament.entries.formatted() ] } } @@ -57,6 +60,7 @@ struct TournamentWinner : HTMLRepresentable { header.append("Prize") } else { header.append("Prizepool") + header.append("Entries") } return "\(header)" } diff --git a/TournamentStats/scrapper/Downloader.swift b/TournamentStats/scrapper/Downloader.swift index b58ff80..b5e0af7 100644 --- a/TournamentStats/scrapper/Downloader.swift +++ b/TournamentStats/scrapper/Downloader.swift @@ -19,29 +19,38 @@ class Downloader { static func downloadWSOPResults() { let ids = [ -// "21666", // 1 -// "21667", // 2 -// "21670", // 5 -// "21671", // 6 -// "21669", // 4 -// "21672", // 7 -// "21673", // 8 -// "21674", // 9 -// "21668", // 3 -// "21675", // 10 -// "21676", // 11 -// "21677", // 12 -// "21678", // 13 -// "21679", // 14 -// "21680", // 15 -// "21681", // 16 -// "21682", // 17 -// "21684", // 19 -// "21685", // 20 -// "21686", // 21 + "21666", // 1 + "21667", // 2 + "21670", // 5 + "21671", // 6 + "21669", // 4 + "21672", // 7 + "21673", // 8 + "21674", // 9 + "21668", // 3 + "21675", // 10 + "21676", // 11 + "21677", // 12 + "21678", // 13 + "21679", // 14 + "21680", // 15 + "21681", // 16 + "21682", // 17 + "21684", // 19 + "21685", // 20 + "21686", // 21 "21687", // 22 "21688", // 23 "21689", // 24 + "21690", // 25 + "21691", // 26 + "21692", // 27 + "21693", // 28 + "21694", // 29 + "21695", // 30 + "21696", // 31 + "21697", // 32 + ] for id in ids {