Commit 48fdc576 authored by Langston Ball's avatar Langston Ball

Merge branch 'master' of git.linuxmce.org:linuxmce/linuxmce

parents e1bc7ffe bf87e8f5
#include "databaseinterface.h"
DatabaseInterface::DatabaseInterface(QObject *parent) : QObject(parent)
{
}
int DatabaseInterface::findExistingFileId(QString filename)
{
}
QString DatabaseInterface::findIdFromFilename(int fileid)
{
}
bool DatabaseInterface::addMetadataToDatabase(LinuxmceFile *filemetadata)
{
}
void DatabaseInterface::initDatabaseConnection()
{
}
#pragma once
#include <QObject>
#include <linuxmcefile.h>
class DatabaseInterface : public QObject
{
Q_OBJECT
public:
explicit DatabaseInterface(QObject *parent = 0);
signals:
public slots:
int findExistingFileId(QString filename);
QString findIdFromFilename(int fileid);
bool addMetadataToDatabase(LinuxmceFile * filemetadata);
private:
bool connectedToDatabase;
private:
void initDatabaseConnection();
};
#include "filenameparser.h"
FilenameParser::FilenameParser(QObject *parent) : QObject(parent)
{
setupFilters();
}
void FilenameParser::parseFileName(QString fileName)
{
}
void FilenameParser::parseFileNameWithData(QString name, int mediaType, int mediaSubtype)
{
}
bool FilenameParser::setupFilters()
{
m_videoFileNames << "mov" << "avi" << "mpeg" << "mpg" << "wmv" << "ts" << "tp" << "dvd" << "vdr" << "ogm" << "evo" << "m2ts" << "iso" << "mp4" << "divx" << "blu";
return true;
}
#pragma once
#include <QObject>
#include <QJsonObject>
class FilenameParser : public QObject
{
Q_OBJECT
public:
explicit FilenameParser(QObject *parent = 0);
signals:
void mediaFileNameParsed(QJsonObject metaData);
public slots:
void parseFileName(QString fileName);
void parseFileNameWithData(QString name, int mediaType=-1, int mediaSubtype=-1);
private slots:
bool setupFilters();
private:
QStringList m_videoFileNames;
QStringList m_televisionStrings;
QStringList m_movieStrings;
QStringList m_specialStrings;
};
#include "linuxmcefile.h"
LinuxmceFile::LinuxmceFile(QObject *parent) : QObject(parent)
{
}
#ifndef LINUXMCEFILE_H
#define LINUXMCEFILE_H
#include "QString"
#include "QObject"
class LinuxmceFile : public QObject
{
Q_OBJECT
public:
explicit LinuxmceFile(QObject *parent = 0);
signals:
public slots:
private:
int m_iFileId;
QString m_fileName;
};
#endif // LINUXMCEFILE_H
QT += core network
QT -= gui
TARGET = lmce-metadata-scanner
CONFIG += console c++11
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp \
filenameparser.cpp \
metadatamanager.cpp \
linuxmcefile.cpp \
networkmetadatamanager.cpp \
databaseinterface.cpp
HEADERS += \
filenameparser.h \
metadatamanager.h \
linuxmcefile.h \
networkmetadatamanager.h \
databaseinterface.h
#include <QCoreApplication>
#include "metadatamanager.h"
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
MetadataManager metaMangager;
return a.exec();
}
#include "metadatamanager.h"
MetadataManager::MetadataManager(QObject *parent) : QObject(parent)
,m_filenameParser(new FilenameParser())
,m_database(new DatabaseInterface())
,m_networkMetadata(new NetworkMetadataManager() )
{
}
void MetadataManager::addFileToQueue(QString incomingFile){
if(!m_filenameQueue.contains(incomingFile)){
m_filenameQueue.append(incomingFile);
emit fileQueueListChanged();
}
}
#pragma once
#include "filenameparser.h"
#include "databaseinterface.h"
#include "networkmetadatamanager.h"
#include <QStringList>
#include <QJsonObject>
class MetadataManager : public QObject
{
Q_OBJECT
public:
explicit MetadataManager(QObject *parent = 0);
signals:
void fileQueueListChanged();
void fileFinished();
public slots:
void addFileToQueue(QString incomingFile);
private:
FilenameParser *m_filenameParser;
QStringList m_filenameQueue;
QList<QJsonObject> m_parsedFileData;
DatabaseInterface * m_database;
NetworkMetadataManager * m_networkMetadata;
};
#include "networkmetadatamanager.h"
NetworkMetadataManager::NetworkMetadataManager(QObject *parent) : QObject(parent)
{
}
#pragma once
#include <QObject>
class NetworkMetadataManager : public QObject
{
Q_OBJECT
public:
explicit NetworkMetadataManager(QObject *parent = 0);
signals:
public slots:
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment