mirror of
https://github.com/yattee/yattee.git
synced 2025-10-11 01:48:12 +00:00
Locations manifest, reorganized instances settings
This commit is contained in:
30
Model/ManifestedInstance.swift
Normal file
30
Model/ManifestedInstance.swift
Normal file
@@ -0,0 +1,30 @@
|
||||
import Foundation
|
||||
|
||||
struct ManifestedInstance: Identifiable, Hashable {
|
||||
let id = UUID().uuidString
|
||||
let app: VideosApp
|
||||
let country: String
|
||||
let region: String
|
||||
let flag: String
|
||||
let url: URL
|
||||
|
||||
var instance: Instance {
|
||||
.init(app: app, name: "Public - \(country)", apiURL: url.absoluteString)
|
||||
}
|
||||
|
||||
var location: String {
|
||||
"\(flag) \(country)"
|
||||
}
|
||||
|
||||
var anonymousAccount: Account {
|
||||
.init(
|
||||
id: UUID().uuidString,
|
||||
app: app,
|
||||
name: location,
|
||||
url: url.absoluteString,
|
||||
anonymous: true,
|
||||
country: country,
|
||||
region: region
|
||||
)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user