Tree: Format

Signed-off-by: kingbri <bdashore3@proton.me>
This commit is contained in:
kingbri 2024-06-03 16:25:32 -04:00
parent c641fdf300
commit f9ecc746a1
5 changed files with 22 additions and 24 deletions

View file

@ -279,7 +279,7 @@ public class AllDebrid: PollingDebridSource {
fileName: magnetResponse.filename,
status: magnetResponse.status,
hash: magnetResponse.hash,
links: magnetResponse.links.map { $0.link }
links: magnetResponse.links.map(\.link)
)
}

View file

@ -190,7 +190,7 @@ public class Premiumize: OAuthDebridSource {
return DebridIA(
magnet: magnet,
source: self.id,
source: id,
expiryTimeStamp: Date().timeIntervalSince1970 + 300,
files: files
)
@ -331,10 +331,8 @@ public class Premiumize: OAuthDebridSource {
// No user torrents for Premiumize
public func getUserTorrents() async throws -> [DebridCloudTorrent] {
return []
[]
}
public func deleteTorrent(torrentId: String) async throws {
return
}
public func deleteTorrent(torrentId: String) async throws {}
}

View file

@ -272,7 +272,7 @@ public class RealDebrid: PollingDebridSource {
availableHashes.append(
DebridIA(
magnet: Magnet(hash: hash, link: nil),
source: self.id,
source: id,
expiryTimeStamp: Date().timeIntervalSince1970 + 300,
files: files
)
@ -281,7 +281,7 @@ public class RealDebrid: PollingDebridSource {
availableHashes.append(
DebridIA(
magnet: Magnet(hash: hash, link: nil),
source: self.id,
source: id,
expiryTimeStamp: Date().timeIntervalSince1970 + 300,
files: []
)

View file

@ -572,26 +572,26 @@ public class DebridManager: ObservableObject {
func fetchRdDownload(magnet: Magnet?, existingLink: String?) async {
// If an existing link is passed in args, set it to that. Otherwise, find one from RD cloud.
/*
let torrentLink: String?
if let existingLink {
torrentLink = existingLink
} else {
// Bypass the TTL for up to date information
await fetchRdCloud(bypassTTL: true)
let torrentLink: String?
if let existingLink {
torrentLink = existingLink
} else {
// Bypass the TTL for up to date information
await fetchRdCloud(bypassTTL: true)
let existingTorrent = realDebridCloudTorrents.first { $0.hash == selectedRealDebridItem?.magnet.hash && $0.status == "downloaded" }
torrentLink = existingTorrent?.links[safe: selectedRealDebridFile?.batchFileIndex ?? 0]
}
*/
let existingTorrent = realDebridCloudTorrents.first { $0.hash == selectedRealDebridItem?.magnet.hash && $0.status == "downloaded" }
torrentLink = existingTorrent?.links[safe: selectedRealDebridFile?.batchFileIndex ?? 0]
}
*/
do {
// If the links match from a user's downloads, no need to re-run a download
/*
if let torrentLink,
let downloadLink = await checkRdUserDownloads(userTorrentLink: torrentLink)
{
downloadUrl = downloadLink
} else */
if let torrentLink,
let downloadLink = await checkRdUserDownloads(userTorrentLink: torrentLink)
{
downloadUrl = downloadLink
} else */
if let magnet {
let downloadLink = try await realDebrid.getDownloadLink(
magnet: magnet, ia: selectedRealDebridItem, iaFile: selectedRealDebridFile

View file

@ -18,7 +18,7 @@ struct RealDebridCloudView: View {
Group {
DisclosureGroup("Downloads") {
ForEach(debridManager.realDebridCloudDownloads.filter {
searchText.isEmpty ? true : $0.fileName .lowercased().contains(searchText.lowercased())
searchText.isEmpty ? true : $0.fileName.lowercased().contains(searchText.lowercased())
}, id: \.self) { cloudDownload in
Button(cloudDownload.fileName) {
navModel.resultFromCloud = true