Commit graph

276 commits

Author SHA1 Message Date
kingbri
904b5a74b5 Ferrite: Update project settings
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
ecdd0199f6 Tree: Cleanup access levels
Public should not be used in an app since it declares public to
additional modules. However, an app is one module. Some structs/
classes need to be left public to conform to CoreData's generation.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
3b771e5deb Extension: Remove Set warning
This will be removed in the future anyway.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
d8107cb5b6 Sources: Add queryFirstLetter param
Stopgap for index-based sources. For example, the keyword "John"
will be converted to "j" for sources that use "/j/John".

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
42e202b207 Plugins: Add request options to sources
Adds HTTP method, headers, and a body string. Also use a common
function to substitute params rather to allow for maintanence of a
common dictionary.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
afceea7bfb Actions: Update to latest
Bump actions and macos build versions.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
4ae1966934 Debrid: Fix UI updates for IA
Hook to the published variable to push updates.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
796cc65016 Premiumize: Fix service-specific errors
This parameter should be optional and errors if it isn't.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
90f44348b8 Logging: Improve generic error message
Point the user to settings logs rather than giving no extra information.
It would be a good idea to give the type of error in the future.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
6192ef1ede Tree: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
973fbb4099 Debrid: Migrate auth to protocol
Unify authentication to the new protocol. Also remove logout on
invalid requests. This became annoying and didn't update the UI
properly.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
243a16e3c4 Debrid: Unify cloud views
Cloud torrents and downloads are unified with the new protocol.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
44a90b77eb Debrid: Remove more redundant vars
the IA vars are no longer needed since that's unified.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
59ac719d9a Debrid: Migrate preferred service setter
PreferredService is now the debrid ID.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
02636e0bda Debrid: Remove separated download functions
No longer needed due to the common type.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
40b323bd56 Debrid: Remove redundant logout functions
Logout is now handled in the debrid class itself.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
91f124130c Debrid: Fix cache alert
Change the returned error to one that's unique to caching. Also
make deleteTorrents optional to delete the first torrent if necessary
since that's always being cached.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
ec8455c08d Debrid: Swap to common DebridError
Removes the redundant error types.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
0c3648120d Debrid: Refactor IA and download functions
Use the common protocol to handle these.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
9650e6deec Debrid: Remove ID storage
Storing an ID reference is redundant. Store a class reference
instead.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
07731e7b00 Debrid: Migrate more components to the protocol
Protocols can't be used in ObservedObjects. Observable in iOS 17
and up solves this, but Ferrite targets iOS 16 and up, so add a
type-erased StateObject which supports protocols.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
b80f8900b7 Debrid: Allow for UI updates
Mark as an ObservableObject so the UI can see parameters that are
being updated in the class.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
cf0c5a30f7 Debrid: Migrate common arrays to their API classes
Add convenience vars which makes the API classes the source of truth
for any interaction.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
96a6722e65 Debrid: Fix RealDebrid download handling
The torrent ID is no longer stored in the DebridManager.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:35 -05:00
kingbri
0caf8a8120 Debrid: Add common functions for existing magnets/downloads
This fixes cloud magnet fetching and also doesn't duplicate magnets
inside the cloud service. Unrestricted links don't get duplicated,
so no need to check against those.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-16 15:00:06 -05:00
kingbri
273403b711 Debrid: Remove per-API IA structures
These aren't required since IA is a unified type. Only keep batch
IA for RealDebrid since it helps clear up confusion when gathering
InstantAvailability results.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-03 16:27:47 -04:00
kingbri
f9ecc746a1 Tree: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-03 16:25:32 -04:00
kingbri
c641fdf300 Debrid: Add source to all models
Gives an ID of where the struct came from.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-03 16:24:07 -04:00
kingbri
f902142fee Debrid: Add Premiumize to InstantAvailability
Also add the requirement to the protocol.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-03 16:15:17 -04:00
kingbri
37ef64224e Debrid: Order API implementations
Reorder everything and mark off where different functions are located.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-03 16:00:40 -04:00
kingbri
9e306eff1e Debrid: Add protocol for cloud handling
Cloud downloads and torrents are now unified under their own
protocol and models. Downloads and torrents are separated.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-03 15:46:18 -04:00
kingbri
37450ef979 Debrid: Add InstantAvailability and download to protocol
Unify IA into a passable client side structure and add a common
download method to the DebridSource protocol.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-02 23:08:05 -04:00
kingbri
0fe1cbc888 Debrid: Begin using common protocols
Unifying the debrid services under a protocol will help slim down
on excess redundant code and allow for easy addition of new services
in the future.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-02 12:31:19 -04:00
kingbri
2e746320cf NavView: Switch to NavigationStack for iOS 17 and up
iOS 17 fixes the issues that NavigationStack had with iOS 16. This
means that futureproofing is fixed.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-08-27 01:14:26 -04:00
kingbri
13a40a237a Premiumize: Fix DDL fetching and debrid IA handling
Signed-off-by: kingbri <bdashore3@proton.me>
2023-08-26 11:29:19 -04:00
kingbri
46e0687bd7 Scraping: Add new source methods
Some sources can be unique and require some extra parsing. Add the
ability to extract a magnet link instead of assuming that every
source provides a properly formatted one.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-06-06 20:09:43 -04:00
kingbri
b8978fd29c Premiumize: Fix API key usage
PM has a different method to handle API keys compared to other services
which takes the value as an authorization header.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-05-02 14:44:03 -04:00
kingbri
cc550dd208 Debrid: Various updates to API and settings
Debrid services can change their APIs at any time which negatively
impacts user experiences on Ferrite.

