mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-21 08:15:28 +03:00
Multiple Stream changes
* Remove useless MemoryStream in DlnaHttpClient * Use HttpContent.ReadFromJsonAsync extension * Call ConfigureAwait for IAsyncDisposable * Use HttpContent.CopyToAsync where possible
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http.Json;
|
||||
using System.Net.Mime;
|
||||
using System.Text;
|
||||
using System.Text.Json;
|
||||
@@ -64,8 +65,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
|
||||
var res = await response.Content.ReadAsStreamAsync();
|
||||
_ = await JsonSerializer.DeserializeAsync<ConfigurationPageInfo[]>(res, _jsonOpions);
|
||||
_ = await response.Content.ReadFromJsonAsync<ConfigurationPageInfo[]>(_jsonOpions);
|
||||
// TODO: check content
|
||||
}
|
||||
|
||||
@@ -81,8 +81,7 @@ namespace Jellyfin.Server.Integration.Tests.Controllers
|
||||
Assert.Equal(MediaTypeNames.Application.Json, response.Content.Headers.ContentType?.MediaType);
|
||||
Assert.Equal(Encoding.UTF8.BodyName, response.Content.Headers.ContentType?.CharSet);
|
||||
|
||||
var res = await response.Content.ReadAsStreamAsync();
|
||||
var data = await JsonSerializer.DeserializeAsync<ConfigurationPageInfo[]>(res, _jsonOpions);
|
||||
var data = await response.Content.ReadFromJsonAsync<ConfigurationPageInfo[]>(_jsonOpions);
|
||||
Assert.NotNull(data);
|
||||
Assert.Empty(data);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user