Commit graph

138 commits

Author SHA1 Message Date
kingbri
b8799be896 Ferrite: Add Kodi support
Adds support for playing links on a preset Kodi server. This is
less featured than the Ferrite companion, but should still work
without a problem.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-05 14:11:52 -05:00
kingbri
438e48be66 Ferrite: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-03 15:09:34 -05:00
kingbri
8c8e9d0215 Ferrite: Bump version
Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-02 11:23:14 -05:00
kingbri
282783c460 Plugins: Fix list sync in view
Plugin entries were not syncing properly inside the plugins view.
Instead of adding events to update filtered lists, make it so that
these filtered lists are updated on state changes.

This is the intended method of reactive programming and removes
complexity from filtering logic.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-02 11:06:57 -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
0661ed66f3 Search: Fix picker overlay and position
iOS 14 requires the scope bar modifier to be on the first subview of
the NavView. This is because a VStack wraps the content.

A bug was that the segmented picker was being overlaid due to the
scope bar modifier having an AppStorage call. The AppStorage call
updated the modifier which for some reason added another HostingView.

I am not sure why this happens, but avoid using AppStorage in the modifier
to make sure this doesn't happen again.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-28 19:42:20 -05:00
kingbri
bcdacdae06 Actions: Add release action
Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-27 15:32:57 -05:00
kingbri
f8b6ea6ba7 Search: Add random text to the searchbar
It's redundant to have the navgiation title of the Search view as
"Search" and the searchbar to have the same title. Make the searchbar
have randomized quotes (from a fixed set) that doesn't repeat cases.

Maybe make this customizable in the future?

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-27 14:24:47 -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
4a87d86e76 Ferrite: Add fixes for Introspect v0.2.2
Introspect now properly updates on every view lifecycle change, so
add a check to a reference on the UIHostingController and see if it
has been instantiated already.

Also clean up view struct names to reflect what is a modifier.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-18 11:39:03 -05:00
kingbri
988e607027 Dependencies: Use Introspect v0.2.1
v0.2.2 causes issues with UI, wait until a fix is released.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-16 22:39:47 -05:00
kingbri
291aa0fe46 Ferrite: Use InlineHeader in all sections
Makes section presentation uniform across all iOS versions since iOS
15 defaults are wonky.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-16 18:52:29 -05:00
kingbri
cb4d935008 Sources: Fix magnet link parsing with RSS
Using the new magnet type auto-populates hashes and links

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-16 18:34:09 -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
88a2dc9742 Sources: Add subName and fixup
The subName parameter is for aggregate sources that pull from a
child website. Make it so it's possible to include that child
site in parsers.

Also remove the magnet link/hash requirement since it's filtered out
anyways after results are fetched.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-08 22:33:27 -05:00
kingbri
41572362c7 PluginManager: Fix multiple plugin list bug
Only entries from the first plugin list would be shown in plugins.
This was because the availableSources array was set every time a list
was iterated upon.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-08 17:08:55 -05:00
kingbri
9ff7f5a7d5 Ferrite: Fix iOS 14 onAppear bug
onAppear does not fire properly on iOS 14 due to a longstanding
bug in SwiftUI. Add a UIKit onAppear hook for listening to these
events and implement inside the backport namespace.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-08 14:41:14 -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
6b0f90178b Backport: Update alert
The alert backport was updated for simplicity. Reflect this inside
Ferrite's source code.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-11 12:23:50 -05:00
kingbri
e31f9a07fe FetchRequest: Add descriptors
Adding the ability to send sort descriptors adds more flexibility
for the DynamicFetchRequest backport. Use this to fix bookmarks sorting.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-08 14:05:07 -05:00
kingbri
6456b34210 Ferrite: Bump version
Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-07 18:47:27 -05:00
kingbri
f960efc1ed Update README
Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-07 18:47:27 -05:00
kingbri
39c4a10a72 Ferrite: format
Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-07 18:47:27 -05:00
kingbri
e8f62e3cdc Library: Add searching and cleanup
Add a searchbar to filter through various library entries so it's
easier to find items.