Add the following:
- Ability for a user to add a manually generated API key only showing the
last 4 characters for security purposes.
- Make ephemeral auth sessions toggle-able. ASWebAuthenticationView does
not automatically clear on toggle change.
- Add the savedLinks endpoint for AllDebrid so users can access their
downloads and magnets.
- Add a links section to AD's cloud view.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-05-01 18:07:15 -04:00
kingbri
d8db3e0cc8 Ferrite: Bump version
Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-23 15:57:32 -04:00
kingbri
3606dbb6ff Settings: Fix focus for fields
Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-23 15:57:18 -04:00
kingbri
9e362c14b7 Ferrite: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-23 15:43:45 -04:00
kingbri
76a0262a14 Filters: Fix label with single value pickers
Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-23 15:43:45 -04:00
kingbri
468d89b983 Scraping: Add configurable URLRequest timeout
Some websites and networks may be slow. Add the option to override
the request timeout of 15 seconds for search requests.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-23 15:43:42 -04:00
kingbri
45900d6456 SecureField: Fix keyboard focus when showing password
Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-23 15:14:12 -04:00
kingbri
5232ddfc97 Filter: Add multi-select picker and change picker style
The default SwiftUI picker is too limited for Ferrite's purposes.
Switch to a custom implementation for UI consistency.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-23 15:14:12 -04:00
kingbri
f7d2f1ce60 Filters: Add result sorting
Sort by seeders, leechers, and size. Also supports ascending and
descending options.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-23 15:14:12 -04:00
kingbri
dc3014095c Search/Lists: Fix UI issues and appearance
The search bar sometimes had the scope bar added twice if a toolbar
was present (probably caused a refresh of the navigationTitle).

Rather than figuring out a hacky swiftUI solution to solve this,
add a check to enforce only one HostingViewController in the
scope bar.

Also migrate the inlinedList modifier to use safeAreaInsets from
native SwiftUI. Keep the introspected modifier for negative values.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-23 15:14:09 -04:00
kingbri
df534327e5 Scraping: Fix JSON scraping with subResults
SubResults were nullified by new title and magnet checks since they
were removed on the first pass.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-12 18:13:09 -04:00
kingbri
1d89b9519d Filters: Fix animations and add clear all button
Filters are more comprehensive and responsive to how many filters
are stored and if a user should clear all of them or not.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-12 18:13:09 -04:00
kingbri
8123fd8d0c Filters: Add debrid cache status option
Items can now be filtered based if they're present in the debrid cache,
are a batch file, or not present at all.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-04-12 18:13:09 -04:00