diff --git a/src/common/kiwix/manager.cpp b/src/common/kiwix/manager.cpp index 31a8f4cd2..1382c16c3 100644 --- a/src/common/kiwix/manager.cpp +++ b/src/common/kiwix/manager.cpp @@ -297,6 +297,18 @@ namespace kiwix { return false; } + bool Manager::setBookPath(const string id, const string path) { + std::vector::iterator itr; + for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) { + if ( itr->id == id) { + itr->path = path; + return true; + } + } + + return false; + } + void Manager::removeBookPaths() { std::vector::iterator itr; for ( itr = library.books.begin(); itr != library.books.end(); ++itr ) { diff --git a/src/common/kiwix/manager.h b/src/common/kiwix/manager.h index e7194e232..c10818385 100644 --- a/src/common/kiwix/manager.h +++ b/src/common/kiwix/manager.h @@ -54,6 +54,7 @@ namespace kiwix { bool removeBookById(const string id); bool setCurrentBookId(const string id); bool setBookIndex(const string id, const string path, const supportedIndexType type); + bool setBookPath(const string id, const string path); string getCurrentBookId(); bool addBookFromPath(const string path, const string url = ""); Library cloneLibrary();