BookInfo GetBookWithIsbn(BookFile first, string isbn, IEnumerable<string> files) { var book = new BookInfo(files) { Isbn = isbn, Author = first.Author, Description = first.Description, PublishDate = first.PublishDate, Publisher = first.Publisher, Title = first.Title }; return book; }
void ReadMobiFile(MobiHeaderReader mobiReader, PdbRecords pdbRecords) { string title = mobiReader.GetTitleReader().ReadTitle(); ExthHeaderReader exthReader = mobiReader.GetExthHeaderReader(); if (exthReader == null) { _mobiFile = MakeMobiFileNoExth(title); } else { _mobiFile = MakeMobiFromExth(exthReader, title); } }
BookInfo GetBookWithoutIsbn(BookFile first) { var files = first.FilePath; var book = new BookInfo(files) { Isbn = "", Author = first.Author, Description = first.Description, PublishDate = first.PublishDate, Publisher = first.Publisher, Title = first.Title }; return book; }
async Task <BookFile> ReadBookFile(string path) { string ext = Path.GetExtension(path); IBookFileReader reader = _lookup[ext]; try { BookFile book = await Task.Run(() => reader.Read(path)); _messages.Write("Read {0}", path); return(book); } catch (Exception ex) { _messages.WriteError(ex, "reading {0}", path); return(null); } }
public BookFile Read(string filepath) { BookFile book = null; try { var epub = new Epub(filepath); book = new BookFile(); book.Author = GetFirstSafe(epub.Creator); book.Title = GetFirstSafe(epub.Title); book.Publisher = GetFirstSafe(epub.Publisher); book.Description = GetFirstSafe(epub.Description); book.PublishDate = GetFirstSafe(epub.Date); book.Isbn = epub.ISBN; book.FilePath = filepath; } catch { } return book; }
public PdbFileReader(string filepath) { _filepath = filepath; _mobiFile = null; }
void OutputComparison(BookFile first, BookFile mobi) { bool titleOk = first.Title == mobi.Title; bool authorOk = first.Author == mobi.Author; bool publisherOk = first.Publisher == mobi.Publisher; if (authorOk && titleOk && publisherOk) return; Console.WriteLine(" {0}: {1}{2}{3} {4}{5}{6}", first.Isbn, titleOk ? " " : "T", authorOk ? " " : "A", publisherOk ? " " : "P", titleOk ? "" : string.Format("({0} -> {1})", first.Title, mobi.Title), authorOk ? "" : string.Format("({0} -> {1})", first.Author, mobi.Author), publisherOk ? "" : string.Format("({0} -> {1})", first.Publisher, mobi.Publisher) ); }