Commit graph

21 commits

Author SHA1 Message Date
kingbri
7202a95bb2 Ferrite: Parallel tasks and logging
Make all tasks run in parallel to increase responsiveness and efficiency
when fetching new data.

However, parallel tasks means that toast errors are no longer feasible.
Instead, add a logging system which has a more detailed view of
app messages and direct the user there if there is an error.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-09 18:48:28 -05:00
kingbri
f622b7af05 Actions: Fix default action settings
Since actions use a new API, update default actions to use the
same API rather than the legacy models. If an action is removed,
a prompt will tell the user to change their default debrid/magnet
action and default to the choice sheet.

Also add extra UI fixes and cleanup.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-01 18:31:29 -05:00
kingbri
cbe3d17be1 Ferrite: Fix search and add progressive loading
The searchbar had a lot of lag when scrolling down the search
results view. This was due to a shared searchText variable which
updated every time the searchbar text changed and caused UI blocking.

Migrate searchText to a local variable and destroy the child
SearchResultsView as it's not needed at this time (may come back
with v0.7 due to searchable).

Also sources now display results progressively without a ProgressView
blocking when each source loads which allows the user to view media
faster.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-27 12:22:36 -05:00
kingbri
0f081d0716 Ferrite: Modify UI
The overall UI of Ferrite has been changed to make animations smoother
and streamline the experiences.

A new search filter interface has been added for all iOS versions,
but iOS 15 and up have smooth UI applied due to bugs with searchbars
in iOS 14 (which shouldn't even have a searchbar in the first place).

Also fix the plugin fetching logic to not listen to a combine publisher
and instead use a notification that is easier to control.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-16 18:34:05 -05:00
kingbri
4512318e8f Ferrite: Add actions, plugins, and tags
Plugins are now a unified format for both sources and actions. Actions
dictate what to do with a link and can now be added through a plugin
JSON file.

Backups have also been versioned to improve performance and add action
support.

Tags are used to give small amounts of information before a user
installs a plugin.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-08 12:09:37 -05:00
kingbri
5a4e98f10d Ferrite: Switch to a Magnet struct
Magnets are expressed in two different ways: a hash and a link. Both
of these mean the same thing with a magnet link giving more information
if required.

However, there was a disconnect if a hash was present or a link was
present and required many steps to check which was available. Unify
magnets by creating a parent structure that attempts to extract
the hash or create a link in the event that either parameter isn't
provided.

Replace everything except bookmarks (to prevent CoreData complaints
and unnecessary abstraction) to use the new Magnet system.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-04 12:49:20 -05:00
kingbri
9b7bc55a25 Library: Add support for RealDebrid cloud
RealDebrid saves a user's unrestricted links and "torrents" (magnet
links in this case). Add the ability to see and queue a user's RD
library in Ferrite itself.

This required a further abstraction of the debrid manager to allow
for more types other than search results to be passed to various
functions.

Deleting an item from RD's cloud list deletes the item from RD as well.

NOTE: This does not track download progress, but it does show if a
magnet is currently being downloaded or not.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-02 15:13:32 -05:00
kingbri
47ef72bf13 MagnetChoiceView: Fix titles
Titles weren't cleared on sheet dismiss which caused conflicts between
batches and single files. Fix this.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-12-14 16:33:18 -05:00
kingbri
a774564212 Ferrite: Improve overall UI
- Make history buttons have 2 lines of text to give more context.
If a batch is given, the full episode name is shown
- Add a "now playing" section to player choices to show what the user
will play in the event of a misclick
- Make the maximum line limit in search results 4 lines to prevent
long title results from taking up the entire cell
- Fix light theme appearance with library since the picker and list
weren't aligned right

Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-18 17:10:42 -05:00
kingbri
e3e8924547 Ferrite: Add backups and massive cleanup
Backups in Ferrite archive a user's bookmarks, history, source lists,
and source names. Sources are not archived due to the size of the backup
increasing exponentially.

These files use the .feb format to avoid JSON conflicts when opening
the file in Ferrite. The backup file can be renamed to JSON for editing
at any time.

