first commit

This commit is contained in:
JinJiangHuang
2026-03-01 14:04:44 +08:00
commit 61e97da938
62 changed files with 9947 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
import Foundation
/// - Android SourceBean.java
struct SourceBean: Codable, Identifiable, Hashable {
var id: String { key }
let key: String
let name: String
let api: String
let searchable: Int // 0: 1:
let filterable: Int // 0: 1:
let playerType: Int // 0: 1:IJK 2:EXO
let type: Int // 0:xml 1:json 3:jar 4:remote
let ext: String?
init(key: String = "", name: String = "", api: String = "",
searchable: Int = 1, filterable: Int = 1,
playerType: Int = 0, type: Int = 1, ext: String? = nil) {
self.key = key
self.name = name
self.api = api
self.searchable = searchable
self.filterable = filterable
self.playerType = playerType
self.type = type
self.ext = ext
}
var isSearchable: Bool { searchable == 1 }
var isFilterable: Bool { filterable == 1 }
/// Swift type=3 JAR/Spider Java
var isSupportedInSwift: Bool {
return type == 0 || type == 1 || type == 4
}
///
var typeDescription: String {
switch type {
case 0: return "XML"
case 1: return "JSON"
case 3: return "JAR"
case 4: return "Remote"
default: return "未知"
}
}
/// api HTTP URL
var isHttpApi: Bool {
return api.hasPrefix("http://") || api.hasPrefix("https://")
}
}