Different services can send different statuses for if a file is
cached or not. Therefore, make this scoped to the debrid service
rather than expecting everything to state "downloaded".
Also it feels pretty blank if the disclosure groups are gone when
a cloud array is empty, so remove those checks.
Signed-off-by: kingbri <bdashore3@proton.me>
Populate cloud lists when the app is launched to begin maintainence
of a synced list. In addition, fix the errors when OffCloud tried
fetching links for a single file. The explore endpoint only works
when the file is a batch which is unknown until it's actually called.
Signed-off-by: kingbri <bdashore3@proton.me>
If a debrid is authorized, a Published variable needs to be notified
since SwiftUI can't read computed properties on the fly (they are
getters). Therefore, it's better to maintain a single source of truth
of which services are logged in.
Signed-off-by: kingbri <bdashore3@proton.me>
TorBox can now show if there's a batch before loading a file.
Cloud downloads should check the server in case there's a different
method to fetch a download link.
Signed-off-by: kingbri <bdashore3@proton.me>
- AllDebrid: Don't throw an empty error if cloud downloads/torrents
is empty
- Fix history not saving with the proper URLs
- Fix the HTMLParser looking at the incorrect term for seedLeech
Signed-off-by: kingbri <bdashore3@proton.me>
OffCloud is a debrid provider that allows for caching and playing
media. Does not have rich debrid support.
Also add a handler if functionality isn't implemented in the service.
Signed-off-by: kingbri <bdashore3@proton.me>
The task can be set to nil after completion, and the unrestrict
flag should also be set to nil when the batch sheet is dismissed.
Signed-off-by: kingbri <bdashore3@proton.me>
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>