mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-22 00:35:26 +03:00
Weather updates
This commit is contained in:
parent
b6bc22ae63
commit
3c47375229
@@ -573,9 +573,9 @@ namespace MediaBrowser.ApiInteraction
|
||||
{
|
||||
string url = ApiUrl + "/ServerConfiguration";
|
||||
|
||||
using (Stream stream = await GetSerializedStreamAsync(url).ConfigureAwait(false))
|
||||
using (Stream stream = await GetSerializedStreamAsync(url, ApiInteraction.SerializationFormat.Json).ConfigureAwait(false))
|
||||
{
|
||||
return DeserializeFromStream<ServerConfiguration>(stream);
|
||||
return DeserializeFromStream<ServerConfiguration>(stream, ApiInteraction.SerializationFormat.Json);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -622,19 +622,27 @@ namespace MediaBrowser.ApiInteraction
|
||||
/// This is a helper around getting a stream from the server that contains serialized data
|
||||
/// </summary>
|
||||
private Task<Stream> GetSerializedStreamAsync(string url)
|
||||
{
|
||||
return GetSerializedStreamAsync(url, SerializationFormat);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This is a helper around getting a stream from the server that contains serialized data
|
||||
/// </summary>
|
||||
private Task<Stream> GetSerializedStreamAsync(string url, SerializationFormat serializationFormat)
|
||||
{
|
||||
if (url.IndexOf('?') == -1)
|
||||
{
|
||||
url += "?dataformat=" + SerializationFormat.ToString().ToLower();
|
||||
url += "?dataformat=" + serializationFormat.ToString().ToLower();
|
||||
}
|
||||
else
|
||||
{
|
||||
url += "&dataformat=" + SerializationFormat.ToString().ToLower();
|
||||
url += "&dataformat=" + serializationFormat.ToString().ToLower();
|
||||
}
|
||||
|
||||
return GetStreamAsync(url);
|
||||
}
|
||||
|
||||
|
||||
private T DeserializeFromStream<T>(Stream stream)
|
||||
{
|
||||
return DeserializeFromStream<T>(stream, SerializationFormat);
|
||||
|
||||
Reference in New Issue
Block a user