protected void CreateClient(Uri server, JellyfinClientOptions options = null)
        {
            _basePath = server.AbsolutePath;

            HttpClientHandler handler = options != null && options.Handler != null ? options.Handler : new JellyfinHttpClientHandler(Logger);

            Client = new HttpClient(handler)
            {
                BaseAddress = server
            };

            UpdateHeaders();
            Client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
        }
        public JellyfinBaseClient(Uri serverAddress, IAuthenticationMethod authentication, JellyfinClientOptions options = null)
        {
            this.ServerAddress  = serverAddress;
            this.Authentication = authentication;
            this.Logger         = (options != null && options.Logger != null) ? options.Logger : NullLogger.Instance;

            CreateClient(serverAddress, options);
        }
Exemple #3
0
 public JellyfinClient(Uri serverAddress, IAuthenticationMethod authentication, JellyfinClientOptions options)
     : base(serverAddress, authentication, options)
 {
 }