project renamed

This commit is contained in:
2017-10-04 09:27:49 +02:00
commit b90cb8db8e
52 changed files with 10927 additions and 0 deletions
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

BIN
View File
Binary file not shown.
+287
View File
@@ -0,0 +1,287 @@
#include "cedit.h"
#include "ui_cedit.h"
#include "cimage.h"
#include "cseasondetails.h"
#include "cmessageanimatedialog.h"
#include <QRadioButton>
#include <QGroupBox>
#include <QGridLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QSpacerItem>
#include <QLineEdit>
#include <QScrollArea>
#include <QDialogButtonBox>
#include <QLabel>
#include <QButtonGroup>
#include <QDebug>
#include <QTime>
cEdit::cEdit(QWidget *parent) :
QDialog(parent),
ui(new Ui::cEdit),
m_bLoaded(false),
m_lpButton1(0),
m_lpButton2(0),
m_lpButton3(0),
m_lpInit(0),
m_lpProgress(0),
m_lpDone(0),
m_lpGroupBox(0),
m_lpGridLayout(0),
m_lpGrid(0),
m_lpLabel(0),
m_lpLabel1(0),
m_lpSpacer(0),
m_lpGroup(0),
m_lpAllInit(0),
m_lpAllProgress(0),
m_lpAllDone(0),
m_lpVerticalSpacer(0),
// m_lpButtonBox(0),
m_lpSerie(0)
{
ui->setupUi(this);
connect(ui->m_lpAllInit, SIGNAL(clicked()), this, SLOT(lpAllInit_clicked()));
connect(ui->m_lpAllProgress, SIGNAL(clicked()), this, SLOT(lpAllProgress_clicked()));
connect(ui->m_lpAllDone, SIGNAL(clicked()), this, SLOT(lpAllDone_clicked()));
ui->m_lpTabWidget->setCurrentIndex(0);
}
cEdit::~cEdit()
{
if(m_lpSerie)
{
int x;
QList<cSeason*> seasonList = m_lpSerie->seasonList();
for(x = 0;x < seasonList.count();x++)
{
cSeason* lpSeason = seasonList.at(x);
QList<cEpisode*> episodeList = lpSeason->episodeList();
for(int y = 0;y < episodeList.count();y++)
{
cEpisode* lpEpisode = episodeList.at(y);
if(lpEpisode)
{
lpEpisode->setButton1(0);
lpEpisode->setButton2(0);
lpEpisode->setButton3(0);
}
}
}
}
delete ui;
}
void cEdit::setSerie(cSerie* lpSerie)
{
m_lpSerie = lpSerie;
if(!lpSerie)
return;
ui->m_lpName->setText(lpSerie->seriesName());
ui->m_lpFirstAired->setDate(lpSerie->firstAired());
ui->m_lpCliffhanger->setChecked(lpSerie->cliffhanger());
ui->m_lpDownloadLink->setText(lpSerie->download());
int x;
QList<cSeason*> seasonList = lpSerie->seasonList();
for(x = 0;x < seasonList.count();x++)
{
cSeason* lpSeason = seasonList.at(x);
m_lpGroupBox = new QGroupBox(QString("Season %1").arg(lpSeason->number()), ui->m_lpScrollAreaWidget);
lpSeason->setGroupBox(m_lpGroupBox);
m_lpGridLayout = new QGridLayout(m_lpGroupBox);
lpSeason->setGridLayout(m_lpGridLayout);
m_lpGrid = new QGridLayout();
lpSeason->setGrid(m_lpGrid);
m_lpLabel1 = new QLabel("Episode");
lpSeason->setLabel1(m_lpLabel1);
m_lpAllInit = new QPushButton("all Init");
lpSeason->setAllInit(m_lpAllInit);
m_lpAllProgress = new QPushButton("all Prog");
lpSeason->setAllProgress(m_lpAllProgress);
m_lpAllDone = new QPushButton("all Done");
lpSeason->setAllDone(m_lpAllDone);
connect(m_lpAllInit, SIGNAL(clicked()), this, SLOT(allInit_clicked()));
connect(m_lpAllProgress, SIGNAL(clicked()), this, SLOT(allProgress_clicked()));
connect(m_lpAllDone, SIGNAL(clicked()), this, SLOT(allDone_clicked()));
m_lpGrid->addWidget(m_lpLabel1, 0, 0, 1, 1);
m_lpGrid->addWidget(m_lpAllInit, 1, 0, 1, 1);
m_lpGrid->addWidget(m_lpAllProgress, 2, 0, 1, 1);
m_lpGrid->addWidget(m_lpAllDone, 3, 0, 1, 1);
bool bFirst = true;
QList<cEpisode*> episodeList = lpSeason->episodeList();
for(int y = 0;y < episodeList.count();y++)
{
cEpisode* lpEpisode = episodeList.at(y);
m_lpGroup = new QButtonGroup(this);
lpEpisode->setGroup(m_lpGroup);
m_lpLabel = new QLabel(QString("%1").arg(lpEpisode->episodeNumber()), m_lpGroupBox);
lpEpisode->setLabel(m_lpLabel);
if(bFirst)
{
m_lpButton1 = new QRadioButton("init", m_lpGroupBox);
m_lpButton2 = new QRadioButton("prog", m_lpGroupBox);
m_lpButton3 = new QRadioButton("done", m_lpGroupBox);
bFirst = false;
}
else
{
m_lpButton1 = new QRadioButton(m_lpGroupBox);
m_lpButton2 = new QRadioButton(m_lpGroupBox);
m_lpButton3 = new QRadioButton(m_lpGroupBox);
}
lpEpisode->setButton1(m_lpButton1);
lpEpisode->setButton2(m_lpButton2);
lpEpisode->setButton3(m_lpButton3);
m_lpLabel->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter);
m_lpButton1->setLayoutDirection(Qt::RightToLeft);
m_lpButton2->setLayoutDirection(Qt::RightToLeft);
m_lpButton3->setLayoutDirection(Qt::RightToLeft);
switch(lpEpisode->state())
{
case cEpisode::StateInit:
m_lpButton1->setChecked(true);
break;
case cEpisode::StateProgress:
m_lpButton2->setChecked(true);
break;
case cEpisode::StateDone:
m_lpButton3->setChecked(true);
break;
default:
break;
}
m_lpGroup->addButton(m_lpButton1);
m_lpGroup->addButton(m_lpButton2);
m_lpGroup->addButton(m_lpButton3);
m_lpGrid->addWidget(m_lpLabel, 0, y+1, 1, 1);
m_lpGrid->addWidget(m_lpButton1, 1, y+1, 1, 1);
m_lpGrid->addWidget(m_lpButton2, 2, y+1, 1, 1);
m_lpGrid->addWidget(m_lpButton3, 3, y+1, 1, 1);
}
m_lpGridLayout->addLayout(m_lpGrid, 0, 0, 1, 1);
m_lpSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);
lpSeason->setSpacer(m_lpSpacer);
m_lpGridLayout->addItem(m_lpSpacer, 0, 1, 1, 1);
ui->m_lpGridLayoutScroll->addWidget(m_lpGroupBox, x, 0, 1, 1);
}
m_lpVerticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
ui->m_lpGridLayoutScroll->addItem(m_lpVerticalSpacer, x+1, 0, 1, 1);
}
void cEdit::lpAllInit_clicked()
{
m_lpSerie->allInit();
}
void cEdit::lpAllProgress_clicked()
{
m_lpSerie->allProgress();
}
void cEdit::lpAllDone_clicked()
{
m_lpSerie->allDone();
}
void cEdit::allInit_clicked()
{
QPushButton* lpButton = (QPushButton*)sender();
m_lpSerie->seasonInit(lpButton);
}
void cEdit::allProgress_clicked()
{
QPushButton* lpButton = (QPushButton*)sender();
m_lpSerie->seasonProgress(lpButton);
}
void cEdit::allDone_clicked()
{
QPushButton* lpButton = (QPushButton*)sender();
m_lpSerie->seasonDone(lpButton);
}
QString cEdit::download()
{
return(ui->m_lpDownloadLink->text());
}
void cEdit::on_m_lpTabWidget_tabBarClicked(int index)
{
if(index == 1)
{
if(!m_bLoaded)
{
cMessageAnimateDialog* lpDialog = new cMessageAnimateDialog(this);
lpDialog->setTitle("Edit");
lpDialog->setMessage("Loading");
lpDialog->show();
cImage image;
QPixmap banner = image.getImage(m_lpSerie->banner());
ui->m_lpDetailsBanner->setPixmap(banner);
ui->m_lpDetailsOverview->setText(m_lpSerie->overview());
ui->m_lpDetailsSeasonTab->clear();
QTreeWidgetItem* lpItem;
for(int x = 0;x < m_lpSerie->actors().count();x++)
{
lpItem = new QTreeWidgetItem(ui->m_lpDetailsActors);
lpItem->setText(0, m_lpSerie->actors().at(x));
ui->m_lpDetailsActors->addTopLevelItem(lpItem);
}
for(int x = 0;x < m_lpSerie->genre().count();x++)
{
lpItem = new QTreeWidgetItem(ui->m_lpDetailsGenre);
lpItem->setText(0, m_lpSerie->genre().at(x));
ui->m_lpDetailsGenre->addTopLevelItem(lpItem);
}
for(int x = 0;x < m_lpSerie->seasonList().count();x++)
{
cSeason* lpSeason = m_lpSerie->seasonList().at(x);
cSeasonDetails* lpSeasonDetails = new cSeasonDetails(ui->m_lpDetailsSeasonTab);
ui->m_lpDetailsSeasonTab->addTab(lpSeasonDetails, QString("Season %1").arg(lpSeason->number()));
lpSeasonDetails->setSeason(lpSeason);
}
delete lpDialog;
m_bLoaded = true;
}
}
}
void cEdit::on_m_lpCliffhanger_clicked()
{
m_lpSerie->setCliffhanger(ui->m_lpCliffhanger->checkState() == Qt::Checked);
}
void cEdit::on_m_lpFirstAired_dateChanged(const QDate &date)
{
m_lpSerie->setFirstAired(date);
}
+67
View File
@@ -0,0 +1,67 @@
#ifndef CEDIT_H
#define CEDIT_H
#include "cserie.h"
#include <QDialog>
//#include <QDialogButtonBox>
namespace Ui {
class cEdit;
}
class cEdit : public QDialog
{
Q_OBJECT
public:
explicit cEdit(QWidget *parent = 0);
~cEdit();
void setSerie(cSerie* lpSerie);
QString download();
private slots:
void lpAllInit_clicked();
void lpAllProgress_clicked();
void lpAllDone_clicked();
void allInit_clicked();
void allProgress_clicked();
void allDone_clicked();
void on_m_lpTabWidget_tabBarClicked(int index);
void on_m_lpCliffhanger_clicked();
void on_m_lpFirstAired_dateChanged(const QDate &date);
private:
Ui::cEdit* ui;
bool m_bLoaded;
QRadioButton* m_lpButton1;
QRadioButton* m_lpButton2;
QRadioButton* m_lpButton3;
QPushButton* m_lpInit;
QPushButton* m_lpProgress;
QPushButton* m_lpDone;
QGroupBox* m_lpGroupBox;
QGridLayout* m_lpGridLayout;
QGridLayout* m_lpGrid;
QLabel* m_lpLabel;
QLabel* m_lpLabel1;
QSpacerItem* m_lpSpacer;
QButtonGroup* m_lpGroup;
QPushButton* m_lpAllInit;
QPushButton* m_lpAllProgress;
QPushButton* m_lpAllDone;
QSpacerItem* m_lpVerticalSpacer;
// QDialogButtonBox* m_lpButtonBox;
cSerie* m_lpSerie;
};
#endif // CEDIT_H
+304
View File
@@ -0,0 +1,304 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>cEdit</class>
<widget class="QDialog" name="cEdit">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>804</width>
<height>732</height>
</rect>
</property>
<property name="windowTitle">
<string>Edit</string>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QTabWidget" name="m_lpTabWidget">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
<string>Progress</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QVBoxLayout" name="m_lpVerticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<widget class="QLineEdit" name="m_lpName">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>Year:</string>
</property>
</widget>
</item>
<item>
<widget class="QDateEdit" name="m_lpFirstAired"/>
</item>
<item>
<widget class="QCheckBox" name="m_lpCliffhanger">
<property name="text">
<string>Cliffhanger</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Download Link:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="m_lpDownloadLink"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="m_lpAllInit">
<property name="text">
<string>all Init</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_lpAllProgress">
<property name="text">
<string>all Progress</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="m_lpAllDone">
<property name="text">
<string>all Done</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QScrollArea" name="m_lpScrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="m_lpScrollAreaWidget">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>754</width>
<height>546</height>
</rect>
</property>
<layout class="QGridLayout" name="m_lpGridLayoutScroll"/>
</widget>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Details</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="0,1,1">
<item>
<widget class="QLabel" name="m_lpDetailsBanner">
<property name="minimumSize">
<size>
<width>758</width>
<height>140</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QScrollArea" name="scrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>756</width>
<height>241</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QTextEdit" name="m_lpDetailsOverview">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="2,1">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="cVerticalLabel" name="label_2">
<property name="text">
<string>Actors</string>
</property>
</widget>
</item>
<item>
<widget class="QTreeWidget" name="m_lpDetailsActors">
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="cVerticalLabel" name="label_3">
<property name="text">
<string>Genre</string>
</property>
</widget>
</item>
<item>
<widget class="QTreeWidget" name="m_lpDetailsGenre">
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QTabWidget" name="m_lpDetailsSeasonTab">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Tab 1</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
<item>
<widget class="QDialogButtonBox" name="m_lpButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>cVerticalLabel</class>
<extends>QLabel</extends>
<header>cverticallabel.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
<connection>
<sender>m_lpButtonBox</sender>
<signal>accepted()</signal>
<receiver>cEdit</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_lpButtonBox</sender>
<signal>rejected()</signal>
<receiver>cEdit</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+350
View File
@@ -0,0 +1,350 @@
#include "cepisode.h"
#define DELETE(x) { if(x) delete x;x = 0;}
cEpisode::cEpisode() :
m_iID(-1),
m_szDirector(""),
m_szEpisodeName(""),
m_iEpisodeNumber(-1),
m_firstAired(QDate(1900, 1, 1)),
m_szGuestStars(""),
m_szIMDBID(""),
m_szLanguage(""),
m_szOverview(""),
m_szProductionCode(""),
m_dRating(-1.0),
m_iRatingCount(-1),
m_iSeasonNumber(-1),
m_szWriter(""),
m_iSeasonID(-1),
m_iSeriesID(-1),
m_state(cEpisode::StateInit),
m_lpGroup(0),
m_lpLabel(0),
m_lpButton1(0),
m_lpButton2(0),
m_lpButton3(0)
{
}
cEpisode::~cEpisode()
{
deleteResources();
}
void cEpisode::setID(const qint32& iID)
{
m_iID = iID;
}
qint32 cEpisode::id()
{
return(m_iID);
}
void cEpisode::setDirector(const QString& szDirector)
{
m_szDirector = szDirector.split("|");
m_szDirector.removeAll("");
}
void cEpisode::setDirector(const QStringList& szDirector)
{
m_szDirector = szDirector;
m_szDirector.removeAll("");
}
QStringList cEpisode::director()
{
return(m_szDirector);
}
void cEpisode::setEpisodeName(const QString& szEpisodeName)
{
m_szEpisodeName = szEpisodeName;
}
QString cEpisode::episodeName()
{
return(m_szEpisodeName);
}
void cEpisode::setEpisodeNumber(const qint16& iEpisodeNumber)
{
m_iEpisodeNumber = iEpisodeNumber;
}
qint16 cEpisode::episodeNumber()
{
return(m_iEpisodeNumber);
}
void cEpisode::setFirstAired(const QString& szFirstAired)
{
m_firstAired = QDate::fromString(szFirstAired, "yyyy-MM-dd");
}
void cEpisode::setFirstAired(const QDate& firstAired)
{
m_firstAired = firstAired;
}
QDate cEpisode::firstAired()
{
return(m_firstAired);
}
void cEpisode::setGuestStars(const QString& szGuestStars)
{
m_szGuestStars = szGuestStars.split("|");
m_szGuestStars.removeAll("");
}
void cEpisode::setGuestStars(const QStringList& szGuestStars)
{
m_szGuestStars = szGuestStars;
m_szGuestStars.removeAll("");
}
QStringList cEpisode::guestStars()
{
return(m_szGuestStars);
}
void cEpisode::setIMDBID(const QString& szIMDBID)
{
m_szIMDBID = szIMDBID;
}
QString cEpisode::imdbID()
{
return(m_szIMDBID);
}
void cEpisode::setLanguage(const QString& szLanguage)
{
m_szLanguage = szLanguage;
}
QString cEpisode::language()
{
return(m_szLanguage);
}
void cEpisode::setOverview(const QString& szOverview)
{
m_szOverview = szOverview;
}
QString cEpisode::overview()
{
return(m_szOverview);
}
void cEpisode::setProductionCode(const QString& szProductionCode)
{
m_szProductionCode = szProductionCode;
}
QString cEpisode::productionCode()
{
return(m_szProductionCode);
}
void cEpisode::setRating(const qreal& dRating)
{
m_dRating = dRating;
}
qreal cEpisode::rating()
{
return(m_dRating);
}
void cEpisode::setRatingCount(const qint32& iRatingCount)
{
m_iRatingCount = iRatingCount;
}
qint32 cEpisode::ratingCount()
{
return(m_iRatingCount);
}
void cEpisode::setSeasonNumber(const qint16& iSeasonNumber)
{
m_iSeasonNumber = iSeasonNumber;
}
qint16 cEpisode::seasonNumber()
{
return(m_iSeasonNumber);
}
void cEpisode::setWriter(const QString& szWriter)
{
m_szWriter = szWriter.split("|");
m_szWriter.removeAll("");
}
void cEpisode::setWriter(const QStringList& szWriter)
{
m_szWriter = szWriter;
m_szWriter.removeAll("");
}
QStringList cEpisode::writer()
{
return(m_szWriter);
}
void cEpisode::setSeasonID(const qint32& iSeasonID)
{
m_iSeasonID = iSeasonID;
}
qint32 cEpisode::seasonID()
{
return(m_iSeasonID);
}
void cEpisode::setSeriesID(const qint32& iSeriesID)
{
m_iSeriesID = iSeriesID;
}
qint32 cEpisode::seriesID()
{
return(m_iSeriesID);
}
void cEpisode::setState(const State& state)
{
m_state = state;
switch(m_state)
{
case StateInit:
if(m_lpButton1)
m_lpButton1->setChecked(true);
if(m_lpButton2)
m_lpButton2->setChecked(false);
if(m_lpButton3)
m_lpButton3->setChecked(false);
break;
case StateProgress:
if(m_lpButton2)
m_lpButton2->setChecked(true);
if(m_lpButton1)
m_lpButton1->setChecked(false);
if(m_lpButton3)
m_lpButton3->setChecked(false);
break;
case StateDone:
if(m_lpButton3)
m_lpButton3->setChecked(true);
if(m_lpButton1)
m_lpButton1->setChecked(false);
if(m_lpButton2)
m_lpButton2->setChecked(false);
break;
default:
break;
}
}
cEpisode::State cEpisode::state()
{
return(m_state);
}
void cEpisode::setFileName(const QString& szFileName)
{
m_szFileName = szFileName;
}
QString cEpisode::fileName()
{
return(m_szFileName);
}
void cEpisode::setThumbHeight(const qint16& iThumbHeight)
{
m_iThumbHeight = iThumbHeight;
}
qint16 cEpisode::thumbHeight()
{
return(m_iThumbHeight);
}
void cEpisode::setThumbWidth(const qint16& iThumbWidth)
{
m_iThumbWidth = iThumbWidth;
}
qint16 cEpisode::thumbWidth()
{
return(m_iThumbWidth);
}
bool cEpisode::isValid()
{
if(m_iSeasonID != -1 && m_iEpisodeNumber != -1 && m_iSeasonNumber != -1)
return(true);
return(false);
}
void cEpisode::setGroup(QButtonGroup* lpGroup)
{
m_lpGroup = lpGroup;
}
void cEpisode::setLabel(QLabel* lpLabel)
{
m_lpLabel = lpLabel;
}
void cEpisode::setButton1(QRadioButton* lpButton1)
{
m_lpButton1 = lpButton1;
}
void cEpisode::setButton2(QRadioButton* lpButton2)
{
m_lpButton2 = lpButton2;
}
void cEpisode::setButton3(QRadioButton* lpButton3)
{
m_lpButton3 = lpButton3;
}
void cEpisode::updateState()
{
if(m_lpButton1)
{
if(m_lpButton1->isChecked())
m_state = StateInit;
}
if(m_lpButton2)
{
if(m_lpButton2->isChecked())
m_state = StateProgress;
}
if(m_lpButton3)
{
if(m_lpButton3->isChecked())
m_state = StateDone;
}
}
void cEpisode::deleteResources()
{
DELETE(m_lpGroup);
DELETE(m_lpLabel);
DELETE(m_lpButton1);
DELETE(m_lpButton2);
DELETE(m_lpButton3);
}
+132
View File
@@ -0,0 +1,132 @@
#ifndef CEPISODE_H
#define CEPISODE_H
#include <QMetaType>
#include <QList>
#include <QDate>
#include <QButtonGroup>
#include <QLabel>
#include <QRadioButton>
class cEpisode
{
public:
enum State
{
StateUnknown = 0,
StateInit = 1,
StateProgress = 2,
StateDone = 3,
};
cEpisode();
~cEpisode();
void setID(const qint32& iID);
qint32 id();
void setDirector(const QString& szDirector);
void setDirector(const QStringList& szDirector);
QStringList director();
void setEpisodeName(const QString& szEpisodeName);
QString episodeName();
void setEpisodeNumber(const qint16& iEpisodeNumber);
qint16 episodeNumber();
void setFirstAired(const QString& szFirstAired);
void setFirstAired(const QDate& firstAired);
QDate firstAired();
void setGuestStars(const QString& szGuestStars);
void setGuestStars(const QStringList& szGuestStars);
QStringList guestStars();
void setIMDBID(const QString& szIMDBID);
QString imdbID();
void setLanguage(const QString& szLanguage);
QString language();
void setOverview(const QString& szOverview);
QString overview();
void setProductionCode(const QString& szProductionCode);
QString productionCode();
void setRating(const qreal& dRating);
qreal rating();
void setRatingCount(const qint32& iRatingCount);
qint32 ratingCount();
void setSeasonNumber(const qint16& iSeasonNumber);
qint16 seasonNumber();
void setWriter(const QString& szWriter);
void setWriter(const QStringList& szWriter);
QStringList writer();
void setSeasonID(const qint32& iSeasonID);
qint32 seasonID();
void setSeriesID(const qint32& iSeriesID);
qint32 seriesID();
void setState(const State& state);
State state();
void setFileName(const QString& szFileName);
QString fileName();
void setThumbHeight(const qint16& iThumbHeight);
qint16 thumbHeight();
void setThumbWidth(const qint16& iThumbWidth);
qint16 thumbWidth();
bool isValid();
void setGroup(QButtonGroup* lpGroup);
void setLabel(QLabel* lpLabel);
void setButton1(QRadioButton* lpButton1);
void setButton2(QRadioButton* lpButton2);
void setButton3(QRadioButton* lpButton3);
void updateState();
void deleteResources();
private:
qint32 m_iID;
QStringList m_szDirector;
QString m_szEpisodeName;
qint16 m_iEpisodeNumber;
QDate m_firstAired;
QStringList m_szGuestStars;
QString m_szIMDBID;
QString m_szLanguage;
QString m_szOverview;
QString m_szProductionCode;
qreal m_dRating;
qint32 m_iRatingCount;
qint16 m_iSeasonNumber;
QStringList m_szWriter;
qint32 m_iSeasonID;
qint32 m_iSeriesID;
State m_state;
QString m_szFileName;
qint16 m_iThumbHeight;
qint16 m_iThumbWidth;
QButtonGroup* m_lpGroup;
QLabel* m_lpLabel;
QRadioButton* m_lpButton1;
QRadioButton* m_lpButton2;
QRadioButton* m_lpButton3;
};
Q_DECLARE_METATYPE(cEpisode*)
#endif // CEPISODE_H
+51
View File
@@ -0,0 +1,51 @@
#include "cepisodedetails.h"
#include "ui_cepisodedetails.h"
#include "cimage.h"
#include "cmessageanimatedialog.h"
#include <QDebug>
cEpisodeDetails::cEpisodeDetails(QWidget *parent) :
QWidget(parent),
ui(new Ui::cEpisodeDetails),
m_lpEpisode(0),
m_bLoaded(false)
{
ui->setupUi(this);
}
cEpisodeDetails::~cEpisodeDetails()
{
delete ui;
}
void cEpisodeDetails::setEpisode(cEpisode* lpEpisode)
{
m_lpEpisode = lpEpisode;
ui->m_lpEpisodeTitle->setText(lpEpisode->episodeName());
ui->m_lpOverview->setText(lpEpisode->overview());
}
void cEpisodeDetails::loadImages()
{
if(!m_lpEpisode)
return;
if(m_bLoaded)
return;
cMessageAnimateDialog* lpDialog = new cMessageAnimateDialog(this);
lpDialog->setTitle("Details");
lpDialog->setMessage("Loading Images");
lpDialog->show();
cImage image;
QPixmap pixmap = image.getImage(m_lpEpisode->fileName()).scaledToHeight(200);
ui->m_lpEpisodeThumb->setPixmap(pixmap);
delete lpDialog;
m_bLoaded = true;
}
+29
View File
@@ -0,0 +1,29 @@
#ifndef CEPISODEDETAILS_H
#define CEPISODEDETAILS_H
#include <QWidget>
#include "cepisode.h"
namespace Ui {
class cEpisodeDetails;
}
class cEpisodeDetails : public QWidget
{
Q_OBJECT
public:
explicit cEpisodeDetails(QWidget *parent = 0);
~cEpisodeDetails();
void setEpisode(cEpisode* lpEpisode);
void loadImages();
private:
Ui::cEpisodeDetails* ui;
cEpisode* m_lpEpisode;
bool m_bLoaded;
};
#endif // CEPISODEDETAILS_H
+76
View File
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>cEpisodeDetails</class>
<widget class="QWidget" name="cEpisodeDetails">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>300</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLabel" name="m_lpEpisodeThumb">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLineEdit" name="m_lpEpisodeTitle">
<property name="font">
<font>
<pointsize>12</pointsize>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QScrollArea" name="m_lpScrollArea">
<property name="widgetResizable">
<bool>true</bool>
</property>
<widget class="QWidget" name="scrollAreaWidgetContents">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>365</width>
<height>245</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTextEdit" name="m_lpOverview">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
+62
View File
@@ -0,0 +1,62 @@
#include "cimage.h"
#include <QDir>
#include <QFile>
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QEventLoop>
#include <QUrl>
cImage::cImage()
{
}
QPixmap cImage::getImage(const QString& szFileName)
{
QPixmap pixmap;
QString szPath = QDir::homePath() + QDir::separator() + "qtseries" + QDir::separator() + szFileName;
if(szFileName.isEmpty())
pixmap.load(QDir::homePath() + QDir::separator() + "qtseries" + QDir::separator() + "empty.jpg");
else
pixmap.load(szPath);
if(!pixmap.width())
return(downloadFile(szFileName));
return(pixmap);
}
QPixmap cImage::downloadFile(const QString& szFileName)
{
QPixmap pixmap;
QString szPath = QDir::homePath() + QDir::separator() + "qtseries" + QDir::separator() + szFileName;
QString szURL = "http://thetvdb.com/banners/" + szFileName;
QNetworkAccessManager networkManager;
QUrl url(szURL);
QNetworkRequest request(url);
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/xml");
QNetworkReply* reply = networkManager.get(request);
QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
QByteArray szData = reply->readAll();
delete reply;
pixmap.loadFromData(szData);
QDir dir(szPath);
QFileInfo fileInfo(szPath);
dir.mkpath(dir.filePath(fileInfo.absolutePath()));
pixmap.save(szPath);
return(pixmap);
}
+17
View File
@@ -0,0 +1,17 @@
#ifndef CIMAGE_H
#define CIMAGE_H
#include <QPixmap>
class cImage
{
public:
cImage();
QPixmap getImage(const QString& szFileName);
private:
QPixmap downloadFile(const QString& szFileName);
};
#endif // CIMAGE_H
+1133
View File
File diff suppressed because it is too large Load Diff
+98
View File
@@ -0,0 +1,98 @@
#ifndef CMAINWINDOW_H
#define CMAINWINDOW_H
#include "cserie.h"
#include "cmovie.h"
#include "cupdatethread.h"
#include "cpicturesthread.h"
#include <QMainWindow>
#include <QList>
#include <QSqlDatabase>
#include <QCloseEvent>
#include <QTime>
#include <QStandardItemModel>
#include <QItemSelection>
namespace Ui {
class cMainWindow;
}
class cMainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit cMainWindow(QWidget *parent = 0);
~cMainWindow();
void initDone();
private slots:
void on_m_lpSeriesList1_customContextMenuRequested(const QPoint &pos);
void on_m_lpSeriesList1_doubleClicked(const QModelIndex &index);
void on_m_lpSeriesList1_pressed(const QModelIndex &index);
void on_m_lpSeriesList2_customContextMenuRequested(const QPoint &pos);
void on_m_lpSeriesList2_doubleClicked(const QModelIndex &index);
void on_m_lpSeriesList2_pressed(const QModelIndex &index);
void onActionAdd();
void onActionUpdate();
void onActionDelete();
void onActionEdit();
void onActionGotoIMDB();
void onActionGotoDownload();
void onActionCopyDownload();
void onActionLoadPictures();
void updateMessage(const QString& szMessage, const qint32 &iProgress);
void updateAppendMessage(const QString& szMessage);
void updateDone();
void picturesMessage(const QString& szMessage, const qint32 &iProgress);
void picturesAppendMessage(const QString& szMessage);
void picturesDone();
void selectionChanged1(const QItemSelection &selected, const QItemSelection &deselected);
void selectionChanged2(const QItemSelection &selected, const QItemSelection &deselected);
void scrollbarValueChanged1(int value);
void scrollbarValueChanged2(int value);
private:
Ui::cMainWindow* ui;
cSerieList m_serieList;
cMovieList m_movieList;
QSqlDatabase m_db;
QString m_szOldSelected;
cMessageDialog* m_lpMessageDialog;
cUpdateThread* m_lpUpdateThread;
cPicturesThread* m_lpPicturesThread;
QTime m_timer;
QStandardItemModel* m_lpSeriesListModel;
bool m_bProcessing;
void initDB();
void loadDB();
void loadSeriesDB();
void loadMoviesDB();
void displaySeries();
bool runEdit(cSerie *lpSerie, QString& szDownload);
protected:
void closeEvent(QCloseEvent *event);
};
#endif // CMAINWINDOW_H
+145
View File
@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>cMainWindow</class>
<widget class="QMainWindow" name="cMainWindow">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1002</width>
<height>632</height>
</rect>
</property>
<property name="windowTitle">
<string>qtSeries</string>
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QTabWidget" name="m_lpMainTab">
<property name="currentIndex">
<number>0</number>
</property>
<widget class="QWidget" name="m_lpTVShowsTab">
<attribute name="title">
<string>TV Shows</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QSplitter" name="m_lpSplitter">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="handleWidth">
<number>0</number>
</property>
<widget class="QTreeView" name="m_lpSeriesList1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="layoutDirection">
<enum>Qt::LeftToRight</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
<attribute name="headerMinimumSectionSize">
<number>37</number>
</attribute>
<attribute name="headerStretchLastSection">
<bool>false</bool>
</attribute>
</widget>
<widget class="QTreeView" name="m_lpSeriesList2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
<horstretch>4</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="contextMenuPolicy">
<enum>Qt::CustomContextMenu</enum>
</property>
<property name="verticalScrollBarPolicy">
<enum>Qt::ScrollBarAsNeeded</enum>
</property>
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOn</enum>
</property>
<property name="editTriggers">
<set>QAbstractItemView::NoEditTriggers</set>
</property>
<property name="alternatingRowColors">
<bool>true</bool>
</property>
<property name="selectionMode">
<enum>QAbstractItemView::ExtendedSelection</enum>
</property>
<property name="rootIsDecorated">
<bool>false</bool>
</property>
<property name="allColumnsShowFocus">
<bool>true</bool>
</property>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="m_lpMoviesTab">
<attribute name="title">
<string>Movies</string>
</attribute>
</widget>
</widget>
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menuBar">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>1002</width>
<height>21</height>
</rect>
</property>
</widget>
<widget class="QToolBar" name="mainToolBar">
<attribute name="toolBarArea">
<enum>TopToolBarArea</enum>
</attribute>
<attribute name="toolBarBreak">
<bool>false</bool>
</attribute>
</widget>
<widget class="QStatusBar" name="statusBar"/>
</widget>
<layoutdefault spacing="6" margin="11"/>
<resources/>
<connections/>
</ui>
+58
View File
@@ -0,0 +1,58 @@
#include "cmessageanimatedialog.h"
#include "ui_cmessageanimatedialog.h"
cMessageAnimateDialog::cMessageAnimateDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::cMessageAnimateDialog),
m_szMessage(""),
m_lpTimer(0),
m_iCount(0),
m_iDirection(1)
{
ui->setupUi(this);
}
cMessageAnimateDialog::~cMessageAnimateDialog()
{
if(m_lpTimer)
delete m_lpTimer;
delete ui;
}
void cMessageAnimateDialog::setTitle(const QString& szTitle)
{
setWindowTitle(szTitle);
}
void cMessageAnimateDialog::setMessage(const QString& szMessage)
{
m_szMessage = szMessage;
ui->m_lpText->setText(m_szMessage);
if(m_lpTimer)
delete m_lpTimer;
m_lpTimer = new QTimer(this);
connect(m_lpTimer, SIGNAL(timeout()), this, SLOT(update()));
m_lpTimer->start(500);
}
void cMessageAnimateDialog::update()
{
m_iCount += m_iDirection;
if(m_iCount == 4)
{
m_iCount = 2;
m_iDirection = -1;
}
else if(m_iCount == -1)
{
m_iCount = 1;
m_iDirection = 1;
}
QString sz = m_szMessage;
for(int z = 0;z < m_iCount;z++)
sz.append(".");
ui->m_lpText->setText(sz);
}
+77
View File
@@ -0,0 +1,77 @@
/**
* \class cMessageAnimateDialog
*
* \brief Class to display a modal message dialog.
*
* Class to display a modal message dialog. Title and message can be configured.
* The dialog displays the message and adds up to 3 points zwice a second to the message.
*
* \ingroup KOOKY
*
* \author Herwig Birke
*
* \version 1.0
*
* \date $Date: 2016/02/09
*/
#ifndef CMESSAGEANIMATEDIALOG_H
#define CMESSAGEANIMATEDIALOG_H
#include <QDialog>
#include <QTimer>
namespace Ui {
class cMessageAnimateDialog;
}
class cMessageAnimateDialog : public QDialog
{
Q_OBJECT
public:
/**
* \brief constructor.
*
* \param parent
*/
explicit cMessageAnimateDialog(QWidget *parent = 0);
/**
* \brief destructor.
*
*/
~cMessageAnimateDialog();
/**
* \brief Sets the title of the dialog.
*
* \param szTitle Title text
*/
void setTitle(const QString& szTitle);
/**
* \brief Sets the message of the dialog.
*
* \param szMessage Message text
*/
void setMessage(const QString& szMessage);
private slots:
/**
* \brief This function is called twice a second to update the displayed message.
*
*/
void update();
private:
Ui::cMessageAnimateDialog *ui; /*!< User interface of the dialog. */
protected:
QString m_szMessage; /*!< Message to be displayed */
QTimer* m_lpTimer; /*!< Timer object */
int m_iCount; /*!< Number of points currently being displayed */
int m_iDirection; /*!< Increase / decrease number of points */
};
#endif // CMESSAGEANIMATEDIALOG_H
+31
View File
@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>cMessageAnimateDialog</class>
<widget class="QDialog" name="cMessageAnimateDialog">
<property name="windowModality">
<enum>Qt::WindowModal</enum>
</property>
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>330</width>
<height>31</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="m_lpText">
<property name="text">
<string/>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
+47
View File
@@ -0,0 +1,47 @@
#include "cmessagedialog.h"
#include "ui_cmessagedialog.h"
#include <QThread>
cMessageDialog::cMessageDialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::cMessageDialog)
{
ui->setupUi(this);
}
cMessageDialog::~cMessageDialog()
{
delete ui;
}
void cMessageDialog::setMessage(const QString& szMessage)
{
ui->m_lpMessage->setText(szMessage);
QThread::msleep(100);
}
void cMessageDialog::addMessage(const QString& szMessage)
{
ui->m_lpMessage->setText(ui->m_lpMessage->text() + szMessage);
}
void cMessageDialog::setProgress(qint32 iMin, qint32 iMax)
{
ui->m_lpProgressBar->setMinimum(iMin);
ui->m_lpProgressBar->setMaximum(iMax);
ui->m_lpProgressBar->setValue(0);
QThread::msleep(100);
}
void cMessageDialog::setProgress(qint32 iValue)
{
ui->m_lpProgressBar->setValue(iValue);
QThread::msleep(100);
}
QPushButton* cMessageDialog::cancelButton()
{
return(ui->m_lpCancel);
}
+28
View File
@@ -0,0 +1,28 @@
#ifndef CMESSAGEDIALOG_H
#define CMESSAGEDIALOG_H
#include <QDialog>
namespace Ui {
class cMessageDialog;
}
class cMessageDialog : public QDialog
{
Q_OBJECT
public:
explicit cMessageDialog(QWidget *parent = 0);
~cMessageDialog();
void setMessage(const QString& szMessage);
void addMessage(const QString& szMessage);
void setProgress(qint32 iMin, qint32 iMax);
void setProgress(qint32 iValue);
QPushButton* cancelButton();
private:
Ui::cMessageDialog *ui;
};
#endif // CMESSAGEDIALOG_H
+76
View File
@@ -0,0 +1,76 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>cMessageDialog</class>
<widget class="QDialog" name="cMessageDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>91</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="m_lpMessage">
<property name="text">
<string/>
</property>
</widget>
</item>
<item>
<widget class="QProgressBar" name="m_lpProgressBar">
<property name="value">
<number>24</number>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="m_lpCancel">
<property name="text">
<string>Cancel</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
+47
View File
@@ -0,0 +1,47 @@
#include "cmovie.h"
cMovie::cMovie()
{
}
void cMovie::setMovieTitle(const QString& szTitle)
{
m_szMovieTitle = szTitle;
}
QString cMovie::movieTitle()
{
return(m_szMovieTitle);
}
void cMovie::setMovieID(const qint32 iID)
{
m_iID = iID;
}
qint32 cMovie::movieID()
{
return(m_iID);
}
void cMovie::setOriginalTitle(const QString& szOriginalTitle)
{
m_szOriginalTitle = szOriginalTitle;
}
QString cMovie::originalTitle()
{
return(m_szOriginalTitle);
}
void cMovie::setReleaseDate(const QString& szDate)
{
m_releaseDate = QDate::fromString(szDate, "yyyy-MM-dd");
}
QDate cMovie::releaseDate()
{
return(m_releaseDate);
}
+42
View File
@@ -0,0 +1,42 @@
#ifndef CMOVIE_H
#define CMOVIE_H
#include <QMetaType>
#include <QDate>
#include <QSqlDatabase>
class cMovie
{
public:
cMovie();
void setMovieTitle(const QString& szTitle);
QString movieTitle();
void setMovieID(const qint32 iID);
qint32 movieID();
void setOriginalTitle(const QString& szOriginalTitle);
QString originalTitle();
void setReleaseDate(const QString& szDate);
QDate releaseDate();
private:
QString m_szMovieTitle;
qint32 m_iID;
QString m_szOriginalTitle;
QDate m_releaseDate;
};
Q_DECLARE_METATYPE(cMovie*)
class cMovieList : public QList<cMovie*>
{
public:
// cMovie* add(const qint32& iID);
// cMovie* add(cMovie* lpMovie);
};
#endif // CMOVIE_H
+64
View File
@@ -0,0 +1,64 @@
#include "cpicturesthread.h"
#include "cserie.h"
#include "cseason.h"
#include "cepisode.h"
#include "cmessagedialog.h"
#include "cimage.h"
#include <QDebug>
cPicturesThread::cPicturesThread() :
m_bStop(false)
{
}
void cPicturesThread::stop()
{
QMutexLocker locker(&m_mutex);
m_bStop = true;
emit picturesAppendMessage(" - cancel pending ...");
}
void cPicturesThread::run()
{
qint16 iCurrent = 0;
for(int z = 0;z < m_items.count();z++)
{
cSerie* lpSerie = m_items.at(z);
if(lpSerie)
{
emit picturesMessage(lpSerie->seriesName(), iCurrent);
cImage image;
image.getImage(lpSerie->banner());
for(int y = 0;y < lpSerie->seasonList().count();y++)
{
cSeason* lpSeason;
lpSeason = lpSerie->seasonList().at(y);
emit picturesMessage(QString("%1 - Season %2").arg(lpSerie->seriesName()).arg(lpSeason->number()), iCurrent);
for(int x = 0;x < lpSeason->episodeList().count();x++)
{
cEpisode* lpEpisode = lpSeason->episodeList().at(x);
image.getImage(lpEpisode->fileName());
iCurrent++;
QMutexLocker locker(&m_mutex);
if(m_bStop)
break;
msleep(10);
}
}
}
}
}
void cPicturesThread::setData(cMessageDialog* lpMessageDialog, const QList<cSerie *> &list)
{
connect(lpMessageDialog->cancelButton(), SIGNAL(clicked()), this, SLOT(stop()));
m_items = list;
}
+37
View File
@@ -0,0 +1,37 @@
#ifndef CPICTURESTHREAD_H
#define CPICTURESTHREAD_H
#include "cmessagedialog.h"
#include "cserie.h"
#include <QThread>
#include <QMutexLocker>
#include <QList>
class cPicturesThread : public QThread
{
Q_OBJECT
public:
explicit cPicturesThread();
void setData(cMessageDialog *lpMessageDialog, const QList<cSerie*>& list);
public slots:
void stop();
signals:
void picturesMessage(const QString& szMessage, const qint32 &iProgress);
void picturesAppendMessage(const QString& szMessage);
private:
QMutex m_mutex;
bool m_bStop;
QList<cSerie*> m_items;
QWidget* m_lpParent;
void run();
};
#endif // CPICTURESTHREAD_H
+88
View File
@@ -0,0 +1,88 @@
#include "csearch.h"
#include "ui_csearch.h"
#include "cthetvdbv2.h"
#include "cserie.h"
#include "cmessageanimatedialog.h"
#include <QList>
cSearch::cSearch(QWidget *parent) :
QDialog(parent),
ui(new Ui::cSearch)
{
ui->setupUi(this);
ui->m_lpSearchButton->setEnabled(false);
ui->m_lpTabWidget->setCurrentIndex(0);
}
cSearch::~cSearch()
{
delete ui;
}
void cSearch::on_m_lpSearch_textChanged(const QString& /*arg1*/)
{
if(ui->m_lpSearch->text().isEmpty())
ui->m_lpSearchButton->setEnabled(false);
else
ui->m_lpSearchButton->setEnabled(true);
}
void cSearch::on_m_lpSearchButton_clicked()
{
cMessageAnimateDialog* lpDialog = new cMessageAnimateDialog(this);
lpDialog->setTitle("Search");
lpDialog->setMessage("Searching");
lpDialog->show();
cTheTVDBV2 theTVDBV2;
QList<cSerie*> serieList2 = theTVDBV2.search(ui->m_lpSearch->text());
ui->m_lpResults->clear();
for(int z = 0;z < serieList2.count();z++)
{
cSerie* lpSerie = serieList2.at(z);
QTreeWidgetItem* lpNew = new QTreeWidgetItem(ui->m_lpResults);
lpNew->setText(0, lpSerie->seriesName());
lpNew->setText(2, QString("%1").arg(lpSerie->firstAired().year()));
lpNew->setData(0, Qt::UserRole, QVariant::fromValue(lpSerie->id()));
ui->m_lpResults->addTopLevelItem(lpNew);
}
ui->m_lpResults->resizeColumnToContents(0);
ui->m_lpResults->resizeColumnToContents(1);
ui->m_lpResults->sortItems(0, Qt::AscendingOrder);
delete lpDialog;
}
qint32 cSearch::id()
{
if(!ui->m_lpResults->selectedItems().count())
{
qint32 iID = ui->m_lpSearch->text().toInt();
if(iID)
return(iID);
return(-1);
}
return(ui->m_lpResults->selectedItems().at(0)->data(0, Qt::UserRole).toInt());
}
QString cSearch::placeholderName()
{
return(ui->m_lpPlaceholderName->text());
}
bool cSearch::placeholder()
{
return(ui->m_lpTabWidget->currentIndex() == 1);
}
qint16 cSearch::year()
{
return(ui->m_lpYear->value());
}
+31
View File
@@ -0,0 +1,31 @@
#ifndef CSEARCH_H
#define CSEARCH_H
#include <QDialog>
namespace Ui {
class cSearch;
}
class cSearch : public QDialog
{
Q_OBJECT
public:
explicit cSearch(QWidget *parent = 0);
~cSearch();
qint32 id();
QString placeholderName();
bool placeholder();
qint16 year();
private slots:
void on_m_lpSearchButton_clicked();
void on_m_lpSearch_textChanged(const QString &arg1);
private:
Ui::cSearch *ui;
};
#endif // CSEARCH_H
+180
View File
@@ -0,0 +1,180 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>cSearch</class>
<widget class="QDialog" name="cSearch">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>334</width>
<height>460</height>
</rect>
</property>
<property name="windowTitle">
<string>Dialog</string>
</property>
<layout class="QGridLayout" name="gridLayout_3">
<item row="1" column="0">
<widget class="QDialogButtonBox" name="m_lpButtonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QTabWidget" name="m_lpTabWidget">
<property name="currentIndex">
<number>1</number>
</property>
<widget class="QWidget" name="Search">
<attribute name="title">
<string>Search</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QLineEdit" name="m_lpSearch"/>
</item>
<item>
<widget class="QPushButton" name="m_lpSearchButton">
<property name="text">
<string>Search</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QTreeWidget" name="m_lpResults">
<property name="columnCount">
<number>3</number>
</property>
<attribute name="headerVisible">
<bool>false</bool>
</attribute>
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">2</string>
</property>
</column>
<column>
<property name="text">
<string notr="true">3</string>
</property>
</column>
</widget>
</item>
</layout>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="Add">
<attribute name="title">
<string>Add Placeholder</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_4">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
<string>Name:</string>
</property>
</widget>
</item>
<item row="0" column="1" colspan="2">
<widget class="QLineEdit" name="m_lpPlaceholderName"/>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Year:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="m_lpYear">
<property name="minimum">
<number>1800</number>
</property>
<property name="maximum">
<number>2100</number>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>m_lpButtonBox</sender>
<signal>accepted()</signal>
<receiver>cSearch</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>m_lpButtonBox</sender>
<signal>rejected()</signal>
<receiver>cSearch</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
+174
View File
@@ -0,0 +1,174 @@
#include "cseason.h"
#define DELETE(x) { if(x) delete x; x=0; }
cSeason::cSeason() :
m_iNumber(-1),
m_lpGroupBox(0),
m_lpGridLayout(0),
m_lpGrid(0),
m_lpLabel1(0),
m_lpAllInit(0),
m_lpAllProgress(0),
m_lpAllDone(0),
m_lpSpacer(0),
m_lpSerie(0)
{
}
cSeason::~cSeason()
{
deleteResources();
}
void cSeason::setNumber(const qint16& iNumber)
{
m_iNumber = iNumber;
}
qint16 cSeason::number()
{
return(m_iNumber);
}
void cSeason::setSerie(cSerie* lpSerie)
{
m_lpSerie = lpSerie;
}
cSerie* cSeason::serie()
{
return(m_lpSerie);
}
cEpisode* cSeason::addEpisode(qint16 iNumber)
{
cEpisode* lpNew = new cEpisode;
lpNew->setEpisodeNumber(iNumber);
lpNew->setState(cEpisode::StateInit);
m_episodeList.append(lpNew);
return(lpNew);
}
cEpisode* cSeason::addEpisode(cEpisode* lpEpisode)
{
if(episodeList().contains(lpEpisode))
return(0);
m_episodeList.append(lpEpisode);
return(lpEpisode);
}
QList<cEpisode*> cSeason::episodeList()
{
return(m_episodeList);
}
qint16 cSeason::episodeCount()
{
qint16 iTotal = -1;
for(int z = 0;z < m_episodeList.count();z++)
{
cEpisode* lpEpisode = m_episodeList.at(z);
if(lpEpisode)
{
if(lpEpisode->episodeNumber() > iTotal)
iTotal = lpEpisode->episodeNumber();
}
}
return(iTotal);
}
void cSeason::setGroupBox(QGroupBox* lpGroupBox)
{
m_lpGroupBox = lpGroupBox;
}
void cSeason::setGridLayout(QGridLayout* lpGridLayout)
{
m_lpGridLayout = lpGridLayout;
}
void cSeason::setGrid(QGridLayout* lpGrid)
{
m_lpGrid = lpGrid;
}
void cSeason::setLabel1(QLabel* lpLabel1)
{
m_lpLabel1 = lpLabel1;
}
void cSeason::setAllInit(QPushButton* lpAllInit)
{
m_lpAllInit = lpAllInit;
}
void cSeason::setAllProgress(QPushButton* lpAllProgress)
{
m_lpAllProgress = lpAllProgress;
}
void cSeason::setAllDone(QPushButton* lpAllDone)
{
m_lpAllDone = lpAllDone;
}
void cSeason::setSpacer(QSpacerItem* lpSpacer)
{
m_lpSpacer = lpSpacer;
}
void cSeason::deleteResources()
{
DELETE(m_lpGroupBox);
DELETE(m_lpGridLayout);
DELETE(m_lpGrid);
DELETE(m_lpLabel1);
DELETE(m_lpAllInit);
DELETE(m_lpAllProgress);
DELETE(m_lpAllDone);
DELETE(m_lpSpacer);
for(int z = 0;z < m_episodeList.count();z++)
m_episodeList.at(z)->deleteResources();
}
void cSeason::updateState()
{
for(int z = 0;z < m_episodeList.count();z++)
m_episodeList.at(z)->updateState();
}
void cSeason::allInit()
{
for(int z = 0;z < m_episodeList.count();z++)
m_episodeList.at(z)->setState(cEpisode::StateInit);
}
void cSeason::allProgress()
{
for(int z = 0;z < m_episodeList.count();z++)
m_episodeList.at(z)->setState(cEpisode::StateProgress);
}
void cSeason::allDone()
{
for(int z = 0;z < m_episodeList.count();z++)
m_episodeList.at(z)->setState(cEpisode::StateDone);
}
QPushButton* cSeason::allInitButton()
{
return(m_lpAllInit);
}
QPushButton* cSeason::allProgressButton()
{
return(m_lpAllProgress);
}
QPushButton* cSeason::allDoneButton()
{
return(m_lpAllDone);
}
+73
View File
@@ -0,0 +1,73 @@
#ifndef CSEASON_H
#define CSEASON_H
#include "cepisode.h"
#include <QMetaType>
#include <QList>
#include <QGroupBox>
#include <QGridLayout>
#include <QLabel>
#include <QPushButton>
#include <QSpacerItem>
class cSerie;
class cSeason
{
public:
cSeason();
~cSeason();
void setNumber(const qint16& iNumber);
qint16 number();
void setSerie(cSerie* lpSerie);
cSerie* serie();
cEpisode* addEpisode(qint16 iNumber);
cEpisode* addEpisode(cEpisode* lpEpisode);
QList<cEpisode*> episodeList();
qint16 episodeCount();
void setGroupBox(QGroupBox* lpGroupBox);
void setGridLayout(QGridLayout* lpGridLayout);
void setGrid(QGridLayout* lpGrid);
void setLabel1(QLabel* lpLabel1);
void setAllInit(QPushButton* lpAllInit);
void setAllProgress(QPushButton* lpAllProgress);
void setAllDone(QPushButton* lpAllDone);
void setSpacer(QSpacerItem* lpSpacer);
void updateState();
void deleteResources();
void allInit();
void allProgress();
void allDone();
QPushButton* allInitButton();
QPushButton* allProgressButton();
QPushButton* allDoneButton();
private:
qint16 m_iNumber;
QList<cEpisode*> m_episodeList;
QGroupBox* m_lpGroupBox;
QGridLayout* m_lpGridLayout;
QGridLayout* m_lpGrid;
QLabel* m_lpLabel1;
QPushButton* m_lpAllInit;
QPushButton* m_lpAllProgress;
QPushButton* m_lpAllDone;
QSpacerItem* m_lpSpacer;
cSerie* m_lpSerie;
};
Q_DECLARE_METATYPE(cSeason*)
#endif // CSEASON_H
+119
View File
@@ -0,0 +1,119 @@
#include "cseasondelegate.h"
#include "cserie.h"
#include "cseason.h"
#include "cepisode.h"
#include <QPainter>
#include <QTreeWidget>
#include <QDebug>
#include <QFontMetrics>
#include <QColor>
#include <QRgb>
#define FIELD_WIDTH 3
#define FIELD_STEP 4
#define FIELD_HEIGHT 15
#define HEIGHT 18
#define STATE_INIT Qt::lightGray
#define STATE_PROGRESS Qt::blue
#define STATE_DONE Qt::green
#define STATE_UNKNOWN Qt::black
void cSeasonDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
if(index.column() > 2)
{
cSeason* lpSeason = 0;
if(index.data(Qt::UserRole).canConvert<cSeason*>())
lpSeason = qvariant_cast<cSeason*>(index.data(Qt::UserRole));
if(option.state & QStyle::State_Selected)
painter->fillRect(option.rect, QBrush(QColor(51, 153, 255)));
if(lpSeason)
{
QList<cEpisode*> episodeList = lpSeason->episodeList();
painter->save();
painter->setRenderHint(QPainter::Antialiasing, false);
painter->setBrush(option.palette.foreground());
painter->translate(option.rect.x(), option.rect.y());
for(int z = 0;z < episodeList.count();z++)
{
painter->setPen(Qt::NoPen);
cEpisode* lpEpisode = episodeList.at(z);
if(lpEpisode)
{
switch(lpEpisode->state())
{
case cEpisode::StateInit:
painter->setBrush(STATE_INIT);
break;
case cEpisode::StateProgress:
painter->setBrush(STATE_PROGRESS);
break;
case cEpisode::StateDone:
painter->setBrush(STATE_DONE);
break;
default:
break;
}
painter->drawRect(z*FIELD_STEP, 0, FIELD_STEP, FIELD_HEIGHT);
painter->setPen(Qt::black);
painter->drawLine(z*FIELD_STEP+FIELD_WIDTH, 0, z*FIELD_STEP+FIELD_WIDTH, FIELD_HEIGHT);
}
}
painter->setBrush(Qt::black);
painter->translate(1.0, 0.0);
painter->restore();
}
}
else
{
QStyledItemDelegate::paint(painter, option, index);
}
}
QSize cSeasonDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
{
if(index.column() > 2)
{
qint16 iTotal = -1;
qint16 z;
cSeason* lpSeason = 0;
if(index.data(Qt::UserRole).canConvert<cSeason*>())
lpSeason = qvariant_cast<cSeason*>(index.data(Qt::UserRole));
if(lpSeason)
{
QList<cEpisode*> episodeList = lpSeason->episodeList();
for(z = 0;z < episodeList.count();z++)
{
cEpisode* lpEpisode = episodeList.at(z);
if(lpEpisode)
{
if(lpEpisode->episodeNumber() > iTotal)
iTotal = lpEpisode->episodeNumber();
}
}
if(iTotal > 0 && lpSeason->number() != 0)
return(QSize((iTotal+1)*FIELD_STEP, HEIGHT));
//return(QSize((iTotal+1)*FIELD_STEP, FIELD_HEIGHT));
else
return(QSize(FIELD_STEP*40, HEIGHT));
//return(QSize(FIELD_STEP*40, FIELD_HEIGHT));
}
return(QSize(FIELD_STEP, HEIGHT));
//return(QSize(FIELD_STEP, FIELD_HEIGHT));
}
return QSize(QStyledItemDelegate::sizeHint(option, index).width(), HEIGHT);
}
+22
View File
@@ -0,0 +1,22 @@
#ifndef CSEASONDELEGATE_H
#define CSEASONDELEGATE_H
#include <QStyledItemDelegate>
class cSeasonDelegate : public QStyledItemDelegate
{
Q_OBJECT
public:
cSeasonDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {}
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
//QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
//void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
//void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const Q_DECL_OVERRIDE;
};
#endif // CSEASONDELEGATE_H
+44
View File
@@ -0,0 +1,44 @@
#include "cseasondetails.h"
#include "ui_cseasondetails.h"
#include "cepisode.h"
#include "cepisodedetails.h"
#include "cmessageanimatedialog.h"
#include <QDebug>
cSeasonDetails::cSeasonDetails(QWidget *parent) :
QWidget(parent),
ui(new Ui::cSeasonDetails)
{
ui->setupUi(this);
}
cSeasonDetails::~cSeasonDetails()
{
delete ui;
}
void cSeasonDetails::setSeason(cSeason* lpSeason)
{
for(int x = 0;x < lpSeason->episodeList().count();x++)
{
cEpisode* lpEpisode = lpSeason->episodeList().at(x);
cEpisodeDetails* lpEpisodeDetails = new cEpisodeDetails(ui->m_lpDetailsEpisodeTab);
ui->m_lpDetailsEpisodeTab->addTab(lpEpisodeDetails, QString("Episode %1").arg(lpEpisode->episodeNumber()));
lpEpisodeDetails->setEpisode(lpEpisode);
if(!x)
lpEpisodeDetails->loadImages();
}
}
void cSeasonDetails::on_m_lpDetailsEpisodeTab_tabBarClicked(int index)
{
cEpisodeDetails* lpEpisodeDetails = (cEpisodeDetails*)ui->m_lpDetailsEpisodeTab->widget(index);
if(!lpEpisodeDetails)
return;
lpEpisodeDetails->loadImages();
}
+31
View File
@@ -0,0 +1,31 @@
#ifndef CSEASONDETAILS_H
#define CSEASONDETAILS_H
#include "cseason.h"
#include <QWidget>
namespace Ui {
class cSeasonDetails;
}
class cSeasonDetails : public QWidget
{
Q_OBJECT
public:
explicit cSeasonDetails(QWidget *parent = 0);
~cSeasonDetails();
void setSeason(cSeason* lpSeason);
private slots:
void on_m_lpDetailsEpisodeTab_tabBarClicked(int index);
private:
Ui::cSeasonDetails* ui;
};
#endif // CSEASONDETAILS_H
+28
View File
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>cSeasonDetails</class>
<widget class="QWidget" name="cSeasonDetails">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>510</width>
<height>415</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QTabWidget" name="m_lpDetailsEpisodeTab">
<property name="currentIndex">
<number>-1</number>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
+572
View File
@@ -0,0 +1,572 @@
#include "cserie.h"
#include <QStringList>
#include <QSqlQuery>
#include <QVariant>
void addPerson(const QString& szTable, const QString& szField1, const qint32 &iValue1, const QString &szField2, const QString& szName)
{
qint32 personID;
QSqlQuery query;
query.exec(QString("SELECT personID FROM person WHERE name='%1';").arg(szName));
if(query.next())
personID = query.value(0).toInt();
else
{
query.prepare("INSERT INTO person (name) VALUES (:name);");
query.bindValue(":name", szName);
query.exec();
query.clear();
query.prepare("SELECT personID FROM person WHERE name=:name;");
query.bindValue(":name", szName);
query.exec();
query.next();
personID = query.value(0).toInt();
}
query.exec(QString("SELECT * FROM %1 WHERE %2=%3 AND %4=%5;").arg(szTable).arg(szField1).arg(iValue1).arg(szField2).arg(personID));
if(!query.next())
{
query.prepare(QString("INSERT INTO %1 (%2, %3) VALUES (:%4, :%5);").arg(szTable).arg(szField1).arg(szField2).arg(szField1).arg(szField2));
query.bindValue(QString(":%1").arg(szField1), iValue1);
query.bindValue(QString(":%1").arg(szField2), personID);
query.exec();
}
}
cSerie::cSerie() :
m_szSeriesName(""),
m_iSeriesID(-1),
m_szLanguage(""),
m_szBanner(""),
m_szOverview(""),
m_firstAired(QDate(1900, 1, 1)),
m_szNetwork(""),
m_szIMDBID(""),
m_iID(-1),
m_szActors(),
m_szContentRating(""),
m_szGenre(),
m_dRating(-1.0),
m_iRatingCount(-1),
m_iRuntime(-1),
m_szStatus(""),
m_szDownload(""),
m_bCliffhanger(false)
{
}
void cSerie::setSeriesName(const QString& szSeriesName)
{
m_szSeriesName = szSeriesName;
}
QString cSerie::seriesName()
{
return(m_szSeriesName);
}
void cSerie::setSeriesID(const qint32& iSeriesID)
{
m_iSeriesID = iSeriesID;
}
qint32 cSerie::seriesID()
{
return(m_iSeriesID);
}
void cSerie::setLanguage(const QString& szLanguage)
{
m_szLanguage = szLanguage;
}
QString cSerie::language()
{
return(m_szLanguage);
}
void cSerie::setBanner(const QString& szBanner)
{
m_szBanner = szBanner;
}
QString cSerie::banner()
{
return(m_szBanner);
}
void cSerie::setOverview(const QString& szOverview)
{
m_szOverview = szOverview;
}
QString cSerie::overview()
{
return(m_szOverview);
}
void cSerie::setFirstAired(const QString& szFirstAired)
{
m_firstAired = QDate::fromString(szFirstAired, "yyyy-MM-dd");
}
void cSerie::setFirstAired(const QDate& firstAired)
{
m_firstAired = firstAired;
}
QDate cSerie::firstAired()
{
return(m_firstAired);
}
void cSerie::setNetwork(const QString& szNetwork)
{
m_szNetwork = szNetwork;
}
QString cSerie::network()
{
return(m_szNetwork);
}
void cSerie::setIMDBID(const QString& szIMDBID)
{
m_szIMDBID = szIMDBID;
}
QString cSerie::imdbID()
{
return(m_szIMDBID);
}
void cSerie::setID(const qint32& iID)
{
m_iID = iID;
}
qint32 cSerie::id()
{
return(m_iID);
}
void cSerie::setActors(const QString& szActors)
{
m_szActors = szActors.split("|");
m_szActors.removeAll("");
}
void cSerie::setActors(const QStringList& szActors)
{
m_szActors = szActors;
m_szActors.removeAll("");
}
QStringList cSerie::actors()
{
return(m_szActors);
}
void cSerie::setContentRating(const QString& szContentRating)
{
m_szContentRating = szContentRating;
}
QString cSerie::contentRating()
{
return(m_szContentRating);
}
void cSerie::setGenre(const QString& szGenre)
{
m_szGenre = szGenre.split("|");
m_szGenre.removeAll("");
}
void cSerie::setGenre(const QStringList& szGenre)
{
m_szGenre = szGenre;
m_szGenre.removeAll("");
}
QStringList cSerie::genre()
{
return(m_szGenre);
}
void cSerie::setRating(const qreal& dRating)
{
m_dRating = dRating;
}
qreal cSerie::rating()
{
return(m_dRating);
}
void cSerie::setRatingCount(const qint16& iRatingCount)
{
m_iRatingCount = iRatingCount;
}
qint16 cSerie::ratingCount()
{
return(m_iRatingCount);
}
void cSerie::setRuntime(const qint16& iRuntime)
{
m_iRuntime = iRuntime;
}
qint16 cSerie::runime()
{
return(m_iRuntime);
}
void cSerie::setStatus(const QString& szStatus)
{
m_szStatus = szStatus;
}
QString cSerie::status()
{
return(m_szStatus);
}
void cSerie::setDownload(const QString& szDownload)
{
m_szDownload = szDownload;
}
QString cSerie::download()
{
return(m_szDownload);
}
void cSerie::setCliffhanger(const bool& bCliffhanger)
{
m_bCliffhanger = bCliffhanger;
}
bool cSerie::cliffhanger()
{
return(m_bCliffhanger);
}
cSeason* cSerie::addSeason(const qint16& iSeason)
{
cSeason* lpNew = new cSeason;
lpNew->setNumber(iSeason);
lpNew->setSerie(this);
m_seasonList.append(lpNew);
return(lpNew);
}
cSeason* cSerie::findSeason(const qint16& iSeason)
{
for(int z = 0;z < m_seasonList.count();z++)
{
if(m_seasonList.at(z)->number() == iSeason)
return(m_seasonList.at(z));
}
return(0);
}
QList<cSeason*> cSerie::seasonList()
{
return(m_seasonList);
}
qint16 cSerie::minSeason()
{
qint16 iMin = 9999;
for(int z = 0;z < m_seasonList.count();z++)
{
if(m_seasonList.at(z)->number() < iMin)
iMin = m_seasonList.at(z)->number();
}
if(iMin == 9999)
return(-1);
return(iMin);
}
qint16 cSerie::maxSeason()
{
qint16 iMax = -1;
for(int z = 0;z < m_seasonList.count();z++)
{
if(m_seasonList.at(z)->number() > iMax)
iMax = m_seasonList.at(z)->number();
}
return(iMax);
}
cEpisode* cSerie::findEpisode(const qint32& id)
{
for(int x = 0;x < m_seasonList.count();x++)
{
cSeason* lpSeason = m_seasonList.at(x);
for(int y = 0;y < lpSeason->episodeList().count();y++)
{
cEpisode* lpEpisode = lpSeason->episodeList().at(y);
if(lpEpisode->id() == id)
return(lpEpisode);
}
}
return(0);
}
bool cSerie::isValid()
{
if(m_iSeriesID != -1 &&
m_szSeriesName.length())
return(true);
return(false);
}
qint16 cSerie::maxEpisode()
{
qint16 iMax = -1;
for(int z = 0;z < m_seasonList.count();z++)
{
if(m_seasonList.at(z)->episodeCount() > iMax)
iMax = m_seasonList.at(z)->episodeCount();
}
return(iMax);
}
bool cSerie::save(QSqlDatabase &db)
{
QSqlQuery query;
QSqlQuery querySerie;
QSqlQuery queryEpisode;
querySerie.prepare("INSERT INTO serie (seriesID,seriesName,language,banner,overview,firstAired,network,imdbid,id,contentRating,rating,ratingCount,runtime,status,download,cliffhanger,actor,genre)"
" VALUES (:seriesID,:seriesName,:language,:banner,:overview,:firstAired,:network,:imdbid,:id,:contentRating,:rating,:ratingCount,:runtime,:status,:download,:cliffhanger,:actor,:genre);");
queryEpisode.prepare("INSERT INTO episode (episodeID,episodeName,episodeNumber,firstAired,imdbid,language,overview,productioncode,rating,ratingCount,seasonNumber,seasonID,seriesID,state,filename,thumb_height,thumb_width,director,gueststars,episode_writer) VALUES (:episodeID,:episodeName,:episodeNumber,:firstAired,:imdbid,:language,:overview,:productioncode,:rating,:ratingCount,:seasonNumber,:seasonID,:seriesID,:state,:filename,:thumb_height,:thumb_width,:director,:gueststars,:episode_writer);");
db.transaction();
query.exec(QString("SELECT id FROM serie WHERE id=%1;").arg(id()));
if(!query.next())
{
query.prepare(QString("SELECT episodeID FROM episode WHERE episodeID=:episodeID"));
querySerie.bindValue(":seriesID", seriesID());
querySerie.bindValue(":seriesName", seriesName());
querySerie.bindValue(":language", language());
querySerie.bindValue(":banner", banner());
querySerie.bindValue(":overview", overview());
querySerie.bindValue(":firstAired", firstAired());
querySerie.bindValue(":network", network());
querySerie.bindValue(":imdbid", imdbID());
querySerie.bindValue(":id", id());
querySerie.bindValue(":contentRating", contentRating());
querySerie.bindValue(":rating", rating());
querySerie.bindValue(":ratingCount", ratingCount());
querySerie.bindValue(":runtime", runime());
querySerie.bindValue(":status", status());
querySerie.bindValue(":download", download());
querySerie.bindValue(":cliffhanger", cliffhanger());
querySerie.bindValue(":actor", actors().join(","));
querySerie.bindValue(":genre", genre().join(","));
if(querySerie.exec())
{
QList<cSeason*> seasonList = this->seasonList();
for(int season = 0;season < seasonList.count();season++)
{
QList<cEpisode*> episodeList = seasonList.at(season)->episodeList();
for(int episode = 0;episode < episodeList.count();episode++)
{
cEpisode* lpEpisode = episodeList.at(episode);
//query.bindValue(":episodeID", lpEpisode->id());
//query.exec();
//if(!query.next())
{
queryEpisode.bindValue(":episodeID", lpEpisode->id());
queryEpisode.bindValue(":episodeName", lpEpisode->episodeName());
queryEpisode.bindValue(":episodeNumber", lpEpisode->episodeNumber());
queryEpisode.bindValue(":firstAired", lpEpisode->firstAired());
queryEpisode.bindValue(":imdbid", lpEpisode->imdbID());
queryEpisode.bindValue(":language", lpEpisode->language());
queryEpisode.bindValue(":overview", lpEpisode->overview());
queryEpisode.bindValue(":productioncode", lpEpisode->productionCode());
queryEpisode.bindValue(":rating", lpEpisode->rating());
queryEpisode.bindValue(":ratingCount", lpEpisode->ratingCount());
queryEpisode.bindValue(":seasonNumber", lpEpisode->seasonNumber());
queryEpisode.bindValue(":seasonID", lpEpisode->seasonID());
queryEpisode.bindValue(":seriesID", lpEpisode->seriesID());
queryEpisode.bindValue(":state", lpEpisode->state());
queryEpisode.bindValue(":filename", lpEpisode->fileName());
queryEpisode.bindValue(":thumb_height", lpEpisode->thumbHeight());
queryEpisode.bindValue(":thumb_width", lpEpisode->thumbWidth());
queryEpisode.bindValue(":director", lpEpisode->director().join(","));
queryEpisode.bindValue(":gueststars", lpEpisode->guestStars().join(","));
queryEpisode.bindValue(":episode_writer", lpEpisode->writer().join(","));
if(queryEpisode.exec())
{
}
}
}
}
}
}
db.commit();
return(true);
}
bool cSerie::del(QSqlDatabase& db)
{
QSqlQuery query;
db.transaction();
query.prepare("DELETE FROM episode WHERE seriesID=:seriesID;");
query.bindValue(":seriesID", id());
query.exec();
query.prepare("DELETE FROM serie WHERE id=:seriesID;");
query.bindValue(":seriesID", id());
query.exec();
db.commit();
return(true);
}
void cSerie::allInit()
{
for(int z = 0;z < m_seasonList.count();z++)
m_seasonList.at(z)->allInit();
}
void cSerie::allProgress()
{
for(int z = 0;z < m_seasonList.count();z++)
m_seasonList.at(z)->allProgress();
}
void cSerie::allDone()
{
for(int z = 0;z < m_seasonList.count();z++)
m_seasonList.at(z)->allDone();
}
void cSerie::seasonInit(QPushButton* lpButton)
{
for(int z = 0;z < m_seasonList.count();z++)
{
if(m_seasonList.at(z)->allInitButton() == lpButton)
{
m_seasonList.at(z)->allInit();
return;
}
}
}
void cSerie::seasonProgress(QPushButton* lpButton)
{
for(int z = 0;z < m_seasonList.count();z++)
{
if(m_seasonList.at(z)->allProgressButton() == lpButton)
{
m_seasonList.at(z)->allProgress();
return;
}
}
}
void cSerie::seasonDone(QPushButton* lpButton)
{
for(int z = 0;z < m_seasonList.count();z++)
{
if(m_seasonList.at(z)->allDoneButton() == lpButton)
{
m_seasonList.at(z)->allDone();
return;
}
}
}
void cSerie::updateState()
{
for(int z = 0;z < m_seasonList.count();z++)
m_seasonList.at(z)->updateState();
}
void cSerie::deleteResources()
{
for(int z = 0;z < m_seasonList.count();z++)
m_seasonList.at(z)->deleteResources();
}
cSerie* cSerieList::add(const qint32& iID)
{
for(int z = 0;z < count();z++)
{
if(at(z)->id() == iID)
return(at(z));
}
cSerie* lpNew = new cSerie;
lpNew->setID(iID);
append(lpNew);
return(lpNew);
}
cSerie* cSerieList::add(cSerie* lpSerie)
{
for(int z = 0;z < count();z++)
{
if(at(z) == lpSerie)
return(0);
}
append(lpSerie);
return(lpSerie);
}
qint16 cSerieList::minSeason()
{
qint16 iMin = 9999;
for(int z = 0;z < count();z++)
{
if(at(z)->minSeason() < iMin)
iMin = at(z)->minSeason();
}
if(iMin == 9999 || iMin < 0)
return(0);
return(iMin);
}
qint16 cSerieList::maxSeason()
{
qint16 iMax = -1;
for(int z = 0;z < count();z++)
{
if(at(z)->maxSeason() > iMax)
iMax = at(z)->maxSeason();
}
if(iMax < 0)
return(0);
return(iMax);
}
qint16 cSerieList::maxEpisode()
{
qint16 iMax = -1;
for(int z = 0;z < count();z++)
{
if(at(z)->maxEpisode() > iMax)
iMax = at(z)->maxEpisode();
}
if(iMax < 0)
return(0);
return(iMax);
}
+137
View File
@@ -0,0 +1,137 @@
#ifndef CSERIE_H
#define CSERIE_H
#include "cseason.h"
#include <QMetaType>
#include <QDate>
#include <QSqlDatabase>
class cSerie
{
public:
cSerie();
void setSeriesName(const QString& szSeriesName);
QString seriesName();
void setSeriesID(const qint32& iSeriesID);
qint32 seriesID();
void setLanguage(const QString& szLanguage);
QString language();
void setBanner(const QString& szBanner);
QString banner();
void setOverview(const QString& szOverview);
QString overview();
void setFirstAired(const QString& szFirstAired);
void setFirstAired(const QDate& firstAired);
QDate firstAired();
void setNetwork(const QString& szNetwork);
QString network();
void setIMDBID(const QString& szIMDBID);
QString imdbID();
void setID(const qint32& iID);
qint32 id();
void setActors(const QString& szActors);
void setActors(const QStringList& szActors);
QStringList actors();
void setContentRating(const QString& szContentRating);
QString contentRating();
void setGenre(const QString& szGenre);
void setGenre(const QStringList& szGenre);
QStringList genre();
void setRating(const qreal& dRating);
qreal rating();
void setRatingCount(const qint16& iRatingCount);
qint16 ratingCount();
void setRuntime(const qint16& iRuntime);
qint16 runime();
void setStatus(const QString& szStatus);
QString status();
void setDownload(const QString& szDownload);
QString download();
void setCliffhanger(const bool& bCliffhanger);
bool cliffhanger();
cSeason* addSeason(const qint16& iSeason);
QList<cSeason*> seasonList();
cSeason* findSeason(const qint16& iSeason);
qint16 minSeason();
qint16 maxSeason();
qint16 maxEpisode();
cEpisode* findEpisode(const qint32& id);
bool isValid();
bool save(QSqlDatabase& db);
bool del(QSqlDatabase& db);
void allInit();
void allProgress();
void allDone();
void seasonInit(QPushButton* lpButton);
void seasonProgress(QPushButton* lpButton);
void seasonDone(QPushButton* lpButton);
void updateState();
void deleteResources();
private:
QString m_szSeriesName;
qint32 m_iSeriesID;
QString m_szLanguage;
QString m_szBanner;
QString m_szOverview;
QDate m_firstAired;
QString m_szNetwork;
QString m_szIMDBID;
qint32 m_iID;
QStringList m_szActors;
QString m_szContentRating;
QStringList m_szGenre;
qreal m_dRating;
qint16 m_iRatingCount;
qint16 m_iRuntime;
QString m_szStatus;
QString m_szDownload;
bool m_bCliffhanger;
QList<cSeason*> m_seasonList;
};
Q_DECLARE_METATYPE(cSerie*)
class cSerieList : public QList<cSerie*>
{
public:
cSerie* add(const qint32& iID);
cSerie* add(cSerie* lpSerie);
qint16 minSeason();
qint16 maxSeason();
qint16 maxEpisode();
};
#endif // CSERIE_H
+106
View File
@@ -0,0 +1,106 @@
#include "cthemoviedbv3.h"
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QEventLoop>
#include <QByteArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
cTheMovieDBV3::cTheMovieDBV3()
{
m_szToken = "a33271b9e54cdcb9a80680eaf5522f1b";
/*
QNetworkAccessManager networkManager;
QNetworkRequest request(QUrl(QString("https://api.themoviedb.org/3/authentication/token/new?api_key=a33271b9e54cdcb9a80680eaf5522f1b")));
QNetworkReply* reply = networkManager.get(request);
QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
if (reply->error() == QNetworkReply::NoError)
{
QString strReply = (QString)reply->readAll();
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());
QJsonObject jsonObj = jsonResponse.object();
bool success = jsonObj["success"].toBool();
m_szToken = jsonObj["request_token"].toString();
delete reply;
}
else
{
qDebug() << reply->errorString();
delete reply;
}
*/
}
QList<cMovie*> cTheMovieDBV3::search(const QString& szMovie, const qint16& year, const QString& szLanguage)
{
QList<cMovie*> movieList;
QNetworkAccessManager networkManager;
QString szRequest = QString("https://api.themoviedb.org/3/search/movie?api_key=%1").arg(m_szToken);
qint16 page = 1;
if(!szLanguage.contains("all"))
szRequest.append(QString("&language=%1").arg(szLanguage));
szRequest.append(QString("&query=%1").arg(szMovie));
if(year != -1)
szRequest.append(QString("&year=%1").arg(year));
szRequest.append("&include_adult=false");
for(;;)
{
QNetworkRequest request(QUrl(QString("%1&page=%2").arg(szRequest).arg(page)));
QNetworkReply* reply = networkManager.get(request);
QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
if (reply->error() == QNetworkReply::NoError)
{
QString strReply = (QString)reply->readAll();
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());
QJsonObject jsonObj = jsonResponse.object();
QJsonArray jsonArray = jsonObj["results"].toArray();
for(int z = 0;z < jsonArray.count();z++)
{
QJsonObject movie = jsonArray[z].toObject();
cMovie* lpMovie = new cMovie;
// lpSerie->setID(serie["id"].toInt());
// lpSerie->setSeriesName(serie["seriesName"].toString());
// lpSerie->setFirstAired(serie["firstAired"].toString());
lpMovie->setMovieTitle(movie["title"].toString());
lpMovie->setMovieID(movie["id"].toInt());
lpMovie->setOriginalTitle(movie["original_title"].toString());
lpMovie->setReleaseDate(movie["release_date"].toString());
movieList.append(lpMovie);
}
if(jsonObj["total_pages"].toInt() == page)
break;
page++;
delete reply;
}
else
{
qDebug() << reply->errorString();
delete reply;
}
}
return(movieList);
}
+26
View File
@@ -0,0 +1,26 @@
#ifndef CTHEMOVIEDBV3_H
#define CTHEMOVIEDBV3_H
#include "cmovie.h"
#include <QString>
#include <QList>
#include <QStringList>
class cTheMovieDBV3
{
public:
cTheMovieDBV3();
QList<cMovie*> search(const QString& szMovie, const qint16& year = -1, const QString& szLanguage = "all");
// cSerie* load(const qint32 &iID, const QString& szLanguage);
private:
QString m_szToken;
// QStringList getActors(const qint32& iID);
// void getEpisodes(cSerie* lpSerie, const QString& szLanguage);
// cEpisode* getEpisode(const qint32& iID, const QString& szLanguage);
};
#endif // CTHEMOVIEDBV3_H
+313
View File
@@ -0,0 +1,313 @@
#include "cthetvdbv2.h"
#include <QNetworkAccessManager>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QEventLoop>
#include <QByteArray>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
cTheTVDBV2::cTheTVDBV2()
{
QByteArray jsonRequest = "{\"apikey\":\"BC0893B659680049\"}";
QByteArray postDataSize = QByteArray::number(jsonRequest.size());
QNetworkAccessManager networkManager;
QNetworkRequest request(QUrl(QString("https://api.thetvdb.com/login")));
request.setRawHeader("Content-Type", "application/json");
request.setRawHeader("Content-Length", postDataSize);
QNetworkReply* reply = networkManager.post(request, jsonRequest);
QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
if (reply->error() == QNetworkReply::NoError)
{
QString strReply = (QString)reply->readAll();
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());
QJsonObject jsonObj = jsonResponse.object();
m_szToken = jsonObj["token"].toString();
delete reply;
}
else
{
qDebug() << reply->errorString();
delete reply;
}
}
QList<cSerie*> cTheTVDBV2::search(const QString& szSerie, const QString& szLanguage)
{
QList<cSerie*> serieList;
QNetworkAccessManager networkManager;
QNetworkRequest request(QUrl(QString("https://api.thetvdb.com/search/series?name=%1").arg(szSerie)));
request.setRawHeader("Content-Type", "application/json");
request.setRawHeader("Authorization", QString("Bearer %1").arg(m_szToken).toUtf8());
if(!szLanguage.contains("all"))
request.setRawHeader("Accept-Language", szLanguage.toUtf8());
else
request.setRawHeader("Accept-Language", "en");
QNetworkReply* reply = networkManager.get(request);
QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
if (reply->error() == QNetworkReply::NoError)
{
QString strReply = (QString)reply->readAll();
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());
QJsonObject jsonObj = jsonResponse.object();
QJsonArray jsonArray = jsonObj["data"].toArray();
for(int z = 0;z < jsonArray.count();z++)
{
QJsonObject serie = jsonArray[z].toObject();
cSerie* lpSerie = new cSerie;
lpSerie->setID(serie["id"].toInt());
lpSerie->setSeriesName(serie["seriesName"].toString());
lpSerie->setFirstAired(serie["firstAired"].toString());
serieList.append(lpSerie);
}
delete reply;
}
else
{
qDebug() << reply->errorString();
delete reply;
}
return(serieList);
}
cSerie* cTheTVDBV2::load(const qint32 &iID, const QString &szLanguage)
{
cSerie* lpSerie = 0;
QNetworkAccessManager networkManager;
QNetworkRequest request(QUrl(QString("https://api.thetvdb.com/series/%1").arg(iID)));
request.setRawHeader("Content-Type", "application/json");
request.setRawHeader("Authorization", QString("Bearer %1").arg(m_szToken).toUtf8());
if(!szLanguage.contains("all"))
request.setRawHeader("Accept-Language", szLanguage.toUtf8());
else
request.setRawHeader("Accept-Language", "en");
QNetworkReply* reply = networkManager.get(request);
QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
if (reply->error() == QNetworkReply::NoError)
{
QString strReply = (QString)reply->readAll();
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());
QJsonObject jsonObj = jsonResponse.object();
QJsonObject serieDetails = jsonObj["data"].toObject();
QJsonArray genreArray = serieDetails["genre"].toArray();
QStringList genreList;
delete reply;
lpSerie = new cSerie;
lpSerie->setSeriesName(serieDetails["seriesName"].toString());
lpSerie->setSeriesID(serieDetails["seriesId"].toInt());
lpSerie->setLanguage(szLanguage);
lpSerie->setBanner(serieDetails["banner"].toString());
lpSerie->setOverview(serieDetails["overview"].toString());
lpSerie->setFirstAired(serieDetails["firstAired"].toString());
lpSerie->setNetwork(serieDetails["network"].toString());
lpSerie->setIMDBID(serieDetails["imdbId"].toString());
lpSerie->setID(serieDetails["id"].toInt());
lpSerie->setContentRating(serieDetails["rating"].toString());
for(int z = 0;z < genreArray.count();z++)
genreList.append(genreArray[z].toString());
lpSerie->setGenre(genreList);
lpSerie->setRating(serieDetails["siteRating"].toDouble());
lpSerie->setRatingCount(serieDetails["siteRatingCount"].toInt());
lpSerie->setRuntime(serieDetails["runtime"].toString().toInt());
lpSerie->setStatus(serieDetails["status"].toString());
lpSerie->setActors(getActors(iID));
getEpisodes(lpSerie, szLanguage);
}
else
{
qDebug() << reply->errorString();
delete reply;
}
return(lpSerie);
}
QStringList cTheTVDBV2::getActors(const qint32& iID)
{
QStringList actorsList;
QNetworkAccessManager networkManager;
QNetworkRequest request(QUrl(QString("https://api.thetvdb.com/series/%1/actors").arg(iID)));
request.setRawHeader("Content-Type", "application/json");
request.setRawHeader("Authorization", QString("Bearer %1").arg(m_szToken).toUtf8());
QNetworkReply* reply = networkManager.get(request);
QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
if (reply->error() == QNetworkReply::NoError)
{
QString strReply = (QString)reply->readAll();
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());
QJsonObject jsonObj = jsonResponse.object();
QJsonArray actorsArray = jsonObj["data"].toArray();
for(int z = 0;z < actorsArray.count();z++)
{
QJsonObject actor = actorsArray.at(z).toObject();
actorsList.append(actor["name"].toString());
}
delete reply;
}
else
{
qDebug() << reply->errorString();
delete reply;
}
return(actorsList);
}
void cTheTVDBV2::getEpisodes(cSerie* lpSerie, const QString& szLanguage)
{
QNetworkAccessManager networkManager;
QNetworkRequest request(QUrl(QString("https://api.thetvdb.com/series/%1/episodes").arg(lpSerie->id())));
request.setRawHeader("Content-Type", "application/json");
request.setRawHeader("Authorization", QString("Bearer %1").arg(m_szToken).toUtf8());
if(!szLanguage.contains("all"))
request.setRawHeader("Accept-Language", szLanguage.toUtf8());
else
request.setRawHeader("Accept-Language", "en");
QNetworkReply* reply = networkManager.get(request);
QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
if (reply->error() == QNetworkReply::NoError)
{
QString strReply = (QString)reply->readAll();
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());
QJsonObject jsonObj = jsonResponse.object();
QJsonArray episodesArray = jsonObj["data"].toArray();
for(int z = 0;z < episodesArray.count();z++)
{
QJsonObject episode = episodesArray.at(z).toObject();
cEpisode* lpEpisode = getEpisode(episode["id"].toInt(), szLanguage);
cSeason* lpSeason = 0;
if(lpEpisode)
{
lpSeason = lpSerie->findSeason(lpEpisode->seasonNumber());
if(!lpSeason)
lpSeason = lpSerie->addSeason(lpEpisode->seasonNumber());
if(!lpSeason)
delete lpEpisode;
else
lpSeason->addEpisode(lpEpisode);
}
}
delete reply;
}
else
{
qDebug() << reply->errorString();
delete reply;
}
}
cEpisode* cTheTVDBV2::getEpisode(const qint32& iID, const QString& szLanguage)
{
cEpisode* lpEpisode = 0;
QNetworkAccessManager networkManager;
QNetworkRequest request(QUrl(QString("https://api.thetvdb.com/episodes/%1").arg(iID)));
request.setRawHeader("Content-Type", "application/json");
request.setRawHeader("Authorization", QString("Bearer %1").arg(m_szToken).toUtf8());
if(!szLanguage.contains("all"))
request.setRawHeader("Accept-Language", szLanguage.toUtf8());
else
request.setRawHeader("Accept-Language", "en");
QNetworkReply* reply = networkManager.get(request);
QEventLoop loop;
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
loop.exec();
if (reply->error() == QNetworkReply::NoError)
{
lpEpisode = new cEpisode;
QString strReply = (QString)reply->readAll();
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());
QJsonObject jsonObj = jsonResponse.object();
QJsonObject episodeObj = jsonObj["data"].toObject();
QJsonArray writerArray = episodeObj["writers"].toArray();
QStringList writerList;
QJsonArray guestArray = episodeObj["guestStars"].toArray();
QStringList guestList;
lpEpisode->setID(episodeObj["id"].toInt());
lpEpisode->setDirector(episodeObj["director"].toString());
lpEpisode->setEpisodeName(episodeObj["episodeName"].toString());
lpEpisode->setEpisodeNumber(episodeObj["airedEpisodeNumber"].toInt());
lpEpisode->setFirstAired(episodeObj["firstAired"].toString());
for(int z = 0;z < guestArray.count();z++)
guestList.append(guestArray[z].toString());
lpEpisode->setGuestStars(guestList);
lpEpisode->setIMDBID(episodeObj["imdbId"].toString()); // IMDBID
lpEpisode->setLanguage(szLanguage);
lpEpisode->setOverview(episodeObj["overview"].toString());
lpEpisode->setProductionCode(episodeObj["productionCode"].toString()); // PRORUCTION CODE
lpEpisode->setRating(episodeObj["siteRating"].toDouble()); // RATING
lpEpisode->setRatingCount(episodeObj["siteRatingCount"].toInt()); // RATING COUNT
lpEpisode->setSeasonNumber(episodeObj["airedSeason"].toInt());
for(int z = 0;z < writerArray.count();z++)
writerList.append(writerArray[z].toString());
lpEpisode->setWriter(writerList);
lpEpisode->setSeasonID(episodeObj["airedSeasonID"].toInt()); // SEASON ID
lpEpisode->setSeriesID(episodeObj["seriesId"].toInt()); // SERIES ID
lpEpisode->setFileName(episodeObj["filename"].toString()); // FILENAME
lpEpisode->setThumbHeight(episodeObj["thumbHeight"].toString().toInt());
lpEpisode->setThumbWidth(episodeObj["thumbWidth"].toString().toInt());
if(!lpEpisode->isValid())
{
delete lpEpisode;
return(0);
}
return(lpEpisode);
}
else
{
qDebug() << reply->errorString();
delete reply;
return(0);
}
}
+25
View File
@@ -0,0 +1,25 @@
#ifndef CTHETVDBV2_H
#define CTHETVDBV2_H
#include "cserie.h"
#include <QList>
#include <QStringList>
class cTheTVDBV2
{
public:
cTheTVDBV2();
QList<cSerie*> search(const QString& szSerie, const QString& szLanguage = "all");
cSerie* load(const qint32 &iID, const QString& szLanguage);
private:
QString m_szToken;
QStringList getActors(const qint32& iID);
void getEpisodes(cSerie* lpSerie, const QString& szLanguage);
cEpisode* getEpisode(const qint32& iID, const QString& szLanguage);
};
#endif // CTHETVDBV2_H
+90
View File
@@ -0,0 +1,90 @@
#include "cupdatethread.h"
#include "cserie.h"
#include "cseason.h"
#include "cepisode.h"
#include "cthetvdbv2.h"
#include "cmessagedialog.h"
#include <QMessageBox>
#include <QDebug>
#include <QTime>
cUpdateThread::cUpdateThread() :
m_bStop(false)
{
}
void cUpdateThread::stop()
{
QMutexLocker locker(&m_mutex);
m_bStop = true;
emit updateAppendMessage(" - cancel pending ...");
}
void cUpdateThread::run()
{
QTime timer;
timer.restart();
QString szFailed;
for(int x = 0;x < m_indexList.count();x++)
{
cSerie* lpSerie = m_indexList.at(x).data(Qt::UserRole).value<cSerie*>();
if(lpSerie)
{
emit updateMessage(lpSerie->seriesName(), x);
cTheTVDBV2 tvDB;
cSerie* lpSerieNew;
if(lpSerie->seriesID() != -1)
{
lpSerieNew = tvDB.load(lpSerie->id(), "de");
if(!lpSerieNew)
lpSerieNew = tvDB.load(lpSerie->id(), "en");
if(!lpSerieNew)
{
if(szFailed.length())
szFailed += ", ";
szFailed += lpSerie->seriesName();
continue;
}
lpSerieNew->setDownload(lpSerie->download());
for(int x = 0;x < lpSerieNew->seasonList().count();x++)
{
cSeason* lpSeasonNew = lpSerieNew->seasonList().at(x);
for(int y = 0;y < lpSeasonNew->episodeList().count();y++)
{
cEpisode* lpEpisodeNew = lpSeasonNew->episodeList().at(y);
cEpisode* lpEpisode = lpSerie->findEpisode(lpEpisodeNew->id());
if(lpEpisode)
lpEpisodeNew->setState(lpEpisode->state());
}
}
lpSerieNew->setCliffhanger(lpSerie->cliffhanger());
lpSerie->del(m_db);
lpSerieNew->save(m_db);
}
}
QMutexLocker locker(&m_mutex);
if(m_bStop)
break;
msleep(10);
}
/*
if(szFailed.length())
{
QMessageBox msgBox;
msgBox.setText(szFailed + QString(" has failed to update."));
msgBox.exec();
}
*/
}
void cUpdateThread::setData(cMessageDialog* lpMessageDialog, const QModelIndexList &indexList, const QSqlDatabase& db)
{
connect(lpMessageDialog->cancelButton(), SIGNAL(clicked()), this, SLOT(stop()));
m_indexList = indexList;
m_db = db;
}
+39
View File
@@ -0,0 +1,39 @@
#ifndef CUPDATETHREAD_H
#define CUPDATETHREAD_H
#include "cmessagedialog.h"
#include <QThread>
#include <QMutexLocker>
#include <QList>
#include <QStandardItem>
#include <QSqlDatabase>
class cUpdateThread : public QThread
{
Q_OBJECT
public:
explicit cUpdateThread();
void setData(cMessageDialog *lpMessageDialog, const QModelIndexList& indexList, const QSqlDatabase& db);
public slots:
void stop();
signals:
void updateMessage(const QString& szMessage, const qint32 &iProgress);
void updateAppendMessage(const QString& szMessage);
private:
QMutex m_mutex;
bool m_bStop;
QModelIndexList m_indexList;
QSqlDatabase m_db;
QWidget* m_lpParent;
void run();
};
#endif // CUPDATETHREAD_H
+38
View File
@@ -0,0 +1,38 @@
#include "cverticallabel.h"
#include <QPainter>
cVerticalLabel::cVerticalLabel(QWidget *parent)
: QLabel(parent)
{
}
cVerticalLabel::cVerticalLabel(const QString &text, QWidget *parent)
: QLabel(text, parent)
{
}
void cVerticalLabel::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.setPen(Qt::black);
painter.setBrush(Qt::Dense1Pattern);
painter.translate(sizeHint().width(), sizeHint().height());
painter.rotate(270);
painter.drawText(0,0, text());
}
QSize cVerticalLabel::minimumSizeHint() const
{
QSize s = QLabel::minimumSizeHint();
return QSize(s.height(), s.width());
}
QSize cVerticalLabel::sizeHint() const
{
QSize s = QLabel::sizeHint();
return QSize(s.height(), s.width());
}
+27
View File
@@ -0,0 +1,27 @@
#ifndef CVERTICALLABEL_H
#define CVERTICALLABEL_H
#include <QLabel>
class cVerticalLabel : public QLabel
{
Q_OBJECT
public:
explicit cVerticalLabel(QWidget *parent = 0);
explicit cVerticalLabel(const QString &text, QWidget *parent=0);
signals:
protected:
void paintEvent(QPaintEvent*);
QSize sizeHint() const ;
QSize minimumSizeHint() const;
public slots:
private:
};
#endif // CVERTICALLABEL_H
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Actors>
<Actor>
<id>316405</id>
<Image></Image>
<Name>Kevin Conway</Name>
<Role>Control Voice</Role>
<SortOrder>3</SortOrder>
</Actor>
</Actors>
+428
View File
@@ -0,0 +1,428 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Banners>
<Banner>
<id>1065691</id>
<BannerPath>fanart/original/72224-1.jpg</BannerPath>
<BannerType>fanart</BannerType>
<BannerType2>1280x720</BannerType2>
<Colors></Colors>
<Language>en</Language>
<Rating>10.0000</Rating>
<RatingCount>2</RatingCount>
<SeriesName>false</SeriesName>
<ThumbnailPath>_cache/fanart/original/72224-1.jpg</ThumbnailPath>
<VignettePath>fanart/vignette/72224-1.jpg</VignettePath>
</Banner>
<Banner>
<id>887842</id>
<BannerPath>fanart/original/72224-6.jpg</BannerPath>
<BannerType>fanart</BannerType>
<BannerType2>1280x720</BannerType2>
<Colors></Colors>
<Language>en</Language>
<Rating>9.6667</Rating>
<RatingCount>3</RatingCount>
<SeriesName>true</SeriesName>
<ThumbnailPath>_cache/fanart/original/72224-6.jpg</ThumbnailPath>
<VignettePath>fanart/vignette/72224-6.jpg</VignettePath>
</Banner>
<Banner>
<id>28625</id>
<BannerPath>fanart/original/72224-2.jpg</BannerPath>
<BannerType>fanart</BannerType>
<BannerType2>1280x720</BannerType2>
<Colors></Colors>
<Language>en</Language>
<Rating>5.5714</Rating>
<RatingCount>7</RatingCount>
<SeriesName>false</SeriesName>
<ThumbnailPath>_cache/fanart/original/72224-2.jpg</ThumbnailPath>
<VignettePath>fanart/vignette/72224-2.jpg</VignettePath>
</Banner>
<Banner>
<id>39152</id>
<BannerPath>fanart/original/72224-5.jpg</BannerPath>
<BannerType>fanart</BannerType>
<BannerType2>1280x720</BannerType2>
<Colors>|233,229,226|186,183,178|139,135,134|</Colors>
<Language>en</Language>
<Rating>4.0000</Rating>
<RatingCount>5</RatingCount>
<SeriesName>false</SeriesName>
<ThumbnailPath>_cache/fanart/original/72224-5.jpg</ThumbnailPath>
<VignettePath>fanart/vignette/72224-5.jpg</VignettePath>
</Banner>
<Banner>
<id>28627</id>
<BannerPath>fanart/original/72224-3.jpg</BannerPath>
<BannerType>fanart</BannerType>
<BannerType2>1280x720</BannerType2>
<Colors></Colors>
<Language>en</Language>
<Rating>3.2500</Rating>
<RatingCount>4</RatingCount>
<SeriesName>false</SeriesName>
<ThumbnailPath>_cache/fanart/original/72224-3.jpg</ThumbnailPath>
<VignettePath>fanart/vignette/72224-3.jpg</VignettePath>
</Banner>
<Banner>
<id>29656</id>
<BannerPath>fanart/original/72224-4.jpg</BannerPath>
<BannerType>fanart</BannerType>
<BannerType2>1280x720</BannerType2>
<Colors></Colors>
<Language>en</Language>
<Rating>3.0000</Rating>
<RatingCount>3</RatingCount>
<SeriesName>false</SeriesName>
<ThumbnailPath>_cache/fanart/original/72224-4.jpg</ThumbnailPath>
<VignettePath>fanart/vignette/72224-4.jpg</VignettePath>
</Banner>
<Banner>
<id>1066059</id>
<BannerPath>posters/72224-5.jpg</BannerPath>
<BannerType>poster</BannerType>
<BannerType2>680x1000</BannerType2>
<Language>en</Language>
<Rating>10.0000</Rating>
<RatingCount>1</RatingCount>
</Banner>
<Banner>
<id>1065692</id>
<BannerPath>posters/72224-3.jpg</BannerPath>
<BannerType>poster</BannerType>
<BannerType2>680x1000</BannerType2>
<Language>en</Language>
<Rating>10.0000</Rating>
<RatingCount>1</RatingCount>
</Banner>
<Banner>
<id>29000</id>
<BannerPath>posters/72224-1.jpg</BannerPath>
<BannerType>poster</BannerType>
<BannerType2>680x1000</BannerType2>
<Language>en</Language>
<Rating>9.0000</Rating>
<RatingCount>8</RatingCount>
</Banner>
<Banner>
<id>876245</id>
<BannerPath>posters/72224-2.jpg</BannerPath>
<BannerType>poster</BannerType>
<BannerType2>680x1000</BannerType2>
<Language>en</Language>
<Rating>6.0000</Rating>
<RatingCount>4</RatingCount>
</Banner>
<Banner>
<id>1065971</id>
<BannerPath>seasons/72224-7-3.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>10.0000</Rating>
<RatingCount>1</RatingCount>
<Season>7</Season>
</Banner>
<Banner>
<id>1012015</id>
<BannerPath>seasons/72224-5-2.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>10.0000</Rating>
<RatingCount>2</RatingCount>
<Season>5</Season>
</Banner>
<Banner>
<id>1012008</id>
<BannerPath>seasons/72224-4-2.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>10.0000</Rating>
<RatingCount>2</RatingCount>
<Season>4</Season>
</Banner>
<Banner>
<id>1012014</id>
<BannerPath>seasons/72224-3-2.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>10.0000</Rating>
<RatingCount>2</RatingCount>
<Season>3</Season>
</Banner>
<Banner>
<id>1012009</id>
<BannerPath>seasons/72224-2-2.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>10.0000</Rating>
<RatingCount>2</RatingCount>
<Season>2</Season>
</Banner>
<Banner>
<id>1065972</id>
<BannerPath>seasons/72224-6-3.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>10.0000</Rating>
<RatingCount>1</RatingCount>
<Season>6</Season>
</Banner>
<Banner>
<id>1012013</id>
<BannerPath>seasons/72224-1-4.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>10.0000</Rating>
<RatingCount>2</RatingCount>
<Season>1</Season>
</Banner>
<Banner>
<id>7592</id>
<BannerPath>seasons/172-1.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>9.0000</Rating>
<RatingCount>1</RatingCount>
<Season>1</Season>
</Banner>
<Banner>
<id>7598</id>
<BannerPath>seasons/172-7.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>9.0000</Rating>
<RatingCount>1</RatingCount>
<Season>7</Season>
</Banner>
<Banner>
<id>7596</id>
<BannerPath>seasons/172-5.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>9.0000</Rating>
<RatingCount>2</RatingCount>
<Season>5</Season>
</Banner>
<Banner>
<id>7594</id>
<BannerPath>seasons/172-3.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>9.0000</Rating>
<RatingCount>1</RatingCount>
<Season>3</Season>
</Banner>
<Banner>
<id>7593</id>
<BannerPath>seasons/172-2.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>9.0000</Rating>
<RatingCount>1</RatingCount>
<Season>2</Season>
</Banner>
<Banner>
<id>7597</id>
<BannerPath>seasons/172-6.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>8.5000</Rating>
<RatingCount>2</RatingCount>
<Season>6</Season>
</Banner>
<Banner>
<id>7595</id>
<BannerPath>seasons/172-4.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>en</Language>
<Rating>8.5000</Rating>
<RatingCount>2</RatingCount>
<Season>4</Season>
</Banner>
<Banner>
<id>27333</id>
<BannerPath>seasons/72224-1.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>es</Language>
<Rating>8.0000</Rating>
<RatingCount>1</RatingCount>
<Season>1</Season>
</Banner>
<Banner>
<id>887839</id>
<BannerPath>seasons/72224-1-3.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>de</Language>
<Rating>6.0000</Rating>
<RatingCount>1</RatingCount>
<Season>1</Season>
</Banner>
<Banner>
<id>27412</id>
<BannerPath>seasons/72224-6.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>es</Language>
<Rating>1.0000</Rating>
<RatingCount>1</RatingCount>
<Season>6</Season>
</Banner>
<Banner>
<id>27407</id>
<BannerPath>seasons/72224-1-2.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>es</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
<Season>1</Season>
</Banner>
<Banner>
<id>27410</id>
<BannerPath>seasons/72224-4.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>es</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
<Season>4</Season>
</Banner>
<Banner>
<id>27411</id>
<BannerPath>seasons/72224-5.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>es</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
<Season>5</Season>
</Banner>
<Banner>
<id>27413</id>
<BannerPath>seasons/72224-7.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>es</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
<Season>7</Season>
</Banner>
<Banner>
<id>27409</id>
<BannerPath>seasons/72224-3.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>es</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
<Season>3</Season>
</Banner>
<Banner>
<id>27408</id>
<BannerPath>seasons/72224-2.jpg</BannerPath>
<BannerType>season</BannerType>
<BannerType2>season</BannerType2>
<Language>es</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
<Season>2</Season>
</Banner>
<Banner>
<id>9536</id>
<BannerPath>graphical/72224-g.jpg</BannerPath>
<BannerType>series</BannerType>
<BannerType2>graphical</BannerType2>
<Language>en</Language>
<Rating>7.7500</Rating>
<RatingCount>4</RatingCount>
</Banner>
<Banner>
<id>21494</id>
<BannerPath>graphical/72224-g2.jpg</BannerPath>
<BannerType>series</BannerType>
<BannerType2>graphical</BannerType2>
<Language>en</Language>
<Rating>5.5000</Rating>
<RatingCount>2</RatingCount>
</Banner>
<Banner>
<id>6449</id>
<BannerPath>graphical/172-g.jpg</BannerPath>
<BannerType>series</BannerType>
<BannerType2>graphical</BannerType2>
<Language>en</Language>
<Rating>4.0000</Rating>
<RatingCount>2</RatingCount>
</Banner>
<Banner>
<id>5337</id>
<BannerPath>text/172.jpg</BannerPath>
<BannerType>series</BannerType>
<BannerType2>text</BannerType2>
<Language>en</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
</Banner>
<Banner>
<id>1078125</id>
<BannerPath>graphical/72224-g6.jpg</BannerPath>
<BannerType>series</BannerType>
<BannerType2>graphical</BannerType2>
<Language>en</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
</Banner>
<Banner>
<id>1078123</id>
<BannerPath>graphical/72224-g4.jpg</BannerPath>
<BannerType>series</BannerType>
<BannerType2>graphical</BannerType2>
<Language>en</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
</Banner>
<Banner>
<id>1078122</id>
<BannerPath>graphical/72224-g3.jpg</BannerPath>
<BannerType>series</BannerType>
<BannerType2>graphical</BannerType2>
<Language>en</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
</Banner>
<Banner>
<id>1078124</id>
<BannerPath>graphical/72224-g5.jpg</BannerPath>
<BannerType>series</BannerType>
<BannerType2>graphical</BannerType2>
<Language>en</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
</Banner>
<Banner>
<id>1078126</id>
<BannerPath>graphical/72224-g7.jpg</BannerPath>
<BannerType>series</BannerType>
<BannerType2>graphical</BannerType2>
<Language>en</Language>
<Rating></Rating>
<RatingCount>0</RatingCount>
</Banner>
</Banners>
+4975
View File
File diff suppressed because it is too large Load Diff
BIN
View File
Binary file not shown.
+22
View File
@@ -0,0 +1,22 @@
#include "cmainwindow.h"
#include <QApplication>
#include <QSettings>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
QCoreApplication::setOrganizationName("WIN-DESIGN");
QCoreApplication::setOrganizationDomain("windesign.at");
QCoreApplication::setApplicationName("qtSerien");
QSettings settings;
cMainWindow w;
if(settings.value("main/maximized").toBool())
w.showMaximized();
else
w.show();
return a.exec();
}
+65
View File
@@ -0,0 +1,65 @@
#-------------------------------------------------
#
# Project created by QtCreator 2016-02-16T11:33:54
#
#-------------------------------------------------
QT += core gui network xml sql
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = qtSerien
TEMPLATE = app
SOURCES += main.cpp\
cmainwindow.cpp \
cserie.cpp \
cseasondelegate.cpp \
cseason.cpp \
cepisode.cpp \
csearch.cpp \
cmessageanimatedialog.cpp \
cedit.cpp \
cimage.cpp \
cseasondetails.cpp \
cverticallabel.cpp \
cepisodedetails.cpp \
cmessagedialog.cpp \
cupdatethread.cpp \
cpicturesthread.cpp \
cthetvdbv2.cpp \
cthemoviedbv3.cpp \
cmovie.cpp
HEADERS += cmainwindow.h \
cserie.h \
cseasondelegate.h \
cseason.h \
cepisode.h \
csearch.h \
cmessageanimatedialog.h \
cedit.h \
cimage.h \
cseasondetails.h \
cverticallabel.h \
cepisodedetails.h \
cmessagedialog.h \
cupdatethread.h \
cpicturesthread.h \
cthetvdbv2.h \
cthemoviedbv3.h \
cmovie.h
FORMS += cmainwindow.ui \
csearch.ui \
cmessageanimatedialog.ui \
cedit.ui \
cseasondetails.ui \
cepisodedetails.ui \
cmessagedialog.ui
DISTFILES +=
RESOURCES += \
resource.qrc
+6
View File
@@ -0,0 +1,6 @@
<RCC>
<qresource prefix="/">
<file>empty.db</file>
<file>128279.png</file>
</qresource>
</RCC>