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

#include <recordingextender.h>

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

Public Member Functions

 RecExtEspnDataSource (QObject *parent)
 
RecExtDataPagenewPage (const QJsonDocument &doc) override
 
QUrl makeInfoUrl (const SportInfo &info, const QDateTime &dt) override
 Create a URL for the ESPN 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 ESPN 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 280 of file recordingextender.h.

Constructor & Destructor Documentation

◆ RecExtEspnDataSource()

RecExtEspnDataSource::RecExtEspnDataSource ( QObject *  parent)
inlineexplicit

Definition at line 283 of file recordingextender.h.

Member Function Documentation

◆ newPage()

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

Implements RecExtDataSource.

Definition at line 284 of file recordingextender.h.

Referenced by loadPage().

◆ makeInfoUrl()

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

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

Parameters
[in]infoA data structure describing the sport/league.
[in]dtThe date for which sporting events should be retrieved.
Returns
a url to extract the list of sporting events from the ESPN API.

Implements RecExtDataSource.

Definition at line 629 of file recordingextender.cpp.

Referenced by findInfoUrl().

◆ makeGameUrl()

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

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

Parameters
[in]gameA data structure describing the specific game of interest.
[in]strThe game id for this specific game.
Returns
a url to extract the status of this specific game from the ESPN API.

Implements RecExtDataSource.

Definition at line 649 of file recordingextender.cpp.

◆ findInfoUrl()

QUrl RecExtEspnDataSource::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 assumes that URLs are specified with UTC. For example, retrieving ".../scoreboard" at 19:59 EDT (23:59Z) returns the games for that day, but at 20:00 EDT (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. This can mean that two games being simultaneously recorded use different URLS if one started before 00:00Z and the other started after.

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

Implements RecExtDataSource.

Definition at line 670 of file recordingextender.cpp.

◆ loadPage()

RecExtDataPage * RecExtEspnDataSource::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 565 of file recordingextender.cpp.

Referenced by findInfoUrl().


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