MythTV  master
Public Member Functions | Private Types | Static Private Attributes | List of all members
RecExtEspnDataPage Class Reference

#include <mythbackend/recordingextender.h>

Inheritance diagram for RecExtEspnDataPage:
[legend]
Collaboration diagram for RecExtEspnDataPage:
[legend]

Public Member Functions

 RecExtEspnDataPage (QObject *parent, QJsonDocument doc)
 
bool findGameInfo (ActiveGame &game) override
 Parse a previously downloaded data page for a given sport. More...
 
GameState findGameScore (ActiveGame &game) override
 Parse the previously downloaded data page for a given game. More...
 
- Public Member Functions inherited from RecExtDataPage
RecExtDataSourcegetSource ()
 
virtual QDateTime getNow ()
 Get the current time. Overridden by the testing code. More...
 
virtual bool timeIsClose (const QDateTime &eventStart)
 Base Classes ///. More...
 
QJsonDocument getDoc ()
 Get the JSON document associated with this object. More...
 
 RecExtDataPage (QObject *parent, QJsonDocument doc)
 Create a new RecExtDataPage object. More...
 

Private Types

enum  GameStatus : std::uint8_t {
  TBD = 0, SCHEDULED = 1, INPROGRESS = 2, FINAL = 3,
  FORFEIT = 4, CANCELLED = 5, POSTPONED = 6, DELAYED = 7,
  SUSPENDED = 8, FORFEIT_HOME_TEAM = 9, FORFEIT_AWAY_TEAM = 10, RAIN_DELAY = 17,
  BEGINNING_OF_PERIOD = 21, END_OF_PERIOD = 22, HALFTIME = 23, OVERTIME = 24,
  FIRST_HALF = 25, SECOND_HALF = 26, ABANDONED = 27, FULL_TIME = 28,
  RESCHEDULED = 29, START_LIST = 30, INTERMEDIATE = 31, UNOFFICIAL = 32,
  MEDAL_OFFICIAL = 33, GROUPINGS_OFFICIAL = 34, PLAY_COMPLETE = 35, OFFICIAL_EVENT_SHORTENED = 36,
  CORRECTED_RESULT = 37, RETIRED = 38, BYE = 39, WALKOVER = 40,
  ESPNVOID = 41, PRELIMINARY = 42, GOLDEN_TIME = 43, SHOOTOUT = 44,
  FINAL_SCORE_AFTER_EXTRA_TIME = 45, FINAL_SCORE_AFTER_GOLDEN_GOAL = 46, FINAL_SCORE_AFTER_PENALTIES = 47, END_EXTRA_TIME = 48,
  EXTRA_TIME_HALF_TIME = 49, FIXTURE_NO_LIVE_COVERAGE = 50, FINAL_SCORE_ABANDONED = 51
}
 

Static Private Attributes

static const QList< GameStatuskFinalStatuses
 A list of the ESPN status that mean the game is over. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from RecExtDataPage
static QJsonObject walkJsonPath (QJsonObject &object, const QStringList &path)
 Iterate through a json object and return the specified object. More...
 
static bool getJsonInt (const QJsonObject &object, QStringList &path, int &value)
 Retrieve the specified integer from a json object. More...
 
static bool getJsonInt (const QJsonObject &object, const QString &key, int &value)
 Retrieve the specified integer from a json object. More...
 
static bool getJsonString (const QJsonObject &object, QStringList &path, QString &value)
 Retrieve the specified string from a json object. More...
 
static bool getJsonString (const QJsonObject &object, const QString &key, QString &value)
 Retrieve the specified string from a json object. More...
 
static bool getJsonObject (const QJsonObject &object, QStringList &path, QJsonObject &value)
 Retrieve a specific object from another json object. More...
 
static bool getJsonObject (const QJsonObject &object, const QString &key, QJsonObject &value)
 Retrieve a specific object from another json object. More...
 
static bool getJsonArray (const QJsonObject &object, const QString &key, QJsonArray &value)
 Retrieve the specified array from a json object. More...
 
- Protected Attributes inherited from RecExtDataPage
QJsonDocument m_doc
 

Detailed Description

Definition at line 192 of file recordingextender.h.

Member Enumeration Documentation

◆ GameStatus

