mirror of
https://github.com/yattee/yattee.git
synced 2026-10-23 21:22:53 +00:00
Delete declarations that Periphery reports unused on every platform that compiles them (iOS, macOS, tvOS), including nine views used only by their own previews. Platform-gated code still used on another platform, device- only MPV render paths, migration models, CloudKit record names, App Intents metadata and unused parameters are kept.
26 lines
882 B
Swift
26 lines
882 B
Swift
//
|
|
// WebDAVClientFactory.swift
|
|
// Yattee
|
|
//
|
|
// Factory for creating WebDAVClient instances with appropriate SSL settings.
|
|
//
|
|
|
|
import Foundation
|
|
|
|
/// Factory for creating WebDAVClient instances based on media source SSL settings.
|
|
final class WebDAVClientFactory: Sendable {
|
|
private let sessionFactory: URLSessionFactory
|
|
|
|
init(sessionFactory: URLSessionFactory = .shared) {
|
|
self.sessionFactory = sessionFactory
|
|
}
|
|
|
|
/// Creates a WebDAVClient configured for the given media source's SSL requirements.
|
|
/// - Parameter source: The media source to create a client for.
|
|
/// - Returns: A WebDAVClient with appropriate SSL settings.
|
|
func createClient(for source: MediaSource) -> WebDAVClient {
|
|
let session = sessionFactory.session(allowInvalidCertificates: source.allowInvalidCertificates)
|
|
return WebDAVClient(session: session)
|
|
}
|
|
}
|