Bloom.Book.Book.FixBookIdAndLineageIfNeeded C# (CSharp) Метод

FixBookIdAndLineageIfNeeded() приватный Метод

private FixBookIdAndLineageIfNeeded ( ) : void
Результат void
        private void FixBookIdAndLineageIfNeeded()
        {
            HtmlDom bookDOM = _storage.Dom;
            //at version 0.9.71, we introduced this book lineage for real. At that point almost all books were from Basic book,
            //so let's get further evidence by looking at the page source and then fix the lineage
            // However, if we have json lineage, it is normal not to have it in HTML metadata.
            if (string.IsNullOrEmpty(BookInfo.BookLineage) && bookDOM.GetMetaValue("bloomBookLineage", "") == "")
                if (bookDOM.GetMetaValue("pageTemplateSource", "") == "Basic Book")
                {
                    bookDOM.UpdateMetaElement("bloomBookLineage", kIdOfBasicBook);
                }

            //there were a number of books in version 0.9 that just copied the id of the basic book from which they were created
            if (bookDOM.GetMetaValue("bloomBookId", "") == kIdOfBasicBook)
            {
                if (bookDOM.GetMetaValue("title", "") != "Basic Book")
                {
                    bookDOM.UpdateMetaElement("bloomBookId", Guid.NewGuid().ToString());
                }
            }
        }
Book