RealDebrid saves a user's unrestricted links and "torrents" (magnet links in this case). Add the ability to see and queue a user's RD library in Ferrite itself. This required a further abstraction of the debrid manager to allow for more types other than search results to be passed to various functions. Deleting an item from RD's cloud list deletes the item from RD as well. NOTE: This does not track download progress, but it does show if a magnet is currently being downloaded or not. Signed-off-by: kingbri <bdashore3@proton.me>
42 lines
845 B
Swift
42 lines
845 B
Swift
//
|
|
// BackupModels.swift
|
|
// Ferrite
|
|
//
|
|
// Created by Brian Dashore on 9/17/22.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
public struct Backup: Codable {
|
|
var bookmarks: [BookmarkJson]?
|
|
var history: [HistoryJson]?
|
|
var sourceNames: [String]?
|
|
var sourceLists: [SourceListBackupJson]?
|
|
}
|
|
|
|
// MARK: - CoreData translation
|
|
|
|
typealias BookmarkJson = SearchResult
|
|
|
|
// Date is an epoch timestamp
|
|
struct HistoryJson: Codable {
|
|
let dateString: String?
|
|
let date: Double
|
|
let entries: [HistoryEntryJson]
|
|
}
|
|
|
|
struct HistoryEntryJson: Codable {
|
|
var name: String? = nil
|
|
var subName: String? = nil
|
|
var url: String? = nil
|
|
var timeStamp: Double? = nil
|
|
let source: String?
|
|
}
|
|
|
|
// Differs from SourceListJson
|
|
struct SourceListBackupJson: Codable {
|
|
let name: String
|
|
let author: String
|
|
let id: String
|
|
let urlString: String
|
|
}
|