Add the Backport namespace to be used for ported features rather
than making a file for every iOS 14 adaptation.

Move history and bookmark creation to the PersistenceController rather
than individual functions.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-06 20:54:45 -05:00
kingbri
b85752c92c RealDebrid: Improve fetch and recache times
To declutter a RealDebrid user's library, check if the file and
unrestricted link exist and serve those existing links. Otherwise
perform a download like normal.

Sometimes RealDebrid deletes cached items, but still keeps them on
instant availability. Add a way to tell the user that the item
is downloading along with an option to cancel it.

Also remove unnecessary published variables from viewmodels

Signed-off-by: kingbri <bdashore3@proton.me>
2022-10-05 10:47:59 -04:00
kingbri
4d3a16f77e Library: Add history functionality
Action history is logged and displayed to the user's library.
These are triggered whenever the magnet choice sheet is displayed.

Also redo alerts and action sheets to avoid deprecation notices
for >iOS 14. These will be removed when iOS 14 support is dropped.

There was also a problem with sheet presentation not working after
a sheet was dismissed. Disable the appropriate view when a sheet
is being presented.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-09-16 12:33:21 -04:00
kingbri
2f870b9410 Ferrite: Add bookmarks
Bookmarks are added through search results and can be accessed through
the library. These can be moved and deleted within the list.

Add a RealDebrid instant availability cache for bookmark IA status
to not overwhelm the API. Instant availability results are fresh on
every search results since the cache is cleared.

Also don't require a source API object to be present for the API parser
button in source settings. If a JSON parser exists for a source, allow
the option to be presented.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-09-16 12:33:18 -04:00
kingbri
1761f8dfb4 Debrid: Add loading indicator and fix iOS <14.5 issues
When a search result is selected, there is usually a delay due to
the debrid dance of API routes for grabbing a download link to stream.
Add a loading indicator and prevent any other tasks from loading
unless the user cancels it.

iOS 14.5 was a huge update which added many QoL SwiftUI changes that
are consistent to modern iOS versions.

However, Ferrite supports iOS versions less than 14.5, mainly 14.3.
More fixes had to be added to make sure UI is consistent across
all OS versions.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 18:47:02 -04:00
kingbri
e0182a700f Sources: Add website API support
Adds support for website APIs both complex and simple. This commit
only supports GET requests to APIs. POST request support can be added
on request.

Client IDs and secrets are also supported. They can be added via
source settings or automatically set by a website endpoint.

Also fetch sources for scraping using the backgroundContext and remove
some functions from using the main actor.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 18:47:02 -04:00
kingbri
530d107218 Ferrite: iOS 14 backport
Add backports to get Ferrite working on iOS 14.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 18:46:47 -04:00
kingbri
2792b61e9b Settings: Add default options when opening a search result
Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 00:41:38 -04:00
kingbri
c82cb1819d Searching: Cleanup existing searches
If a user searched after cancelling the search the first time,
the first search would still continue.

Assign the search task to navigation view and automatically cancel
it and dismiss the searchbar when the user switches to a different
tab.

Also add a ProgressView to show which source is being parsed.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 00:41:38 -04:00
kingbri
ff23a854ef Sources: Add source updating and source list edits
Sources can now be updated based on the repo ID. To preserve repo IDs
across single URL links, the source lists can be edited and the ID
is transferred over.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 00:41:38 -04:00
kingbri
064a68fbb2 Sources: Add RSS, descriptions, and settings
RSS parsing has been added as a method to parse source since they're
easier on the website's end to parse.

Source settings have been added. The only current setting is the fetch
mode which selects which parser/scraper to use. By default, if an RSS
parser is found, it's selected.

A source now has info shown regarding versioning and authorship. A source
list's repository name and author string are now required.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 00:41:38 -04:00
kingbri
1eef8202ca Ferrite: Decouple torrent sources
These sources will be converted to be more flexible with JavaScript
in the future.

The source catalog is populated by adding a source list in settings
then installing a source from the catalog.

Sources can be enabled or disabled when using Ferrite.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-04 21:33:59 -04:00
Renamed from Ferrite/Models/NavigationViewModel.swift (Browse further)