458 Commits

Author SHA1 Message Date
Joseph Milazzo
2ae9f8c203
Private Email Service Support (#1028)
* Added ServerSettingKey's for SMTP and moved email service code to Kavita. Nothing integrated in the UI yet.

* Undo all the custom SMTP stuff and prepare for custom email service url.

* Foundation for email service to use a custom url is setup.

* Implemented the ability to hook up custom email url
2022-02-04 09:54:54 -08:00
Joseph Milazzo
03112d3f8f
New Search (#1029)
* Implemented a basic version of enhanced search where we can return multiple types of entities in one go. Current unoptimized version is twice as expensive as normal search, but under NFR. Currently 200ms max.

* Worked in some basic code for grouped typeahead search component. Keyboard navigation is working.

* Most of the code is in place for the typeahead. Needs css work and some accessibility work.

* Hooked up filtering into all-series. Added debouncing on search, clear input field now works. Some optimizations related to memory cleanup

* Added ability to define a custom placeholder

* Hooked in noResults template and logic

* Fixed a duplicate issue in Collection tag searching and commented out old code. OPDS still needs some updates.

* Don't trigger inputChanged when reopening/clicking on input.

* Added Reading list to OPDS search

* Added a new image component so all the images can be lazyloaded without logic duplication

* Added a maxWidth/Height on the image component

* Search css update

* cursor fixes

* card changes

- fixing border radius on cards
- adding bottom card color

* Expose intenral state of if the search component has focus

* Adjusted the accessibility to not use complex keys and just use tab instead since this is a search, not a typeahead

* Cleaned up dead code, removed angular-ng-complete library as it's no longer used.

* Fixes for mobile search

* Merged code

* Fixed a bad merge and some nav bar styling

* Cleaned up the focus code for nav bar

* Removed focusIndex and just use hover state. Fixed clicking on items

* fixing overlay overlap issue

Co-authored-by: Robbie Davis <robbie@therobbiedavis.com>
2022-02-04 08:28:49 -08:00
Joseph Milazzo
730624d364
Recently Added Chapter Feedback (#1020)
* Added an alt implementation which shows Recently Added chapters. No extra grouping is performed if multiple chapters per volume.

* Started working on a grouping implementation for series.

* Disabled the code for bookmarks cleanup as there is some critical issue in there.

* Implemented a Series Group activity stream which shows recently updated series and providers a count badge showing how many new chapters/volumes were added in that series.

* Removed the bookmark disabling code

* Cleaned up code

* One more code cleanup
2022-02-02 07:18:09 -08:00
Joseph Milazzo
6ee8320c2b
Ability to restrict a user's ability to change passwords (#1018)
* Implemented a new role "Change Password". This role allows you to change your own password. By default, all users will have it. A user can have it removed arbitrarliy.

Removed components that are no longer going to be used.

* Cleaned up some code
2022-02-01 07:40:41 -08:00
Joseph Milazzo
8ff123e06c
Forgot Password (#1017)
* Implemented forgot password flow. Fixed a bug in manage user where admins were showing the Sharing With section.

* Cleaned up the reset password flow.

* Reverted some debug code

* Fixed an issue with invites due to ImmutableArray not being set.
2022-02-01 06:04:23 -08:00
Joseph Milazzo
4e7d1433d1
Don't throw an exception when we are trying to save progress and there is nothing new to save. (#1016) 2022-01-31 12:12:39 -08:00
Joseph Milazzo
c6d1311560
Misc Bugfixes (#1015)
* Fixed some security issues in dev env

* When deleting folders in bookmark cleanup, delete empty folders correctly.

* When a new library is created and cards are added, cards can have a blank library name. Card library name code is reworked to be much lighter on memory.

* Added a config for github issues to disable blank issues.

* Skip any sort of directory iteration code if we haven't deleted any bookmarks.

* Fixed a bug where some style overrides were duplicating. Now logic is much more targetted, only applying to the correct tags.

* Applied sorting to the filtering apis.

* Reverted one of my changes for a better version Robbie did.
2022-01-31 08:50:13 -08:00
Joseph Milazzo
c8de3fb097
Remove No Authentication mode from Kavita (#1006)
* Moved the Server Settings out into a button on nav header

* Refactored Mange Users page to the new design (skeleton). Implemented skeleton code for Invite User.

* Hashed out more of the code, but need to move all the email code to a Kavita controlled API server due to password credentials.

* Cleaned up some warnings

* When no user exists for an api key in Plugin controller, throw 401.

* Hooked in the ability to check if the Kavita instance can be accessed externally so we can determine if the user can invite or not.

* Hooked up some logic if the user's server isn't accessible, then default to old flow

* Basic flow is working for confirm email. Needs validation, error handling, etc.

* Refactored Password validation to account service

* Cleaned up the code in confirm-email to work much better.

* Refactored the login page to have a container functionality, so we can reuse the styles on multiple pages (registration pages). Hooked up the code for confirm email.

* Messy code, but making progress. Refactored Register to be used only for first time user registration. Added a new register component to handle first time flow only.

* Invite works much better, still needs a bit of work for non-accessible server setup. Started work on underlying manage users page to meet new design.

* Changed (you) to a star to indicate who you're logged in as.

* Inviting a user is now working and tested fully.

* Removed the register member component as we now have invite and confirm components.

* Editing a user is now working. Username change and Role/Library access from within one screen. Email changing is on hold.

* Cleaned up code for edit user and disabled email field for now.

* Cleaned up the code to indicate changing a user's email is not possible.

* Implemented a migration for existing accounts so they can validate their emails and still login.

* Change url for email server

* Implemented the ability to resend an email confirmation code (or regenerate for non accessible servers). Fixed an overflow on the confirm dialog.

* Removed all code around disabling authentication. Users that were already disabled can look up their password on the wiki.
2022-01-31 05:42:06 -08:00
Joseph Milazzo
efb527035d
Account Email Support (#1000)
* Moved the Server Settings out into a button on nav header

* Refactored Mange Users page to the new design (skeleton). Implemented skeleton code for Invite User.

* Hashed out more of the code, but need to move all the email code to a Kavita controlled API server due to password credentials.

* Cleaned up some warnings

* When no user exists for an api key in Plugin controller, throw 401.

* Hooked in the ability to check if the Kavita instance can be accessed externally so we can determine if the user can invite or not.

* Hooked up some logic if the user's server isn't accessible, then default to old flow

* Basic flow is working for confirm email. Needs validation, error handling, etc.

* Refactored Password validation to account service

* Cleaned up the code in confirm-email to work much better.

* Refactored the login page to have a container functionality, so we can reuse the styles on multiple pages (registration pages). Hooked up the code for confirm email.

* Messy code, but making progress. Refactored Register to be used only for first time user registration. Added a new register component to handle first time flow only.

* Invite works much better, still needs a bit of work for non-accessible server setup. Started work on underlying manage users page to meet new design.

* Changed (you) to a star to indicate who you're logged in as.

* Inviting a user is now working and tested fully.

* Removed the register member component as we now have invite and confirm components.

* Editing a user is now working. Username change and Role/Library access from within one screen. Email changing is on hold.

* Cleaned up code for edit user and disabled email field for now.

* Cleaned up the code to indicate changing a user's email is not possible.

* Implemented a migration for existing accounts so they can validate their emails and still login.

* Change url for email server

* Implemented the ability to resend an email confirmation code (or regenerate for non accessible servers). Fixed an overflow on the confirm dialog.

* Took care of some code cleanup

* Removed 3 db calls from cover refresh and some misc cleanup

* Fixed a broken test
2022-01-30 14:45:57 -08:00
Joseph Milazzo
fd46cda7c4
Reworked the logic for finding comicinfo to ensure that it finds top-level first and stream lined the logic. (#1008) 2022-01-29 08:50:24 -08:00
Joseph Milazzo
2d59580aef
Recently Added Chapters/Volumes (#1007)
* Working on adding recently added chapter/volumes to dashboard. Have some progress, need to tweak grouping logic.

* Tweaked the logic to work well for grouping. Now to incorporate information for UI to provide seamless integration

* Implemented UI part for Recently Added.
2022-01-29 08:04:18 -08:00
Joseph Milazzo
567d475e46
Bugfix/tachiyomi sync issue (#1002)
* Added extra unit cases for GetContinuePoint. Fixed a bug where if the series was just read chapters, the first chapter wouldn't be returned and would throw an error.

* Wrote unit tests for MarkChaptersUntilAsRead for Tachiyomi and fixed a few cases where due to tracking on Tachiyomi, Volumes with a single 0 chapter would get marked as read.
2022-01-28 06:29:49 -08:00
Joseph Milazzo
bde5dc0d80
Updated NetVips.Native to fix an issue with cover generation being skewed due to the way lipjpeg handles some streams. (#998) 2022-01-27 07:47:29 -08:00
Joseph Milazzo
415832d9e1
Added a bug marker to ebook reader, made an optimization to continue-point api, Fixed a bulk selection bug where storyline tab wasn't properly selecting. (#997) 2022-01-27 06:55:35 -08:00
Robbie Davis
ea9f59320e
Fixes filter application (#992)
* Fixes filter application

# Fixed:
- Fixed: Fixed an issue where pagination would not reset on filter application (develop)

* Fixing up code

* code fixes

* When no user exists for an api key in Plugin controller, throw 401.

* Cleaned up the code to remove the extra variable and make use of what we had already.

* Fixed the broken build from last PR

* Fixed a few places the code didn't get updated

Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
2022-01-26 15:54:35 -08:00
Joseph Milazzo
480cd94ab5
API for Tachiyomi Progress Sync (#996)
* Added a stub for an api

* Added code to Parser to get MaximumNumberFromRange. Added new API for Tachiyomi Progress tracking "mark-chapter-until-as-read"
2022-01-26 15:35:31 -08:00
jeongsu816
239b7c523d
Fixed Parser.Parser.Normalize returns empty string (#991)
Parser.Parser.Normalize returns empty string when name doesn't have any
alphanumeric characters. It messes up Series at least.
To prevent this issue, if normalized string is empty, it just returns
received name variable. In this case user has to carefully set file names but
it is better than messed up Series.
2022-01-26 07:42:28 -08:00
Robbie Davis
21b89a5386
Series Detail Enhancements (#983)
* Series Detail Enhancements

# Added
- Added: Volume tab for `Comic` Library Types
- Added: Storyline tab for `Comic` and `Manga` library types. This will show Volumes and Chapters together sorted in order.

# Changed
- Changed: Changed `Chapters/Issues` to show all chapters or issues regardless of if they are in a volume for both `Manga` and `Comic` library types

* Removed 3 loops to speed up load time

* Refactored some library type checks. Reset selection on nav change.

* Refactored hasReadingProgress for a series to the backend and further optimized the series detail page.

* Fixed up the regex for "Annual" special case and added unit tests.

Co-authored-by: Joseph Milazzo <joseph.v.milazzo@gmail.com>
2022-01-24 09:02:44 -08:00
Joseph Milazzo
52ab01571b
Removed showing toasts when series are added to the server since cards will show automatically. Hide events widget unless you're an admin. Changed an API signature to match the data that's being sent back. (#979) 2022-01-22 07:56:07 -08:00
Joseph Milazzo
6c73f8b61a
Less Logging In (#978)
* Implemented the framework for Refresh Token. Needs testing.

* Implemented Refresh Tokens. Users are issued tokens that last 7 days, just before the 7 days, the UI will request a new token to avoid having to re-authenticate.
2022-01-22 06:36:32 -08:00
Joseph Milazzo
5f5c24564f
Misc Cleanup (#977)
* Fixed Day not getting set when reading from epubs.

* Fixed typo for "On Going" to "Ongoing"

* Removed filtering on Reading List page since it doesn't make sense
2022-01-21 08:08:38 -08:00
Joseph Milazzo
218f642870
Refactored the setContinuePoint code from the UI to the backend. Now, through an API, we can get the chapter to restart from. (#973) 2022-01-20 15:49:26 -08:00
Joseph Milazzo
1a0fd3445d
Reading List Change (#972)
* Allow an admin to delete another user's reading list

* Allow an admin to delete another user's reading list
2022-01-20 08:54:08 -08:00
Joseph Milazzo
eb7e2781c1
Validate Download Claim (#971)
* Partially complete, got some code to validate your Role. Needs to be applied to all methods and made a filter.

* Cleaned up the code on the backend to validate each call. The reason the RequireDownloadRole doesn't work is that the user still has the claim in their token so the simple validation isn't working. We need explicit checks.

* Don't allow users to download files if they have lost the claim but not refreshed token.

* Don't allow users to download files if they have lost the claim but not refreshed token.
2022-01-20 07:46:59 -08:00
Joseph Milazzo
6c2731071d
Migration Safety (#967)
* Updated EF version

* When we perform a migration, backup the database to temp/migration/VERSION and do it only once in case a migration fails.

* When a migration fails, we will now restore what was corrupted.
2022-01-19 15:03:47 -08:00
Joseph Milazzo
fadfab0fba
Missing Age Ratings (#955)
* Fixed GetTags having wrong return type defined

* Added missing Age Rating tags
2022-01-18 14:01:11 -08:00
Joseph Milazzo
9d1d17249d
Fixed GetTags having wrong return type defined (#954) 2022-01-18 13:30:34 -08:00
Joseph Milazzo
680240af8d
Shakeout testing Fixes (#952)
* Cleaned up some old code in download bookmark that could create pointless temp folders.

* Fixed a bad http call on reading list remove read and cleaned up the messaging

* Undid an optimization in finding cover image due to it perfoming depth first rather than breadth.

* Updated CleanComicInfo to have Translators and CoverArtists, which were previously missing.

* Renamed Refresh Metadata to Refresh Covers on the UI, given Metadata refresh is done in Scan.

* Library detail will now retain the search query in the UI. Reduced the amount of api calls to the backend on load.

* Reverted allowing the filter to reside in the UI (even though it does work).

* Updated the Age Rating to match the v2.1 spec.

* Fixed a bug where progress wasn't being saved

* Fixed line height not having any effect due to not applying to children elements in the reader

* Fixed some wording for Refresh Covers confirmation

* Delete Series will now send an event to the UI informing that series was deleted.

* Change Progress widget to show Refreshing Covers for

* When we exit early due to potential missing folders/drives in a scan, tell the UI that scan is 100% done.

* Fixed manage library not supressing scan loader when a complete came in

* Fixed a spelling difference for Publication Status between filter and series detail

* Fixed a bug where collection detail page would flash on first load due to duplicate load events

* Added bookmarks to backups

* Fixed issues where fullscreen mode would break infinite scroller contiunous reader
2022-01-18 08:35:59 -08:00
Joseph Milazzo
4645f8e3f2
Reader Fixes (#951)
* Normalized paths on download controller and when scan is killed due to missing or empty folders, log a critical error.

* Tweaked the query for OnDeck to better promote recently added chapters in a series with read progress, but it's still not perfect.

* Fixed an issue where up/down key weren't working unless you clicked on the book explicitly

* Fixed an issue where infinite scroller was broken in fullscreen mode

* When toggling fullscreen mode on infinite scroller, the current page is retained as current position

* Fixed an issue where a double render would occur when we didn't need to render as fit split

* Stop showing loader when not using fit split
2022-01-17 09:34:32 -08:00
Joseph Milazzo
ce3bd92244
Scanner not merging with series that has LocalizedName match (#950)
* When performing a scan, series should group if they share the same localized name as a pre-existing series.

* Fixed a bug where a series with a different name and localized name weren't merging with a different set of files with the same naming as localized name.
2022-01-16 15:48:15 -08:00
Joseph Milazzo
2434e96fe9
Removed a hack that was put in when users complained about a tool improperly tagging. This is not the case for most tools. (#949) 2022-01-16 15:46:41 -08:00
Joseph Milazzo
80e9738f67
Metadata Tags (#947)
* Implemented the ability to click a metadata tag (in series detail) and load a pre-filtered view. Apply still needs to be implemented (preset load is out of sync with external filter)

* Refactored people to properly use typeahead so duplicates don't happen and use an observable chain so we can update the screen correctly

* Many refactoring to ensure that the timings for filtering always works
2022-01-16 13:17:29 -08:00
Joseph Milazzo
591b574706
Unit Tests & New Natural Sort (#941)
* Added a lot of tests

* More tests! Added a Parser.NormalizePath to normalize all paths within Kavita.

* Fixed a bug where MarkChaptersAsUnread implementation wasn't consistent between different files and lead to extra row generation for no reason.

* Added more unit tests

* Found a better implementation for Natural Sorting. Added tests and validate it works. Next commit will swap out natural Sort for new Extension.

* Replaced NaturalSortComparer with OrderByNatural.

* Drastically simplified and sped up FindFirstEntry for finding cover images in archives

* Initial fix for a epub bug where metadata defines key as absolute path but document uses a relative path. We now have a hack to correct for the epub.
2022-01-15 07:39:34 -08:00
Robbie Davis
491d9600dd
Performance Enhancements (#937) 2022-01-14 15:42:32 -05:00
Joseph Milazzo
996c68d753
Feature/parse scanned files tests (#934)
* Fixed a bug in CleanupBookmarks where the Except was deleting all files because the path separators didn't match.

* Added unit tests for ParseScannedFiles.cs.

* Fixed some unit tests. Parser will now clear out multiple spaces in a row and replace with a single.
2022-01-13 11:40:45 -08:00
Joseph Milazzo
7eaa0248c3
Fixed a bug in CleanupBookmarks where the Except was deleting all files because the path separators didn't match. (#932) 2022-01-13 08:15:23 -08:00
Joseph Milazzo
fb71d54fe6
Misc Fixes and Changes (#927)
* Cleaned up a ton of warnings/suggestions from the IDE.

* Fixed a bug when clearing the filters some presets could be undone.

* Renamed a class in the OPDS spec

* Simplified logic for when Fit To Screen rendering logic occurs. It now works always rather than only on cover images.

* Give some additional info to the user on what the differences between Library Types are

* Don't scan .qpkg folders (QNAP devices)

* Refactored some code to enable ability to test CoverImage Test. This is a broken test, test.zip is waiting on an issue in NetVips.

* Fixed an issue where Extra might get flagged as special too early, if in a word like Extraordinary

* Cleaned up the regex for the extra issue to be more flexible
2022-01-12 15:00:00 -08:00
Joseph Milazzo
ab8c762830
Metadata Performance Scan (#921)
* Refactored updating chapter metadata from ComicInfo into the Scan loop. This let's us avoid an additional N file reads (expensive) in the metadata service, as we already have to read them in the scan loop.

* Refactored Series level metadata aggregation into the scan loop. This allows for the batching of DB updates to be much smaller, thus faster without much overhead of GC.

* Refactored some of the code for ProcessFile to remove a few redundant if statements
2022-01-09 10:36:24 -08:00
Joseph Milazzo
ad3c8bb2c7
Don't tag a series as completed if count is 0. (#917) 2022-01-08 16:31:02 -08:00
Joseph Milazzo
a2364285b0
Book Reader Issue Take 2 (#916)
* Implemented Publication Status in SeriesMetadata and the ability to filter it.

* Updated the docs for Language on metadata to specify it's a BCP-47 code to match Anansi Project. Fixed a bug with reader from previous PR.
2022-01-08 16:17:04 -08:00
Joseph Milazzo
2fbcf203aa
Implemented Publication Status in SeriesMetadata and the ability to filter it. (#915) 2022-01-08 13:10:03 -08:00
Joseph Milazzo
c5e5aa19d5
Misc Fixes (#914)
* Fixed the book reader off by one issue with loading last page

* Fixed a case where scanner would not delete a series if another series with same name but different format was added in that same scan.

* Added some missing tag generation (chapter language and summary)
2022-01-08 11:36:47 -08:00
Joseph Milazzo
0be0e294aa
Metadata Optimizations (#910)
* Added a tooltip to inform user that format and collection filter selections do not only show for the selected library.

* Refactored a lot of code around when we update chapter cover images. Applied an optimization for when we re-calculate volume/series covers, such that it only occurs when the first chapter's image updates.

* Updated code to ensure only lastmodified gets refreshed in metadata since it always follows a scan

* Optimized how metadata is populated on the series. Instead of re-reading the comicInfos, instead I read the data from the underlying chapter entities. This reduces N additional reads AND enables the ability in the future to show/edit chapter level metadata.

* Spelling mistake

* Fixed a concurency issue by not selecting Genres from DB. Added a test for long paths.

* Fixed a bug in filter where collection tag wasn't populating on load

* Cleaned up the logic for changelog to better compare against the installed verison. For nightly users, show the last stable as installed.

* Removed some demo code

* SplitQuery to allow loading tags much faster for series metadata load.
2022-01-08 06:41:47 -08:00
Joseph Milazzo
2b57449a63
Book Reader Issues (#906)
* Refactored the Font Escaping Regex with new unit tests.

* Fonts are now properly escaped, somehow a regression was introduced.

* Refactored most of the book page loading for the reader into the service.

* Fixed a bug where going into fullscreen in non dark mode will cause the background of the reader to go black. Fixed a rendering issue with margin left/right screwing html up. Fixed an issue where line-height: 100% would break book's css, now we remove the styles if they are non-valuable.

* Changed how I fixed the black mode in fullscreen

* Fixed an issue where anchors wouldn't be colored blue in white mode

* Fixed a bug in the code that checks if a filename is a cover where it would choose "backcover" as a cover, despite it not being a valid case.

* Validate if ReleaseYear is a valid year and if not, set it to 0 to disable it.

* Fixed an issue where some large images could blow out the screen when reading on mobile. Now images will force to be max of width of browser

* Put my hack back in for fullscreen putting background color to black

* Change forwarded headers from All to explicit names

* Fixed an issue where Scheme was not https when it should have been. Now the browser will handle which scheme to request.

* Cleaned up the user preferences to stack multiple controls onto one row

* Fixed fullscreen scroll issue with progress, but now sticky top is missing.

* Corrected the element on which we fullscreen
2022-01-07 06:56:28 -08:00
Joseph Milazzo
6006faa574
Fixed a critical bug where registration was broken for first time flow. Refactored how backup before migrations occured such that it now puts the db in temp. The db will be deleted automatically that night. (#900) 2022-01-05 15:07:54 -08:00
Joseph Milazzo
027b8b78e2
Backup on Migrations (#898)
* Refactored how the migrations are run.

* A backup will be performed before any migrations. Added additional guards before a sub-module is loaded.
2022-01-05 12:47:01 -08:00
Joseph Milazzo
70f7f34ac9
Only admins should be able to create new users (#896) 2022-01-05 11:04:45 -08:00
Joseph Milazzo
a1a6333f09
Bookmark Refactor (#893)
* Fixed a bug which didn't take sort direction when not changing sort field

* Added foundation for Bookmark refactor

* Code broken, need to take a break. Issue is Getting bookmark image needs authentication but UI doesn't send.

* Implemented the ability to send bookmarked files to the web. Implemented ability to clear bookmarks on disk on a re-occuring basis.

* Updated the bookmark design to have it's own card that is self contained. View bookmarks modal has been updated to better lay out the cards.

* Refactored download bookmark codes to select files from bookmark directory directly rather than open underlying files.

* Wrote the basic logic to kick start the bookmark migration.

Added Installed Version into the DB to allow us to know more accurately when to run migrations

* Implemented the ability to change the bookmarks directory

* Updated all references to BookmarkDirectory to use setting from the DB.

Updated Server Settings page to use 2 col for some rows.

* Refactored some code to DirectoryService (hasWriteAccess) and fixed up some unit tests from a previous PR.

* Treat folders that start with ._ as blacklisted.

* Implemented Reset User preferences. Some extra code to prep for the migration.

* Implemented a migration for existing bookmarks to using new filesystem based bookmarks
2022-01-05 09:56:49 -08:00
Joseph Milazzo
0ef8d47831
Fixed a bug with OPDS feeds not returning back results due to improperly setting up FilterDto. (#882) 2022-01-03 06:17:55 -08:00
Joseph Milazzo
720c52f494
Reader Fixes and Enhancements (#880)
* Don't show an exception when bookmarking doesn't have anything to change.

* Cleaned up the bookmark code a bit.

* Implemented fullscreen mode in the web reader. Refactored User Settings to move Password and 3rd Party Clients to a tab rather than accordion. Removed color filters for web reader.

* Implemented fullscreen mode into book reader

* Added some code for toggling fullscreen which re-renders the screen to ensure the fitting works optimially

* Fixed an issue where moving from FitToScreen -> Split (L/R) wouldn't render the screen correctly due to canvas not being reset.

* Fixed bad optimization and scaling when drawing fit to screen

* Removed left/right highlights on page direction change in favor for icons. Double arrow will dictate the page change.

* Reduced overlay auto close time to 3 seconds

* Updated the paginging direction overlay to use icons and colors. Added a blur effect on menus

* Removed debug flags
2022-01-02 17:10:37 -08:00