mirror of
https://github.com/YACReader/yacreader
synced 2025-07-18 04:54:29 -04:00
Extract library paths methods to it's own struct in yacreader_global.h and use it everywhere
This commit is contained in:
@ -1,10 +1,8 @@
|
||||
#include "covercontroller_v2.h"
|
||||
#include "db_helper.h" //get libraries
|
||||
#include <QImage>
|
||||
#include "yacreader_libraries.h"
|
||||
#include "yacreader_http_session.h"
|
||||
|
||||
#include "template.h"
|
||||
#include "../static.h"
|
||||
#include "yacreader_global.h"
|
||||
|
||||
using stefanfrings::HttpRequest;
|
||||
using stefanfrings::HttpResponse;
|
||||
@ -22,7 +20,7 @@ void CoverControllerV2::service(HttpRequest &request, HttpResponse &response)
|
||||
QString libraryName = DBHelper::getLibraryName(pathElements.at(3).toInt());
|
||||
QString fileName = pathElements.at(5);
|
||||
|
||||
QImage img(libraries.getPath(libraryName) + "/.yacreaderlibrary/covers/" + fileName);
|
||||
QImage img(YACReader::LibraryPaths::coverPathWithFileName(libraries.getPath(libraryName), fileName));
|
||||
if (!img.isNull()) {
|
||||
QByteArray ba;
|
||||
QBuffer buffer(&ba);
|
||||
|
Reference in New Issue
Block a user