mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-21 16:25:28 +03:00
fixed configuration saving issues
This commit is contained in:
@@ -22,22 +22,6 @@ namespace MediaBrowser.Common.Implementations.Serialization
|
||||
netSerializer.Serialize(writer, obj);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes from stream.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="stream">The stream.</param>
|
||||
/// <returns>``0.</returns>
|
||||
public T DeserializeFromStream<T>(Stream stream)
|
||||
{
|
||||
using (var reader = new XmlTextReader(stream))
|
||||
{
|
||||
var netSerializer = new System.Xml.Serialization.XmlSerializer(typeof(T));
|
||||
|
||||
return (T)netSerializer.Deserialize(reader);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes from stream.
|
||||
/// </summary>
|
||||
@@ -67,20 +51,6 @@ namespace MediaBrowser.Common.Implementations.Serialization
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Deserializes from file.
|
||||
/// </summary>
|
||||
/// <typeparam name="T"></typeparam>
|
||||
/// <param name="file">The file.</param>
|
||||
/// <returns>``0.</returns>
|
||||
public T DeserializeFromFile<T>(string file)
|
||||
{
|
||||
using (var stream = File.OpenRead(file))
|
||||
{
|
||||
return DeserializeFromStream<T>(stream);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Serializes to file.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user