Add support for setting custom covers on folders

This commit is contained in:
Luis Ángel San Martín
2025-05-08 22:00:55 +02:00
parent f0b9d45033
commit b976b7f809
17 changed files with 263 additions and 34 deletions

View File

@ -18,7 +18,8 @@ void CoverControllerV2::service(HttpRequest &request, HttpResponse &response)
QString path = QUrl::fromPercentEncoding(request.getPath()).toUtf8();
QStringList pathElements = path.split('/');
QString libraryName = DBHelper::getLibraryName(pathElements.at(3).toInt());
QString fileName = pathElements.at(5);
QStringList remainingPathElements = pathElements.mid(5);
QString fileName = remainingPathElements.join('/');
QImage img(YACReader::LibraryPaths::coverPathWithFileName(libraries.getPath(libraryName), fileName));
if (!img.isNull()) {