mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-20 00:55:13 +01:00
Added an api call to pull down user configuration
This commit is contained in:
parent
0a48b5e31a
commit
6c7175e33d
@@ -1,16 +1,36 @@
|
||||
using MediaBrowser.Common.Configuration;
|
||||
using System.Collections.Generic;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
|
||||
namespace MediaBrowser.Controller.Configuration
|
||||
{
|
||||
public class ServerConfiguration : BaseConfiguration
|
||||
{
|
||||
public string ImagesByNamePath { get; set; }
|
||||
public int RecentItemDays { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the default UI configuration
|
||||
/// </summary>
|
||||
public UserConfiguration DefaultUserConfiguration { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a list of registered UI device names
|
||||
/// </summary>
|
||||
public List<string> DeviceNames { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets all available UIConfigurations
|
||||
/// The key contains device name and user id
|
||||
/// </summary>
|
||||
public Dictionary<string, UserConfiguration> UserConfigurations { get; set; }
|
||||
|
||||
public ServerConfiguration()
|
||||
: base()
|
||||
{
|
||||
RecentItemDays = 14;
|
||||
DefaultUserConfiguration = new UserConfiguration();
|
||||
|
||||
UserConfigurations = new Dictionary<string, UserConfiguration>();
|
||||
|
||||
DeviceNames = new List<string>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using MediaBrowser.Common.Configuration;
|
||||
|
||||
namespace MediaBrowser.Controller.Configuration
|
||||
{
|
||||
/// <summary>
|
||||
/// Extends BaseConfigurationController by adding methods to get and set UIConfiguration data
|
||||
/// </summary>
|
||||
public class ServerConfigurationController : ConfigurationController<ServerConfiguration>
|
||||
{
|
||||
private string GetDictionaryKey(Guid userId, string deviceName)
|
||||
{
|
||||
string guidString = userId == Guid.Empty ? string.Empty : userId.ToString();
|
||||
|
||||
return deviceName + "-" + guidString;
|
||||
}
|
||||
|
||||
public UserConfiguration GetUserConfiguration(Guid userId)
|
||||
{
|
||||
return Configuration.DefaultUserConfiguration;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user