mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-07-09 03:04:24 -04:00
save library options on dialog close
This commit is contained in:
parent
7dbeeadea6
commit
89dd4f0be1
@ -11,6 +11,7 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using CommonIO;
|
using CommonIO;
|
||||||
using MediaBrowser.Controller.Configuration;
|
using MediaBrowser.Controller.Configuration;
|
||||||
|
using MediaBrowser.Controller.Entities;
|
||||||
using MediaBrowser.Model.Configuration;
|
using MediaBrowser.Model.Configuration;
|
||||||
|
|
||||||
namespace MediaBrowser.Api.Library
|
namespace MediaBrowser.Api.Library
|
||||||
@ -140,6 +141,14 @@ namespace MediaBrowser.Api.Library
|
|||||||
public bool RefreshLibrary { get; set; }
|
public bool RefreshLibrary { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Route("/Library/VirtualFolders/LibraryOptions", "POST")]
|
||||||
|
public class UpdateLibraryOptions : IReturnVoid
|
||||||
|
{
|
||||||
|
public string Id { get; set; }
|
||||||
|
|
||||||
|
public LibraryOptions LibraryOptions { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Class LibraryStructureService
|
/// Class LibraryStructureService
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@ -188,6 +197,13 @@ namespace MediaBrowser.Api.Library
|
|||||||
return ToOptimizedSerializedResultUsingCache(result);
|
return ToOptimizedSerializedResultUsingCache(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Post(UpdateLibraryOptions request)
|
||||||
|
{
|
||||||
|
var collectionFolder = (CollectionFolder)_libraryManager.GetItemById(request.Id);
|
||||||
|
|
||||||
|
collectionFolder.UpdateLibraryOptions(request.LibraryOptions);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Posts the specified request.
|
/// Posts the specified request.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -95,10 +95,20 @@ namespace MediaBrowser.Controller.Entities
|
|||||||
return System.IO.Path.Combine(path, "options.xml");
|
return System.IO.Path.Combine(path, "options.xml");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void UpdateLibraryOptions(LibraryOptions options)
|
||||||
|
{
|
||||||
|
SaveLibraryOptions(Path, options);
|
||||||
|
}
|
||||||
|
|
||||||
public static void SaveLibraryOptions(string path, LibraryOptions options)
|
public static void SaveLibraryOptions(string path, LibraryOptions options)
|
||||||
{
|
{
|
||||||
|
lock (LibraryOptions)
|
||||||
|
{
|
||||||
|
LibraryOptions[path] = options;
|
||||||
|
|
||||||
XmlSerializer.SerializeToFile(options, GetLibraryOptionsPath(path));
|
XmlSerializer.SerializeToFile(options, GetLibraryOptionsPath(path));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allow different display preferences for each collection folder
|
/// Allow different display preferences for each collection folder
|
||||||
|
@ -110,8 +110,7 @@ namespace MediaBrowser.Controller.Entities.Movies
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
// TODO
|
return !FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.DataPath, Path);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ namespace MediaBrowser.Server.Implementations.Collections
|
|||||||
public class CollectionsDynamicFolder : IVirtualFolderCreator
|
public class CollectionsDynamicFolder : IVirtualFolderCreator
|
||||||
{
|
{
|
||||||
private readonly IApplicationPaths _appPaths;
|
private readonly IApplicationPaths _appPaths;
|
||||||
private IFileSystem _fileSystem;
|
private readonly IFileSystem _fileSystem;
|
||||||
|
|
||||||
public CollectionsDynamicFolder(IApplicationPaths appPaths, IFileSystem fileSystem)
|
public CollectionsDynamicFolder(IApplicationPaths appPaths, IFileSystem fileSystem)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user