mediascanner.h
1 #ifndef MEDIASCANNER_H
2 #define MEDIASCANNER_H
3 
4 #include <QObject>
5 #include <QString>
6 #include <QRunnable>
7 #include <QDir>
8 #include <QDebug>
9 #include <QDateTime>
10 #include <QtSql>
11 #include "mediadb.h"
12 #include <QStorageInfo>
13 #include <QVariant>
14 #include <taglib/taglib.h>
15 #include <taglib/tag.h>
16 #include <taglib/fileref.h>
17 #include <taglib/taglib_config.h>
18 #include <taglib/tpropertymap.h>
19 
20 class MediaScanner: public QObject,public QRunnable
21 {
22 Q_OBJECT
23 public:
24  MediaScanner();
25  virtual void run() override;
26  QVariantList getVolumes();
27  int addLocation(QString name, QString v_unique_id, QString v_path, QString relative_path);
28  void scanLocation(int location_id);
29  void updateLocationsAvailability();
30  QVariantMap getMusicInfo(QString file);
31  MediaDB *mediadb;
32 signals:
33  void scanningStarted();
34  void scanningFinished();
35 private:
36  QStringList audioFileTypes;
37  QStringList videoFileTypes;
38  QStringList playlistFileTypes;
39  QStringList imageFileTypes;
40  QStringList mediaFileTypes;
41  QList<QMap<QString, QVariant>> pathsToScan;
42  QString scanForThumbnail(QString path, bool tryParent, QString absPosition);
43  void scanForMediaFiles(QString path, int folder_id);
44  void scanForFolders(QString path, bool is_root, int location_id, QString current_dir, qint64 last_modified);
45  bool isRunning;
46  QString getStorageUUID(QString device);
47 };
48 
49 #endif // MEDIASCANNER_H
Database abstraction class, used to fetch and insert/update data to/from the media library&#39;s SQLITE d...
Definition: mediadb.h:58
Definition: mediascanner.h:20