/
CustomMovieScraper.h
51 lines (41 loc) · 1.66 KB
/
CustomMovieScraper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef CUSTOMMOVIESCRAPER_H
#define CUSTOMMOVIESCRAPER_H
#include <QObject>
#include "data/ImageProviderInterface.h"
#include "data/ScraperInterface.h"
class CustomMovieScraper : public ScraperInterface
{
Q_OBJECT
public:
explicit CustomMovieScraper(QObject *parent = 0);
static CustomMovieScraper *instance(QObject *parent = 0);
QString name();
QString identifier();
void search(QString searchStr);
void loadData(QMap<ScraperInterface*, QString> ids, Movie *movie, QList<int> infos);
bool hasSettings();
void loadSettings(QSettings &settings);
void saveSettings(QSettings &settings);
QList<int> scraperSupports();
QList<int> scraperNativelySupports();
QList<ScraperInterface*> scrapersNeedSearch(QList<int> infos, QMap<ScraperInterface *, QString> alreadyLoadedIds);
ScraperInterface *titleScraper();
QWidget *settingsWidget();
bool isAdult();
ScraperInterface *scraperForInfo(int info);
private slots:
void onTitleSearchDone(QList<ScraperSearchResult> results);
void onLoadTmdbFinished();
signals:
void searchDone(QList<ScraperSearchResult>);
private:
QList<ScraperInterface*> m_scrapers;
QNetworkAccessManager m_qnam;
QList<ScraperInterface*> scrapersForInfos(QList<int> infos);
ImageProviderInterface *imageProviderForInfo(int info);
QList<ImageProviderInterface*> imageProvidersForInfos(QList<int> infos);
QList<int> infosForScraper(ScraperInterface *scraper, QList<int> selectedInfos);
void loadAllData(QMap<ScraperInterface*, QString> ids, Movie *movie, QList<int> infos, QString tmdbId, QString imdbId);
QNetworkAccessManager *qnam();
};
#endif // CUSTOMMOVIESCRAPER_H