mirror of
https://github.com/YACReader/yacreader
synced 2025-06-04 01:28:55 -04:00
Set all new imported comics and folders as manga if the parent folder is manga
This commit is contained in:
parent
60de69635b
commit
d402999991
@ -223,14 +223,18 @@ qulonglong LibraryCreator::insertFolders()
|
|||||||
auto _database = QSqlDatabase::database(_databaseConnection);
|
auto _database = QSqlDatabase::database(_databaseConnection);
|
||||||
QList<Folder>::iterator i;
|
QList<Folder>::iterator i;
|
||||||
int currentId = 0;
|
int currentId = 0;
|
||||||
|
Folder currentParent;
|
||||||
for (i = _currentPathFolders.begin(); i != _currentPathFolders.end(); ++i) {
|
for (i = _currentPathFolders.begin(); i != _currentPathFolders.end(); ++i) {
|
||||||
if (!(i->knownId)) {
|
if (!(i->knownId)) {
|
||||||
i->setFather(currentId);
|
i->setFather(currentId);
|
||||||
|
i->setManga(currentParent.isManga());
|
||||||
currentId = DBHelper::insert(&(*i), _database); //insertFolder(currentId,*i);
|
currentId = DBHelper::insert(&(*i), _database); //insertFolder(currentId,*i);
|
||||||
i->setId(currentId);
|
i->setId(currentId);
|
||||||
} else {
|
} else {
|
||||||
currentId = i->id;
|
currentId = i->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
currentParent = *i;
|
||||||
}
|
}
|
||||||
return currentId;
|
return currentId;
|
||||||
}
|
}
|
||||||
@ -311,6 +315,7 @@ void LibraryCreator::insertComic(const QString &relativePath, const QFileInfo &f
|
|||||||
}
|
}
|
||||||
|
|
||||||
comic.parentId = _currentPathFolders.last().id;
|
comic.parentId = _currentPathFolders.last().id;
|
||||||
|
comic.info.manga = _currentPathFolders.last().isManga();
|
||||||
DBHelper::insert(&comic, _database);
|
DBHelper::insert(&comic, _database);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user