Files
yattee/Yattee/Services/MediaSources/WebDAVClientFactory.swift
Arkadiusz Fal 4770bbe3b9 Remove dead code found by Periphery on all platforms
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.
2026-10-08 23:57:56 +02:00

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)
}
}