TorBox is a service that handles magnet links under both a free
and paid plan. Integrate support into Ferrite. Will add rich services
once the instantAvailability endpoint returns a file list.
Signed-off-by: kingbri <bdashore3@proton.me>
Some debrid services aren't "rich", which means that they don't
broadcast whether an instantly available torrent is a batch or a
single file. This results in all torrents either having the green
badge or red badge based on what hash is given.
However, batches need to intercept the download itself which requires
the download function to be split into download and unrestrict. In
between, there's room for the batch sheet to act.
Signed-off-by: kingbri <bdashore3@proton.me>
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>