mirror of
https://github.com/YACReader/yacreader
synced 2025-07-14 02:54:46 -04:00
Update the UI when a comic is updated using the http api
This commit is contained in:
@ -2818,6 +2818,29 @@ void LibraryWindow::importLibraryPackage()
|
||||
importLibraryDialog->open(libraries);
|
||||
}
|
||||
|
||||
void LibraryWindow::updateViewsOnComicUpdateWithId(quint64 libraryId, quint64 comicId)
|
||||
{
|
||||
if (libraryId == (quint64)libraries.getId(selectedLibrary->currentText())) {
|
||||
auto path = libraries.getPath(libraryId);
|
||||
if (path.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
QString connectionName = "";
|
||||
{
|
||||
QSqlDatabase db = DataBaseManagement::loadDatabase(path + "/.yacreaderlibrary");
|
||||
bool found;
|
||||
auto comic = DBHelper::loadComic(comicId, db, found);
|
||||
if (found) {
|
||||
updateViewsOnComicUpdate(libraryId, comic);
|
||||
}
|
||||
|
||||
qDebug() << db.lastError();
|
||||
connectionName = db.connectionName();
|
||||
}
|
||||
QSqlDatabase::removeDatabase(connectionName);
|
||||
}
|
||||
}
|
||||
|
||||
void LibraryWindow::updateViewsOnComicUpdate(quint64 libraryId, const ComicDB &comic)
|
||||
{
|
||||
if (libraryId == (quint64)libraries.getId(selectedLibrary->currentText())) {
|
||||
|
Reference in New Issue
Block a user