Merge branch 'develop' into 9.5.0_bugfixes

This commit is contained in:
Luis Ángel San Martín 2018-05-31 18:12:52 +02:00 committed by GitHub
commit 1a91206a2d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 12 additions and 60 deletions

View File

@ -1682,8 +1682,10 @@ void MainWindowViewer::decreasePageZoomLevel()
void MainWindowViewer::sendComic()
{
YACReaderLocalClient * client = new YACReaderLocalClient;
connect(client, &YACReaderLocalClient::finished, client, &YACReaderLocalClient::deleteLater);
currentComicDB.info.lastTimeOpened = QDateTime::currentSecsSinceEpoch();
currentComicDB.info.lastTimeOpened = QDateTime::currentMSecsSinceEpoch() / 1000;
viewer->updateComic(currentComicDB);
if (currentComicDB.info.currentPage == currentComicDB.info.numPages) {

View File

@ -111,6 +111,8 @@ void ComicVineDialog::doConnections()
connect(selectVolumeWidget,SIGNAL(loadPage(QString,int)),this,SLOT(searchVolume(QString,int)));
connect(selectComicWidget,SIGNAL(loadPage(QString,int)),this,SLOT(getVolumeComicsInfo(QString,int)));
connect(sortVolumeComicsWidget,SIGNAL(loadPage(QString,int)),this,SLOT(getVolumeComicsInfo(QString,int)));
connect(this, SIGNAL(accepted()), this, SLOT(close()), Qt::QueuedConnection);
}
void ComicVineDialog::goNext()
@ -456,7 +458,6 @@ void ComicVineDialog::getComicsInfo(QList<QPair<ComicDB, QString> > & matchingIn
db.close();
QSqlDatabase::removeDatabase(db.connectionName());
close();
emit accepted();
}
@ -472,8 +473,7 @@ void ComicVineDialog::getComicInfo(const QString &comicId, int count, const QStr
//TODO
if(mode == SingleComic || currentIndex == (comics.count()-1))
{
close();
emit accepted();
emit accepted();
} else
{
goToNextComic();
@ -496,7 +496,6 @@ void ComicVineDialog::getComicInfo(const QString &comicId, int count, const QStr
if(mode == SingleComic || currentIndex == (comics.count()-1))
{
close();
emit accepted();
} else
{
@ -645,7 +644,6 @@ void ComicVineDialog::goToNextComic()
{
if(mode == SingleComic || currentIndex == (comics.count()-1))
{
close();
emit accepted();
return;
}

View File

@ -736,7 +736,7 @@ void DBHelper::updateReadingRemoteProgress(const ComicInfo &comicInfo, QSqlDatab
updateComicInfo.bindValue(":read", comicInfo.read?1:0);
updateComicInfo.bindValue(":currentPage", comicInfo.currentPage);
updateComicInfo.bindValue(":hasBeenOpened", comicInfo.hasBeenOpened?1:0);
updateComicInfo.bindValue(":lastTimeOpened", QDateTime::currentSecsSinceEpoch());
updateComicInfo.bindValue(":lastTimeOpened", QDateTime::currentMSecsSinceEpoch() / 1000);
updateComicInfo.bindValue(":id", comicInfo.id);
updateComicInfo.bindValue(":rating", comicInfo.rating);
updateComicInfo.exec();

View File

@ -1054,7 +1054,7 @@ void LibraryWindow::createConnections()
connect(propertiesDialog,SIGNAL(accepted()),navigationController,SLOT(reselectCurrentSource()));
//comic vine
connect(comicVineDialog,SIGNAL(accepted()),navigationController,SLOT(reselectCurrentSource()));
connect(comicVineDialog,SIGNAL(accepted()),navigationController,SLOT(reselectCurrentSource()), Qt::QueuedConnection);
connect(updateLibraryAction,SIGNAL(triggered()),this,SLOT(updateLibrary()));
connect(renameLibraryAction,SIGNAL(triggered()),this,SLOT(renameLibrary()));

View File

@ -23,5 +23,6 @@ void ComicDownloadInfoControllerV2::service(HttpRequest& request, HttpResponse&
//TODO: check if the comic wasn't found;
response.write(QString("fileName:%1\r\n").arg(comic.getFileName()).toUtf8());
response.write(QString("fileSize:%1\r\n").arg(comic.getFileSize()).toUtf8());
response.write(QString("hash:%1\r\n").arg(comic.info.hash).toUtf8(),true);
response.write(QString("libraryId:%1\r\n").arg(libraryId).toUtf8());
response.write(comic.toTXT().toUtf8(),true);
}

View File

@ -11,8 +11,6 @@ CoverControllerV2::CoverControllerV2() {}
void CoverControllerV2::service(HttpRequest& request, HttpResponse& response)
{
response.setHeader("Content-Type", "image/jpeg");
response.setHeader("Connection","close");
//response.setHeader("Content-Type", "plain/text; charset=ISO-8859-1");
YACReaderLibraries libraries = DBHelper::getLibraries();
@ -21,60 +19,14 @@ void CoverControllerV2::service(HttpRequest& request, HttpResponse& response)
QString libraryName = DBHelper::getLibraryName(pathElements.at(3).toInt());
QString fileName = pathElements.at(5);
//response.writeText(path+"<br/>");
//response.writeText(libraryName+"<br/>");
//response.writeText(libraries.value(libraryName)+"/.yacreaderlibrary/covers/"+fileName+"<br/>");
//QFile file(libraries.value(libraryName)+"/.yacreaderlibrary/covers/"+fileName);
//if (file.exists()) {
// if (file.open(QIODevice::ReadOnly))
// {
// qDebug("StaticFileController: Open file %s",qPrintable(file.fileName()));
// // Return the file content, do not store in cache
// while (!file.atEnd() && !file.error()) {
// response.write(file.read(131072));
// }
// }
// file.close();
//}
QImage img(libraries.getPath(libraryName)+"/.yacreaderlibrary/covers/"+fileName);
if (!img.isNull()) {
/*int width = 80, height = 120;
if(ySession->getDisplayType()=="@2x")
{
width = 160;
height = 240;
}
if(float(img.width())/img.height() < 0.66666)
img = img.scaledToWidth(width,Qt::SmoothTransformation);
else
img = img.scaledToHeight(height,Qt::SmoothTransformation);
QImage destImg(width,height,QImage::Format_RGB32);
destImg.fill(Qt::black);
QPainter p(&destImg);
p.drawImage((width-img.width())/2,(height-img.height())/2,img);
if(folderCover)
{
if(ySession->getDisplayType()=="@2x")
p.drawImage(0,0,QImage(":/images/f_overlayed_retina.png"));
else
p.drawImage(0,0,QImage(":/images/f_overlayed.png"));
}
*/
QByteArray ba;
QBuffer buffer(&ba);
buffer.open(QIODevice::WriteOnly);
img.save(&buffer, "JPG");
response.write(ba,true);
}
//DONE else, hay que devolver un 404
else
{
response.setStatus(404,"not found");

View File

@ -12,7 +12,6 @@ LibrariesControllerV2::LibrariesControllerV2() {}
void LibrariesControllerV2::service(HttpRequest& request, HttpResponse& response)
{
response.setHeader("Content-Type", "application/json");
response.setHeader("Connection","close");
YACReaderLibraries libraries = DBHelper::getLibraries();
QList<QString> names = DBHelper::getLibrariesNames();

View File

@ -247,8 +247,8 @@ void RequestMapper::serviceV2(HttpRequest& request, HttpResponse& response)
QByteArray path=request.getPath();
QRegExp folderInfo("/v2/library/.+/folder/[0-9]+/info/?"); //get folder info
QRegExp comicDownloadInfo("/v2/library/.+/comic/[0-9]+/?"); //get comic info (basic/download info)
QRegExp comicOpenForDownloading("/v2/library/.+/comic/[0-9]+/info/?"); //get comic info (full info + opening)
QRegExp comicDownloadInfo("/v2/library/.+/comic/[0-9]+/info/?"); //get comic info (full download info)
QRegExp comicOpenForDownloading("/v2/library/.+/comic/[0-9]+/?"); //get comic info (full info + opening)
QRegExp comicOpenForRemoteReading("/v2/library/.+/comic/[0-9]+/remote/?"); //the server will open for reading the comic
QRegExp comicFullInfo("/v2/library/.+/comic/[0-9]+/fullinfo/?"); //get comic info
QRegExp comicUpdate("/v2/library/.+/comic/[0-9]+/update/?"); //get comic info