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>
Make searchText a local variable passed to ScrapingModel to prevent
extreme keyboard lag and CPU usage when tracking this EnvironmentObject.
Signed-off-by: kingbri <bdashore3@proton.me>
Make it so that when a user chooses a source to filter, only filter
that specific source when a search occurs.
Also fix the "no results found" overlay text by checking if the
search bar textfield is being edited or not by modifiying ESSearchable.
Signed-off-by: kingbri <bdashore3@proton.me>
ExpandedSearchable opens up the capabilities of the SwiftUI searchable
modifier and allows for additions of more properties such as custom
scope bars.
Since this is a reimplementation of UISearchController, changes
to SwiftUI should not affect search bars that rely on the scope bar
to always be present.
Signed-off-by: kingbri <bdashore3@proton.me>
Place refreshable in the individual lists instead of in the parent
ZStack as that applies to sheets as well.
Signed-off-by: kingbri <bdashore3@proton.me>
These will serve as descriptions for a plugin which will be displayed
in the Plugin Info screen.
website has also replaced baseUrl and dynamicWebsite has replaced
dynamicBaseUrl
Signed-off-by: kingbri <bdashore3@proton.me>
searchURL used to be a required variable in HTML parsers, but some
HTML sources can be single page which means that a search URL isn't
required.
Also make regex matching case insensitive along with adding anchors
to match newlines.
Signed-off-by: kingbri <bdashore3@proton.me>
YAML is a modern configuration format which is human readable
and supports more conventions than JSON.
However, some people may still prefer to write in JSON, so add the
option for users to write legacy JSON if they want to and to provide
backwards compatability with older plugins.
Signed-off-by: kingbri <bdashore3@proton.me>
Make searchbars adhere to autocorrect and fix the random search prompts
not applying by moving functionality to a ViewModel.
Also add a searchbar in the batch choice sheet.
Signed-off-by: kingbri <bdashore3@proton.me>
Titles are now required as an entry without a title shouldn't be
featured. Support via regex is now added for matching along with
splicing strings via capture groups.
If a capture group isn't present, assume that a contains check
is occurring.
Also migrate back to searchText being located in scrapingModel.
Signed-off-by: kingbri <bdashore3@proton.me>