Show missing-credentials indicator for remote server sources

After reinstalling the app and importing sources from iCloud, remote
server instances with Keychain-only credentials showed no indication
that login is needed, unlike WebDAV/SMB sources.

- Show the orange key icon for Yattee Server instances without stored
  basic auth credentials (auth is always required for this type)
- Persist usesBasicAuth/usesAccountLogin flags on Instance (synced via
  iCloud) so missing Invidious/Piped/PeerTube credentials are detectable
  too; maintained on credential save/delete, login/logout, and legacy
  migration
- Centralize the check in AppEnvironment.needsCredentials(for:) used by
  SourcesListView, MediaSourcesView, and SourceRow
- Backfill the flags at launch from credentials currently in the
  Keychain so existing setups publish them without a re-login
This commit is contained in:
Arkadiusz Fal
2026-07-23 18:19:38 +02:00
parent c3e39c955d
commit 6994b9353a
9 changed files with 132 additions and 7 deletions

View File

@@ -221,13 +221,16 @@ final class LegacyDataMigrationService {
password: basicAuthCredentials.password,
for: instance
)
instancesManager.setUsesBasicAuth(true, for: instance)
}
invidiousCredentialsManager.setCredential(credential, for: instance)
instancesManager.setUsesAccountLogin(true, for: instance)
case .piped:
credential = try await pipedAPI.login(username: username, password: password, instance: instance)
addInstanceIfNeeded(instance)
pipedCredentialsManager.setCredential(credential, for: instance)
instancesManager.setUsesAccountLogin(true, for: instance)
default:
throw APIError.notSupported
@@ -264,6 +267,7 @@ final class LegacyDataMigrationService {
password: basicAuthCredentials.password,
for: instance
)
instancesManager.setUsesBasicAuth(true, for: instance)
}
removeLegacyInstance(item)