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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>