Commit graph

22 commits

Author SHA1 Message Date
kingbri
ecdd0199f6 Tree: Cleanup access levels
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>
2024-06-16 15:00:35 -05:00
kingbri
42e202b207 Plugins: Add request options to sources
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>
2024-06-16 15:00:35 -05:00
kingbri
d918039810 Plugins: Add website and about properties
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>
2023-04-02 14:53:22 -04:00
kingbri
51366f3215 Sources: Don't require searchUrl in HTML parser
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>
2023-04-01 23:19:15 -04:00
kingbri
2cf6e46422 Sources: Improve regex and require title
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>
2023-04-01 14:12:43 -04:00
kingbri
87d94e4c35 Plugins: Fix animation and appearance
Switching to a list that changes state on updates caused sheets
to break when animating. Place the list in a container ZStack
that doesn't break sheet presentation.

Also modernize the plugin installation buttons and make the catalog
buttons include the plugin list name which should help prevent
duplication.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-24 14:37:52 -04:00
kingbri
69d2f6babe Actions: Add OS-specific checks
Plugin lists are universal across clients and OS-specific cases
should be appropriately handled.

OSes can now be added to the deeplink action case and Ferrite scans
for either iOS-specific or fallthrough actions.

There must be 1 action that corresponds to an OS and/or 1 fallback
case, otherwise the action will not show in the plugins list.

Also remove some extraneous files.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-19 21:24:24 -04:00
kingbri
438e48be66 Ferrite: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2023-03-03 15:09:34 -05:00
kingbri
88a2dc9742 Sources: Add subName and fixup
The subName parameter is for aggregate sources that pull from a
child website. Make it so it's possible to include that child
site in parsers.

Also remove the magnet link/hash requirement since it's filtered out
anyways after results are fetched.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-08 22:33:27 -05:00
kingbri
4512318e8f Ferrite: Add actions, plugins, and tags
Plugins are now a unified format for both sources and actions. Actions
dictate what to do with a link and can now be added through a plugin
JSON file.

Backups have also been versioned to improve performance and add action
support.

Tags are used to give small amounts of information before a user
installs a plugin.

Signed-off-by: kingbri <bdashore3@proton.me>
2023-02-08 12:09:37 -05:00
kingbri
a89e832d1c Ferrite: Concurrency, cleanup, and format
Use strict concurrency checking in Xcode 14 to find misuses with
Swift concurrency.

Cleanup files and rearrange them along with fixing comment headers.

Signed-off-by: kingbri <bdashore3@proton.me>
2022-10-05 10:48:02 -04:00
kingbri
1761f8dfb4 Debrid: Add loading indicator and fix iOS <14.5 issues
When a search result is selected, there is usually a delay due to
the debrid dance of API routes for grabbing a download link to stream.
Add a loading indicator and prevent any other tasks from loading
unless the user cancels it.

iOS 14.5 was a huge update which added many QoL SwiftUI changes that
are consistent to modern iOS versions.

However, Ferrite supports iOS versions less than 14.5, mainly 14.3.
More fixes had to be added to make sure UI is consistent across
all OS versions.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 18:47:02 -04:00
kingbri
62f1717c83 Sources: Add a minimum app version check
If a minimum app version is specified, certain app versions cannot
use a source until the user is updated to the supported app version.

This does not require any changes to CoreData.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 18:47:02 -04:00
kingbri
79d88ffab6 Sources: Add fallback URLs
If a website times out, use the fallback options. The data URL
request now has a hard timeout of 15 seconds.

This only works for the base URL of a source, if an RSS url or
API url is provided, fallback URLs won't be used and the request
will fail.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 18:47:02 -04:00
kingbri
e0182a700f Sources: Add website API support
Adds support for website APIs both complex and simple. This commit
only supports GET requests to APIs. POST request support can be added
on request.

Client IDs and secrets are also supported. They can be added via
source settings or automatically set by a website endpoint.

Also fetch sources for scraping using the backgroundContext and remove
some functions from using the main actor.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 18:47:02 -04:00
kingbri
cab6eb3bb6 Sources: Allow for dynamic properties and basic API usage
Some sources are self-hosted and require unique keys and sever
addresses.

Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-31 00:41:38 -04:00
kingbri
3907f23fec Sources: Add list IDs and source IDs
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>
2022-08-31 00:41:38 -04:00
kingbri
bf70b436db Sources: Change version to Int16
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>
2022-08-31 00:41:38 -04:00
kingbri
064a68fbb2 Sources: Add RSS, descriptions, and settings
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>
2022-08-31 00:41:38 -04:00
kingbri
940f8337a5 Ferrite: Overhaul sources
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>
2022-08-31 00:41:38 -04:00
kingbri
9d5a0d0120 Ferrite: Format
Signed-off-by: kingbri <bdashore3@gmail.com>
2022-08-04 21:33:59 -04:00
kingbri
1eef8202ca Ferrite: Decouple torrent sources
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>
2022-08-04 21:33:59 -04:00