Also add fixes for < iOS 16 devices and fix up searchbar constraints.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-07 18:47:05 -05:00
kingbri
2258036f7b Debrid: Add support for AllDebrid cloud and cleanup
This commit adds support for viewing a user's AllDebrid magnet list.
AllDebrid does not save unlocked links, but they do save which magnets
a user has queried.

Also clean up various functions in DebridManager.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-06 16:12:08 -05:00
kingbri
90ed4f8353 Debrid: Unify errors
Error handling can be tedious with debrid because network errors
to ignore are present (such as -999). Create a function to properly
display the errors to the user and log them via print statments.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-05 21:10:28 -05:00
kingbri
025d3797dc Premiumize: Perform a transfer if a link is present
This is required for PM's cloud since transfers will also add the
files to a user's cloud rather than just fetching the DDL link.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-04 14:33:38 -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
9f54397b77 Library: Add support for Premiumize cloud
Add the ability to view a user's Premiumize files in Ferrite. Files
can be deleted from a user's account directly in Ferrite's list.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-01-03 14:22: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
b0850d43d7 Search: Fix inline navigation title
Transitioning the navigation title to inline while editing search
broke for older OS versions. Make a more bulletproof solution to
inline the navigation title when the user commits a search as that's
a definitive event to listen to.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-12-31 12:35:28 -05:00
kingbri
15ad8c5581 Bookmarks: Fix context menu removal
NotificationCenter posts to other instances of the same button
caused the existing bookmark reference to be nullified for every other
button.

Add a comparison between object IDs to make sure the correct instances
are being nullified.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-12-31 12:33:51 -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
04e4503c86 Premiumize: Split cache check requests by 100
Premiumize has a dynamic upper limit of 107-110 (from testing)
hashes per request. To play it safe, cache requests are split by
100 and executed in parallel as 2 (or more) requests.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-12-09 14:15:39 -05:00
kingbri
55226e5628 Build: Add scripts for commit and nightly information
This automatically embeds the commit hash and if the build is an
actions nightly or not which will help with debugging crashes.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-12-06 12:37:15 -05:00
kingbri
32e5e21d3c DebridManager: Fix magnet links not loading
I mistakenly added an and condition which caused all debrid services
to fail unless the user is using Premiumize.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-12-06 10:35:18 -05:00
kingbri
17867db40c Debrid: Add Premiumize support and cleanup
Premiumize is another debrid provider. Add support in addition
to other debrid services.

Add a unified Magnet type that encloses both the link and hash
when needed for certain services.

A universal ASAuthenticationSession has been added to make implicit
authentication easier for services that support it.

Clean up declarations of certain variables that were mismanaged
during the debrid decentralization process.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-12-05 18:10:10 -05:00
kingbri
2322d3af67 Debrid: Decentralize and add AllDebrid support
AllDebrid is another debrid provider. Add support to Ferrite in
addition to RealDebrid.

The overall debrid login backend has changed to accomodate for a more
agnostic app structure where more services can be added as needed.

Also add some cosmetic changes to search so filters can be added while
searching for a phrase.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-27 18:18:09 -05:00
kingbri
06d4f8e84e RealDebrid, Github: Reorganize models
Prep for more debrid services

Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-25 14:49:24 -05:00
kingbri
a1cd62d3b9 Ferrite: Bump version
Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-19 17:03:09 -05:00
kingbri
9d7f85cc62 Info: Fix backup restoration
This is a bug that causes production Ferrite to freak out whenever
a backup is tapped in Files.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-19 16:42:36 -05:00
kingbri
3f588e249d Ferrite: Bump version
Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-19 12:42:05 -05:00
kingbri
f27578be7a Settings: Fix debrid button state
Make the button published for iOS 14.3 support

Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-19 12:40:27 -05:00
kingbri
102b59ab0a Scraping: Add source specific errors
State what source errored when one occurs.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-19 12:13:29 -05:00
kingbri
e063b91f3f Ferrite: Format and cleanup
Also add swipe to delete support in source lists

Signed-off-by: kingbri <bdashore3@proton.me>
2022-11-19 11:58:02 -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
a89e832d1c Ferrite: Concurrency, cleanup, and format
Use strict concurrency checking in Xcode 14 to find misuses with
Swift concurrency.

Cleanup files and rearrange them along with fixing comment headers.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-10-05 10:48:02 -04: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