yattee/Model/ManifestedInstance.swift

31 lines
680 B
Swift
Raw Normal View History

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 {
2022-12-09 00:15:19 +00:00
.init(app: app, name: "Public - \(country)", apiURLString: url.absoluteString)
}
var location: String {
"\(flag) \(country)"
}
var anonymousAccount: Account {
.init(
id: UUID().uuidString,
app: app,
name: location,
2022-12-09 00:15:19 +00:00
urlString: url.absoluteString,
anonymous: true,
country: country,
region: region
)
}
}