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 // libmythtv headers
11 #include "programdata.h"
12 
13 // filldata headers
14 #include "channeldata.h"
15 #include "xmltvparser.h"
16 
17 #define 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 Source
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 SourceList = std::vector<Source>;
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 Source& source, int offset);
54  bool Run(SourceList &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
Source::lineupid
QString lineupid
Definition: filldata.h:32
FillData::m_fatalErrors
QStringList m_fatalErrors
Definition: filldata.h:80
ChannelData
Definition: channeldata.h:12
programdata.h
FillData::m_refreshAll
bool m_refreshAll
Definition: filldata.h:79
FillData::FillData
FillData()
Definition: filldata.h:45
Source::xmltvgrabber_lineups
bool xmltvgrabber_lineups
Definition: filldata.h:37
Source::xmltvgrabber_manualconfig
bool xmltvgrabber_manualconfig
Definition: filldata.h:34
Source::xmltvgrabber_apiconfig
bool xmltvgrabber_apiconfig
Definition: filldata.h:36
updateLastRunEnd
bool updateLastRunEnd()
Definition: filldata.cpp:39
FillData::m_grabOptions
QString m_grabOptions
Definition: filldata.h:66
Source::xmltvgrabber_prefmethod
QString xmltvgrabber_prefmethod
Definition: filldata.h:38
FillData::Run
bool Run(SourceList &sourcelist)
Goes through the sourcelist and updates its channels with program info grabbed with the associated gr...
Definition: filldata.cpp:247
Source
Definition: channelsettings.cpp:68
Source::xmltvgrabber_baseline
bool xmltvgrabber_baseline
Definition: filldata.h:33
FillData::GrabData
bool GrabData(const Source &source, int offset)
Definition: filldata.cpp:120
FillData::kRefreshClear
@ kRefreshClear
Definition: filldata.h:58
xmltvparser.h
Source::userid
QString userid
Definition: filldata.h:30
Source::xmltvgrabber_cache
bool xmltvgrabber_cache
Definition: filldata.h:35
updateNextScheduledRun
bool updateNextScheduledRun()
Definition: filldata.cpp:63
FillData::m_chanData
ChannelData m_chanData
Definition: filldata.h:63
uint
unsigned int uint
Definition: compat.h:144
Source::name
QString name
Definition: filldata.h:28
FillData::GrabDataFromFile
bool GrabDataFromFile(int id, const QString &filename)
Definition: filldata.cpp:89
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:47
channeldata.h
Source::password
QString password
Definition: filldata.h:31
FillData::SetRefresh
void SetRefresh(int day, bool set)
Definition: filldata.cpp:71
updateLastRunStatus
bool updateLastRunStatus(QString &status)
Definition: filldata.cpp:56
FillData::m_refreshTba
bool m_refreshTba
Definition: filldata.h:71
FillData::m_interrupted
bool m_interrupted
Definition: filldata.h:69
SourceList
std::vector< Source > SourceList
Definition: filldata.h:40
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
Source::xmltvgrabber
QString xmltvgrabber
Definition: filldata.h:29
FillData::kRefreshAll
@ kRefreshAll
Definition: filldata.h:59