Giter VIP home page Giter VIP logo

kareadita / kavita Goto Github PK

View Code? Open in Web Editor NEW
5.2K 45.0 264.0 166.92 MB

Kavita is a fast, feature rich, cross platform reading server. Built with the goal of being a full solution for all your reading needs. Setup your own server and share your reading collection with your friends and family.

Home Page: http://www.kavitareader.com

License: GNU General Public License v3.0

C# 60.22% Shell 0.18% Dockerfile 0.02% TypeScript 24.60% HTML 12.36% SCSS 2.49% COBOL 0.07% Python 0.02% JavaScript 0.04%
manga self-hosted metadata media-server free cross-platform csharp ubooquity epub epub-reader

kavita's People

Contributors

4bookmark avatar afermar avatar alei643 avatar amadeusgraves avatar andre1wall avatar asong91 avatar christoffergreen avatar dieseltech avatar gmahomarf avatar gozilla-paradise avatar hanskalisvaart avatar havokdan avatar hobogrammer avatar icemouton avatar iroquai avatar jeanpauldot avatar jiriheger avatar kalagaar avatar kizaing avatar leewan1210 avatar majora2007 avatar oxygen44k avatar senpai-notices avatar thepromidius avatar therobbiedavis avatar tjarls avatar tombatti avatar weblate avatar yegcsharpdev avatar zsuatem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kavita's Issues

Chore: Fix Build Tests

For some reason, unit tests on PRs are failing, yet working locally. Investigate and fix this annoyance.

Epic: Library Support - Library/Folder Scanning

Given that a Library is represented by a collection of physical folders, Kavita needs the ability to scan said folders on both a scheduled and ad-hoc basic for new or modified content.

The goal of this task is to update the DB's entries for files and their ties to a volume, chapter, or library.

In future, this will trigger metadata resolving per series.

BUG: ScanLibrary issues causing fallout

There is a bug in ScanLibrary for Chapters where multiple chapters get created and thus exceptions are caused by SingleOrDefault() causing whole series to be skipped.

Epic: Library Support - Filename Parsing/Matching

In order to provide grouping of files to Series/Volumes, Kavita needs to be able to parse filenames and folder names in a way to group the data.

Implement a set of Parser methods to parse the following attributes:

  • Series name
  • Volume Number
  • Chapter Number
  • File type

In addition, a Match API that abstracts the underlying parser code would make integrating with the Scan Library code trivial.

Setup User creation with Login

The following must provide:

  • Ability to store users in DB
  • Ability to register new users
  • Ability to login with a given username/password
  • Users should have hashed/salted passwords
  • Users should use JWT for authentication on future APIs

BUG: Figure out this rare issue that happens with Hangfire. Freezes backend.

fail: API.Middleware.ExceptionMiddleware[0] Timeout expired. The timeout elapsed prior to obtaining a distributed lock on the 'Could not place a lock on the resource 'HangFire:lock:recurring-job:ScannerService.ScanLibraries': The lock request timed out.' resource. Hangfire.Storage.DistributedLockTimeoutException: Timeout expired. The timeout elapsed prior to obtaining a distributed lock on the 'Could not place a lock on the resource 'HangFire:lock:recurring-job:ScannerService.ScanLibrar ies': The lock request timed out.' resource. at Hangfire.LiteDB.LiteDbDistributedLock.Acquire(TimeSpan timeout) at Hangfire.LiteDB.LiteDbDistributedLock..ctor(String resource, TimeSpan timeout, HangfireDbContext database, LiteDbStorageOptions storageOptions) at Hangfire.LiteDB.LiteDbConnection.AcquireDistributedLock(String resource, TimeSpan timeout) at Hangfire.RecurringJobExtensions.AcquireDistributedRecurringJobLock(IStorageConnection connection, String recurringJobId, TimeSpan timeout) at Hangfire.RecurringJobManager.AddOrUpdate(String recurringJobId, Job job, String cronExpression, RecurringJobOptions options) at Hangfire.RecurringJobManagerExtensions.AddOrUpdate(IRecurringJobManager manager, String recurringJobId, Job job, String cronExpression, TimeZoneInfo timeZone, String queue) at Hangfire.RecurringJob.AddOrUpdate(Expression1 methodCall, String cronExpression, TimeZoneInfo timeZone, String queue)
at Hangfire.RecurringJob.AddOrUpdate(Expression1 methodCall, Func1 cronExpression, TimeZoneInfo timeZone, String queue)
at API.Services.TaskScheduler..ctor(ICacheService cacheService, ILogger1 logger, IScannerService scannerService, IUnitOfWork unitOfWork) in C:\Users\Joe\Documents\Projects\KavitaOrg\Kavita\API\Services\TaskScheduler.cs:lin e 30 at ResolveService(ILEmitResolverBuilderRuntimeContext , ServiceProviderEngineScope ) at Microsoft.Extensions.DependencyInjection.ActivatorUtilities.GetService(IServiceProvider sp, Type type, Type requiredBy, Boolean isDefaultParameterRequired) at lambda_method327(Closure , IServiceProvider , Object[] ) at Microsoft.AspNetCore.Mvc.Controllers.ControllerActivatorProvider.<>c__DisplayClass4_0.<CreateActivator>b__0(ControllerContext controllerContext) at Microsoft.AspNetCore.Mvc.Controllers.ControllerFactoryProvider.<>c__DisplayClass5_0.<CreateControllerFactory>g__CreateController|0(ControllerContext controllerContext) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync() --- End of stack trace from previous location --- at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|19_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger) at Microsoft.AspNetCore.Authorization.Policy.AuthorizationMiddlewareResultHandler.HandleAsync(RequestDelegate next, HttpContext context, AuthorizationPolicy policy, PolicyAuthorizationResult authorizeResult) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Builder.Extensions.MapMiddleware.Invoke(HttpContext context) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at API.Middleware.ExceptionMiddleware.InvokeAsync(HttpContext context) in C:\Users\Joe\Documents\Projects\KavitaOrg\Kavita\API\Middleware\ExceptionMiddleware.cs:line 30

