-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpodcastmanager.h
59 lines (34 loc) · 1.21 KB
/
podcastmanager.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
52
53
54
55
56
57
58
59
#ifndef PODCASTMANAGER_H
#define PODCASTMANAGER_H
#include <QString>
#include <QtNetwork/QNetworkAccessManager>
#include <QtNetwork/QNetworkReply>
#include <QUrl>
#include <QXmlStreamReader>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QFile>
#include <QStandardPaths>
#include <QEventLoop>
#include <QImage>
class PodcastManager
{
public:
PodcastManager();
QString addPodcast(QString Link, QString Type);
QString removePodcast(QString podcastName);
private:
QNetworkAccessManager *manager;
QString appDataFolder = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) + "/PodcastFeed";
QString xmlFolder = appDataFolder + "/xml";
QString iconFolder = appDataFolder + "/icons";
QString appDataFile = appDataFolder + "/podcasts.json";
bool getRSSurl(QString itunesLink, QString &rssLink);
bool storeXmlFile(QString podcastName, QByteArray rawReply);
bool storeIcon(QString podcastName, QString iconURL);
bool addPodcast_toAppDataFile(QString podcastName, QString rssLink);
bool removePodcast_fromAppDataFile(QString podcastName);
bool checkPodcastExists(QString podcastName);
};
#endif // PODCASTMANAGER_H