MythTV  master
Macros | Functions | Variables
recordingextender.cpp File Reference
#include <QFile>
#include <QJsonArray>
#include <QJsonObject>
#include <QUrlQuery>
#include "libmythbase/mythchrono.h"
#include "libmythbase/mythcorecontext.h"
#include "libmythbase/mythdate.h"
#include "libmythbase/mythdb.h"
#include "libmythbase/mythdownloadmanager.h"
#include "libmythbase/mythevent.h"
#include "libmythbase/mythlogging.h"
#include "recordingextender.h"
#include "scheduler.h"
Include dependency graph for recordingextender.cpp:

Go to the source code of this file.

Macros

#define LOC   QString("RecExt: ")
 

Functions

static bool ValidRecordingStatus (RecStatus::Type recstatus)
 Does this recording status indicate that the recording is still ongoing. More...
 
static QString normalizeString (const QString &s)
 Remove all diacritical marks, etc., etc., from a string leaving just the base characters. More...
 
static bool parseProgramString (const QString &string, qsizetype limit, QString &team1, QString &team2)
 

Variables

static constexpr int64_t kLookBackTime { 3LL * 60 * 60 }
 Does the specified time fall within -3/+1 hour from now? More...
 
static constexpr int64_t kLookForwardTime { 1LL * 60 * 60 }
 
static constexpr std::chrono::minutes kExtensionTime {10}
 
static constexpr int kExtensionTimeInSec
 
static const QRegularExpression kVersusPattern {R"(\s(at|@|vs\.?)\s)"}
 
static const QRegularExpression kSentencePattern {R"(:|\.+\s)"}
 
static const QString espnInfoUrlFmt {"http://site.api.espn.com/apis/site/v2/sports/%1/%2/scoreboard"}
 ESPN ///. More...
 
static const QString espnGameUrlFmt {"http://sports.core.api.espn.com/v2/sports/%1/leagues/%2/events/%3/competitions/%3/status"}
 

Macro Definition Documentation

◆ LOC

#define LOC   QString("RecExt: ")

Definition at line 43 of file recordingextender.cpp.

Function Documentation

◆ ValidRecordingStatus()

static bool ValidRecordingStatus ( RecStatus::Type  recstatus)
inlinestatic

Does this recording status indicate that the recording is still ongoing.

Parameters
[in]recstatusThe status of a single program recording.
Returns
true if the program is still being recorded. Returns false if the recording has failed, stopped, etc.

Definition at line 60 of file recordingextender.cpp.

Referenced by RecordingExtender::processActiveRecordings(), and RecordingExtender::processNewRecordings().

◆ normalizeString()

static QString normalizeString ( const QString &  s)
static

Remove all diacritical marks, etc., etc., from a string leaving just the base characters.

This is needed for cases where TV listing use diacritical marks in the sports team names, but the information provider doesn't.

Parameters
sThe string to clean up.
Returns
The cleaned up string.

Definition at line 350 of file recordingextender.cpp.

Referenced by RecordingExtender::nameCleanup().

◆ parseProgramString()

static bool parseProgramString ( const QString &  string,
qsizetype  limit,
QString &  team1,
QString &  team2 
)
static

Definition at line 1219 of file recordingextender.cpp.

Referenced by RecordingExtender::parseProgramInfo().

Variable Documentation

◆ kLookBackTime

constexpr int64_t kLookBackTime { 3LL * 60 * 60 }
staticconstexpr

Does the specified time fall within -3/+1 hour from now?

Definition at line 46 of file recordingextender.cpp.

Referenced by RecExtDataPage::timeIsClose().

◆ kLookForwardTime

constexpr int64_t kLookForwardTime { 1LL * 60 * 60 }
staticconstexpr

Definition at line 47 of file recordingextender.cpp.

Referenced by RecExtDataPage::timeIsClose().

◆ kExtensionTime

constexpr std::chrono::minutes kExtensionTime {10}
staticconstexpr

◆ kExtensionTimeInSec

constexpr int kExtensionTimeInSec
staticconstexpr
Initial value:
{
(duration_cast<std::chrono::seconds>(kExtensionTime).count()) }

Definition at line 50 of file recordingextender.cpp.

Referenced by RecordingExtender::extendRecording(), and RecordingExtender::processActiveRecordings().

◆ kVersusPattern

const QRegularExpression kVersusPattern {R"(\s(at|@|vs\.?)\s)"}
static

Definition at line 52 of file recordingextender.cpp.

Referenced by RecExtEspnDataPage::findGameInfo(), and parseProgramString().

◆ kSentencePattern

const QRegularExpression kSentencePattern {R"(:|\.+\s)"}
static

Definition at line 53 of file recordingextender.cpp.

Referenced by parseProgramString().

◆ espnInfoUrlFmt

const QString espnInfoUrlFmt {"http://site.api.espn.com/apis/site/v2/sports/%1/%2/scoreboard"}
static

ESPN ///.

Definition at line 400 of file recordingextender.cpp.

Referenced by RecExtEspnDataSource::makeInfoUrl().

◆ espnGameUrlFmt

const QString espnGameUrlFmt {"http://sports.core.api.espn.com/v2/sports/%1/leagues/%2/events/%3/competitions/%3/status"}
static

Definition at line 401 of file recordingextender.cpp.

Referenced by RecExtEspnDataSource::makeGameUrl().

kExtensionTime
static constexpr std::chrono::minutes kExtensionTime
Definition: recordingextender.cpp:49