User Preferences

A user should have their own settings for reading direction, page splitting, etc.

A user should be able to update them and have defaults.

Enhance GetDirectories

The current GetDirectories from C# does not filter out System or Hidden folders.

Enhance the service to filter these folders out automatically.

Generate Series Cover Image

Implement the ability to find the most appropriate cover image for a Series cover.

Generally the first image of the first volume/chapter is used, unless there is an image file named folder in the archive.

This will be overridden if there is a cover image file in the directory the archives are.

Track read progress

We need the ability to track for each user, how much a user has read of a given series.

Track Series rating + User review

The ability for a user to rate a series and give their own review for it (text). In future, this might be pulled from a linked account.

Ability to schedule tasks

Things like automated scans, cover image calculation, etc.

Options will be:
Disabled
Daily
Every 3 days
Weekly

This is automated scans, ad-hoc will run immediately.

User Preferences

A user of the application should be able to configure preferences used throughout the web app.

Potential preferences could be:

  • Split Options for reading
  • Which side of screen is Next Page (left or right to emulate japanese book style flipping)
  • Theme? (not sure if this is possible)
  • Ordering of libraries on libraries page (Superhero Comics, Isekai Manga, Other Comics, Other Manga)

Parallelize ScanLibrary code

Currently, the rewritten ScanLibrary is completely bound to 1 thread. Now that it is battle tested, we can enhance by spreading it out onto multiple threads.

The data is already broken up in such a way that there should be minimal locking.

This task should ensure that scan library can be parallelized and that gains are significant to warrant the added complexity.

Investigate splitting Metadata (cover image) generation from Scanning code.

Parsing disk scans is cheap. For a decently sized library we are talking < 3 seconds.

Since it is so cheap to parse Disk IO and this doesn't have to be done in real time, we can move archive work (metadata) off into a separate task that executes after the initial DB update from Scan Library.

This will ensure the entities get entered into DB as fast as possible and metadata can follow.

This story is to investigate the performance benefit vs code complexity.

Setup Testing Framework

A testing framework should be setup. The following need to be accomplished:

  • Ability to create and run Unit Tests
  • Ability to mock and run Integration tests (DB mocking)
  • Ability for PRs to automatically execute all tests and fail merge check if tests fail.

Epic: Library Support - Series Entities

A Series is the representation for a Manga, Comic, or a Book title (Each book is it's own Series (subject to change)).

A Series consists of a collection of Volumes or Chapters. Volumes/Chapters are what the user actually reads.

Most manga is downloaded as cbzs and either in volumes, but some in just chapters. Ideally, we'd want everything as volumes, but need to be prepared to either a) provide scripts to organize their media for them or b) provide a way to emulate as if they were all in volumes (cloning multiple chapters, recreating a cbz for one volume, then serving).

A Series is expected in future releases to present metadata around the manga, including genres tags, description, author, etc (See requirement doc for more). Design this with future metadata in mind.

A Series at the least needs:

  • Name
  • Thumb Image
  • LibraryId (Foreign key)

ScanLibrary: Bugs and test coverage

During partial support implementation, many bugs have been found in ScanLibrary. Many of those bugs are fixed, but upon fixing them and refactoring the code to be more streamlined, it left me wanting a way to mock testing (have to use PrivateObjects or protected internal hacks) for the code.

I need to build out a test utility that generates fake archive files for testing and then cleans up after itself.

Epic: Library Support - File Format Loading/Unloading/Streaming

Implement the ability to Load a Volume/Manga file (cbz, cbr, zip, rar) and serve images to the Frontend.

The API needs to handle memory carefully and make sure all filestreams are closed when the user stops reading or closes a volume with timeouts for when a user connection severs.

Search items

The user can search for items in libraries they have access to

Epic: Library Support - Library Entities

A Library entity represents a ICollection of Series. A Library is bound to one of more physical folders on the disk that contain a given metadata type.

First pass implementation for a Library is:
Name,
Metadata Type (Manga, Comic, Book, Raw)
Folders
Thumb Image (image to show on the UI)

First pass implementation should only focus on MetadataType.Manga.

The following APIs are needed with DTO, Entities, and Migrations:

  • GetLibraries
  • GetLibrary(int libraryId)
  • UpdateLibrary (update properties of it)
  • DeleteLibrary
  • CreateLibrary

N.B. Use Optimistic Concurency with EF (RowVersion) as libraries might be updated at same time and we need to prevent locking.

Technical Debt

In the Kavita and Kavita-webui codebases, take care of some of the TODOs and NOTEs.

BUG: In some cases (Dorohedoro), not all parsed Infos will get added to the ConcurrentDictionary.

so what's happening is some volumes which are on disk and are being paresd correctly don't show up in the DB or DB entity creation code.

I traced it down to a piece of code that updates the concurent dictionary. What's happening is that I scan the directories using multiple threads for speed. Each thread finds files, parses them and tries to add them to the concurent dictionary.

Well for some reason, I just observed one thread add to the dictionary then another thread try to update the key (same key), but update failed, so it went to add to an empty dictionary. Meaning we lost the first object added.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.