Commit graph

241 commits

Author SHA1 Message Date
kingbri
aaf12e28e2 Update README
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
935f3d1ea4 Debrid: Make TorBox a rich service and fix cloud downloads
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>
2024-06-19 16:40:26 -05:00
kingbri
e0510ca924 Update README
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
8f84508e03 Debrid: Add description field and cleanup
Allow for overriding of the default description in the settings UI.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
8e20d6c76d Update README and add media
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
d47d535b16 Tree: Fix various bugs
- 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>
2024-06-19 16:40:26 -05:00
kingbri
02fca1502d Debrid: Add OffCloud support
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>
2024-06-19 16:40:26 -05:00
kingbri
aa0712b967 Debrid: Fix cleanup of unrestrict and task
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>
2024-06-19 16:40:26 -05:00
kingbri
e14c684b5f Tree: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
c4edd5f687 Tree: Remove OffCloud references
Was an experiment for later commits.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
4cee7a15ec Debrid: Add TorBox support
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>
2024-06-19 16:40:26 -05:00
kingbri
0f69b92540 Debrid: Add split for download and unrestrict
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>
2024-06-19 16:40:26 -05:00
kingbri
e46e115244 Debrid: Add alert if there's no web login option
Indicates to the user that an API must be used to log into the debrid
service.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
15651eb695 Debrid: Reorder protocol
Helps when auto-filling stubs for new classes.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
8c9bb4a699 Revert "Extension: Remove Set warning"
This reverts commit cf090cfaa61acef5ff43f9f261764b0a125411f8.
2024-06-19 16:40:26 -05:00
kingbri
4ecc9d9ee7 Ferrite: Update project settings
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
905943330f 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-19 16:40:26 -05:00
kingbri
1289c24fa5 Extension: Remove Set warning
This will be removed in the future anyway.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
d0f1f70d60 Sources: Add queryFirstLetter param
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>
2024-06-19 16:40:26 -05:00
kingbri
ff57c90a62 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-19 16:40:26 -05:00
kingbri
17ac5f8534 Actions: Update to latest
Bump actions and macos build versions.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
8755009ad4 Debrid: Fix UI updates for IA
Hook to the published variable to push updates.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
0ad2ba5cf2 Premiumize: Fix service-specific errors
This parameter should be optional and errors if it isn't.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
1d928b9a36 Logging: Improve generic error message
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>
2024-06-19 16:40:26 -05:00
kingbri
457d938be8 Tree: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
5b4cef7ef0 Debrid: Migrate auth to protocol
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>
2024-06-19 16:40:26 -05:00
kingbri
eeb9cbdf65 Debrid: Unify cloud views
Cloud torrents and downloads are unified with the new protocol.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
694a2bfdf1 Debrid: Remove more redundant vars
the IA vars are no longer needed since that's unified.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
7e83a47050 Debrid: Migrate preferred service setter
PreferredService is now the debrid ID.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
b6a1179d1b Debrid: Remove separated download functions
No longer needed due to the common type.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
d54a2b4e37 Debrid: Remove redundant logout functions
Logout is now handled in the debrid class itself.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
f00ffb1b8c Debrid: Fix cache alert
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>
2024-06-19 16:40:26 -05:00
kingbri
fa8e5c19c3 Debrid: Swap to common DebridError
Removes the redundant error types.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
aa739133be Debrid: Refactor IA and download functions
Use the common protocol to handle these.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
7d5cdc5d06 Debrid: Remove ID storage
Storing an ID reference is redundant. Store a class reference
instead.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
5120b3e576 Debrid: Migrate more components to the protocol
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>
2024-06-19 16:40:26 -05:00
kingbri
2db5273ec4 Debrid: Allow for UI updates
Mark as an ObservableObject so the UI can see parameters that are
being updated in the class.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
6a3733ca9a Debrid: Migrate common arrays to their API classes
Add convenience vars which makes the API classes the source of truth
for any interaction.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
1c21f563e2 Debrid: Fix RealDebrid download handling
The torrent ID is no longer stored in the DebridManager.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
2d220045c6 Debrid: Add common functions for existing magnets/downloads
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>
2024-06-19 16:40:26 -05:00
kingbri
551083f521 Debrid: Remove per-API IA structures
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>
2024-06-19 16:40:26 -05:00
kingbri
11dd2cabb6 Tree: Format
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
3435e929d8 Debrid: Add source to all models
Gives an ID of where the struct came from.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
5eb1158456 Debrid: Add Premiumize to InstantAvailability
Also add the requirement to the protocol.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
fd9eb080be Debrid: Order API implementations
Reorder everything and mark off where different functions are located.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
cf58626384 Debrid: Add protocol for cloud handling
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>
2024-06-19 16:40:26 -05:00
kingbri
69a9d30475 Debrid: Add InstantAvailability and download to protocol
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>
2024-06-19 16:40:26 -05:00
kingbri
b8a225e141 Debrid: Begin using common protocols
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>
2024-06-19 16:40:26 -05:00
kingbri
b1227db143 NavView: Switch to NavigationStack for iOS 17 and up
iOS 17 fixes the issues that NavigationStack had with iOS 16. This
means that futureproofing is fixed.

Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00
kingbri
20f500fb64 Premiumize: Fix DDL fetching and debrid IA handling
Signed-off-by: kingbri <bdashore3@proton.me>
2024-06-19 16:40:26 -05:00