This commit is contained in:
Arkadiusz Fal
2022-05-20 21:53:17 +02:00
parent 794ba2f7ec
commit d99462acf8
7 changed files with 15 additions and 15 deletions

View File

@@ -53,7 +53,7 @@ final class InstancesModel: ObservableObject {
}
static func remove(_ instance: Instance) {
let accounts = InstancesModel.accounts(instance.id)
let accounts = Self.accounts(instance.id)
if let index = Defaults[.instances].firstIndex(where: { $0.id == instance.id }) {
Defaults[.instances].remove(at: index)
accounts.forEach { AccountsModel.remove($0) }

View File

@@ -160,11 +160,11 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
}
private func pathPattern(_ path: String) -> String {
"**\(InvidiousAPI.basePath)/\(path)"
"**\(Self.basePath)/\(path)"
}
private func basePathAppending(_ path: String) -> String {
"\(InvidiousAPI.basePath)/\(path)"
"\(Self.basePath)/\(path)"
}
private var cookieHeader: String {
@@ -172,11 +172,11 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
}
var popular: Resource? {
resource(baseURL: account.url, path: "\(InvidiousAPI.basePath)/popular")
resource(baseURL: account.url, path: "\(Self.basePath)/popular")
}
func trending(country: Country, category: TrendingCategory?) -> Resource {
resource(baseURL: account.url, path: "\(InvidiousAPI.basePath)/trending")
resource(baseURL: account.url, path: "\(Self.basePath)/trending")
.withParam("type", category?.name)
.withParam("region", country.rawValue)
}
@@ -186,7 +186,7 @@ final class InvidiousAPI: Service, ObservableObject, VideosAPI {
}
var feed: Resource? {
resource(baseURL: account.url, path: "\(InvidiousAPI.basePath)/auth/feed")
resource(baseURL: account.url, path: "\(Self.basePath)/auth/feed")
}
var subscriptions: Resource? {

View File

@@ -13,7 +13,7 @@ final class SponsorBlockAPI: ObservableObject {
@Published var segments = [Segment]()
static func categoryDescription(_ name: String) -> String? {
guard SponsorBlockAPI.categories.contains(name) else {
guard Self.categories.contains(name) else {
return nil
}
@@ -30,7 +30,7 @@ final class SponsorBlockAPI: ObservableObject {
}
static func categoryDetails(_ name: String) -> String? {
guard SponsorBlockAPI.categories.contains(name) else {
guard Self.categories.contains(name) else {
return nil
}