-
-
@@ -153,8 +171,9 @@ export default class BookSection {
}
getTags(tags) {
- return (tags || []).map(({ id, name }) => {
- return `#${name}`;
+ return (tags || [])
+ .map(({ id, name }) => {
+ return `#${name}`;
})
.join("");
}
@@ -192,13 +211,25 @@ export default class BookSection {
}
this.element.classList.remove("spinner");
+ this.closeMenu()
+ }
+
+ makeLike(element) {
+ const { bookid: likedBookId } = element.dataset || {};
+ this.makeAction({ id: 0, authorid: "", bookid: likedBookId });
+ element.classList.add("liked");
}
async update(params) {
this.element.classList.add("blur", "spinner");
- const query = params || {};
- const data = await fetchData({ query, url: this.url });
+ let data = [];
+ if (params?.isByAuthor) {
+ data = await searchByAuthor({ id: params.id });
+ } else {
+ const query = params;
+ data = await fetchData({ query, url: this.url });
+ }
console.log("data", data);
if (data && Object.values(data).length) {
this.subElements.body.innerHTML = this.getBookBody(data);
@@ -208,6 +239,7 @@ export default class BookSection {
}
this.element.classList.remove("spinner");
}
+
getSubElements(element) {
const result = {};
const elements = element.querySelectorAll("[data-element]");
diff --git a/src/BukiVedi.App/web/js/requests/index.js b/src/BukiVedi.App/web/js/requests/index.js
index 1e3122e..3b75058 100644
--- a/src/BukiVedi.App/web/js/requests/index.js
+++ b/src/BukiVedi.App/web/js/requests/index.js
@@ -1,6 +1,7 @@
import { SUCCESS } from "../constants/index.js";
export const fetchData = ({ query, url }) => {
+ console.log('query, url', query, url);
return $.ajax({
contentType: "application/json; charset=utf-8",
dataType: "json",
@@ -119,4 +120,22 @@ export const downloadBook = ({ id, title, format }) => {
console.log(jqXHR.statusText);
},
});
-}
\ No newline at end of file
+}
+
+export const searchByAuthor = ({ id }) => {
+ return $.ajax({
+ contentType: "application/json; charset=utf-8",
+ dataType: "json",
+ type: "POST",
+ url: `../api/author/${id}/books`,
+ success: function (data, textStatus, jqXHR) {
+ if (textStatus === SUCCESS) {
+ return data;
+ }
+ return [];
+ },
+ error: function (jqXHR, textStatus, errorThrown) {
+ console.log(jqXHR.statusText);
+ },
+ });
+};
diff --git a/src/BukiVedi.App/web/js/scroll/index.js b/src/BukiVedi.App/web/js/scroll/index.js
new file mode 100644
index 0000000..1e56820
--- /dev/null
+++ b/src/BukiVedi.App/web/js/scroll/index.js
@@ -0,0 +1,80 @@
+export default class ButtonScroll {
+ element;
+
+ constructor() {
+ this.render();
+ }
+
+ get template() {
+ return `
+
+ `;
+ }
+
+ initialize() {
+ this.initEventListeners();
+ }
+
+ initEventListeners() {
+ const offset = 200;
+
+ window.addEventListener("scroll", () => {
+ const scrollPos =
+ window.scrollY ||
+ window.scrollTop ||
+ document.getElementsByTagName("html")[0].scrollTop;
+ scrollPos > offset
+ ? this.element.classList.add("is-active")
+ : this.element.classList.remove("is-active");
+ });
+
+ this.element.addEventListener("click", (event) => {
+ const isScroll = event.target.closest("[data-scroll]");
+ if (isScroll) {
+ window.scrollTo({ top: 0, behavior: 'smooth' });
+ }
+ });
+ }
+
+ render() {
+ const divElement = document.createElement("div");
+ divElement.innerHTML = this.template;
+ this.element = divElement.firstElementChild;
+ this.initialize();
+ }
+
+ remove() {
+ if (this.element) {
+ this.element.remove();
+ destroyEventListeners();
+ }
+ }
+
+ destroy() {
+ this.remove();
+ this.element = null;
+ }
+}
diff --git a/src/BukiVedi.App/web/script.js b/src/BukiVedi.App/web/script.js
new file mode 100644
index 0000000..4576623
--- /dev/null
+++ b/src/BukiVedi.App/web/script.js
@@ -0,0 +1,29 @@
+
+import BookSection from "./js/main/index.js";
+import ButtonScroll from './js/scroll/index.js';
+
+const input = document.getElementById("search");
+const books = document.getElementById("books");
+const content = document.getElementById("content");
+const booksSection = new BookSection({
+ url: "../api/books/search",
+ label: "books",
+});
+const click = () => {
+ const query = document.getElementById("search").value;
+ if (query) {
+ booksSection.update({ query });
+ }
+};
+
+searchButton.addEventListener("click", click);
+
+input.addEventListener("keypress", function (event) {
+ if (event.key === "Enter") {
+ click();
+ }
+});
+books.append(booksSection.element);
+
+const scroll = new ButtonScroll()
+content.append(scroll.element)
\ No newline at end of file
diff --git a/src/BukiVedi.App/web/server.js b/src/BukiVedi.App/web/server.js
new file mode 100644
index 0000000..fe8a538
--- /dev/null
+++ b/src/BukiVedi.App/web/server.js
@@ -0,0 +1,52 @@
+const path = require('path');
+const { createProxyMiddleware } = require('http-proxy-middleware');
+const cors = require('cors');
+
+const express = require('express');
+const app = express();
+
+const server = require('http').Server(app);
+const router = require('express').Router()
+
+const options = {
+ target: 'https://book.ogoun.name/', // target host
+ changeOrigin: true, // needed for virtual hosted sites
+ ws: true, // proxy websockets
+ logLevel: 'debug',
+ secure: false,
+ cookieDomainRewrite: {
+ '*': 'localhost',
+ },
+ onProxyRes(proxyRes, req, _res) {
+ if (proxyRes.headers['set-cookie'] !== undefined) {
+ req.cookie = proxyRes.headers['set-cookie'];
+ }
+ },
+ onProxyReq(proxyReq, req, _res) {
+ if (req && req.cookie !== undefined) {
+ proxyReq.setHeader('Cookie', req.cookie[0]);
+ }
+ },
+};
+
+const myLogger = function (req, res, next) {
+ next()
+}
+
+app.use(myLogger)
+
+app.use(express.static(__dirname));
+app.use(express.static(__dirname + '/js'));
+app.use(express.static(__dirname + '/css'));
+app.use(express.static(__dirname + '/constants'));
+
+// app.get('/login', function (req, res) {
+// res.sendFile(path.join(__dirname, '/login.html'));
+// });
+
+app.use('/', cors({
+ credentials: true,
+ origin: 'http://localhost:3000',
+}), createProxyMiddleware(options));
+
+server.listen(3001);
\ No newline at end of file
diff --git a/src/BukiVedi.Shared/Apps/AuthorHandler.cs b/src/BukiVedi.Shared/Apps/AuthorHandler.cs
new file mode 100644
index 0000000..72f7ea1
--- /dev/null
+++ b/src/BukiVedi.Shared/Apps/AuthorHandler.cs
@@ -0,0 +1,67 @@
+using BukiVedi.Shared.Entities;
+using BukiVedi.Shared.Models;
+using BukiVedi.Shared.Services;
+using BukiVedi.Shared.Services.Mappers;
+using MongoDB.Driver;
+
+namespace BukiVedi.Shared.Apps
+{
+ public class AuthorHandler
+ : IAuthorHandler
+ {
+ private readonly ILibrary _library;
+ public AuthorHandler(ILibrary library)
+ {
+ if (library == null) throw new ArgumentNullException(nameof(library));
+ _library = library;
+ }
+
+ public async Task AddToFavorite(string id, OperationContext context)
+ {
+ if (context?.OperationInitiator?.Id == null) throw new InvalidOperationException("Unauthorized");
+ var exists_fiter = Builders.Filter.And
+ (
+ Builders.Filter.Eq(f => f.UserId, context.OperationInitiator.Id),
+ Builders.Filter.Eq(f => f.AuthorId, id)
+ );
+ if (await Tables.FavoriteAuthors.Exists(exists_fiter) == false)
+ {
+ await Tables.FavoriteAuthors.Write(new FavoriteAuthor { AuthorId = id, UserId = context.OperationInitiator.Id });
+ }
+ }
+
+ public async Task> GetAllAuthors(OperationContext context)
+ {
+ var authors = (await Tables.Authors.GetAll()).Select(a => new AuthorInfo { Id = a.Id, Name = a.Name }).ToArray();
+ return authors;
+ }
+
+ public async Task> GetFavoriteAuthors(OperationContext context)
+ {
+ var authorIds = (await Tables.FavoriteAuthors.Get(Builders.Filter.Eq(f => f.UserId, context.OperationInitiator.Id))).Select(f => f.AuthorId).ToHashSet();
+ var authors = (await Tables.Authors.Get(Builders.Filter.In(a => a.Id, authorIds))).Select(a => new AuthorInfo { Id = a.Id, Name = a.Name }).ToArray();
+ return authors;
+ }
+
+ public async Task RemoveFromFavorite(string id, OperationContext context)
+ {
+ if (context?.OperationInitiator?.Id == null) throw new InvalidOperationException("Unauthorized");
+ var exists_fiter = Builders.Filter.And
+ (
+ Builders.Filter.Eq(f => f.UserId, context.OperationInitiator.Id),
+ Builders.Filter.Eq(f => f.AuthorId, id)
+ );
+ var records = await Tables.FavoriteAuthors.Get(exists_fiter);
+ foreach (var record in records)
+ {
+ await Tables.FavoriteAuthors.TryRemoveById(record.Id);
+ }
+ }
+
+ public async Task> SearchByAuthor(string id, OperationContext context)
+ {
+ var books = (await _library.SearchBooksByAuthor(id)).ToArray();
+ return await BookEntityMapper.Map(books);
+ }
+ }
+}
diff --git a/src/BukiVedi.Shared/Apps/BooksHandler.cs b/src/BukiVedi.Shared/Apps/BooksHandler.cs
new file mode 100644
index 0000000..9211fe7
--- /dev/null
+++ b/src/BukiVedi.Shared/Apps/BooksHandler.cs
@@ -0,0 +1,243 @@
+using Amazon.Runtime.Internal;
+using BukiVedi.Shared.Entities;
+using BukiVedi.Shared.Models;
+using BukiVedi.Shared.Services;
+using BukiVedi.Shared.Services.Mappers;
+using MongoDB.Driver;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Reflection.Metadata;
+using System.Text;
+using System.Threading.Tasks;
+using ZeroLevel.Services.FileSystem;
+
+namespace BukiVedi.Shared.Apps
+{
+ public class BooksHandler
+ : IBooksHandler
+ {
+ private readonly ILibrary _library;
+ public BooksHandler(ILibrary library)
+ {
+ if (library == null) throw new ArgumentNullException(nameof(library));
+ _library = library;
+ }
+
+ public async Task AddAuthorsToFavorite(string id, OperationContext context)
+ {
+ var book = await Tables.Books.GetById(id);
+ if (book != null)
+ {
+ var account_id = context.OperationInitiator.Id;
+ var authors = book.AuthorIds;
+ if (!string.IsNullOrEmpty(account_id) && authors?.Count > 0)
+ {
+ foreach (var author in authors)
+ {
+ var exists_fiter = Builders.Filter.And
+ (
+ Builders.Filter.Eq(f => f.UserId, account_id),
+ Builders.Filter.Eq(f => f.AuthorId, author)
+ );
+ if (await Tables.FavoriteAuthors.Exists(exists_fiter) == false)
+ {
+ await Tables.FavoriteAuthors.Write(new FavoriteAuthor { AuthorId = author, UserId = account_id });
+ }
+ }
+ }
+ }
+ }
+
+ public async Task AddBookToReadingQueue(string id, OperationContext context)
+ {
+ if (await Tables.Books.ExistById(id))
+ {
+ var account_id = context.OperationInitiator.Id;
+ if (!string.IsNullOrEmpty(account_id))
+ {
+ var exists_fiter = Builders.Filter.And
+ (
+ Builders.Filter.Eq(f => f.UserId, account_id),
+ Builders.Filter.Eq(f => f.BookId, id)
+ );
+ if (await Tables.ReadQueue.Exists(exists_fiter) == false)
+ {
+ await Tables.ReadQueue.Write(new ReadQueueItem { BookId = id, UserId = account_id, Timestamp = Timestamp.UtcNow });
+ }
+ }
+ }
+ }
+
+ public async Task AddToFavorite(string id, OperationContext context)
+ {
+ if (await Tables.Books.ExistById(id))
+ {
+ var account_id = context.OperationInitiator.Id;
+ if (!string.IsNullOrEmpty(account_id))
+ {
+ var exists_fiter = Builders.Filter.And
+ (
+ Builders.Filter.Eq(f => f.UserId, account_id),
+ Builders.Filter.Eq(f => f.BookId, id)
+ );
+ if (await Tables.FavoriteBooks.Exists(exists_fiter) == false)
+ {
+ await Tables.FavoriteBooks.Write(new FavoriteBook { BookId = id, UserId = account_id });
+ }
+ }
+ }
+ }
+
+ public async Task BlockBook(string id, OperationContext context)
+ {
+ if (await Tables.Books.ExistById(id))
+ {
+ var account_id = context.OperationInitiator.Id;
+ if (!string.IsNullOrEmpty(account_id))
+ {
+ var exists_fiter = Builders.Filter.And
+ (
+ Builders.Filter.Eq(f => f.UserId, account_id),
+ Builders.Filter.Eq(f => f.BookId, id)
+ );
+ if (await Tables.DisgustingBooks.Exists(exists_fiter) == false)
+ {
+ await Tables.DisgustingBooks.Write(new DisgustingBook { BookId = id, UserId = account_id });
+ }
+ }
+ }
+ }
+
+ public async Task BlockBookAuthor(string id, OperationContext context)
+ {
+ var book = await Tables.Books.GetById(id);
+ if (book != null)
+ {
+ var account_id = context.OperationInitiator.Id;
+ var authors = book.AuthorIds;
+ if (!string.IsNullOrEmpty(account_id) && authors?.Count > 0)
+ {
+ foreach (var author in authors)
+ {
+ var exists_fiter = Builders.Filter.And
+ (
+ Builders.Filter.Eq(f => f.UserId, account_id),
+ Builders.Filter.Eq(f => f.AuthorId, author)
+ );
+ if (await Tables.DisgustingAuthors.Exists(exists_fiter) == false)
+ {
+ await Tables.DisgustingAuthors.Write(new DisgustingAuthor { AuthorId = author, UserId = account_id });
+ }
+ }
+ }
+ }
+ }
+
+ public async Task<(string, MemoryStream)> GetBlobData(string id, OperationContext context)
+ {
+ var content = new System.IO.MemoryStream();
+ var book = await _library.DownloadToStream(content, id);
+ string name = id;
+ if (book != null && string.IsNullOrWhiteSpace(book.Title) == false)
+ {
+ name = FSUtils.FileNameCorrection(book.Title);
+ }
+ content.Position = 0;
+ return (name, content);
+ }
+
+ public async Task RemoveFromFavorite(string id, OperationContext context)
+ {
+ if (context?.OperationInitiator?.Id == null) throw new InvalidOperationException("Unauthorized");
+ var exists_fiter = Builders.Filter.And
+ (
+ Builders.Filter.Eq(f => f.UserId, context.OperationInitiator.Id),
+ Builders.Filter.Eq(f => f.BookId, id)
+ );
+ var records = await Tables.FavoriteBooks.Get(exists_fiter);
+ foreach (var record in records)
+ {
+ await Tables.FavoriteBooks.TryRemoveById(record.Id);
+ }
+ }
+
+ public async Task RemoveFromReadingQueue(string id, OperationContext context)
+ {
+ if (context?.OperationInitiator?.Id == null) throw new InvalidOperationException("Unauthorized");
+ var exists_fiter = Builders.Filter.And
+ (
+ Builders.Filter.Eq(f => f.UserId, context.OperationInitiator.Id),
+ Builders.Filter.Eq(f => f.BookId, id)
+ );
+ var records = await Tables.ReadQueue.Get(exists_fiter);
+ foreach (var record in records)
+ {
+ await Tables.ReadQueue.TryRemoveById(record.Id);
+ }
+ }
+
+ public async Task> Search(string query, string? tag, OperationContext context)
+ {
+ if (string.IsNullOrWhiteSpace(query) == false)
+ {
+ switch (query.Trim().ToLowerInvariant())
+ {
+ case "@favorites":
+ {
+ var books = (await _library.SearchFavoritesBooks(context.OperationInitiator.Id)).ToArray();
+ return await BookEntityMapper.Map(books);
+ }
+ case "@favoriteauthors":
+ {
+ var books = (await _library.SearchFavoriteAuthorsBooks(context.OperationInitiator.Id)).ToArray();
+ return await BookEntityMapper.Map(books);
+ }
+ case "@tagged":
+ {
+ var books = (await _library.SearchTaggedBooks(context.OperationInitiator.Id, tag: tag!)).ToArray();
+ return await BookEntityMapper.Map(books);
+ }
+
+ case "@blocked":
+ {
+ var books = (await _library.SearchBlockedBooks(context.OperationInitiator.Id)).ToArray();
+ return await BookEntityMapper.Map(books);
+ }
+
+ case "@toread":
+ {
+ var books = (await _library.SearchToReadBooks(context.OperationInitiator.Id)).ToArray();
+ return await BookEntityMapper.Map(books);
+ }
+
+ default:
+ {
+ var books = (await _library.SearchBooks(query)).ToArray();
+ return await BookEntityMapper.Map(books);
+ }
+ }
+ }
+ return Enumerable.Empty();
+ }
+
+ public async Task UnblockBook(string id, OperationContext context)
+ {
+ if (context?.OperationInitiator?.Id == null) throw new InvalidOperationException("Unauthorized");
+ var account_id = context.OperationInitiator.Id;
+ if (!string.IsNullOrEmpty(account_id))
+ {
+ var exists_fiter = Builders.Filter.And
+ (
+ Builders.Filter.Eq(f => f.UserId, account_id),
+ Builders.Filter.Eq(f => f.BookId, id)
+ );
+ var records = await Tables.DisgustingBooks.Get(exists_fiter);
+ foreach (var record in records)
+ {
+ await Tables.DisgustingBooks.TryRemoveById(record.Id);
+ }
+ }
+ }
+ }
+}
diff --git a/src/BukiVedi.Shared/Apps/IAuthorHandler.cs b/src/BukiVedi.Shared/Apps/IAuthorHandler.cs
new file mode 100644
index 0000000..cb31784
--- /dev/null
+++ b/src/BukiVedi.Shared/Apps/IAuthorHandler.cs
@@ -0,0 +1,13 @@
+using BukiVedi.Shared.Models;
+
+namespace BukiVedi.Shared.Apps
+{
+ public interface IAuthorHandler
+ {
+ Task> SearchByAuthor(string id, OperationContext context);
+ Task AddToFavorite(string id, OperationContext context);
+ Task RemoveFromFavorite(string id, OperationContext context);
+ Task> GetAllAuthors(OperationContext context);
+ Task> GetFavoriteAuthors(OperationContext context);
+ }
+}
diff --git a/src/BukiVedi.Shared/Apps/IBooksHandler.cs b/src/BukiVedi.Shared/Apps/IBooksHandler.cs
new file mode 100644
index 0000000..f166ae5
--- /dev/null
+++ b/src/BukiVedi.Shared/Apps/IBooksHandler.cs
@@ -0,0 +1,18 @@
+using BukiVedi.Shared.Models;
+
+namespace BukiVedi.Shared.Apps
+{
+ public interface IBooksHandler
+ {
+ Task> Search(string query, string? tag, OperationContext context);
+ Task AddToFavorite(string id, OperationContext context);
+ Task AddAuthorsToFavorite(string id, OperationContext context);
+ Task BlockBook(string id, OperationContext context);
+ Task BlockBookAuthor(string id, OperationContext context);
+ Task AddBookToReadingQueue(string id, OperationContext context);
+ Task<(string, MemoryStream)> GetBlobData(string id, OperationContext context);
+ Task UnblockBook(string id, OperationContext context);
+ Task RemoveFromFavorite(string id, OperationContext context);
+ Task RemoveFromReadingQueue(string id, OperationContext context);
+ }
+}
diff --git a/src/BukiVedi.Shared/Apps/ITagsHandler.cs b/src/BukiVedi.Shared/Apps/ITagsHandler.cs
new file mode 100644
index 0000000..1f15f37
--- /dev/null
+++ b/src/BukiVedi.Shared/Apps/ITagsHandler.cs
@@ -0,0 +1,12 @@
+using BukiVedi.Shared.Models;
+
+namespace BukiVedi.Shared.Apps
+{
+ public interface ITagsHandler
+ {
+ Task AppendTag(string bookId, string name, OperationContext context);
+ Task RemoveTag(string id, OperationContext context);
+ Task> GetUserTags(OperationContext context);
+ Task> Search(string id, OperationContext context);
+ }
+}
diff --git a/src/BukiVedi.Shared/Apps/TagsHandler.cs b/src/BukiVedi.Shared/Apps/TagsHandler.cs
new file mode 100644
index 0000000..c1fac51
--- /dev/null
+++ b/src/BukiVedi.Shared/Apps/TagsHandler.cs
@@ -0,0 +1,56 @@
+using BukiVedi.Shared.Entities;
+using BukiVedi.Shared.Models;
+using BukiVedi.Shared.Services;
+using BukiVedi.Shared.Services.Mappers;
+using MongoDB.Driver;
+
+namespace BukiVedi.Shared.Apps
+{
+ public class TagsHandler
+ : ITagsHandler
+ {
+ private readonly ILibrary _library;
+ public TagsHandler(ILibrary library)
+ {
+ if (library == null) throw new ArgumentNullException(nameof(library));
+ _library = library;
+ }
+
+ public async Task AppendTag(string bookId, string name, OperationContext context)
+ {
+ if (string.IsNullOrWhiteSpace(name) == false && await Tables.Books.ExistById(bookId))
+ {
+ name = name.Trim().ToLowerInvariant();
+ var tagFilter = Builders.Filter.And(Builders.Filter.Eq(t => t.BookId, bookId), Builders.Filter.Eq(t => t.Name, name));
+ if (false == await Tables.UserTag.Exists(tagFilter))
+ {
+ await Tables.UserTag.Write(new UserTag { BookId = bookId, Name = name, UserId = context.OperationInitiator.Id });
+ }
+ }
+ }
+
+ public async Task> GetUserTags(OperationContext context)
+ {
+ return (await Tables.UserTag.Get(Builders.Filter.Eq(t => t.UserId, context.OperationInitiator.Id)))?.Select(t => t.Name)!;
+ }
+
+ public async Task RemoveTag(string id, OperationContext context)
+ {
+ if (string.IsNullOrWhiteSpace(id) == false && await Tables.UserTag.ExistById(id))
+ {
+ return await Tables.UserTag.TryRemoveById(id);
+ }
+ return false;
+ }
+
+ public async Task> Search(string id, OperationContext context)
+ {
+ if (string.IsNullOrWhiteSpace(id) == false)
+ {
+ var books = await _library.SearchByTagBooks(context.OperationInitiator.Id, id);
+ return await BookEntityMapper.Map(books);
+ }
+ return Enumerable.Empty();
+ }
+ }
+}
diff --git a/src/BukiVedi.Shared/Models/AuthorInfo.cs b/src/BukiVedi.Shared/Models/AuthorInfo.cs
new file mode 100644
index 0000000..3f5fa5a
--- /dev/null
+++ b/src/BukiVedi.Shared/Models/AuthorInfo.cs
@@ -0,0 +1,10 @@
+namespace BukiVedi.Shared.Models
+{
+ public class AuthorInfo
+ {
+ public string Id { get; set; }
+ public string Name { get; set; }
+ public bool IsFavorite { get; set; }
+ public bool IsBlocked { get; set; }
+ }
+}
diff --git a/src/BukiVedi.Shared/Models/BookDocument.cs b/src/BukiVedi.Shared/Models/BookDocument.cs
index 0892848..020d632 100644
--- a/src/BukiVedi.Shared/Models/BookDocument.cs
+++ b/src/BukiVedi.Shared/Models/BookDocument.cs
@@ -9,10 +9,10 @@ namespace BukiVedi.Shared.Models
[SleoIndex("title", 100.0f, true)]
public string Title { get; set; }
- [SleoIndex("titlelm", 100.0f)]
+ [SleoIndex("titlelm", 90.0f)]
public string TitleLemmas { get; set; }
- [SleoIndex("author", 100.0f, true)]
+ [SleoIndex("author", 90.0f, true)]
public string Author { get; set; }
[SleoIndex("genre", 10.0f, true)]
diff --git a/src/BukiVedi.Shared/Models/BookDto.cs b/src/BukiVedi.Shared/Models/BookDto.cs
new file mode 100644
index 0000000..ccc8cf9
--- /dev/null
+++ b/src/BukiVedi.Shared/Models/BookDto.cs
@@ -0,0 +1,15 @@
+namespace BukiVedi.Shared.Models
+{
+ public class BookDto
+ {
+ public int Year { get; set; }
+ public string Title { get; set; }
+ public string[] TitleLemmas { get; set; }
+ public string Description { get; set; }
+ public string[] Authors { get; set; }
+ public string[] Genres { get; set; }
+ public string ArchivePath { get; set; }
+ public int ArchiveIndex { get; set; }
+ public BookFormat Format { get; set; }
+ }
+}
diff --git a/src/BukiVedi.Shared/Models/BookInfo.cs b/src/BukiVedi.Shared/Models/BookInfo.cs
index a8eb739..530ed39 100644
--- a/src/BukiVedi.Shared/Models/BookInfo.cs
+++ b/src/BukiVedi.Shared/Models/BookInfo.cs
@@ -2,14 +2,61 @@
{
public class BookInfo
{
- public int Year { get; set; }
+ ///
+ /// Идентификатор
+ ///
+ public string Id { get; set; }
+ ///
+ /// Изображение(урл)
+ ///
+ public string ImageUrl { get; set; }
+ ///
+ /// Название
+ ///
public string Title { get; set; }
- public string[] TitleLemmas { get; set; }
+ ///
+ /// Описание
+ ///
public string Description { get; set; }
- public string[] Authors { get; set; }
- public string[] Genres { get; set; }
- public string ArchivePath { get; set; }
- public int ArchiveIndex { get; set; }
- public BookFormat Format { get; set; }
+ ///
+ /// Заметка
+ ///
+ public string Note { get; set; }
+ ///
+ /// Авторы(массив объектов с полями id; имя автора)
+ ///
+ public AuthorInfo[] Authors { get; set; }
+ ///
+ /// Жанры(массив объектов с полями id; название жанра)
+ ///
+ public GenreInfo[] Genres { get; set; }
+ ///
+ /// Серия
+ ///
+ public string Series { get; set; }
+ ///
+ /// Подсерия
+ ///
+ public string Subseries { get; set; }
+ ///
+ /// Теги(массив объектов с полями id; имя тега)
+ ///
+ public IEnumerable Tags { get; set; }
+ ///
+ /// Год издания
+ ///
+ public int Year { get; set; }
+ ///
+ /// Формат книги
+ ///
+ public string Format { get; set; }
+ ///
+ /// Книга заблокирована пользователем
+ ///
+ public bool IsBlocked { get; set; }
+ ///
+ /// Книга находится в избранном
+ ///
+ public bool IsFavorite { get; set; }
}
}
diff --git a/src/BukiVedi.Shared/Models/FormatInfo.cs b/src/BukiVedi.Shared/Models/FormatInfo.cs
new file mode 100644
index 0000000..698c5d1
--- /dev/null
+++ b/src/BukiVedi.Shared/Models/FormatInfo.cs
@@ -0,0 +1,8 @@
+namespace BukiVedi.Shared.Models
+{
+ public class FormatInfo
+ {
+ public string Id { get; set; }
+ public string Name { get; set; }
+ }
+}
diff --git a/src/BukiVedi.Shared/Models/GenreInfo.cs b/src/BukiVedi.Shared/Models/GenreInfo.cs
new file mode 100644
index 0000000..f159567
--- /dev/null
+++ b/src/BukiVedi.Shared/Models/GenreInfo.cs
@@ -0,0 +1,8 @@
+namespace BukiVedi.Shared.Models
+{
+ public class GenreInfo
+ {
+ public string Id { get; set; }
+ public string Name { get; set; }
+ }
+}
diff --git a/src/BukiVedi.Shared/Models/TagInfo.cs b/src/BukiVedi.Shared/Models/TagInfo.cs
new file mode 100644
index 0000000..f30b3da
--- /dev/null
+++ b/src/BukiVedi.Shared/Models/TagInfo.cs
@@ -0,0 +1,8 @@
+namespace BukiVedi.Shared.Models
+{
+ public class TagInfo
+ {
+ public string Id { get; set; }
+ public string Name { get; set; }
+ }
+}
diff --git a/src/BukiVedi.Shared/Services/Library.cs b/src/BukiVedi.Shared/Services/Library.cs
index c0a875b..c8f6930 100644
--- a/src/BukiVedi.Shared/Services/Library.cs
+++ b/src/BukiVedi.Shared/Services/Library.cs
@@ -19,7 +19,7 @@ namespace BukiVedi.Shared.Services
Task> SearchBlockedBooks(string accountId);
Task> SearchFavoriteAuthorsBooks(string accountId);
Task> SearchToReadBooks(string accountId);
- Task DownloadToStream(Stream stream, string id);
+ Task DownloadToStream(Stream stream, string id);
}
public class Library
@@ -213,13 +213,15 @@ namespace BukiVedi.Shared.Services
}
}
- public async Task DownloadToStream(Stream stream, string id)
+ public async Task DownloadToStream(Stream stream, string id)
{
var b = await Tables.Books.GetById(id);
if (b != null)
{
await _library.Download(Path.Combine(_libraryPath, b.ArchivePath), b.ArchiveIndex, stream);
+ return b;
}
+ return null;
}
public async Task> SearchBooks(string query)
diff --git a/src/BukiVedi.Shared/Services/Mappers/BookEntityMapper.cs b/src/BukiVedi.Shared/Services/Mappers/BookEntityMapper.cs
new file mode 100644
index 0000000..6e30bc1
--- /dev/null
+++ b/src/BukiVedi.Shared/Services/Mappers/BookEntityMapper.cs
@@ -0,0 +1,41 @@
+using BukiVedi.Shared.Entities;
+using BukiVedi.Shared.Models;
+using MongoDB.Driver;
+
+namespace BukiVedi.Shared.Services.Mappers
+{
+ public class BookEntityMapper
+ {
+ public static async Task> Map(IEnumerable books)
+ {
+ var booksIds = books.Select(x => x.Id).ToList();
+ var tags_list = (await Tables.UserTag.Get(Builders.Filter.In(t => t.BookId, booksIds)));
+ var tags = new Dictionary>();
+ foreach (var t in tags_list)
+ {
+ if (tags.TryGetValue(t.BookId, out var list)) { list.Add(new TagInfo { Id = t.Id, Name = t.Name }); }
+ else
+ {
+ tags.Add(t.BookId,
+ new List
+ {
+ new TagInfo { Id = t.Id, Name = t.Name }
+ });
+ }
+ }
+
+ return books.Select(book =>
+ new BookInfo
+ {
+ Authors = book.Authors.Select(a => new AuthorInfo { Id = a.Id, Name = a.Name }).ToArray(),
+ Description = book.Description,
+ Format = book.Format,
+ Id = book.Id,
+ Genres = new GenreInfo[1] { new GenreInfo { Id = book.Genre.Id, Name = book.Genre.Code } },
+ Title = book.Title,
+ Year = book.Year,
+ Tags = tags.ContainsKey(book.Id) ? tags[book.Id] : null!
+ });
+ }
+ }
+}
diff --git a/src/BukiVedi.Shared/Services/ZipLibraryReader.cs b/src/BukiVedi.Shared/Services/ZipLibraryReader.cs
index dee128f..9fd56d6 100644
--- a/src/BukiVedi.Shared/Services/ZipLibraryReader.cs
+++ b/src/BukiVedi.Shared/Services/ZipLibraryReader.cs
@@ -19,12 +19,12 @@ namespace BukiVedi.Shared.Services
_zipFilesPath = zipFilesPath;
}
- public BookInfo ReadBookInfo(string archivePath, int index)
+ public BookDto ReadBookInfo(string archivePath, int index)
{
using (var zip = ZipFile.OpenRead(archivePath))
{
var entry = zip.Entries[index];
- BookInfo book = null;
+ BookDto book = null;
if (entry.Name.EndsWith(".fb2", StringComparison.OrdinalIgnoreCase))
{
using (var s = entry.Open())
@@ -36,7 +36,7 @@ namespace BukiVedi.Shared.Services
return null!;
}
- public IEnumerable ReadBooks()
+ public IEnumerable ReadBooks()
{
foreach (var zipFile in Directory.EnumerateFiles(_zipFilesPath, "*.zip"))
{
@@ -45,7 +45,7 @@ namespace BukiVedi.Shared.Services
var index = 0;
foreach (var e in zip.Entries)
{
- BookInfo book = null;
+ BookDto book = null;
if (e.Name.EndsWith(".fb2", StringComparison.OrdinalIgnoreCase))
{
using (var s = e.Open())
@@ -113,7 +113,7 @@ namespace BukiVedi.Shared.Services
#region FB2
private static XmlLoadSettings _fbSettings = new XmlLoadSettings(new XmlReaderSettings { DtdProcessing = DtdProcessing.Ignore });
- private static BookInfo ReadFromFb2(Stream s, string name, string path, int index)
+ private static BookDto ReadFromFb2(Stream s, string name, string path, int index)
{
try
{
@@ -124,7 +124,7 @@ namespace BukiVedi.Shared.Services
var authors = Authors(file.TitleInfo.BookAuthors);
var title = file.TitleInfo.BookTitle?.Text;
var genres = file.TitleInfo?.Genres?.Select(g => g.Genre)?.ToArray();
- return new BookInfo
+ return new BookDto
{
ArchiveIndex = index,
ArchivePath = path,
diff --git a/src/BukiVedi.Shared/bin/Debug/net8.0/BukiVedi.Shared.deps.json b/src/BukiVedi.Shared/bin/Debug/net8.0/BukiVedi.Shared.deps.json
index 236813f..3b731c6 100644
--- a/src/BukiVedi.Shared/bin/Debug/net8.0/BukiVedi.Shared.deps.json
+++ b/src/BukiVedi.Shared/bin/Debug/net8.0/BukiVedi.Shared.deps.json
@@ -14,7 +14,7 @@
"LemmaSharpPrebuiltFull": "1.0.0",
"MongoDB.Driver": "2.24.0",
"Sleopok.Engine": "1.0.0",
- "ZeroLevel": "1.0.0"
+ "ZeroLevel": "4.0.0"
},
"runtime": {
"BukiVedi.Shared.dll": {}
@@ -201,13 +201,13 @@
},
"Sleopok.Engine/1.0.0": {
"dependencies": {
- "ZeroLevel": "1.0.0"
+ "ZeroLevel": "4.0.0"
},
"runtime": {
"Sleopok.Engine.dll": {}
}
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"runtime": {
"ZeroLevel.dll": {}
}
@@ -381,7 +381,7 @@
"serviceable": false,
"sha512": ""
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
diff --git a/src/BukiVedi.Shared/bin/Debug/net8.0/BukiVedi.Shared.pdb b/src/BukiVedi.Shared/bin/Debug/net8.0/BukiVedi.Shared.pdb
index 1722770..59e76c2 100644
Binary files a/src/BukiVedi.Shared/bin/Debug/net8.0/BukiVedi.Shared.pdb and b/src/BukiVedi.Shared/bin/Debug/net8.0/BukiVedi.Shared.pdb differ
diff --git a/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharp.pdb b/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharp.pdb
index 257050a..9ede083 100644
Binary files a/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharp.pdb and b/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharp.pdb differ
diff --git a/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharpPrebuilt.pdb b/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharpPrebuilt.pdb
index 67657c7..b40b41d 100644
Binary files a/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharpPrebuilt.pdb and b/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharpPrebuilt.pdb differ
diff --git a/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharpPrebuiltFull.pdb b/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharpPrebuiltFull.pdb
index 87ef50d..9589249 100644
Binary files a/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharpPrebuiltFull.pdb and b/src/BukiVedi.Shared/bin/Debug/net8.0/LemmaSharpPrebuiltFull.pdb differ
diff --git a/src/BukiVedi.Shared/bin/Release/net8.0/BukiVedi.Shared.deps.json b/src/BukiVedi.Shared/bin/Release/net8.0/BukiVedi.Shared.deps.json
index 236813f..3b731c6 100644
--- a/src/BukiVedi.Shared/bin/Release/net8.0/BukiVedi.Shared.deps.json
+++ b/src/BukiVedi.Shared/bin/Release/net8.0/BukiVedi.Shared.deps.json
@@ -14,7 +14,7 @@
"LemmaSharpPrebuiltFull": "1.0.0",
"MongoDB.Driver": "2.24.0",
"Sleopok.Engine": "1.0.0",
- "ZeroLevel": "1.0.0"
+ "ZeroLevel": "4.0.0"
},
"runtime": {
"BukiVedi.Shared.dll": {}
@@ -201,13 +201,13 @@
},
"Sleopok.Engine/1.0.0": {
"dependencies": {
- "ZeroLevel": "1.0.0"
+ "ZeroLevel": "4.0.0"
},
"runtime": {
"Sleopok.Engine.dll": {}
}
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"runtime": {
"ZeroLevel.dll": {}
}
@@ -381,7 +381,7 @@
"serviceable": false,
"sha512": ""
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
diff --git a/src/BukiVedi.Shared/bin/Release/net8.0/BukiVedi.Shared.pdb b/src/BukiVedi.Shared/bin/Release/net8.0/BukiVedi.Shared.pdb
index f921012..2aed3aa 100644
Binary files a/src/BukiVedi.Shared/bin/Release/net8.0/BukiVedi.Shared.pdb and b/src/BukiVedi.Shared/bin/Release/net8.0/BukiVedi.Shared.pdb differ
diff --git a/src/BukiVedi.Shared/obj/BukiVedi.Shared.csproj.nuget.dgspec.json b/src/BukiVedi.Shared/obj/BukiVedi.Shared.csproj.nuget.dgspec.json
index 81e3daf..957c143 100644
--- a/src/BukiVedi.Shared/obj/BukiVedi.Shared.csproj.nuget.dgspec.json
+++ b/src/BukiVedi.Shared/obj/BukiVedi.Shared.csproj.nuget.dgspec.json
@@ -5,7 +5,7 @@
},
"projects": {
"F:\\Documents\\GitHub\\Zero\\ZeroLevel\\ZeroLevel.csproj": {
- "version": "1.0.0",
+ "version": "4.0.0",
"restore": {
"projectUniqueName": "F:\\Documents\\GitHub\\Zero\\ZeroLevel\\ZeroLevel.csproj",
"projectName": "ZeroLevel",
diff --git a/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.AssemblyInfo.cs b/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.AssemblyInfo.cs
index 80a46be..7ab13af 100644
--- a/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.AssemblyInfo.cs
+++ b/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.AssemblyInfo.cs
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("BukiVedi.Shared")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+653045cfe4c19cb8cabc63ce1b8f61d4b7e4f26e")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+431f2503a837ccf39eac97076a865db39f86a8dd")]
[assembly: System.Reflection.AssemblyProductAttribute("BukiVedi.Shared")]
[assembly: System.Reflection.AssemblyTitleAttribute("BukiVedi.Shared")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.AssemblyInfoInputs.cache b/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.AssemblyInfoInputs.cache
index c5c3e17..7f32097 100644
--- a/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.AssemblyInfoInputs.cache
+++ b/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.AssemblyInfoInputs.cache
@@ -1 +1 @@
-6662423c1e23f623328b320f21205ebeff7a4aebfe8c7b0b24e3f18247b7d14a
+22258ed3f3bd48ae74b9c3607cf0cf82ec9b3322b631691b32743438f798c7cc
diff --git a/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.csproj.AssemblyReference.cache b/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.csproj.AssemblyReference.cache
index aecaecc..815d751 100644
Binary files a/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.csproj.AssemblyReference.cache and b/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.csproj.AssemblyReference.cache differ
diff --git a/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.csproj.CoreCompileInputs.cache b/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.csproj.CoreCompileInputs.cache
index 5df5d54..cb23dd3 100644
--- a/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.csproj.CoreCompileInputs.cache
+++ b/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-2bddd0bc3dcd27073c70a4760f8dbf79dac12620146c67283751aa5c04e62c2b
+8f1511391c660118f311ede1de029df8d3c4dca0dcff3c3fe53339a3d1836ea1
diff --git a/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.pdb b/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.pdb
index 1722770..59e76c2 100644
Binary files a/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.pdb and b/src/BukiVedi.Shared/obj/Debug/net8.0/BukiVedi.Shared.pdb differ
diff --git a/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.AssemblyInfo.cs b/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.AssemblyInfo.cs
index ad61e1d..50fa052 100644
--- a/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.AssemblyInfo.cs
+++ b/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.AssemblyInfo.cs
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("BukiVedi.Shared")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+653045cfe4c19cb8cabc63ce1b8f61d4b7e4f26e")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+431f2503a837ccf39eac97076a865db39f86a8dd")]
[assembly: System.Reflection.AssemblyProductAttribute("BukiVedi.Shared")]
[assembly: System.Reflection.AssemblyTitleAttribute("BukiVedi.Shared")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.AssemblyInfoInputs.cache b/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.AssemblyInfoInputs.cache
index 28255ba..73796d8 100644
--- a/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.AssemblyInfoInputs.cache
+++ b/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.AssemblyInfoInputs.cache
@@ -1 +1 @@
-28e06cd4b9a59e2ff22da92879fdac725f071bab5552441829896eec6bfa3411
+06715856c937a6aa0ade3b1fa065928029591cc434dd76545f239523dd28567b
diff --git a/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.csproj.AssemblyReference.cache b/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.csproj.AssemblyReference.cache
index e391ef1..05631fb 100644
Binary files a/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.csproj.AssemblyReference.cache and b/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.csproj.AssemblyReference.cache differ
diff --git a/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.csproj.CoreCompileInputs.cache b/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.csproj.CoreCompileInputs.cache
index 7fc31d2..ff42b00 100644
--- a/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.csproj.CoreCompileInputs.cache
+++ b/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.csproj.CoreCompileInputs.cache
@@ -1 +1 @@
-79899f010b0c66fc84b9abdf331440593c067d267d0f470e1f4033e933b4c19e
+946ae02ae1d24f78debab34bdbac2f87234e55c2d9142e2f73b46c18adb4ce88
diff --git a/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.pdb b/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.pdb
index f921012..2aed3aa 100644
Binary files a/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.pdb and b/src/BukiVedi.Shared/obj/Release/net8.0/BukiVedi.Shared.pdb differ
diff --git a/src/BukiVedi.Shared/obj/project.assets.json b/src/BukiVedi.Shared/obj/project.assets.json
index 4f8b5f0..5678192 100644
--- a/src/BukiVedi.Shared/obj/project.assets.json
+++ b/src/BukiVedi.Shared/obj/project.assets.json
@@ -340,7 +340,7 @@
"type": "project",
"framework": ".NETCoreApp,Version=v8.0",
"dependencies": {
- "ZeroLevel": "1.0.0"
+ "ZeroLevel": "4.0.0"
},
"compile": {
"bin/placeholder/Sleopok.Engine.dll": {}
@@ -349,7 +349,7 @@
"bin/placeholder/Sleopok.Engine.dll": {}
}
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"type": "project",
"framework": ".NETStandard,Version=v2.1",
"compile": {
@@ -666,7 +666,7 @@
"type": "project",
"framework": ".NETCoreApp,Version=v8.0",
"dependencies": {
- "ZeroLevel": "1.0.0"
+ "ZeroLevel": "4.0.0"
},
"compile": {
"bin/placeholder/Sleopok.Engine.dll": {}
@@ -675,7 +675,7 @@
"bin/placeholder/Sleopok.Engine.dll": {}
}
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"type": "project",
"framework": ".NETStandard,Version=v2.1",
"compile": {
@@ -1203,7 +1203,7 @@
"path": "../../../sleopok/src/Sleopok/Sleopok.Engine/Sleopok.Engine.csproj",
"msbuildProject": "../../../sleopok/src/Sleopok/Sleopok.Engine/Sleopok.Engine.csproj"
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"type": "project",
"path": "F:\\Documents\\GitHub\\Zero\\ZeroLevel\\ZeroLevel.csproj",
"msbuildProject": "F:\\Documents\\GitHub\\Zero\\ZeroLevel\\ZeroLevel.csproj"
@@ -1217,7 +1217,7 @@
"LemmaSharpPrebuiltFull >= 1.0.0",
"MongoDB.Driver >= 2.24.0",
"Sleopok.Engine >= 1.0.0",
- "ZeroLevel >= 1.0.0"
+ "ZeroLevel >= 4.0.0"
]
},
"packageFolders": {
diff --git a/src/BukiVedi.Shared/obj/project.nuget.cache b/src/BukiVedi.Shared/obj/project.nuget.cache
index b1cc1c7..a981fc4 100644
--- a/src/BukiVedi.Shared/obj/project.nuget.cache
+++ b/src/BukiVedi.Shared/obj/project.nuget.cache
@@ -1,6 +1,6 @@
{
"version": 2,
- "dgSpecHash": "yT5XSXnkL8QDzBzWmb4d84rvHwETnt31t/sfuePGLwfvd9Qc6aS9gJSYjBmenihhmuQWC/N0ANii96e18tjqlQ==",
+ "dgSpecHash": "I5NF3rZJZUmDLwIKUi7T7NRpUaNrPoHKlXnBGtdzl5MdYPzg4P1cn162b2nsZJbsHNBvnds14OIqZJxmohNxNw==",
"success": true,
"projectFilePath": "G:\\Documents\\GitHub\\BukiVedi\\src\\BukiVedi.Shared\\BukiVedi.Shared.csproj",
"expectedPackageFiles": [
@@ -22,7 +22,8 @@
"C:\\Users\\Ogoun\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\5.0.0\\system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512",
"C:\\Users\\Ogoun\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512",
"C:\\Users\\Ogoun\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512",
- "C:\\Users\\Ogoun\\.nuget\\packages\\zstdsharp.port\\0.7.3\\zstdsharp.port.0.7.3.nupkg.sha512"
+ "C:\\Users\\Ogoun\\.nuget\\packages\\zstdsharp.port\\0.7.3\\zstdsharp.port.0.7.3.nupkg.sha512",
+ "C:\\Users\\Ogoun\\.nuget\\packages\\zerolevel\\4.0.0\\zerolevel.4.0.0.nupkg.sha512"
],
"logs": []
}
\ No newline at end of file
diff --git a/src/IndexExportTest/IndexExportTest.csproj b/src/IndexExportTest/IndexExportTest.csproj
index 445464d..15fd14b 100644
--- a/src/IndexExportTest/IndexExportTest.csproj
+++ b/src/IndexExportTest/IndexExportTest.csproj
@@ -9,6 +9,13 @@
+
+
+
+
+
+ Always
+
diff --git a/src/IndexExportTest/Program.cs b/src/IndexExportTest/Program.cs
index 5d339c4..cc210f7 100644
--- a/src/IndexExportTest/Program.cs
+++ b/src/IndexExportTest/Program.cs
@@ -1,4 +1,6 @@
-using Sleopok.Engine.Services.Storage;
+using BukiVedi.Shared.Services;
+using Sleopok.Engine.Services;
+using Sleopok.Engine.Services.Storage;
namespace IndexExportTest
{
@@ -6,16 +8,22 @@ namespace IndexExportTest
{
static async Task Main(string[] args)
{
- var store = new DataStorage(@"/var/www/books");
+ var library = new Library();
+
+
+ var store = new DataStorage(@"H:\TEST");
await Dump(store, "author");
await Dump(store, "genre");
await Dump(store, "title");
await Dump(store, "titlelm");
+
+
+ Console.ReadLine();
}
static async Task Dump(DataStorage store, string field)
{
- using (var fs = new FileStream($"/var/www/{field}.txt", FileMode.Create, FileAccess.Write, FileShare.None))
+ using (var fs = new FileStream($"H:/TEST1/{field}.txt", FileMode.Create, FileAccess.Write, FileShare.None))
{
await store.Dump(field, fs);
}
diff --git a/src/IndexExportTest/config.ini b/src/IndexExportTest/config.ini
new file mode 100644
index 0000000..f89aa27
--- /dev/null
+++ b/src/IndexExportTest/config.ini
@@ -0,0 +1,9 @@
+login=ogoun
+password=A3n1g4e1l5#
+libraryPath=I:\Library\Flibusta.Net
+
+[MongoDB]
+ConnectionString="mongodb://192.168.0.222:27017"
+
+[Sleopok]
+path=H:\TEST
\ No newline at end of file
diff --git a/src/TitleReader/bin/Debug/net8.0/BukiVedi.Shared.pdb b/src/TitleReader/bin/Debug/net8.0/BukiVedi.Shared.pdb
index 1722770..59e76c2 100644
Binary files a/src/TitleReader/bin/Debug/net8.0/BukiVedi.Shared.pdb and b/src/TitleReader/bin/Debug/net8.0/BukiVedi.Shared.pdb differ
diff --git a/src/TitleReader/bin/Debug/net8.0/LemmaSharp.pdb b/src/TitleReader/bin/Debug/net8.0/LemmaSharp.pdb
index 257050a..9ede083 100644
Binary files a/src/TitleReader/bin/Debug/net8.0/LemmaSharp.pdb and b/src/TitleReader/bin/Debug/net8.0/LemmaSharp.pdb differ
diff --git a/src/TitleReader/bin/Debug/net8.0/LemmaSharpPrebuilt.pdb b/src/TitleReader/bin/Debug/net8.0/LemmaSharpPrebuilt.pdb
index 67657c7..b40b41d 100644
Binary files a/src/TitleReader/bin/Debug/net8.0/LemmaSharpPrebuilt.pdb and b/src/TitleReader/bin/Debug/net8.0/LemmaSharpPrebuilt.pdb differ
diff --git a/src/TitleReader/bin/Debug/net8.0/LemmaSharpPrebuiltFull.pdb b/src/TitleReader/bin/Debug/net8.0/LemmaSharpPrebuiltFull.pdb
index 87ef50d..9589249 100644
Binary files a/src/TitleReader/bin/Debug/net8.0/LemmaSharpPrebuiltFull.pdb and b/src/TitleReader/bin/Debug/net8.0/LemmaSharpPrebuiltFull.pdb differ
diff --git a/src/TitleReader/bin/Debug/net8.0/TitleReader.deps.json b/src/TitleReader/bin/Debug/net8.0/TitleReader.deps.json
index 52dac63..103c31b 100644
--- a/src/TitleReader/bin/Debug/net8.0/TitleReader.deps.json
+++ b/src/TitleReader/bin/Debug/net8.0/TitleReader.deps.json
@@ -179,7 +179,7 @@
"LemmaSharpPrebuiltFull": "1.0.0",
"MongoDB.Driver": "2.24.0",
"Sleopok.Engine": "1.0.0",
- "ZeroLevel": "1.0.0"
+ "ZeroLevel": "4.0.0"
},
"runtime": {
"BukiVedi.Shared.dll": {}
@@ -209,13 +209,13 @@
},
"Sleopok.Engine/1.0.0": {
"dependencies": {
- "ZeroLevel": "1.0.0"
+ "ZeroLevel": "4.0.0"
},
"runtime": {
"Sleopok.Engine.dll": {}
}
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"runtime": {
"ZeroLevel.dll": {}
}
@@ -394,7 +394,7 @@
"serviceable": false,
"sha512": ""
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
diff --git a/src/TitleReader/bin/Debug/net8.0/TitleReader.pdb b/src/TitleReader/bin/Debug/net8.0/TitleReader.pdb
index dd4d927..db2ebb2 100644
Binary files a/src/TitleReader/bin/Debug/net8.0/TitleReader.pdb and b/src/TitleReader/bin/Debug/net8.0/TitleReader.pdb differ
diff --git a/src/TitleReader/obj/Debug/net8.0/TitleReader.AssemblyInfo.cs b/src/TitleReader/obj/Debug/net8.0/TitleReader.AssemblyInfo.cs
index c38fa9a..81a7141 100644
--- a/src/TitleReader/obj/Debug/net8.0/TitleReader.AssemblyInfo.cs
+++ b/src/TitleReader/obj/Debug/net8.0/TitleReader.AssemblyInfo.cs
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("TitleReader")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+653045cfe4c19cb8cabc63ce1b8f61d4b7e4f26e")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+431f2503a837ccf39eac97076a865db39f86a8dd")]
[assembly: System.Reflection.AssemblyProductAttribute("TitleReader")]
[assembly: System.Reflection.AssemblyTitleAttribute("TitleReader")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/src/TitleReader/obj/Debug/net8.0/TitleReader.AssemblyInfoInputs.cache b/src/TitleReader/obj/Debug/net8.0/TitleReader.AssemblyInfoInputs.cache
index 7f01128..e0f1ae1 100644
--- a/src/TitleReader/obj/Debug/net8.0/TitleReader.AssemblyInfoInputs.cache
+++ b/src/TitleReader/obj/Debug/net8.0/TitleReader.AssemblyInfoInputs.cache
@@ -1 +1 @@
-b6e867e96464d226d6f64f5bb8ff88fd91a7dc10b0cbc8df658695411d89c7c7
+d7606117e667c055ed565f5f0d94c916cbdbb0bbb171442e9a9d4b51ab356451
diff --git a/src/TitleReader/obj/Debug/net8.0/TitleReader.assets.cache b/src/TitleReader/obj/Debug/net8.0/TitleReader.assets.cache
index 893adf6..1e81a2d 100644
Binary files a/src/TitleReader/obj/Debug/net8.0/TitleReader.assets.cache and b/src/TitleReader/obj/Debug/net8.0/TitleReader.assets.cache differ
diff --git a/src/TitleReader/obj/Debug/net8.0/TitleReader.csproj.AssemblyReference.cache b/src/TitleReader/obj/Debug/net8.0/TitleReader.csproj.AssemblyReference.cache
index 105f8d6..ae0d9ad 100644
Binary files a/src/TitleReader/obj/Debug/net8.0/TitleReader.csproj.AssemblyReference.cache and b/src/TitleReader/obj/Debug/net8.0/TitleReader.csproj.AssemblyReference.cache differ
diff --git a/src/TitleReader/obj/Debug/net8.0/TitleReader.pdb b/src/TitleReader/obj/Debug/net8.0/TitleReader.pdb
index dd4d927..db2ebb2 100644
Binary files a/src/TitleReader/obj/Debug/net8.0/TitleReader.pdb and b/src/TitleReader/obj/Debug/net8.0/TitleReader.pdb differ
diff --git a/src/TitleReader/obj/Release/net8.0/TitleReader.AssemblyInfo.cs b/src/TitleReader/obj/Release/net8.0/TitleReader.AssemblyInfo.cs
index 719a3c3..7f9eee5 100644
--- a/src/TitleReader/obj/Release/net8.0/TitleReader.AssemblyInfo.cs
+++ b/src/TitleReader/obj/Release/net8.0/TitleReader.AssemblyInfo.cs
@@ -14,7 +14,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("TitleReader")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Release")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
-[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+653045cfe4c19cb8cabc63ce1b8f61d4b7e4f26e")]
+[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+431f2503a837ccf39eac97076a865db39f86a8dd")]
[assembly: System.Reflection.AssemblyProductAttribute("TitleReader")]
[assembly: System.Reflection.AssemblyTitleAttribute("TitleReader")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
diff --git a/src/TitleReader/obj/Release/net8.0/TitleReader.AssemblyInfoInputs.cache b/src/TitleReader/obj/Release/net8.0/TitleReader.AssemblyInfoInputs.cache
index ae363b2..8cc1727 100644
--- a/src/TitleReader/obj/Release/net8.0/TitleReader.AssemblyInfoInputs.cache
+++ b/src/TitleReader/obj/Release/net8.0/TitleReader.AssemblyInfoInputs.cache
@@ -1 +1 @@
-588b6177dc8dadc34104d72c7f17ba8cc3301324d19dcc1fef526a0a4fcaa5de
+a7282ddb1bbc4aea6cf73d9f5cd24625e715891dd94841b8c41be90b8822b144
diff --git a/src/TitleReader/obj/Release/net8.0/TitleReader.assets.cache b/src/TitleReader/obj/Release/net8.0/TitleReader.assets.cache
index 93c1684..fc986a6 100644
Binary files a/src/TitleReader/obj/Release/net8.0/TitleReader.assets.cache and b/src/TitleReader/obj/Release/net8.0/TitleReader.assets.cache differ
diff --git a/src/TitleReader/obj/Release/net8.0/TitleReader.csproj.AssemblyReference.cache b/src/TitleReader/obj/Release/net8.0/TitleReader.csproj.AssemblyReference.cache
index 56fb993..a22402c 100644
Binary files a/src/TitleReader/obj/Release/net8.0/TitleReader.csproj.AssemblyReference.cache and b/src/TitleReader/obj/Release/net8.0/TitleReader.csproj.AssemblyReference.cache differ
diff --git a/src/TitleReader/obj/TitleReader.csproj.nuget.dgspec.json b/src/TitleReader/obj/TitleReader.csproj.nuget.dgspec.json
index 0d0ad8d..abd4398 100644
--- a/src/TitleReader/obj/TitleReader.csproj.nuget.dgspec.json
+++ b/src/TitleReader/obj/TitleReader.csproj.nuget.dgspec.json
@@ -5,7 +5,7 @@
},
"projects": {
"F:\\Documents\\GitHub\\Zero\\ZeroLevel\\ZeroLevel.csproj": {
- "version": "1.0.0",
+ "version": "4.0.0",
"restore": {
"projectUniqueName": "F:\\Documents\\GitHub\\Zero\\ZeroLevel\\ZeroLevel.csproj",
"projectName": "ZeroLevel",
diff --git a/src/TitleReader/obj/project.assets.json b/src/TitleReader/obj/project.assets.json
index 001119e..b81fafc 100644
--- a/src/TitleReader/obj/project.assets.json
+++ b/src/TitleReader/obj/project.assets.json
@@ -312,7 +312,7 @@
"LemmaSharpPrebuiltFull": "1.0.0",
"MongoDB.Driver": "2.24.0",
"Sleopok.Engine": "1.0.0",
- "ZeroLevel": "1.0.0"
+ "ZeroLevel": "4.0.0"
},
"compile": {
"bin/placeholder/BukiVedi.Shared.dll": {}
@@ -359,7 +359,7 @@
"type": "project",
"framework": ".NETCoreApp,Version=v8.0",
"dependencies": {
- "ZeroLevel": "1.0.0"
+ "ZeroLevel": "4.0.0"
},
"compile": {
"bin/placeholder/Sleopok.Engine.dll": {}
@@ -368,7 +368,7 @@
"bin/placeholder/Sleopok.Engine.dll": {}
}
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"type": "project",
"framework": ".NETStandard,Version=v2.1",
"compile": {
@@ -901,7 +901,7 @@
"path": "../../../sleopok/src/Sleopok/Sleopok.Engine/Sleopok.Engine.csproj",
"msbuildProject": "../../../sleopok/src/Sleopok/Sleopok.Engine/Sleopok.Engine.csproj"
},
- "ZeroLevel/1.0.0": {
+ "ZeroLevel/4.0.0": {
"type": "project",
"path": "F:\\Documents\\GitHub\\Zero\\ZeroLevel\\ZeroLevel.csproj",
"msbuildProject": "F:\\Documents\\GitHub\\Zero\\ZeroLevel\\ZeroLevel.csproj"
diff --git a/src/TitleReader/obj/project.nuget.cache b/src/TitleReader/obj/project.nuget.cache
index 60a3f0d..2609510 100644
--- a/src/TitleReader/obj/project.nuget.cache
+++ b/src/TitleReader/obj/project.nuget.cache
@@ -1,6 +1,6 @@
{
"version": 2,
- "dgSpecHash": "kWMsTMYfHKFRfmEETdspspZMDX5Q7j8a9bwhSWnX9GUwk9jMvNjEEVpRTQ1BcySO4xIeyDgBFMoFZ/6NKYNuOg==",
+ "dgSpecHash": "Sw/P8SWtQDkQsfDVJxqQlQjTkIGfP1lboPxZ+pAQBR6QlHJi296GVIfCq+cIhVP0NOhSpqFErs2oyZY9AwwjkA==",
"success": true,
"projectFilePath": "G:\\Documents\\GitHub\\BukiVedi\\src\\TitleReader\\TitleReader.csproj",
"expectedPackageFiles": [
@@ -22,7 +22,8 @@
"C:\\Users\\Ogoun\\.nuget\\packages\\system.runtime.compilerservices.unsafe\\5.0.0\\system.runtime.compilerservices.unsafe.5.0.0.nupkg.sha512",
"C:\\Users\\Ogoun\\.nuget\\packages\\system.security.accesscontrol\\5.0.0\\system.security.accesscontrol.5.0.0.nupkg.sha512",
"C:\\Users\\Ogoun\\.nuget\\packages\\system.security.principal.windows\\5.0.0\\system.security.principal.windows.5.0.0.nupkg.sha512",
- "C:\\Users\\Ogoun\\.nuget\\packages\\zstdsharp.port\\0.7.3\\zstdsharp.port.0.7.3.nupkg.sha512"
+ "C:\\Users\\Ogoun\\.nuget\\packages\\zstdsharp.port\\0.7.3\\zstdsharp.port.0.7.3.nupkg.sha512",
+ "C:\\Users\\Ogoun\\.nuget\\packages\\zerolevel\\4.0.0\\zerolevel.4.0.0.nupkg.sha512"
],
"logs": []
}
\ No newline at end of file