mirror of
https://github.com/Ferrite-iOS/Ferrite.git
synced 2026-01-11 20:10:27 +00:00
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>
This commit is contained in:
parent
80e966512a
commit
5223c60acd
3 changed files with 10 additions and 26 deletions
|
|
@ -307,10 +307,6 @@ class AllDebrid: PollingDebridSource, ObservableObject {
|
|||
let data = try await performRequest(request: &request, requestName: #function)
|
||||
let rawResponse = try jsonDecoder.decode(ADResponse<MagnetStatusResponse>.self, from: data).data
|
||||
|
||||
if rawResponse.magnets.isEmpty {
|
||||
throw DebridError.EmptyData
|
||||
}
|
||||
|
||||
cloudTorrents = rawResponse.magnets.map { magnetResponse in
|
||||
DebridCloudTorrent(
|
||||
torrentId: String(magnetResponse.id),
|
||||
|
|
@ -342,10 +338,6 @@ class AllDebrid: PollingDebridSource, ObservableObject {
|
|||
let data = try await performRequest(request: &request, requestName: #function)
|
||||
let rawResponse = try jsonDecoder.decode(ADResponse<SavedLinksResponse>.self, from: data).data
|
||||
|
||||
if rawResponse.links.isEmpty {
|
||||
throw DebridError.EmptyData
|
||||
}
|
||||
|
||||
// The link is also the ID
|
||||
cloudDownloads = rawResponse.links.map { link in
|
||||
DebridCloudDownload(
|
||||
|
|
|
|||
|
|
@ -920,7 +920,7 @@ class ScrapingViewModel: ObservableObject {
|
|||
)
|
||||
}
|
||||
|
||||
if let leecherQuery = seederLeecher.seeders {
|
||||
if let leecherQuery = seederLeecher.leechers {
|
||||
leechers = try? runHtmlComplexQuery(
|
||||
row: row,
|
||||
query: leecherQuery,
|
||||
|
|
|
|||
|
|
@ -28,15 +28,15 @@ struct SearchResultButtonView: View {
|
|||
navModel.selectedTitle = result.title ?? ""
|
||||
navModel.resultFromCloud = false
|
||||
|
||||
var historyEntry = HistoryEntryJson(
|
||||
name: result.title,
|
||||
source: result.source
|
||||
)
|
||||
|
||||
switch debridIAStatus ?? debridManager.matchMagnetHash(result.magnet) {
|
||||
case .full:
|
||||
if debridManager.selectDebridResult(magnet: result.magnet) {
|
||||
debridManager.currentDebridTask = Task {
|
||||
let historyEntry = HistoryEntryJson(
|
||||
name: result.title,
|
||||
url: debridManager.downloadUrl,
|
||||
source: result.source
|
||||
)
|
||||
await debridManager.fetchDebridDownload(magnet: result.magnet)
|
||||
|
||||
// Bump to batch
|
||||
|
|
@ -48,6 +48,7 @@ struct SearchResultButtonView: View {
|
|||
}
|
||||
|
||||
if !debridManager.downloadUrl.isEmpty {
|
||||
historyEntry.url = debridManager.downloadUrl
|
||||
PersistenceController.shared.createHistory(historyEntry, performSave: true)
|
||||
|
||||
pluginManager.runDefaultAction(
|
||||
|
|
@ -63,21 +64,12 @@ struct SearchResultButtonView: View {
|
|||
}
|
||||
case .partial:
|
||||
if debridManager.selectDebridResult(magnet: result.magnet) {
|
||||
navModel.selectedHistoryInfo = HistoryEntryJson(
|
||||
name: result.title,
|
||||
source: result.source
|
||||
)
|
||||
navModel.selectedHistoryInfo = historyEntry
|
||||
navModel.currentChoiceSheet = .batch
|
||||
}
|
||||
case .none:
|
||||
PersistenceController.shared.createHistory(
|
||||
HistoryEntryJson(
|
||||
name: result.title,
|
||||
url: result.magnet.link,
|
||||
source: result.source
|
||||
),
|
||||
performSave: true
|
||||
)
|
||||
historyEntry.url = result.magnet.link
|
||||
PersistenceController.shared.createHistory(historyEntry, performSave: true)
|
||||
|
||||
pluginManager.runDefaultAction(
|
||||
urlString: result.magnet.link,
|
||||
|
|
|
|||
Loading…
Reference in a new issue