Commit Graph

1342 Commits

Author SHA1 Message Date
schroda
8655fe1f6d Update dependency "@typescript-eslint" to v5.59.8 (#334) 2023-06-04 21:16:56 +02:00
schroda
647260f18c Update dependency "prettier" to v2.8.8 (#333) 2023-06-04 21:14:33 +02:00
schroda
1ce27ea939 Feature/update dependency mui to v5.x (#332)
* Update dependency "mui" to v5.x

Update to v5.13.3

Fixes issue of "SxProps" not being exported by "@mui/material"

* Update dependency "mui" to v5.x - Fix grid item size

Update to v5.13.3

Fixes issue of "SxProps" not being exported by "@mui/material"

* Update dependency "mui" to v5.x - Replace "ListItem" with "ListItemButton"

* Update dependency "mui" to v5.x - Fix tsc issue

* Update dependency "mui" to v5.x - Prevent reader white screen

Due to "initialChapter" being a function returning an object, it causes a re-render everytime due to it (the object) being used as a dependency.
This caused a white screen when skipping to the previous or next chapter
2023-06-04 21:13:07 +02:00
schroda
6911f60eb4 Feature/remove dependency mui system (#331)
* Remove duplicated dependency "@mui/system"

Already included in "@mui/material"

* Remove duplicated dependency "@mui/system" - Fix theme "custom" palette

Already included in "@mui/material"

* Remove duplicated dependency "@mui/system" - Fix imports

Already included in "@mui/material"
2023-06-04 21:08:39 +02:00
schroda
2a6950b015 Feature/remove dependency mui styles (#330)
* Remove deprecated dependency "@mui/styles"

* Remove deprecated dependency "@mui/styles" - Remove usage
2023-06-04 20:58:44 +02:00
schroda
3a82fd0abb Remove unused dependency "react-lazyload" (#329) 2023-06-04 20:57:13 +02:00
schroda
9e8c4254bd Remove unused dependency "p-queue" (#328) 2023-06-04 20:53:35 +02:00
schroda
9ae7b2e592 Remove console log (#327)
The 2nd time this happens... AINTNOWAY
2023-06-04 01:03:45 +02:00
schroda
0fb204f141 Feature/request manager remove get client usage (#325)
* Remove "getClient" usage from "metadata" util

* Remove "getClient" usage from "useRefreshManga" hook

* Remove "getClient" usage from "isDupChapter" util function

* Use correct endpoint for setting category metadata

"/meta" suffix was missing from url

* Use correct http method for updating manga metadata
2023-06-04 00:50:58 +02:00
schroda
207a87f3e9 Fix import backup file request (#326)
The file wasn't send correctly due to converting it to a string.
2023-06-04 00:32:08 +02:00
schroda
eaa8392789 Fix axios requests (#324)
The response was the expected data and not the actual axios response.
Thus, there was no "data" property and trying to use it could lead to errors like e.g. TypeErrors.
2023-06-04 00:30:48 +02:00
Alexandre
d60ed0c055 Add fit page to window reader setting (#323)
* Add fit page to window reader setting

* Renamed option and conditional rendering

* Rename translation key
2023-06-03 20:53:52 +02:00
schroda
46a7ff6e3b Feature/refactor source mangas screen (#314)
* Refactor "SourceMangas"

* Refactor "SourceMangas" - Show loading placeholder on filter reset or submit

Due to the url being the same for all "filter requests" the loading state doesn't get changed by SWR.
Instead, only the "isValidating" state gets updated.

* Refactor "SourceMangas" - Update routing

* Refactor "SourceMangas" - Prevent duplicated mangas in grid

There is a possibility that the "latest" endpoint returns the same manga on different pages

* Always set the toolbar content on the manga page

"setAction" wasn't called on the manga page, thus, in case the previous page didn't unset the action, it never got unset

* Rename source content type "Browse" to "Popular"
2023-05-28 12:16:06 +02:00
schroda
1480507c35 Fix/source options filters state (#320)
* Prevent mutating passed object

Causes the options to not get reset correctly and/or to get set without "submitting" them

* Always use local filter state instead of requested one

The local filter state sometimes got overwritten by the state from the server response.
This resulted in showing an incorrect filter state while still sending the correct one to the server when filtering

* Update text filter faster

The timeout (2.5s) is too long and can cause the filter state to not have been updated by the time the filters are getting submitted.
Thus, causing a request with outdated filters and requiring a "re-submit" for the actual filters to get used.
2023-05-28 02:18:37 +02:00
schroda
f852255d82 Add additional info about SWR infinite load to response (#321)
The SWR response only has "isLoading" and "isValidating".
"isLoading" only indicates the initial load.
For every subsequent load, only "isValidating" gets set to true.
2023-05-28 02:18:23 +02:00
schroda
606ee9de2d RequestManager make requests abortable - Fix missed usages (#318) 2023-05-23 13:54:14 +02:00
schroda
c32cb53592 Feature/improve refactored global search performance (#317)
* Move "search term" retrieval to parent component

Preparation for reducing re-renders.
Each "SourceSearchPreview" component would re-render at each key press.

* Memoize "SourceSearchPreview" components

Only re-render in case the "searchString" (or other props) changed.
Due to the query the components rendered everytime a key was pressed in the search field

* Hide "SourceSearchPreview" immediately in case the search query is empty

Do not wait for the debounced "searchString" in case it will be an empty string anyways

* Abort outdated search requests

In case many sources are being searched, the outdated requests can block the new ones.
To prevent this, the old ones will get canceled.

* Debounce source search result state changes

In case multiple search requests are finished in short succession, each state update would trigger an update.
By debouncing these updates, the search results do not "jump around" as much, since the sources get sorted by search request state and result
2023-05-23 13:35:09 +02:00
schroda
0d36d2dcfb Feature/request manager make requests abortable (#316)
* Make requests abortable

* Make requests abortable - Fix usage
2023-05-23 13:27:38 +02:00
schroda
95ceac335b Update to axios v1.x (#315)
Update to axious v1.4.0
2023-05-23 13:25:48 +02:00
schroda
84433ffff8 Support SWR infinite requests via POST (#313)
* Support SWR infinite requests via POST

* Correct "source quick-search" request
2023-05-22 14:04:05 +02:00
schroda
6fd0dd0dad Fix "setSourceFilters" request (#312) 2023-05-22 14:03:50 +02:00
schroda
a95937f253 Fix/global search not showing request error (#310)
* Show error message in case search request failed

In case of an error the message was showing "no mangas found"

* [i18n::en] Sort keys alphabetically
2023-05-20 13:25:10 +02:00
schroda
474e568a05 Refactor SearchAll screen (#308) 2023-05-20 13:23:30 +02:00
schroda
836b4ea4d2 Set the manga ref for the "list style" (#311)
Ref was never set for the "list style" which caused the pagination to not work
2023-05-20 13:22:24 +02:00
schroda
f908195b09 Feature/cleanup search all (#307)
* [Cleanup] Improve variable names

* [Cleanup] Improve typing

* [Cleanup] Extract source sort by name logic into function

* Do not sort original loaded source list

"Sort" mutates the original array

* [Cleanup] Extract search result sort logic into function

* [Cleanup] Simplify adding default languages to shown languages
2023-05-20 13:19:03 +02:00
schroda
0cd5720f54 Fix/request manager infinite swr requests (#306)
* Fix RequestManager initial infinite swr requests

Functions always returned "null" as the url, which causes SWR to not send the request

 - useGetSourceLatestMangas
 - useSourceSearch
 - useSourceQuickSearch

* Use "skipRequest" for infinite SWR requests

Is easier to use then overwriting "getEndpoint" only for specific cases

* Request correct first page for infinite SWR requests

The following endpoints start at page 1
 - popular source mangas
 - latest source mangas
 - source search
 - source quick search

* Remove wrong parameter from source manga browse requests

No idea why I've added this in the first place

* Correctly request "latest" and "popular" source mangas

The "page" wasn't a param of the query but part of the endpoint
2023-05-20 13:12:23 +02:00
schroda
feac34ba83 Trigger global search request (#305)
Issue introduced with a457d80c44.
"FetchedSources" was changed to represent the loading state of the request, but it was forgotten to update its usage
2023-05-18 22:28:53 +02:00
schroda
aa801a57ee Feature/updates screen use infinite swr hook (#303)
* Use "RequestManager" for loading updates

* [Cleanup] Fix typing

* Memoize grouped updates

* [TSConfig] Increase target version

Makes it possible to iterate over a "IterableIterator" (e.g. [...<Map>.entries()])

* Use "GroupedVirtuoso" for "Updates" screen

* Optionally use "padding" instead of margin for the loading placeholder

In case the loading placeholder gets used in a "react-virtuoso" list, the margin might cause issues with the calculated height.

* Use "padding" instead of "margin"

"Margin" breaks "react-virtuosos" height calculation

* Add background color to group header

With virtuoso the group headers are sticky, thus, a background color is needed

* Simplify "groupByDate" object structure

It's not necessary to save the items inside the group object
2023-05-18 13:48:01 +02:00
schroda
a457d80c44 Feature/streamline backend requests (#297)
* Introduce "RequestManager"

* Use "RequestManager" - Simple replacements

 - Get rid of all "util/client" imports
 - replace old requests with new "RequestManager"
 - remove "fetcher" from global SWR config
     instead of using the SWR hooks by themselves, the "requestManager" is supposed to be used

* Use "RequestManager" - Do requests via SWR hooks

Use SWR hooks at places where it's easily usable

* Prevent trailing slashes in the "baseUrl"
2023-05-18 13:25:19 +02:00
schroda
f86c7ea08a Prevent showing "empty library" message on first load (#302)
Due to using "useEffect" the grid always rendered once with stale data, causing the error message to be shown.
With "useMemo" the latest data is always getting rendered immediately.
2023-05-18 13:24:34 +02:00
schroda
58eb2fead3 Feature/enforce license notice in each file via eslint rule (#304)
* [ESLint] Add "eslint-plugin-header" as dev dependency

* [ESLint::eslint-plugin-header] Setup rule

* [ESLint::eslint-plugin-header] Fix errors
2023-05-18 13:17:41 +02:00
schroda
13dbb8faf4 Prevent add category FAB from overlaying last category (#301) 2023-05-15 18:41:43 +02:00
schroda
14ac872876 Prevent manga page FAB from changing position when selecting chapters (#300)
When selecting chapters the FAB button slightly moved further up and to the left.
This happened because "em" was used for the positioning and the "SelectionFAB" being inside a "Box" component while the "Start/ResumeFAB" had "no extra" parent component.
2023-05-15 18:36:16 +02:00
schroda
0a0d902bd2 Fix/manga screen prevent fab from overlaying last chapter in list (#298)
* Introduce "StyledFAb"

MUI "Fab" with the "default" styling applied

* Prevent FAB from overlaying last chapter in list of Manga details page
2023-05-15 18:23:26 +02:00
schroda
5aaf0854fe Fix/download queue staying stopped when removing download (#299)
* [Cleanup] Use async/await

* Show download queue removal error toast

* Optionally restart download queue after removing download

When removing a download while the download queue was running, the queue was never started again.
2023-05-15 18:15:28 +02:00
schroda
8dae72604f Update to SWR version 2.x (#296)
* Update SWR to version 2.1.5

* Improve generic type names

* Use "isLoading" property of "useSWR" response

* Correctly load library without selected tab

With the latest SWR version the library was empty on the first load.
Not sure what exactly is the reason, but due to "isPaused" the request wasn't sent even after "activeTab" wasn't undefined anymore.
Instead of using "isPaused", passing "null" as the key will also prevent SWR from doing the request.
2023-05-15 11:56:55 +02:00
schroda
4aff22079a Settings language add description (#294)
* Add translation notice to language setting

* Make local source guide link readable in dark mode
2023-05-12 11:52:00 +02:00
schroda
c8b0c64a8d Add new languages to resources (#293) 2023-05-12 11:51:15 +02:00
Weblate (bot)
b6c87dd630 Translations update from Hosted Weblate (#276)
* Translated using Weblate (French)

Currently translated at 0.5% (1 of 175 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/fr/

* Translated using Weblate (French)

Currently translated at 100.0% (175 of 175 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/fr/

* Added translation using Weblate (Chinese (Simplified))

* Translated using Weblate (German)

Currently translated at 100.0% (175 of 175 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/de/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (175 of 175 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/zh_Hans/

* Added translation using Weblate (Japanese)

* Translated using Weblate (German)

Currently translated at 100.0% (175 of 175 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/de/

* Translated using Weblate (Spanish)

Currently translated at 100.0% (175 of 175 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/es/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 100.0% (175 of 175 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/zh_Hans/

* Added translation using Weblate (Chinese (Traditional))

* Translated using Weblate (Spanish)

Currently translated at 100.0% (178 of 178 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/es/

* Translated using Weblate (Arabic)

Currently translated at 6.1% (11 of 178 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/ar/

* Translated using Weblate (Arabic)

Currently translated at 10.4% (20 of 192 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/ar/

* Translated using Weblate (Chinese (Simplified))

Currently translated at 97.9% (188 of 192 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/zh_Hans/

* Translated using Weblate (Portuguese)

Currently translated at 44.7% (86 of 192 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/pt/

* Added translation using Weblate (Ukrainian)

* Translated using Weblate (Ukrainian)

Currently translated at 100.0% (194 of 194 strings)

Translation: Suwayomi/Tachidesk-WebUI
Translate-URL: https://hosted.weblate.org/projects/suwayomi/tachidesk-webui/uk/

---------

Co-authored-by: Aria Moradi <aria.moradi007@gmail.com>
Co-authored-by: Nathan <bonnemainsnathan@gmail.com>
Co-authored-by: misaka10843 <misaka10843@outlook.jp>
Co-authored-by: Fumo Vite <simonfumo@protonmail.com>
Co-authored-by: Yon <genjilolic@gmail.com>
Co-authored-by: rx443 <hi@corx.me>
Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Co-authored-by: Bander AL-shreef <bander.alshreef@gmail.com>
Co-authored-by: DevCoz <qq851428876@gmail.com>
Co-authored-by: Shinzo wo name <sasoj27791@in2reach.com>
Co-authored-by: Dan <denqwerta@gmail.com>
2023-05-11 22:50:56 +02:00
Allan Nordhøy
b4b3dc54a7 App strings reworked (#277)
* App strings reworked

* Lowercase labels, fixes

* Allowed languages, reverted sorting

* Use emoji for reader types

* Update image cache strings

* Change "Catalog" to "category"

---------

Co-authored-by: schroda <50052685+schroda@users.noreply.github.com>
2023-05-11 18:01:05 +02:00
schroda
bd91510227 Remove eslint rule deactivations (#290) 2023-05-11 18:00:37 +02:00
schroda
d92dc83dda Display strings in uppercase (#291)
Translation string will be changed to a capitalized string instead of uppercase.
2023-05-11 02:17:59 +03:30
schroda
2e05e7d35c fix/manga_screen_missing_source_toast (#288) 2023-05-02 00:35:56 +02:00
schroda
548b22d211 fix/library_settings_screen_title_update_on_language_change (#287) 2023-05-01 23:32:38 +02:00
schroda
b906509f9f Add missing licence text (#286) 2023-05-01 23:31:41 +02:00
schroda
f5a961e82f Fix/manga white screen missing extension (#285)
* Prevent white screen when source is missing

A undefined source caused a TypeError

* Show error message when source is missing
2023-05-01 23:31:14 +02:00
schroda
9a27335760 Add option to include and exclude categories from the global update (#265) 2023-04-22 13:03:51 +02:00
schroda
79b2305e54 Feature/library show number of mangas in category (#269)
* Pass optional browser tab only title

Makes it possible to have a different title for the "NavBar" and the browser tab

* Show number of items in category and library

---------

Co-authored-by: schroda <github@dasch.simplelogin.com>
2023-04-22 11:39:59 +02:00
schroda
4157611d83 Feature/improve typing of metadata related logic (#268)
* Improve metadata typing

* Rename types

Still included the "I" prefix for interfaces

* Improve typing in setting util files
2023-04-22 11:34:19 +02:00
schroda
0a56a2f6d4 Extensions cleanup (#257)
* [Cleanup] Add enums and types

* Extract "default languages" from ISOLanguages

The "default languages" will also be translated depending on which language the user selected
2023-04-21 00:27:42 +02:00