mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-16 11:13:32 +01:00
stub out storage for new path substitution
This commit is contained in:
@@ -48,24 +48,14 @@ namespace MediaBrowser.Controller.Entities
|
||||
private static readonly Dictionary<string, LibraryOptions> LibraryOptions = new Dictionary<string, LibraryOptions>();
|
||||
public LibraryOptions GetLibraryOptions()
|
||||
{
|
||||
lock (LibraryOptions)
|
||||
{
|
||||
LibraryOptions options;
|
||||
if (!LibraryOptions.TryGetValue(Path, out options))
|
||||
{
|
||||
options = LoadLibraryOptions();
|
||||
LibraryOptions[Path] = options;
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
return GetLibraryOptions(Path);
|
||||
}
|
||||
|
||||
private LibraryOptions LoadLibraryOptions()
|
||||
private static LibraryOptions LoadLibraryOptions(string path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = XmlSerializer.DeserializeFromFile(typeof(LibraryOptions), GetLibraryOptionsPath(Path)) as LibraryOptions;
|
||||
var result = XmlSerializer.DeserializeFromFile(typeof(LibraryOptions), GetLibraryOptionsPath(path)) as LibraryOptions;
|
||||
|
||||
if (result == null)
|
||||
{
|
||||
@@ -100,6 +90,21 @@ namespace MediaBrowser.Controller.Entities
|
||||
SaveLibraryOptions(Path, options);
|
||||
}
|
||||
|
||||
public static LibraryOptions GetLibraryOptions(string path)
|
||||
{
|
||||
lock (LibraryOptions)
|
||||
{
|
||||
LibraryOptions options;
|
||||
if (!LibraryOptions.TryGetValue(path, out options))
|
||||
{
|
||||
options = LoadLibraryOptions(path);
|
||||
LibraryOptions[path] = options;
|
||||
}
|
||||
|
||||
return options;
|
||||
}
|
||||
}
|
||||
|
||||
public static void SaveLibraryOptions(string path, LibraryOptions options)
|
||||
{
|
||||
lock (LibraryOptions)
|
||||
|
||||
Reference in New Issue
Block a user