mirror of
https://github.com/YACReader/yacreader
synced 2025-05-28 03:10:27 -04:00
commit
7945f658c3
@ -2,6 +2,14 @@
|
||||
|
||||
Version counting is based on semantic versioning (Major.Feature.Patch)
|
||||
|
||||
## 9.14.2
|
||||
|
||||
### YACReaderLibrary
|
||||
* Fix columns in the search results.
|
||||
* Fix type not being propagated to new folders from their parents.
|
||||
* Fix default type set to folders in the root folder when they are added.
|
||||
* Improve and fix comic file size format.
|
||||
|
||||
## 9.14.1
|
||||
|
||||
### YACReader
|
||||
|
@ -35,6 +35,10 @@
|
||||
#include <QDate>
|
||||
#include <QMenuBar>
|
||||
|
||||
#ifdef use_unarr
|
||||
#include "unarr.h"
|
||||
#endif
|
||||
|
||||
MainWindowViewer::MainWindowViewer()
|
||||
: QMainWindow(), fullscreen(false), toolbars(true), currentDirectory("."), currentDirectoryImgDest("."), isClient(false)
|
||||
{
|
||||
@ -781,8 +785,10 @@ void MainWindowViewer::open()
|
||||
QFileDialog openDialog;
|
||||
#ifndef use_unarr
|
||||
QString pathFile = openDialog.getOpenFileName(this, tr("Open Comic"), currentDirectory, tr("Comic files") + "(*.cbr *.cbz *.rar *.zip *.tar *.pdf *.7z *.cb7 *.arj *.cbt)");
|
||||
#else
|
||||
#elif (UNARR_API_VERSION < 110)
|
||||
QString pathFile = openDialog.getOpenFileName(this, tr("Open Comic"), currentDirectory, tr("Comic files") + "(*.cbr *.cbz *.rar *.zip *.tar *.pdf *.cbt)");
|
||||
#else
|
||||
QString pathFile = openDialog.getOpenFileName(this, tr("Open Comic"), currentDirectory, tr("Comic files") + "(*.cbr *.cbz *.rar *.zip *.tar *.pdf *.cbt *.7z *.cb7)");
|
||||
#endif
|
||||
if (!pathFile.isEmpty()) {
|
||||
openComicFromPath(pathFile);
|
||||
@ -1435,6 +1441,10 @@ void MainWindowViewer::getSiblingComics(QString path, QString currentComic)
|
||||
<< "*.zip"
|
||||
<< "*.tar"
|
||||
<< "*.pdf"
|
||||
#if (UNARR_API_VERSION >= 110)
|
||||
<< "*.7z"
|
||||
<< "*.cb7"
|
||||
#endif
|
||||
<< "*.cbt");
|
||||
#endif
|
||||
d.setSorting(QDir::Name | QDir::IgnoreCase | QDir::LocaleAware);
|
||||
|
@ -11,6 +11,9 @@
|
||||
#include "comic_db.h"
|
||||
#include "db_helper.h"
|
||||
#include "reading_list_model.h"
|
||||
#ifdef use_unarr
|
||||
#include <unarr.h>
|
||||
#endif
|
||||
|
||||
// ci.number,ci.title,c.fileName,ci.numPages,c.id,c.parentId,c.path,ci.hash,ci.read
|
||||
#include "QsLog.h"
|
||||
@ -290,7 +293,18 @@ QVariant ComicModel::data(const QModelIndex &index, int role) const
|
||||
auto item = static_cast<ComicItem *>(index.internalPointer());
|
||||
|
||||
auto sizeString = [=] {
|
||||
return QString::number(item->data(ComicModel::Hash).toString().right(item->data(ComicModel::Hash).toString().length() - 40).toInt() / 1024.0 / 1024.0, 'f', 2) + "Mb";
|
||||
auto bytes = item->data(ComicModel::Hash).toString().right(item->data(ComicModel::Hash).toString().length() - 40).toULongLong();
|
||||
|
||||
QStringList units = { "B", "KB", "MB", "GB", "TB" };
|
||||
int i;
|
||||
double outputSize = bytes;
|
||||
for (i = 0; i < units.size() - 1; i++) {
|
||||
if (outputSize < 1024) {
|
||||
break;
|
||||
}
|
||||
outputSize = outputSize / 1024;
|
||||
}
|
||||
return QString("%1 %2").arg(outputSize, 0, 'f', 2).arg(units[i]);
|
||||
};
|
||||
|
||||
if (role == NumberRole)
|
||||
@ -433,7 +447,7 @@ QVariant ComicModel::headerData(int section, Qt::Orientation orientation,
|
||||
return QVariant(QIcon(":/images/zip.png"));
|
||||
else if (ext.compare("rar", Qt::CaseInsensitive) == 0)
|
||||
return QVariant(QIcon(":/images/rar.png"));
|
||||
#ifndef use_unarr
|
||||
#if !defined(use_unarr) || (UNARR_API_VERSION >= 110)
|
||||
else if (ext.compare("7z", Qt::CaseInsensitive) == 0)
|
||||
return QVariant(QIcon(":/images/7z.png"));
|
||||
else if (ext.compare("cb7", Qt::CaseInsensitive) == 0)
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <list>
|
||||
|
||||
#define SEARCH_FOLDERS_QUERY "SELECT DISTINCT f.* FROM folder f LEFT JOIN comic c ON (f.id = c.parentId) INNER JOIN comic_info ci ON (c.comicInfoId = ci.id) WHERE "
|
||||
#define SEARCH_COMICS_QUERY "SELECT ci.number,ci.title,c.fileName,ci.numPages,c.id,c.parentId,c.path,ci.hash,ci.read,ci.isBis,ci.currentPage,ci.rating,ci.hasBeenOpened,ci.date,ci.added,ci.type FROM comic c INNER JOIN comic_info ci ON (c.comicInfoId = ci.id) LEFT JOIN folder f ON (f.id == c.parentId) WHERE "
|
||||
#define SEARCH_COMICS_QUERY "SELECT ci.number,ci.title,c.fileName,ci.numPages,c.id,c.parentId,c.path,ci.hash,ci.read,ci.currentPage,ci.rating,ci.hasBeenOpened,ci.date,ci.added,ci.type,ci.lastTimeOpened,ci.series,ci.volume,ci.storyArc FROM comic c INNER JOIN comic_info ci ON (c.comicInfoId = ci.id) LEFT JOIN folder f ON (f.id == c.parentId) WHERE "
|
||||
|
||||
/**
|
||||
* This class is used to generate an SQL query string from a search expression,
|
||||
|
@ -1270,12 +1270,14 @@ qulonglong DBHelper::insert(Folder *folder, QSqlDatabase &db)
|
||||
folder->added = added;
|
||||
|
||||
QSqlQuery query(db);
|
||||
query.prepare("INSERT INTO folder (parentId, name, path, added) "
|
||||
"VALUES (:parentId, :name, :path, :added)");
|
||||
query.prepare("INSERT INTO folder (parentId, name, path, added, type) "
|
||||
"VALUES (:parentId, :name, :path, :added, :type)");
|
||||
query.bindValue(":parentId", folder->parentId);
|
||||
query.bindValue(":name", folder->name);
|
||||
query.bindValue(":path", folder->path);
|
||||
query.bindValue(":added", added);
|
||||
auto intType = static_cast<int>(folder->type);
|
||||
query.bindValue(":type", intType);
|
||||
query.exec();
|
||||
|
||||
return query.lastInsertId().toULongLong();
|
||||
|
@ -54,7 +54,7 @@ void LibraryCreator::updateFolder(const QString &source, const QString &target,
|
||||
folderDestinationModelIndex = dest;
|
||||
|
||||
_currentPathFolders.clear();
|
||||
_currentPathFolders.append(Folder(1, 1, "root", "/"));
|
||||
_currentPathFolders.append(Folder::rootFolder());
|
||||
|
||||
QString relativeFolderPath = sourceFolder;
|
||||
relativeFolderPath = relativeFolderPath.remove(QDir::cleanPath(source));
|
||||
@ -139,7 +139,7 @@ void LibraryCreator::run()
|
||||
if (_mode == CREATOR) {
|
||||
QLOG_INFO() << "Starting to create new library ( " << _source << "," << _target << ")";
|
||||
_currentPathFolders.clear();
|
||||
_currentPathFolders.append(Folder(1, 1, "root", "/"));
|
||||
_currentPathFolders.append(Folder::rootFolder());
|
||||
// se crean los directorios .yacreaderlibrary y .yacreaderlibrary/covers
|
||||
QDir dir;
|
||||
dir.mkpath(_target + "/covers");
|
||||
@ -173,7 +173,7 @@ void LibraryCreator::run()
|
||||
QLOG_INFO() << "Starting to update folder" << _sourceFolder << "in library ( " << _source << "," << _target << ")";
|
||||
if (!partialUpdate) {
|
||||
_currentPathFolders.clear();
|
||||
_currentPathFolders.append(Folder(1, 1, "root", "/"));
|
||||
_currentPathFolders.append(Folder::rootFolder());
|
||||
QLOG_DEBUG() << "update whole library";
|
||||
}
|
||||
{
|
||||
|
@ -70,6 +70,14 @@ Folder &Folder::operator=(const Folder &other)
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
Folder Folder::rootFolder()
|
||||
{
|
||||
auto root = Folder(1, 1, "root", "/");
|
||||
root.type = YACReader::FileType::Comic; // TODO: make this configurable by the user so it can set a default type for a library
|
||||
return root;
|
||||
}
|
||||
|
||||
Folder::Folder(const QString &folderName, const QString &folderPath)
|
||||
: knownParent(false),
|
||||
knownId(false),
|
||||
|
@ -41,6 +41,8 @@ public:
|
||||
Folder(const Folder &folder);
|
||||
Folder &operator=(const Folder &other);
|
||||
|
||||
static Folder rootFolder();
|
||||
|
||||
inline void setId(qulonglong sid)
|
||||
{
|
||||
id = sid;
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include <QMetaType>
|
||||
#include <QAbstractItemModel>
|
||||
|
||||
#define VERSION "9.14.1"
|
||||
#define VERSION "9.14.2"
|
||||
|
||||
// Used to check if the database needs to be updated, the version is stored in the database.
|
||||
// This value is only incremented when the database structure changes.
|
||||
|
@ -66,6 +66,10 @@ YACReader::WhatsNewDialog::WhatsNewDialog(QWidget *parent)
|
||||
" • Improve style of the webui status page.<br/>"
|
||||
" • Fix type not being propagated to new files in a folder.<br/>"
|
||||
" • Mark the current type in the context menu so the user can know the current type.<br/>"
|
||||
" • Fix columns in the search results. (new in 9.14.2)<br/>"
|
||||
" • Fix type not being propagated to new folders from their parents. (new in 9.14.2)<br/>"
|
||||
" • Fix default type set to folders in the root folder when they are added. (new in 9.14.2)<br/>"
|
||||
" • Improve and fix comic file size format. (new in 9.14.2)<br/>"
|
||||
"<br/>"
|
||||
"<span style=\"font-weight:600\">YACReaderLibraryServer</span><br/>"
|
||||
" • Add `rescan-xml-info` command.<br/>"
|
||||
|
Loading…
Reference in New Issue
Block a user