MythTV  master
Public Member Functions | List of all members
RecExtMlbDataSource Class Reference

#include <recordingextender.h>

Inheritance diagram for RecExtMlbDataSource:
Inheritance graph
[legend]
Collaboration diagram for RecExtMlbDataSource:
Collaboration graph
[legend]

Public Member Functions

 RecExtMlbDataSource (QObject *parent)
 
RecExtDataPagenewPage (const QJsonDocument &doc) override
 
QUrl makeInfoUrl (const SportInfo &info, const QDateTime &dt) override
 Create a URL for the MLB API that is built from the various known bits of data accumulated so far. More...
 
QUrl makeGameUrl (const ActiveGame &game, const QString &str) override
 Create a URL for one specific game in the MLB API that is built from the various known bits of data accumulated so far. More...
 
QUrl findInfoUrl (ActiveGame &game, SportInfo &info) override
 Find the right URL for a specific recording. More...
 
RecExtDataPageloadPage (const ActiveGame &game, const QUrl &_url) override
 Download the data page for a game, and do some minimal validation. More...
 
- Public Member Functions inherited from RecExtDataSource
RecordingExtendergetExtender ()
 

Additional Inherited Members

- Static Public Member Functions inherited from RecExtDataSource
static void clearCache ()
 Clear the downloaded document cache. More...
 
- Protected Member Functions inherited from RecExtDataSource
 RecExtDataSource (QObject *parent)
 
- Protected Attributes inherited from RecExtDataSource
QUrl m_url
 
- Static Protected Attributes inherited from RecExtDataSource
static QHash< QString, QJsonDocument > s_downloadedJson {}
 A cache of downloaded documents. More...
 

Detailed Description

Definition at line 292 of file recordingextender.h.

Constructor & Destructor Documentation

◆ RecExtMlbDataSource()

RecExtMlbDataSource::RecExtMlbDataSource ( QObject *  parent)
inlineexplicit

Definition at line 295 of file recordingextender.h.

Member Function Documentation

◆ newPage()

RecExtDataPage* RecExtMlbDataSource::newPage ( const QJsonDocument &  doc)
inlineoverridevirtual

Implements RecExtDataSource.

Definition at line 296 of file recordingextender.h.

Referenced by loadPage().

◆ makeInfoUrl()

QUrl RecExtMlbDataSource::makeInfoUrl ( const SportInfo info,
const QDateTime &  dt 
)
overridevirtual

Create a URL for the MLB API that is built from the various known bits of data accumulated so far.

Parameters
infoA data structure describing the sport/league.
dtThe date for which sporting events should be retrieved.
Returns
a URL to extract the list of sporting events from the MLB API.

Implements RecExtDataSource.

Definition at line 993 of file recordingextender.cpp.

Referenced by findInfoUrl().

◆ makeGameUrl()

QUrl RecExtMlbDataSource::makeGameUrl ( const ActiveGame game,
const QString &  str 
)
overridevirtual

Create a URL for one specific game in the MLB API that is built from the various known bits of data accumulated so far.

Parameters
gameA data structure describing the specific game of interest.
strThe game id for this specific game.
Returns
a URL to extract the status of this specific game from the MLB API.

Implements RecExtDataSource.

Definition at line 1017 of file recordingextender.cpp.

◆ findInfoUrl()

QUrl RecExtMlbDataSource::findInfoUrl ( ActiveGame game,
SportInfo info 
)
overridevirtual

Find the right URL for a specific recording.

The data pages are grouped by the day they start (in local time), but the retrieval service operates using UTC. For example, retrieving ".../scoreboard" at 19:59EDT (23:59Z) returns the games for that day, but at 20:00EDT (00:00Z) it retrieves the games for the next day. The form ".../scoreboard?dates=yyyMMdd" has to be used to select the correct data page.

Parameters
[in]gameA description of the desired game. The team names and the URL must be valid on input.
infoA structure describing this data endpoint.
Returns
The URL to use for data on this specific game.

Implements RecExtDataSource.

Definition at line 1037 of file recordingextender.cpp.

◆ loadPage()

RecExtDataPage * RecExtMlbDataSource::loadPage ( const ActiveGame game,
const QUrl &  _url 
)
overridevirtual

Download the data page for a game, and do some minimal validation.

Cache the result so that subsequent lookups don't cause repeated downloads of the same page. (The cache must be cleared periodically.)

Parameters
[in]gameA description of the desired game. The team names and the URL must be valid on input.
Returns
The downloaded json document.

Implements RecExtDataSource.

Definition at line 939 of file recordingextender.cpp.

Referenced by findInfoUrl().


The documentation for this class was generated from the following files: