MythTV  master
filldata.h
Go to the documentation of this file.
1 #ifndef FILLDATA_H
2 #define FILLDATA_H
3 
4 // C++ headers
5 #include <vector>
6 
7 // Qt headers
8 #include <QString>
9 
10 // MythTV headers
11 #include "libmythtv/programdata.h"
12 
13 // filldata headers
14 #include "channeldata.h"
15 #include "xmltvparser.h"
16 
17 static constexpr int8_t REFRESH_MAX { 21 };
18 
19 // helper functions to update mfdb status fields in settings
20 bool updateLastRunEnd();
21 bool updateLastRunStart();
22 bool updateLastRunStatus(QString &status);
24 
25 struct DataSource
26 {
27  int id {0};
28  QString name;
29  QString xmltvgrabber;
30  QString userid;
31  QString password;
32  QString lineupid;
33  bool xmltvgrabber_baseline {false};
35  bool xmltvgrabber_cache {false};
36  bool xmltvgrabber_apiconfig {false};
37  bool xmltvgrabber_lineups {false};
39 };
40 using DataSourceList = std::vector<DataSource>;
41 
42 class FillData
43 {
44  public:
46  {
47  SetRefresh(1, true);
48  }
49 
50  void SetRefresh(int day, bool set);
51 
52  bool GrabDataFromFile(int id, const QString &filename);
53  bool GrabData(const DataSource& source, int offset);
54  bool Run(DataSourceList &sourcelist);
55 
56  enum
57  {
58  kRefreshClear = 0xFFFF0,
59  kRefreshAll = 0xFFFF1,
60  };
61 
62  public:
65 
66  QString m_grabOptions;
68 
69  bool m_interrupted {false};
70  bool m_endOfData {false};
71  bool m_refreshTba {true};
72  bool m_needPostGrabProc {true};
73  bool m_onlyUpdateChannels {false};
74  bool m_channelUpdateRun {false};
75  bool m_noAllAtOnce {false};
76 
77  private:
78  QMap<uint,bool> m_refreshDay;
79  bool m_refreshAll {false};
80  mutable QStringList m_fatalErrors;
81 };
82 
83 #endif // FILLDATA_H
FillData::m_fatalErrors
QStringList m_fatalErrors
Definition: filldata.h:80
DataSource::xmltvgrabber
QString xmltvgrabber
Definition: filldata.h:29
DataSourceList
std::vector< DataSource > DataSourceList
Definition: filldata.h:40
ChannelData
Definition: channeldata.h:12
DataSource::name
QString name
Definition: filldata.h:28
programdata.h
FillData::m_refreshAll
bool m_refreshAll
Definition: filldata.h:79
FillData::FillData
FillData()
Definition: filldata.h:45
DataSource::lineupid
QString lineupid
Definition: filldata.h:32
DataSource
Definition: filldata.h:25
FillData::kRefreshAll
@ kRefreshAll
Definition: filldata.h:59
DataSource::xmltvgrabber_apiconfig
bool xmltvgrabber_apiconfig
Definition: filldata.h:36
updateLastRunEnd
bool updateLastRunEnd()
Definition: filldata.cpp:38
FillData::m_grabOptions
QString m_grabOptions
Definition: filldata.h:66
FillData::kRefreshClear
@ kRefreshClear
Definition: filldata.h:58
xmltvparser.h
FillData::Run
bool Run(DataSourceList &sourcelist)
Goes through the sourcelist and updates its channels with program info grabbed with the associated gr...
Definition: filldata.cpp:246
REFRESH_MAX
static constexpr int8_t REFRESH_MAX
Definition: filldata.h:17
updateNextScheduledRun
bool updateNextScheduledRun()
Definition: filldata.cpp:62
FillData::m_chanData
ChannelData m_chanData
Definition: filldata.h:63
uint
unsigned int uint
Definition: compat.h:81
FillData::GrabData
bool GrabData(const DataSource &source, int offset)
Definition: filldata.cpp:119
FillData::GrabDataFromFile
bool GrabDataFromFile(int id, const QString &filename)
Definition: filldata.cpp:88
DataSource::xmltvgrabber_prefmethod
QString xmltvgrabber_prefmethod
Definition: filldata.h:38
XMLTVParser
Definition: xmltvparser.h:16
FillData
Definition: filldata.h:42
FillData::m_onlyUpdateChannels
bool m_onlyUpdateChannels
Definition: filldata.h:73
FillData::m_endOfData
bool m_endOfData
Definition: filldata.h:70
updateLastRunStart
bool updateLastRunStart()
Definition: filldata.cpp:46
DataSource::userid
QString userid
Definition: filldata.h:30
channeldata.h
FillData::SetRefresh
void SetRefresh(int day, bool set)
Definition: filldata.cpp:70
updateLastRunStatus
bool updateLastRunStatus(QString &status)
Definition: filldata.cpp:55
FillData::m_refreshTba
bool m_refreshTba
Definition: filldata.h:71
DataSource::xmltvgrabber_baseline
bool xmltvgrabber_baseline
Definition: filldata.h:33
FillData::m_interrupted
bool m_interrupted
Definition: filldata.h:69
DataSource::xmltvgrabber_lineups
bool xmltvgrabber_lineups
Definition: filldata.h:37
DataSource::xmltvgrabber_manualconfig
bool xmltvgrabber_manualconfig
Definition: filldata.h:34
FillData::m_noAllAtOnce
bool m_noAllAtOnce
Definition: filldata.h:75
FillData::m_channelUpdateRun
bool m_channelUpdateRun
Definition: filldata.h:74
build_compdb.filename
filename
Definition: build_compdb.py:21
FillData::m_needPostGrabProc
bool m_needPostGrabProc
Definition: filldata.h:72
FillData::m_xmltvParser
XMLTVParser m_xmltvParser
Definition: filldata.h:64
FillData::m_maxDays
uint m_maxDays
Definition: filldata.h:67
FillData::m_refreshDay
QMap< uint, bool > m_refreshDay
Definition: filldata.h:78
DataSource::xmltvgrabber_cache
bool xmltvgrabber_cache
Definition: filldata.h:35
DataSource::password
QString password
Definition: filldata.h:31