Assign covers to folders from subfolders & comics

Before this commit folder with no direct comics (only subfolders) didn't have a cover image to be displayed. Now updating the children info  is done recursively and subfolders are taken into account.

This affects the iOS client remote browser so far, but it is also needed for the future browser update (display folders as a grid instead of using EmptyFolderWidget)
This commit is contained in:
Luis Ángel San Martín
2022-08-31 18:58:25 +02:00
parent 0fcf9d0cba
commit 8a6ec5fcc6
4 changed files with 72 additions and 15 deletions

View File

@ -547,7 +547,8 @@ void FolderModel::deleteFolder(const QModelIndex &mi)
{
QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath);
DBHelper::removeFromDB(&f, db);
DBHelper::updateChildrenInfo(item->parent()->id, db);
auto folder = DBHelper::updateChildrenInfo(item->parent()->id, db);
DBHelper::propagateFolderUpdatesToParent(folder, db);
connectionName = db.connectionName();
}
QSqlDatabase::removeDatabase(connectionName);
@ -560,7 +561,8 @@ void FolderModel::updateFolderChildrenInfo(qulonglong folderId)
QString connectionName = "";
{
QSqlDatabase db = DataBaseManagement::loadDatabase(_databasePath);
DBHelper::updateChildrenInfo(folderId, db);
auto folder = DBHelper::updateChildrenInfo(folderId, db);
DBHelper::propagateFolderUpdatesToParent(folder, db);
connectionName = db.connectionName();
}
QSqlDatabase::removeDatabase(connectionName);