If a user searched after cancelling the search the first time,
the first search would still continue.
Assign the search task to navigation view and automatically cancel
it and dismiss the searchbar when the user switches to a different
tab.
Also add a ProgressView to show which source is being parsed.
Signed-off-by: kingbri <bdashore3@gmail.com>
Sources can now be updated based on the repo ID. To preserve repo IDs
across single URL links, the source lists can be edited and the ID
is transferred over.
Signed-off-by: kingbri <bdashore3@gmail.com>
List IDs are used to link a source list with an actual source. Each
list entry has a unique ID that a user can compare with a source
to see if it's legitimate.
Source IDs are just identifiers for sources. Not sure what to do with
these yet but they may be useful for the future.
Signed-off-by: kingbri <bdashore3@gmail.com>
A version string will not allow for comparisions when checking
to update a source. Make the type an integer instead on both the
model and coredata store.
Signed-off-by: kingbri <bdashore3@gmail.com>
RSS parsing has been added as a method to parse source since they're
easier on the website's end to parse.
Source settings have been added. The only current setting is the fetch
mode which selects which parser/scraper to use. By default, if an RSS
parser is found, it's selected.
A source now has info shown regarding versioning and authorship. A source
list's repository name and author string are now required.
Signed-off-by: kingbri <bdashore3@gmail.com>
Sources are now completely changed to use a more flexible API. This
uses a fully native source system, so there will be 0 overhead on
resource usage and performance.
JSON objects specify what is fetched and displayed by Ferrite when
searching torrents.
Sources now include sizes, seeders, and leechers for any site that
specifies them.
The versioning and repo naming framework has been added, but will be
displayed in another update.
API support will be included in another update.
Signed-off-by: kingbri <bdashore3@gmail.com>
Last-child is not supported on SwiftSoup, but nth-last-child is.
Therefore, sources must use nth-child or nth-last-child instead of
the first-child and last-child aliases.
Signed-off-by: kingbri <bdashore3@gmail.com>
Add a ListRowButtonView which runs a function and include a label.
Use this to style magnet choice buttons.
Signed-off-by: kingbri <bdashore3@gmail.com>
WebTor is a website to view magnet links on the web for free. It
has an API to include magnets, so why not?
Suggested by BlackSwordsman in Discord.
Signed-off-by: kingbri <bdashore3@gmail.com>
In iOS 15, a searchbar will become inherited if a sheet call is
within the searchable view and its children.
Migrate the sheet call outside the search results view.
Signed-off-by: kingbri <bdashore3@gmail.com>
I was accidentally calling dismiss on failure which dismisses the
alert and breaks how presentation is handled on sheets.
Signed-off-by: kingbri <bdashore3@gmail.com>
These sources will be converted to be more flexible with JavaScript
in the future.
The source catalog is populated by adding a source list in settings
then installing a source from the catalog.
Sources can be enabled or disabled when using Ferrite.
Signed-off-by: kingbri <bdashore3@gmail.com>
Batch torrents are torrents that have multiple files bundled within
one torrent file.
RealDebrid does support these, but it is difficult to get them to work.
The main flow requires setting a specific combination in RealDebrid
to allow for link generation. However, this is not intuitive to users
and is bad API design on RealDebrid's part.
Ferrite's implementation presents users with all the possible files
from batches (duplicates deleted) and selects the user-chosen file
to download. That way, only the user chosen file is presented to
play on an external video player.
This still needs work for optimization purposes, but this commit
does produce a working build.
Signed-off-by: kingbri <bdashore3@gmail.com>
The instantAvailability endpoint is now decoded using Codable
and does not have any ambiguity.
Batches are now checked, but still not accounted for due to how
RD handles batches from this endpoint. All batch links are not
supported for instant streaming from Ferrite until support is added.
Thanks to Skitty for helping out with decoding the endpoint.
Signed-off-by: kingbri <bdashore3@gmail.com>
Every request has to add an authentication header. If the response
is 401 (Unauthorized), log the user out of RealDebrid.
Signed-off-by: kingbri <bdashore3@gmail.com>