readSrcShelf function

Future<SrcShelf> readSrcShelf(
  1. CometYaml cometYaml,
  2. String folderName
)

read src shelf

Implementation

Future<SrcShelf> readSrcShelf(CometYaml cometYaml, String folderName) async {
  final bookFolders = await readSubFolderNames(folderName);

  final List<SrcBook> srcBooks = [];
  for (final bookFolder in bookFolders) {
    final srcBook = await readSrcBook(folderName, bookFolder);
    srcBooks.add(srcBook);
  }

  final srcShelf = SrcShelf(
    name: folderName,
    books: srcBooks,
  );
  return srcShelf;
}