enum RecExtEspnDataPage::GameStatus : std::uint8_t
private
Enumerator
TBD 
SCHEDULED 
INPROGRESS 
FINAL 
FORFEIT 
CANCELLED 
POSTPONED 
DELAYED 
SUSPENDED 
FORFEIT_HOME_TEAM 
FORFEIT_AWAY_TEAM 
RAIN_DELAY 
BEGINNING_OF_PERIOD 
END_OF_PERIOD 
HALFTIME 
OVERTIME 
FIRST_HALF 
SECOND_HALF 
ABANDONED 
FULL_TIME 
RESCHEDULED 
START_LIST 
INTERMEDIATE 
UNOFFICIAL 
MEDAL_OFFICIAL 
GROUPINGS_OFFICIAL 
PLAY_COMPLETE 
OFFICIAL_EVENT_SHORTENED 
CORRECTED_RESULT 
RETIRED 
BYE 
WALKOVER 
ESPNVOID 
PRELIMINARY 
GOLDEN_TIME 
SHOOTOUT 
FINAL_SCORE_AFTER_EXTRA_TIME 
FINAL_SCORE_AFTER_GOLDEN_GOAL 
FINAL_SCORE_AFTER_PENALTIES 
END_EXTRA_TIME 
EXTRA_TIME_HALF_TIME 
FIXTURE_NO_LIVE_COVERAGE 
FINAL_SCORE_ABANDONED 

Definition at line 195 of file recordingextender.h.

Constructor & Destructor Documentation

◆ RecExtEspnDataPage()

RecExtEspnDataPage::RecExtEspnDataPage ( QObject *  parent,
QJsonDocument  doc 
)
inline

Definition at line 243 of file recordingextender.h.

Member Function Documentation

◆ findGameInfo()

bool RecExtEspnDataPage::findGameInfo ( ActiveGame game)
overridevirtual

Parse a previously downloaded data page for a given sport.

Find an entry that matches the specified team names, and update the game information with the starting time and a URL for retrieving the score for this game.

Parameters
game[in,out]A description of the desired game. The team names must be valid on input.
Returns
true if a match was found.

Implements RecExtDataPage.

Definition at line 420 of file recordingextender.cpp.

◆ findGameScore()

GameState RecExtEspnDataPage::findGameScore ( ActiveGame game)
overridevirtual

Parse the previously downloaded data page for a given game.

Find the current state of the game, and the current period. Unfortunately for us the "completed" field on this page can't be used, as it indicates that the final score of the game has gone into the record books. If the game has been suspended/postponed/whatever but not gone the required length of time to be considered "complete", this field remains false.

Parameters
[in]gameA description of the desired game. The team names and the URL must be valid on input.
Returns
The game state for the specified game.

Implements RecExtDataPage.

Definition at line 516 of file recordingextender.cpp.

Member Data Documentation

◆ kFinalStatuses

const QList< RecExtEspnDataPage::GameStatus > RecExtEspnDataPage::kFinalStatuses
staticprivate

The documentation for this class was generated from the following files:
RecExtEspnDataPage::FULL_TIME
@ FULL_TIME
Definition: recordingextender.h:215
RecExtEspnDataPage::END_EXTRA_TIME
@ END_EXTRA_TIME
Definition: recordingextender.h:235
RecExtEspnDataPage::BYE
@ BYE
Definition: recordingextender.h:226
RecExtEspnDataPage::FORFEIT_AWAY_TEAM
@ FORFEIT_AWAY_TEAM
Definition: recordingextender.h:206
RecExtEspnDataPage::FINAL_SCORE_AFTER_PENALTIES
@ FINAL_SCORE_AFTER_PENALTIES
Definition: recordingextender.h:234
RecExtEspnDataPage::FINAL_SCORE_ABANDONED
@ FINAL_SCORE_ABANDONED
Definition: recordingextender.h:238
RecExtEspnDataPage::ABANDONED
@ ABANDONED
Definition: recordingextender.h:214
RecExtEspnDataPage::POSTPONED
@ POSTPONED
Definition: recordingextender.h:202
RecExtEspnDataPage::FORFEIT
@ FORFEIT
Definition: recordingextender.h:200
RecExtEspnDataPage::OFFICIAL_EVENT_SHORTENED
@ OFFICIAL_EVENT_SHORTENED
Definition: recordingextender.h:223
RecExtEspnDataPage::FINAL
@ FINAL
Definition: recordingextender.h:199
RecExtEspnDataPage::RETIRED
@ RETIRED
Definition: recordingextender.h:225
RecExtEspnDataPage::FINAL_SCORE_AFTER_GOLDEN_GOAL
@ FINAL_SCORE_AFTER_GOLDEN_GOAL
Definition: recordingextender.h:233
RecExtEspnDataPage::FORFEIT_HOME_TEAM
@ FORFEIT_HOME_TEAM
Definition: recordingextender.h:205
RecExtEspnDataPage::FINAL_SCORE_AFTER_EXTRA_TIME
@ FINAL_SCORE_AFTER_EXTRA_TIME
Definition: recordingextender.h:232
RecExtEspnDataPage::PLAY_COMPLETE
@ PLAY_COMPLETE
Definition: recordingextender.h:222
RecExtEspnDataPage::CANCELLED
@ CANCELLED
Definition: recordingextender.h:201
RecExtEspnDataPage::SUSPENDED
@ SUSPENDED
Definition: recordingextender.h:204
RecExtEspnDataPage::ESPNVOID
@ ESPNVOID
Definition: recordingextender.h:228