mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
Merge branch 'develop' into 9.5.0_bugfixes
This commit is contained in:
commit
1a91206a2d
@ -1682,8 +1682,10 @@ void MainWindowViewer::decreasePageZoomLevel()
|
|||||||
void MainWindowViewer::sendComic()
|
void MainWindowViewer::sendComic()
|
||||||
{
|
{
|
||||||
YACReaderLocalClient * client = new YACReaderLocalClient;
|
YACReaderLocalClient * client = new YACReaderLocalClient;
|
||||||
|
|
||||||
connect(client, &YACReaderLocalClient::finished, client, &YACReaderLocalClient::deleteLater);
|
connect(client, &YACReaderLocalClient::finished, client, &YACReaderLocalClient::deleteLater);
|
||||||
currentComicDB.info.lastTimeOpened = QDateTime::currentSecsSinceEpoch();
|
currentComicDB.info.lastTimeOpened = QDateTime::currentMSecsSinceEpoch() / 1000;
|
||||||
|
|
||||||
viewer->updateComic(currentComicDB);
|
viewer->updateComic(currentComicDB);
|
||||||
|
|
||||||
if (currentComicDB.info.currentPage == currentComicDB.info.numPages) {
|
if (currentComicDB.info.currentPage == currentComicDB.info.numPages) {
|
||||||
|
@ -111,6 +111,8 @@ void ComicVineDialog::doConnections()
|
|||||||
connect(selectVolumeWidget,SIGNAL(loadPage(QString,int)),this,SLOT(searchVolume(QString,int)));
|
connect(selectVolumeWidget,SIGNAL(loadPage(QString,int)),this,SLOT(searchVolume(QString,int)));
|
||||||
connect(selectComicWidget,SIGNAL(loadPage(QString,int)),this,SLOT(getVolumeComicsInfo(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(sortVolumeComicsWidget,SIGNAL(loadPage(QString,int)),this,SLOT(getVolumeComicsInfo(QString,int)));
|
||||||
|
|
||||||
|
connect(this, SIGNAL(accepted()), this, SLOT(close()), Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ComicVineDialog::goNext()
|
void ComicVineDialog::goNext()
|
||||||
@ -456,7 +458,6 @@ void ComicVineDialog::getComicsInfo(QList<QPair<ComicDB, QString> > & matchingIn
|
|||||||
db.close();
|
db.close();
|
||||||
QSqlDatabase::removeDatabase(db.connectionName());
|
QSqlDatabase::removeDatabase(db.connectionName());
|
||||||
|
|
||||||
close();
|
|
||||||
emit accepted();
|
emit accepted();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -472,8 +473,7 @@ void ComicVineDialog::getComicInfo(const QString &comicId, int count, const QStr
|
|||||||
//TODO
|
//TODO
|
||||||
if(mode == SingleComic || currentIndex == (comics.count()-1))
|
if(mode == SingleComic || currentIndex == (comics.count()-1))
|
||||||
{
|
{
|
||||||
close();
|
emit accepted();
|
||||||
emit accepted();
|
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
goToNextComic();
|
goToNextComic();
|
||||||
@ -496,7 +496,6 @@ void ComicVineDialog::getComicInfo(const QString &comicId, int count, const QStr
|
|||||||
|
|
||||||
if(mode == SingleComic || currentIndex == (comics.count()-1))
|
if(mode == SingleComic || currentIndex == (comics.count()-1))
|
||||||
{
|
{
|
||||||
close();
|
|
||||||
emit accepted();
|
emit accepted();
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
@ -645,7 +644,6 @@ void ComicVineDialog::goToNextComic()
|
|||||||
{
|
{
|
||||||
if(mode == SingleComic || currentIndex == (comics.count()-1))
|
if(mode == SingleComic || currentIndex == (comics.count()-1))
|
||||||
{
|
{
|
||||||
close();
|
|
||||||
emit accepted();
|
emit accepted();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -736,7 +736,7 @@ void DBHelper::updateReadingRemoteProgress(const ComicInfo &comicInfo, QSqlDatab
|
|||||||
updateComicInfo.bindValue(":read", comicInfo.read?1:0);
|
updateComicInfo.bindValue(":read", comicInfo.read?1:0);
|
||||||
updateComicInfo.bindValue(":currentPage", comicInfo.currentPage);
|
updateComicInfo.bindValue(":currentPage", comicInfo.currentPage);
|
||||||
updateComicInfo.bindValue(":hasBeenOpened", comicInfo.hasBeenOpened?1:0);
|
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(":id", comicInfo.id);
|
||||||
updateComicInfo.bindValue(":rating", comicInfo.rating);
|
updateComicInfo.bindValue(":rating", comicInfo.rating);
|
||||||
updateComicInfo.exec();
|
updateComicInfo.exec();
|
||||||
|
@ -1054,7 +1054,7 @@ void LibraryWindow::createConnections()
|
|||||||
connect(propertiesDialog,SIGNAL(accepted()),navigationController,SLOT(reselectCurrentSource()));
|
connect(propertiesDialog,SIGNAL(accepted()),navigationController,SLOT(reselectCurrentSource()));
|
||||||
|
|
||||||
//comic vine
|
//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(updateLibraryAction,SIGNAL(triggered()),this,SLOT(updateLibrary()));
|
||||||
connect(renameLibraryAction,SIGNAL(triggered()),this,SLOT(renameLibrary()));
|
connect(renameLibraryAction,SIGNAL(triggered()),this,SLOT(renameLibrary()));
|
||||||
|
@ -23,5 +23,6 @@ void ComicDownloadInfoControllerV2::service(HttpRequest& request, HttpResponse&
|
|||||||
//TODO: check if the comic wasn't found;
|
//TODO: check if the comic wasn't found;
|
||||||
response.write(QString("fileName:%1\r\n").arg(comic.getFileName()).toUtf8());
|
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("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);
|
||||||
}
|
}
|
||||||
|
@ -11,8 +11,6 @@ CoverControllerV2::CoverControllerV2() {}
|
|||||||
void CoverControllerV2::service(HttpRequest& request, HttpResponse& response)
|
void CoverControllerV2::service(HttpRequest& request, HttpResponse& response)
|
||||||
{
|
{
|
||||||
response.setHeader("Content-Type", "image/jpeg");
|
response.setHeader("Content-Type", "image/jpeg");
|
||||||
response.setHeader("Connection","close");
|
|
||||||
//response.setHeader("Content-Type", "plain/text; charset=ISO-8859-1");
|
|
||||||
|
|
||||||
YACReaderLibraries libraries = DBHelper::getLibraries();
|
YACReaderLibraries libraries = DBHelper::getLibraries();
|
||||||
|
|
||||||
@ -21,60 +19,14 @@ void CoverControllerV2::service(HttpRequest& request, HttpResponse& response)
|
|||||||
QString libraryName = DBHelper::getLibraryName(pathElements.at(3).toInt());
|
QString libraryName = DBHelper::getLibraryName(pathElements.at(3).toInt());
|
||||||
QString fileName = pathElements.at(5);
|
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);
|
QImage img(libraries.getPath(libraryName)+"/.yacreaderlibrary/covers/"+fileName);
|
||||||
if (!img.isNull()) {
|
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;
|
QByteArray ba;
|
||||||
QBuffer buffer(&ba);
|
QBuffer buffer(&ba);
|
||||||
buffer.open(QIODevice::WriteOnly);
|
buffer.open(QIODevice::WriteOnly);
|
||||||
img.save(&buffer, "JPG");
|
img.save(&buffer, "JPG");
|
||||||
response.write(ba,true);
|
response.write(ba,true);
|
||||||
}
|
}
|
||||||
//DONE else, hay que devolver un 404
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
response.setStatus(404,"not found");
|
response.setStatus(404,"not found");
|
||||||
|
@ -12,7 +12,6 @@ LibrariesControllerV2::LibrariesControllerV2() {}
|
|||||||
void LibrariesControllerV2::service(HttpRequest& request, HttpResponse& response)
|
void LibrariesControllerV2::service(HttpRequest& request, HttpResponse& response)
|
||||||
{
|
{
|
||||||
response.setHeader("Content-Type", "application/json");
|
response.setHeader("Content-Type", "application/json");
|
||||||
response.setHeader("Connection","close");
|
|
||||||
|
|
||||||
YACReaderLibraries libraries = DBHelper::getLibraries();
|
YACReaderLibraries libraries = DBHelper::getLibraries();
|
||||||
QList<QString> names = DBHelper::getLibrariesNames();
|
QList<QString> names = DBHelper::getLibrariesNames();
|
||||||
|
@ -247,8 +247,8 @@ void RequestMapper::serviceV2(HttpRequest& request, HttpResponse& response)
|
|||||||
QByteArray path=request.getPath();
|
QByteArray path=request.getPath();
|
||||||
|
|
||||||
QRegExp folderInfo("/v2/library/.+/folder/[0-9]+/info/?"); //get folder info
|
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 comicDownloadInfo("/v2/library/.+/comic/[0-9]+/info/?"); //get comic info (full download info)
|
||||||
QRegExp comicOpenForDownloading("/v2/library/.+/comic/[0-9]+/info/?"); //get comic info (full info + opening)
|
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 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 comicFullInfo("/v2/library/.+/comic/[0-9]+/fullinfo/?"); //get comic info
|
||||||
QRegExp comicUpdate("/v2/library/.+/comic/[0-9]+/update/?"); //get comic info
|
QRegExp comicUpdate("/v2/library/.+/comic/[0-9]+/update/?"); //get comic info
|
||||||
|
Loading…
Reference in New Issue
Block a user