mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 23:02:04 +00:00
Allow importing account-less legacy instances as sources
Legacy v1 instances without an account had no import path after the switch to explicit account review. Surface them in a separate "Sources" section of the legacy import view where they can be added with a single tap (no sign-in) or removed, mirroring the accounts flow. Instances tied to an account stay in the Accounts section and are not duplicated. Detection now gates the entry points and first-launch prompt on any legacy data (accounts or sources), not accounts alone.
This commit is contained in:
@@ -173,3 +173,35 @@ struct LegacyAccountImportItem: Identifiable, Sendable {
|
||||
return url.host ?? url.absoluteString
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - Legacy Instance Import Item
|
||||
|
||||
/// Represents a legacy instance (source) that can be re-created without signing in.
|
||||
/// Used for v1 instances that have no associated account.
|
||||
struct LegacyInstanceImportItem: Identifiable, Sendable {
|
||||
/// The original v1 instance ID.
|
||||
let legacyInstanceID: String
|
||||
|
||||
/// The type of instance.
|
||||
let instanceType: InstanceType
|
||||
|
||||
/// The instance URL.
|
||||
let url: URL
|
||||
|
||||
/// User-defined instance name, if any.
|
||||
let instanceName: String?
|
||||
|
||||
/// Whether this instance proxies videos.
|
||||
let proxiesVideos: Bool
|
||||
|
||||
/// Stable identifier for SwiftUI lists.
|
||||
var id: String { legacyInstanceID }
|
||||
|
||||
/// Display name for the source row.
|
||||
var instanceDisplayName: String {
|
||||
if let instanceName, !instanceName.isEmpty {
|
||||
return instanceName
|
||||
}
|
||||
return url.host ?? url.absoluteString
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user