ReSharper Reformat: Properties to expression bodied form.

pull/1154/head
Erwin de Haan 6 years ago
parent 9fa60ec934
commit a36658f6f0

@ -3,103 +3,31 @@ namespace BDInfo
{ {
class BDInfoSettings class BDInfoSettings
{ {
public static bool GenerateStreamDiagnostics public static bool GenerateStreamDiagnostics => true;
{
get
{
return true;
}
}
public static bool EnableSSIF public static bool EnableSSIF => true;
{
get
{
return true;
}
}
public static bool AutosaveReport public static bool AutosaveReport => false;
{
get
{
return false;
}
}
public static bool GenerateFrameDataFile public static bool GenerateFrameDataFile => false;
{
get
{
return false;
}
}
public static bool FilterLoopingPlaylists public static bool FilterLoopingPlaylists => true;
{
get
{
return true;
}
}
public static bool FilterShortPlaylists public static bool FilterShortPlaylists => false;
{
get
{
return false;
}
}
public static int FilterShortPlaylistsValue public static int FilterShortPlaylistsValue => 0;
{
get
{
return 0;
}
}
public static bool UseImagePrefix public static bool UseImagePrefix => false;
{
get
{
return false;
}
}
public static string UseImagePrefixValue public static string UseImagePrefixValue => null;
{
get
{
return null;
}
}
/// <summary> /// <summary>
/// Setting this to false throws an IComparer error on some discs. /// Setting this to false throws an IComparer error on some discs.
/// </summary> /// </summary>
public static bool KeepStreamOrder public static bool KeepStreamOrder => true;
{
get
{
return true;
}
}
public static bool GenerateTextSummary public static bool GenerateTextSummary => false;
{
get
{
return false;
}
}
public static string LastPath public static string LastPath => string.Empty;
{
get
{
return string.Empty;
}
}
} }
} }

@ -142,21 +142,12 @@ namespace BDInfo
public double PacketSeconds = 0; public double PacketSeconds = 0;
public int AngleIndex = 0; public int AngleIndex = 0;
public ulong PacketSize public ulong PacketSize => PacketCount * 192;
{
get
{
return PacketCount * 192;
}
}
private string _LanguageCode; private string _LanguageCode;
public string LanguageCode public string LanguageCode
{ {
get get => _LanguageCode;
{
return _LanguageCode;
}
set set
{ {
_LanguageCode = value; _LanguageCode = value;
@ -398,13 +389,7 @@ namespace BDInfo
} }
} }
public virtual string Description public virtual string Description => "";
{
get
{
return "";
}
}
public abstract TSStream Clone(); public abstract TSStream Clone();
@ -444,10 +429,7 @@ namespace BDInfo
private TSVideoFormat _VideoFormat; private TSVideoFormat _VideoFormat;
public TSVideoFormat VideoFormat public TSVideoFormat VideoFormat
{ {
get get => _VideoFormat;
{
return _VideoFormat;
}
set set
{ {
_VideoFormat = value; _VideoFormat = value;
@ -488,10 +470,7 @@ namespace BDInfo
private TSFrameRate _FrameRate; private TSFrameRate _FrameRate;
public TSFrameRate FrameRate public TSFrameRate FrameRate
{ {
get get => _FrameRate;
{
return _FrameRate;
}
set set
{ {
_FrameRate = value; _FrameRate = value;

@ -37,21 +37,9 @@ namespace BDInfo
Stream = new MemoryStream(Buffer); Stream = new MemoryStream(Buffer);
} }
public long Length public long Length => (long)BufferLength;
{
get
{
return (long)BufferLength;
}
}
public long Position public long Position => Stream.Position;
{
get
{
return Stream.Position;
}
}
public void Add( public void Add(
byte[] buffer, byte[] buffer,

@ -74,13 +74,7 @@ namespace BDInfo
} }
} }
public ulong PacketSize public ulong PacketSize => PacketCount * 192;
{
get
{
return PacketCount * 192;
}
}
public ulong PacketBitRate public ulong PacketBitRate
{ {

@ -115,29 +115,11 @@ namespace Emby.Dlna.Api
public IRequest Request { get; set; } public IRequest Request { get; set; }
private IHttpResultFactory _resultFactory; private IHttpResultFactory _resultFactory;
private IContentDirectory ContentDirectory private IContentDirectory ContentDirectory => DlnaEntryPoint.Current.ContentDirectory;
{
get
{
return DlnaEntryPoint.Current.ContentDirectory;
}
}
private IConnectionManager ConnectionManager private IConnectionManager ConnectionManager => DlnaEntryPoint.Current.ConnectionManager;
{
get
{
return DlnaEntryPoint.Current.ConnectionManager;
}
}
private IMediaReceiverRegistrar MediaReceiverRegistrar private IMediaReceiverRegistrar MediaReceiverRegistrar => DlnaEntryPoint.Current.MediaReceiverRegistrar;
{
get
{
return DlnaEntryPoint.Current.MediaReceiverRegistrar;
}
}
public DlnaServerService(IDlnaManager dlnaManager, IHttpResultFactory httpResultFactory) public DlnaServerService(IDlnaManager dlnaManager, IHttpResultFactory httpResultFactory)
{ {

@ -51,9 +51,6 @@ namespace Emby.Dlna.Didl
_encoding = encoding; _encoding = encoding;
} }
public override Encoding Encoding public override Encoding Encoding => (null == _encoding) ? base.Encoding : _encoding;
{
get { return (null == _encoding) ? base.Encoding : _encoding; }
}
} }
} }

@ -261,21 +261,9 @@ namespace Emby.Dlna
return false; return false;
} }
private string UserProfilesPath private string UserProfilesPath => Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "user");
{
get
{
return Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "user");
}
}
private string SystemProfilesPath private string SystemProfilesPath => Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system");
{
get
{
return Path.Combine(_appPaths.ConfigurationDirectoryPath, "dlna", "system");
}
}
private IEnumerable<DeviceProfile> GetProfiles(string path, DeviceProfileType type) private IEnumerable<DeviceProfile> GetProfiles(string path, DeviceProfileType type)
{ {

@ -23,12 +23,6 @@ namespace Emby.Dlna.Eventing
TriggerCount++; TriggerCount++;
} }
public bool IsExpired public bool IsExpired => SubscriptionTime.AddSeconds(TimeoutSeconds) >= DateTime.UtcNow;
{
get
{
return SubscriptionTime.AddSeconds(TimeoutSeconds) >= DateTime.UtcNow;
}
}
} }
} }

@ -35,10 +35,7 @@ namespace Emby.Dlna.PlayTo
RefreshVolumeIfNeeded(); RefreshVolumeIfNeeded();
return _volume; return _volume;
} }
set set => _volume = value;
{
_volume = value;
}
} }
public TimeSpan? Duration { get; set; } public TimeSpan? Duration { get; set; }
@ -46,41 +43,17 @@ namespace Emby.Dlna.PlayTo
private TimeSpan _position = TimeSpan.FromSeconds(0); private TimeSpan _position = TimeSpan.FromSeconds(0);
public TimeSpan Position public TimeSpan Position
{ {
get get => _position;
{ set => _position = value;
return _position;
}
set
{
_position = value;
}
} }
public TRANSPORTSTATE TransportState { get; private set; } public TRANSPORTSTATE TransportState { get; private set; }
public bool IsPlaying public bool IsPlaying => TransportState == TRANSPORTSTATE.PLAYING;
{
get
{
return TransportState == TRANSPORTSTATE.PLAYING;
}
}
public bool IsPaused public bool IsPaused => TransportState == TRANSPORTSTATE.PAUSED || TransportState == TRANSPORTSTATE.PAUSED_PLAYBACK;
{
get
{
return TransportState == TRANSPORTSTATE.PAUSED || TransportState == TRANSPORTSTATE.PAUSED_PLAYBACK;
}
}
public bool IsStopped public bool IsStopped => TransportState == TRANSPORTSTATE.STOPPED;
{
get
{
return TransportState == TRANSPORTSTATE.STOPPED;
}
}
#endregion #endregion

@ -34,26 +34,14 @@ namespace Emby.Dlna.PlayTo
private string _baseUrl = string.Empty; private string _baseUrl = string.Empty;
public string BaseUrl public string BaseUrl
{ {
get get => _baseUrl;
{ set => _baseUrl = value;
return _baseUrl;
}
set
{
_baseUrl = value;
}
} }
public DeviceIcon Icon { get; set; } public DeviceIcon Icon { get; set; }
private readonly List<DeviceService> _services = new List<DeviceService>(); private readonly List<DeviceService> _services = new List<DeviceService>();
public List<DeviceService> Services public List<DeviceService> Services => _services;
{
get
{
return _services;
}
}
public DeviceIdentification ToDeviceIdentification() public DeviceIdentification ToDeviceIdentification()
{ {

@ -44,18 +44,9 @@ namespace Emby.Dlna.PlayTo
private readonly string _accessToken; private readonly string _accessToken;
private readonly DateTime _creationTime; private readonly DateTime _creationTime;
public bool IsSessionActive public bool IsSessionActive => !_disposed && _device != null;
{
get
{
return !_disposed && _device != null;
}
}
public bool SupportsMediaControl public bool SupportsMediaControl => IsSessionActive;
{
get { return IsSessionActive; }
}
public PlayToController(SessionInfo session, ISessionManager sessionManager, ILibraryManager libraryManager, ILogger logger, IDlnaManager dlnaManager, IUserManager userManager, IImageProcessor imageProcessor, string serverAddress, string accessToken, IDeviceDiscovery deviceDiscovery, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, IConfigurationManager config, IMediaEncoder mediaEncoder) public PlayToController(SessionInfo session, ISessionManager sessionManager, ILibraryManager libraryManager, ILogger logger, IDlnaManager dlnaManager, IUserManager userManager, IImageProcessor imageProcessor, string serverAddress, string accessToken, IDeviceDiscovery deviceDiscovery, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, IConfigurationManager config, IMediaEncoder mediaEncoder)
{ {
@ -436,13 +427,7 @@ namespace Emby.Dlna.PlayTo
private int _currentPlaylistIndex; private int _currentPlaylistIndex;
private readonly List<PlaylistItem> _playlist = new List<PlaylistItem>(); private readonly List<PlaylistItem> _playlist = new List<PlaylistItem>();
private List<PlaylistItem> Playlist private List<PlaylistItem> Playlist => _playlist;
{
get
{
return _playlist;
}
}
private void AddItemFromId(Guid id, List<BaseItem> list) private void AddItemFromId(Guid id, List<BaseItem> list)
{ {

@ -12,27 +12,15 @@ namespace Emby.Dlna.PlayTo
private List<StateVariable> _stateVariables = new List<StateVariable>(); private List<StateVariable> _stateVariables = new List<StateVariable>();
public List<StateVariable> StateVariables public List<StateVariable> StateVariables
{ {
get get => _stateVariables;
{ set => _stateVariables = value;
return _stateVariables;
}
set
{
_stateVariables = value;
}
} }
private List<ServiceAction> _serviceActions = new List<ServiceAction>(); private List<ServiceAction> _serviceActions = new List<ServiceAction>();
public List<ServiceAction> ServiceActions public List<ServiceAction> ServiceActions
{ {
get get => _serviceActions;
{ set => _serviceActions = value;
return _serviceActions;
}
set
{
_serviceActions = value;
}
} }
public static TransportCommands Create(XDocument document) public static TransportCommands Create(XDocument document)

@ -34,46 +34,34 @@ namespace Emby.Drawing.Skia
LogVersion(); LogVersion();
} }
public string[] SupportedInputFormats public string[] SupportedInputFormats =>
{ new[]
get
{ {
// Some common file name extensions for RAW picture files include: .cr2, .crw, .dng, .nef, .orf, .rw2, .pef, .arw, .sr2, .srf, and .tif. "jpeg",
return new[] "jpg",
{ "png",
"jpeg",
"jpg",
"png",
"dng",
"webp",
"gif",
"bmp",
"ico",
"astc",
"ktx",
"pkm",
"wbmp",
// TODO
// Are all of these supported? https://github.com/google/skia/blob/master/infra/bots/recipes/test.py#L454
// working on windows at least
"cr2",
"nef",
"arw"
};
}
}
public ImageFormat[] SupportedOutputFormats "dng",
{
get "webp",
{ "gif",
return new[] { ImageFormat.Webp, ImageFormat.Jpg, ImageFormat.Png }; "bmp",
} "ico",
} "astc",
"ktx",
"pkm",
"wbmp",
// TODO
// Are all of these supported? https://github.com/google/skia/blob/master/infra/bots/recipes/test.py#L454
// working on windows at least
"cr2",
"nef",
"arw"
};
public ImageFormat[] SupportedOutputFormats => new[] { ImageFormat.Webp, ImageFormat.Jpg, ImageFormat.Png };
private void LogVersion() private void LogVersion()
{ {
@ -666,19 +654,10 @@ namespace Emby.Drawing.Skia
} }
} }
public string Name public string Name => "Skia";
{
get { return "Skia"; }
}
public bool SupportsImageCollageCreation public bool SupportsImageCollageCreation => true;
{
get { return true; }
}
public bool SupportsImageEncoding public bool SupportsImageEncoding => true;
{
get { return true; }
}
} }
} }

@ -74,7 +74,7 @@ namespace Emby.Drawing
public IImageEncoder ImageEncoder public IImageEncoder ImageEncoder
{ {
get { return _imageEncoder; } get => _imageEncoder;
set set
{ {
if (value == null) if (value == null)
@ -86,67 +86,44 @@ namespace Emby.Drawing
} }
} }
public string[] SupportedInputFormats public string[] SupportedInputFormats =>
{ new string[]
get {
{ "tiff",
return new string[] "tif",
{ "jpeg",
"tiff", "jpg",
"tif", "png",
"jpeg", "aiff",
"jpg", "cr2",
"png", "crw",
"aiff",
"cr2", // Remove until supported
"crw", //"nef",
"orf",
// Remove until supported "pef",
//"nef", "arw",
"orf", "webp",
"pef", "gif",
"arw", "bmp",
"webp", "erf",
"gif", "raf",
"bmp", "rw2",
"erf", "nrw",
"raf", "dng",
"rw2", "ico",
"nrw", "astc",
"dng", "ktx",
"ico", "pkm",
"astc", "wbmp"
"ktx", };
"pkm",
"wbmp"
}; public bool SupportsImageCollageCreation => _imageEncoder.SupportsImageCollageCreation;
}
} private string ResizedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "resized-images");
private string EnhancedImageCachePath => Path.Combine(_appPaths.ImageCachePath, "enhanced-images");
public bool SupportsImageCollageCreation
{
get
{
return _imageEncoder.SupportsImageCollageCreation;
}
}
private string ResizedImageCachePath
{
get
{
return Path.Combine(_appPaths.ImageCachePath, "resized-images");
}
}
private string EnhancedImageCachePath
{
get
{
return Path.Combine(_appPaths.ImageCachePath, "enhanced-images");
}
}
public void AddParts(IEnumerable<IImageEnhancer> enhancers) public void AddParts(IEnumerable<IImageEnhancer> enhancers)
{ {

@ -6,26 +6,15 @@ namespace Emby.Drawing
{ {
public class NullImageEncoder : IImageEncoder public class NullImageEncoder : IImageEncoder
{ {
public string[] SupportedInputFormats public string[] SupportedInputFormats =>
{ new[]
get
{ {
return new[] "png",
{ "jpeg",
"png", "jpg"
"jpeg", };
"jpg"
};
}
}
public ImageFormat[] SupportedOutputFormats public ImageFormat[] SupportedOutputFormats => new[] { ImageFormat.Jpg, ImageFormat.Png };
{
get
{
return new[] { ImageFormat.Jpg, ImageFormat.Png };
}
}
public void CropWhiteSpace(string inputPath, string outputPath) public void CropWhiteSpace(string inputPath, string outputPath)
{ {
@ -42,20 +31,11 @@ namespace Emby.Drawing
throw new NotImplementedException(); throw new NotImplementedException();
} }
public string Name public string Name => "Null Image Encoder";
{
get { return "Null Image Encoder"; }
}
public bool SupportsImageCollageCreation public bool SupportsImageCollageCreation => false;
{
get { return false; }
}
public bool SupportsImageEncoding public bool SupportsImageEncoding => false;
{
get { return false; }
}
public ImageSize GetImageSize(string path) public ImageSize GetImageSize(string path)
{ {

@ -13,7 +13,7 @@ namespace IsoMounter
public class LinuxIsoManager : IIsoMounter public class LinuxIsoManager : IIsoMounter
{ {
[DllImport("libc", SetLastError = true)] [DllImport("libc", SetLastError = true)]
public static extern uint getuid(); static extern uint getuid();
#region Private Fields #region Private Fields
@ -102,26 +102,11 @@ namespace IsoMounter
#region Interface Implementation for IIsoMounter #region Interface Implementation for IIsoMounter
public bool IsInstalled public bool IsInstalled => true;
{
get
{
return true;
}
}
public string Name public string Name => "LinuxMount";
{
get { return "LinuxMount"; }
}
public bool RequiresInstallation public bool RequiresInstallation => false;
{
get
{
return false;
}
}
public bool CanMount(string path) public bool CanMount(string path)
{ {

@ -13,30 +13,18 @@ namespace IsoMounter
} }
private Guid _id = new Guid("4682DD4C-A675-4F1B-8E7C-79ADF137A8F8"); private Guid _id = new Guid("4682DD4C-A675-4F1B-8E7C-79ADF137A8F8");
public override Guid Id public override Guid Id => _id;
{
get { return _id; }
}
/// <summary> /// <summary>
/// Gets the name of the plugin /// Gets the name of the plugin
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
public override string Name public override string Name => "Iso Mounter";
{
get { return "Iso Mounter"; }
}
/// <summary> /// <summary>
/// Gets the description. /// Gets the description.
/// </summary> /// </summary>
/// <value>The description.</value> /// <value>The description.</value>
public override string Description public override string Description => "Mount and stream ISO contents";
{
get
{
return "Mount and stream ISO contents";
}
}
} }
} }

@ -6,7 +6,8 @@ namespace Emby.Naming.Common
public class EpisodeExpression public class EpisodeExpression
{ {
private string _expression; private string _expression;
public string Expression { get { return _expression; } set { _expression = value; _regex = null; } } public string Expression { get => _expression;
set { _expression = value; _regex = null; } }
public bool IsByDate { get; set; } public bool IsByDate { get; set; }
public bool IsOptimistic { get; set; } public bool IsOptimistic { get; set; }
@ -16,13 +17,7 @@ namespace Emby.Naming.Common
public string[] DateTimeFormats { get; set; } public string[] DateTimeFormats { get; set; }
private Regex _regex; private Regex _regex;
public Regex Regex public Regex Regex => _regex ?? (_regex = new Regex(Expression, RegexOptions.IgnoreCase | RegexOptions.Compiled));
{
get
{
return _regex ?? (_regex = new Regex(Expression, RegexOptions.IgnoreCase | RegexOptions.Compiled));
}
}
public EpisodeExpression(string expression, bool byDate) public EpisodeExpression(string expression, bool byDate)
{ {

@ -65,10 +65,7 @@ namespace Emby.Naming.Video
/// Gets the file name without extension. /// Gets the file name without extension.
/// </summary> /// </summary>
/// <value>The file name without extension.</value> /// <value>The file name without extension.</value>
public string FileNameWithoutExtension public string FileNameWithoutExtension => !IsDirectory ? System.IO.Path.GetFileNameWithoutExtension(Path) : System.IO.Path.GetFileName(Path);
{
get { return !IsDirectory ? System.IO.Path.GetFileNameWithoutExtension(Path) : System.IO.Path.GetFileName(Path); }
}
public override string ToString() public override string ToString()
{ {

@ -199,9 +199,6 @@ namespace Emby.Photos
return Task.FromResult(result); return Task.FromResult(result);
} }
public string Name public string Name => "Embedded Information";
{
get { return "Embedded Information"; }
}
} }
} }

@ -45,13 +45,7 @@ namespace Emby.Server.Implementations.Data
/// Gets the name of the repository /// Gets the name of the repository
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
public string Name public string Name => "SQLite";
{
get
{
return "SQLite";
}
}
/// <summary> /// <summary>
/// Gets the json serializer. /// Gets the json serializer.
@ -97,21 +91,9 @@ namespace Emby.Server.Implementations.Data
private const string ChaptersTableName = "Chapters2"; private const string ChaptersTableName = "Chapters2";
protected override int? CacheSize protected override int? CacheSize => 20000;
{
get
{
return 20000;
}
}
protected override bool EnableTempStoreMemory protected override bool EnableTempStoreMemory => true;
{
get
{
return true;
}
}
/// <summary> /// <summary>
/// Opens the connection to the database /// Opens the connection to the database

@ -16,14 +16,7 @@ namespace Jellyfin.Server
{ {
} }
public override bool CanSelfRestart public override bool CanSelfRestart => StartupOptions.ContainsOption("-restartpath");
{
get
{
// A restart script must be provided
return StartupOptions.ContainsOption("-restartpath");
}
}
protected override void RestartInternal() => Program.Restart(); protected override void RestartInternal() => Program.Restart();
@ -32,13 +25,7 @@ namespace Jellyfin.Server
protected override void ShutdownInternal() => Program.Shutdown(); protected override void ShutdownInternal() => Program.Shutdown();
protected override bool SupportsDualModeSockets protected override bool SupportsDualModeSockets => true;
{
get
{
return true;
}
}
protected override IHttpListener CreateHttpListener() protected override IHttpListener CreateHttpListener()
=> new WebSocketSharpListener( => new WebSocketSharpListener(

@ -113,21 +113,9 @@ namespace Jellyfin.SocketSharp
return form; return form;
} }
public string Accept public string Accept => string.IsNullOrEmpty(request.Headers["Accept"]) ? null : request.Headers["Accept"];
{
get
{
return string.IsNullOrEmpty(request.Headers["Accept"]) ? null : request.Headers["Accept"];
}
}
public string Authorization public string Authorization => string.IsNullOrEmpty(request.Headers["Authorization"]) ? null : request.Headers["Authorization"];
{
get
{
return string.IsNullOrEmpty(request.Headers["Authorization"]) ? null : request.Headers["Authorization"];
}
}
protected bool validate_cookies, validate_query_string, validate_form; protected bool validate_cookies, validate_query_string, validate_form;
protected bool checked_cookies, checked_query_string, checked_form; protected bool checked_cookies, checked_query_string, checked_form;
@ -410,30 +398,17 @@ namespace Jellyfin.SocketSharp
throw new NotSupportedException(); throw new NotSupportedException();
} }
public override bool CanRead public override bool CanRead => true;
{
get { return true; }
}
public override bool CanSeek
{
get { return true; }
}
public override bool CanWrite
{
get { return false; }
}
public override long Length public override bool CanSeek => true;
{
get { return end - offset; } public override bool CanWrite => false;
}
public override long Length => end - offset;
public override long Position public override long Position
{ {
get get => position - offset;
{
return position - offset;
}
set set
{ {
if (value > Length) if (value > Length)
@ -451,37 +426,13 @@ namespace Jellyfin.SocketSharp
this.stream = new ReadSubStream(base_stream, offset, length); this.stream = new ReadSubStream(base_stream, offset, length);
} }
public string ContentType public string ContentType => content_type;
{
get
{
return content_type;
}
}
public int ContentLength public int ContentLength => (int)stream.Length;
{
get
{
return (int)stream.Length;
}
}
public string FileName public string FileName => name;
{
get
{
return name;
}
}
public Stream InputStream public Stream InputStream => stream;
{
get
{
return stream;
}
}
} }
class Helpers class Helpers

@ -85,13 +85,7 @@ namespace Jellyfin.SocketSharp
/// Gets or sets the state. /// Gets or sets the state.
/// </summary> /// </summary>
/// <value>The state.</value> /// <value>The state.</value>
public WebSocketState State public WebSocketState State => WebSocket.ReadyState;
{
get
{
return WebSocket.ReadyState;
}
}
/// <summary> /// <summary>
/// Sends the async. /// Sends the async.

@ -39,88 +39,38 @@ namespace Jellyfin.SocketSharp
return string.IsNullOrEmpty(endHostUrl) ? null : endHostUrl.TrimEnd('/'); return string.IsNullOrEmpty(endHostUrl) ? null : endHostUrl.TrimEnd('/');
} }
public HttpListenerRequest HttpRequest public HttpListenerRequest HttpRequest => request;
{
get { return request; }
}
public object OriginalRequest public object OriginalRequest => request;
{
get { return request; }
}
public IResponse Response public IResponse Response => response;
{
get { return response; }
}
public IHttpResponse HttpResponse public IHttpResponse HttpResponse => response;
{
get { return response; }
}
public string OperationName { get; set; } public string OperationName { get; set; }
public object Dto { get; set; } public object Dto { get; set; }
public string RawUrl public string RawUrl => request.RawUrl;
{
get { return request.RawUrl; }
}
public string AbsoluteUri public string AbsoluteUri => request.Url.AbsoluteUri.TrimEnd('/');
{
get { return request.Url.AbsoluteUri.TrimEnd('/'); }
}
public string UserHostAddress public string UserHostAddress => request.UserHostAddress;
{
get { return request.UserHostAddress; }
}
public string XForwardedFor public string XForwardedFor => string.IsNullOrEmpty(request.Headers["X-Forwarded-For"]) ? null : request.Headers["X-Forwarded-For"];
{
get
{
return string.IsNullOrEmpty(request.Headers["X-Forwarded-For"]) ? null : request.Headers["X-Forwarded-For"];
}
}
public int? XForwardedPort public int? XForwardedPort => string.IsNullOrEmpty(request.Headers["X-Forwarded-Port"]) ? (int?)null : int.Parse(request.Headers["X-Forwarded-Port"]);
{
get
{
return string.IsNullOrEmpty(request.Headers["X-Forwarded-Port"]) ? (int?)null : int.Parse(request.Headers["X-Forwarded-Port"]);
}
}
public string XForwardedProtocol public string XForwardedProtocol => string.IsNullOrEmpty(request.Headers["X-Forwarded-Proto"]) ? null : request.Headers["X-Forwarded-Proto"];
{
get
{
return string.IsNullOrEmpty(request.Headers["X-Forwarded-Proto"]) ? null : request.Headers["X-Forwarded-Proto"];
}
}
public string XRealIp public string XRealIp => string.IsNullOrEmpty(request.Headers["X-Real-IP"]) ? null : request.Headers["X-Real-IP"];
{
get
{
return string.IsNullOrEmpty(request.Headers["X-Real-IP"]) ? null : request.Headers["X-Real-IP"];
}
}
private string remoteIp; private string remoteIp;
public string RemoteIp public string RemoteIp =>
{ remoteIp ??
get (remoteIp = (CheckBadChars(XForwardedFor)) ??
{ (NormalizeIp(CheckBadChars(XRealIp)) ??
return remoteIp ?? (request.RemoteEndPoint != null ? NormalizeIp(request.RemoteEndPoint.Address.ToString()) : null)));
(remoteIp = (CheckBadChars(XForwardedFor)) ??
(NormalizeIp(CheckBadChars(XRealIp)) ??
(request.RemoteEndPoint != null ? NormalizeIp(request.RemoteEndPoint.Address.ToString()) : null)));
}
}
private static readonly char[] HttpTrimCharacters = new char[] { (char)0x09, (char)0xA, (char)0xB, (char)0xC, (char)0xD, (char)0x20 }; private static readonly char[] HttpTrimCharacters = new char[] { (char)0x09, (char)0xA, (char)0xB, (char)0xC, (char)0xD, (char)0x20 };
@ -215,34 +165,20 @@ namespace Jellyfin.SocketSharp
return ip; return ip;
} }
public bool IsSecureConnection public bool IsSecureConnection => request.IsSecureConnection || XForwardedProtocol == "https";
{
get { return request.IsSecureConnection || XForwardedProtocol == "https"; }
}
public string[] AcceptTypes public string[] AcceptTypes => request.AcceptTypes;
{
get { return request.AcceptTypes; }
}
private Dictionary<string, object> items; private Dictionary<string, object> items;
public Dictionary<string, object> Items public Dictionary<string, object> Items => items ?? (items = new Dictionary<string, object>());
{
get { return items ?? (items = new Dictionary<string, object>()); }
}
private string responseContentType; private string responseContentType;
public string ResponseContentType public string ResponseContentType
{ {
get get =>
{ responseContentType
return responseContentType ?? (responseContentType = GetResponseContentType(this));
?? (responseContentType = GetResponseContentType(this)); set => this.responseContentType = value;
}
set
{
this.responseContentType = value;
}
} }
public const string FormUrlEncoded = "application/x-www-form-urlencoded"; public const string FormUrlEncoded = "application/x-www-form-urlencoded";
@ -434,58 +370,32 @@ namespace Jellyfin.SocketSharp
} }
} }
public string UserAgent public string UserAgent => request.UserAgent;
{
get { return request.UserAgent; }
}
public QueryParamCollection Headers public QueryParamCollection Headers => request.Headers;
{
get { return request.Headers; }
}
private QueryParamCollection queryString; private QueryParamCollection queryString;
public QueryParamCollection QueryString public QueryParamCollection QueryString => queryString ?? (queryString = MyHttpUtility.ParseQueryString(request.Url.Query));
{
get { return queryString ?? (queryString = MyHttpUtility.ParseQueryString(request.Url.Query)); }
}
public bool IsLocal public bool IsLocal => request.IsLocal;
{
get { return request.IsLocal; }
}
private string httpMethod; private string httpMethod;
public string HttpMethod public string HttpMethod =>
{ httpMethod
get ?? (httpMethod = request.HttpMethod);
{
return httpMethod
?? (httpMethod = request.HttpMethod);
}
}
public string Verb public string Verb => HttpMethod;
{
get { return HttpMethod; }
}
public string ContentType public string ContentType => request.ContentType;
{
get { return request.ContentType; }
}
public Encoding contentEncoding; public Encoding contentEncoding;
public Encoding ContentEncoding public Encoding ContentEncoding
{ {
get { return contentEncoding ?? request.ContentEncoding; } get => contentEncoding ?? request.ContentEncoding;
set { contentEncoding = value; } set => contentEncoding = value;
} }
public Uri UrlReferrer public Uri UrlReferrer => request.UrlReferrer;
{
get { return request.UrlReferrer; }
}
public static Encoding GetEncoding(string contentTypeHeader) public static Encoding GetEncoding(string contentTypeHeader)
{ {
@ -501,15 +411,9 @@ namespace Jellyfin.SocketSharp
} }
} }
public Stream InputStream public Stream InputStream => request.InputStream;
{
get { return request.InputStream; }
}
public long ContentLength public long ContentLength => request.ContentLength64;
{
get { return request.ContentLength64; }
}
private IHttpFile[] httpFiles; private IHttpFile[] httpFiles;
public IHttpFile[] Files public IHttpFile[] Files

@ -31,27 +31,24 @@ namespace Jellyfin.SocketSharp
public IRequest Request { get; private set; } public IRequest Request { get; private set; }
public Dictionary<string, object> Items { get; private set; } public Dictionary<string, object> Items { get; private set; }
public object OriginalResponse public object OriginalResponse => _response;
{
get { return _response; }
}
public int StatusCode public int StatusCode
{ {
get { return this._response.StatusCode; } get => this._response.StatusCode;
set { this._response.StatusCode = value; } set => this._response.StatusCode = value;
} }
public string StatusDescription public string StatusDescription
{ {
get { return this._response.StatusDescription; } get => this._response.StatusDescription;
set { this._response.StatusDescription = value; } set => this._response.StatusDescription = value;
} }
public string ContentType public string ContentType
{ {
get { return _response.ContentType; } get => _response.ContentType;
set { _response.ContentType = value; } set => _response.ContentType = value;
} }
//public ICookies Cookies { get; set; } //public ICookies Cookies { get; set; }
@ -67,13 +64,7 @@ namespace Jellyfin.SocketSharp
_response.AddHeader(name, value); _response.AddHeader(name, value);
} }
public QueryParamCollection Headers public QueryParamCollection Headers => _response.Headers;
{
get
{
return _response.Headers;
}
}
public string GetHeader(string name) public string GetHeader(string name)
{ {
@ -85,10 +76,7 @@ namespace Jellyfin.SocketSharp
_response.Redirect(url); _response.Redirect(url);
} }
public Stream OutputStream public Stream OutputStream => _response.OutputStream;
{
get { return _response.OutputStream; }
}
public void Close() public void Close()
{ {
@ -179,8 +167,8 @@ namespace Jellyfin.SocketSharp
public bool SendChunked public bool SendChunked
{ {
get { return _response.SendChunked; } get => _response.SendChunked;
set { _response.SendChunked = value; } set => _response.SendChunked = value;
} }
public bool KeepAlive { get; set; } public bool KeepAlive { get; set; }

@ -22,25 +22,13 @@ namespace MediaBrowser.Api
/// Gets or sets the logger. /// Gets or sets the logger.
/// </summary> /// </summary>
/// <value>The logger.</value> /// <value>The logger.</value>
public ILogger Logger public ILogger Logger => ApiEntryPoint.Instance.Logger;
{
get
{
return ApiEntryPoint.Instance.Logger;
}
}
/// <summary> /// <summary>
/// Gets or sets the HTTP result factory. /// Gets or sets the HTTP result factory.
/// </summary> /// </summary>
/// <value>The HTTP result factory.</value> /// <value>The HTTP result factory.</value>
public IHttpResultFactory ResultFactory public IHttpResultFactory ResultFactory => ApiEntryPoint.Instance.ResultFactory;
{
get
{
return ApiEntryPoint.Instance.ResultFactory;
}
}
/// <summary> /// <summary>
/// Gets or sets the request context. /// Gets or sets the request context.

@ -45,13 +45,7 @@ namespace MediaBrowser.Api.LiveTv
_streamHelper = streamHelper; _streamHelper = streamHelper;
} }
public IDictionary<string, string> Headers public IDictionary<string, string> Headers => _outputHeaders;
{
get
{
return _outputHeaders;
}
}
private Stream GetInputStream(bool allowAsyncFileRead) private Stream GetInputStream(bool allowAsyncFileRead)
{ {

@ -141,10 +141,7 @@ namespace MediaBrowser.Api.Playback
return Path.Combine(folder, dataHash + (outputFileExtension ?? string.Empty).ToLower()); return Path.Combine(folder, dataHash + (outputFileExtension ?? string.Empty).ToLower());
} }
protected virtual bool EnableOutputInSubFolder protected virtual bool EnableOutputInSubFolder => false;
{
get { return false; }
}
protected readonly CultureInfo UsCulture = new CultureInfo("en-US"); protected readonly CultureInfo UsCulture = new CultureInfo("en-US");

@ -52,10 +52,7 @@ namespace MediaBrowser.Api.Playback.Hls
/// Gets the type of the transcoding job. /// Gets the type of the transcoding job.
/// </summary> /// </summary>
/// <value>The type of the transcoding job.</value> /// <value>The type of the transcoding job.</value>
protected override TranscodingJobType TranscodingJobType protected override TranscodingJobType TranscodingJobType => TranscodingJobType.Hls;
{
get { return TranscodingJobType.Hls; }
}
/// <summary> /// <summary>
/// Processes the request. /// Processes the request.

@ -102,10 +102,7 @@ namespace MediaBrowser.Api.Playback.Progressive
/// Gets the type of the transcoding job. /// Gets the type of the transcoding job.
/// </summary> /// </summary>
/// <value>The type of the transcoding job.</value> /// <value>The type of the transcoding job.</value>
protected override TranscodingJobType TranscodingJobType protected override TranscodingJobType TranscodingJobType => TranscodingJobType.Progressive;
{
get { return TranscodingJobType.Progressive; }
}
/// <summary> /// <summary>
/// Processes the request. /// Processes the request.

@ -50,13 +50,7 @@ namespace MediaBrowser.Api.Playback.Progressive
_environment = environment; _environment = environment;
} }
public IDictionary<string, string> Headers public IDictionary<string, string> Headers => _outputHeaders;
{
get
{
return _outputHeaders;
}
}
private Stream GetInputStream(bool allowAsyncFileRead) private Stream GetInputStream(bool allowAsyncFileRead)
{ {

@ -31,10 +31,7 @@ namespace MediaBrowser.Api.Playback
/// Gets the options. /// Gets the options.
/// </summary> /// </summary>
/// <value>The options.</value> /// <value>The options.</value>
public IDictionary<string, string> Headers public IDictionary<string, string> Headers => _options;
{
get { return _options; }
}
public async Task WriteToAsync(Stream responseStream, CancellationToken cancellationToken) public async Task WriteToAsync(Stream responseStream, CancellationToken cancellationToken)
{ {

@ -50,13 +50,7 @@ namespace MediaBrowser.Api.Playback
/// Gets a value indicating whether this instance has fixed resolution. /// Gets a value indicating whether this instance has fixed resolution.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value>
public bool HasFixedResolution public bool HasFixedResolution => Width.HasValue || Height.HasValue;
{
get
{
return Width.HasValue || Height.HasValue;
}
}
public bool EnableSubtitlesInManifest { get; set; } public bool EnableSubtitlesInManifest { get; set; }
} }

@ -17,7 +17,7 @@ namespace MediaBrowser.Api.Playback
public StreamRequest Request public StreamRequest Request
{ {
get { return (StreamRequest)BaseRequest; } get => (StreamRequest)BaseRequest;
set set
{ {
BaseRequest = value; BaseRequest = value;
@ -28,10 +28,7 @@ namespace MediaBrowser.Api.Playback
public TranscodingThrottler TranscodingThrottler { get; set; } public TranscodingThrottler TranscodingThrottler { get; set; }
public VideoStreamRequest VideoRequest public VideoStreamRequest VideoRequest => Request as VideoStreamRequest;
{
get { return Request as VideoStreamRequest; }
}
/// <summary> /// <summary>
/// Gets or sets the log file stream. /// Gets or sets the log file stream.
@ -42,10 +39,7 @@ namespace MediaBrowser.Api.Playback
public string WaitForPath { get; set; } public string WaitForPath { get; set; }
public bool IsOutputVideo public bool IsOutputVideo => Request is VideoStreamRequest;
{
get { return Request is VideoStreamRequest; }
}
public int SegmentLength public int SegmentLength
{ {
@ -98,13 +92,7 @@ namespace MediaBrowser.Api.Playback
} }
} }
public int HlsListSize public int HlsListSize => 0;
{
get
{
return 0;
}
}
public string UserAgent { get; set; } public string UserAgent { get; set; }

@ -24,10 +24,7 @@ namespace MediaBrowser.Api.ScheduledTasks
/// Gets the name. /// Gets the name.
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
protected override string Name protected override string Name => "ScheduledTasksInfo";
{
get { return "ScheduledTasksInfo"; }
}
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="ScheduledTasksWebSocketListener" /> class. /// Initializes a new instance of the <see cref="ScheduledTasksWebSocketListener" /> class.

@ -17,10 +17,7 @@ namespace MediaBrowser.Api.Session
/// Gets the name. /// Gets the name.
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
protected override string Name protected override string Name => "Sessions";
{
get { return "Sessions"; }
}
/// <summary> /// <summary>
/// The _kernel /// The _kernel

@ -17,10 +17,7 @@ namespace MediaBrowser.Api.System
/// Gets the name. /// Gets the name.
/// </summary> /// </summary>
/// <value>The name.</value> /// <value>The name.</value>
protected override string Name protected override string Name => "ActivityLogEntry";
{
get { return "ActivityLogEntry"; }
}
/// <summary> /// <summary>
/// The _kernel /// The _kernel

@ -24,11 +24,8 @@ namespace MediaBrowser.Common.Net
/// <value>The accept header.</value> /// <value>The accept header.</value>
public string AcceptHeader public string AcceptHeader
{ {
get { return GetHeaderValue("Accept"); } get => GetHeaderValue("Accept");
set set => RequestHeaders["Accept"] = value;
{
RequestHeaders["Accept"] = value;
}
} }
/// <summary> /// <summary>
/// Gets or sets the cancellation token. /// Gets or sets the cancellation token.
@ -48,11 +45,8 @@ namespace MediaBrowser.Common.Net
/// <value>The user agent.</value> /// <value>The user agent.</value>
public string UserAgent public string UserAgent
{ {
get { return GetHeaderValue("User-Agent"); } get => GetHeaderValue("User-Agent");
set set => RequestHeaders["User-Agent"] = value;
{
RequestHeaders["User-Agent"] = value;
}
} }
/// <summary> /// <summary>

@ -18,10 +18,7 @@ namespace MediaBrowser.Common.Plugins
/// Gets the description. /// Gets the description.
/// </summary> /// </summary>
/// <value>The description.</value> /// <value>The description.</value>
public virtual string Description public virtual string Description => string.Empty;
{
get { return string.Empty; }
}
/// <summary> /// <summary>
/// Gets the unique id. /// Gets the unique id.
@ -108,10 +105,7 @@ namespace MediaBrowser.Common.Plugins
/// Gets the type of configuration this plugin uses /// Gets the type of configuration this plugin uses
/// </summary> /// </summary>
/// <value>The type of the configuration.</value> /// <value>The type of the configuration.</value>
public Type ConfigurationType public Type ConfigurationType => typeof(TConfigurationType);
{
get { return typeof(TConfigurationType); }
}
private Action<string> _directoryCreateFn; private Action<string> _directoryCreateFn;
public void SetStartupInfo(Action<string> directoryCreateFn) public void SetStartupInfo(Action<string> directoryCreateFn)
@ -124,13 +118,7 @@ namespace MediaBrowser.Common.Plugins
/// Gets the name the assembly file /// Gets the name the assembly file
/// </summary> /// </summary>
/// <value>The name of the assembly file.</value> /// <value>The name of the assembly file.</value>
protected string AssemblyFileName protected string AssemblyFileName => Path.GetFileName(AssemblyFilePath);
{
get
{
return Path.GetFileName(AssemblyFilePath);
}
}
/// <summary> /// <summary>
/// The _configuration sync lock /// The _configuration sync lock
@ -161,10 +149,7 @@ namespace MediaBrowser.Common.Plugins
} }
return _configuration; return _configuration;
} }
protected set protected set => _configuration = value;
{
_configuration = value;
}
} }
private TConfigurationType LoadConfiguration() private TConfigurationType LoadConfiguration()
@ -185,22 +170,13 @@ namespace MediaBrowser.Common.Plugins
/// Gets the name of the configuration file. Subclasses should override /// Gets the name of the configuration file. Subclasses should override
/// </summary> /// </summary>
/// <value>The name of the configuration file.</value> /// <value>The name of the configuration file.</value>
public virtual string ConfigurationFileName public virtual string ConfigurationFileName => Path.ChangeExtension(AssemblyFileName, ".xml");
{
get { return Path.ChangeExtension(AssemblyFileName, ".xml"); }
}
/// <summary> /// <summary>
/// Gets the full path to the configuration file /// Gets the full path to the configuration file
/// </summary> /// </summary>
/// <value>The configuration file path.</value> /// <value>The configuration file path.</value>
public string ConfigurationFilePath public string ConfigurationFilePath => Path.Combine(ApplicationPaths.PluginConfigurationsPath, ConfigurationFileName);
{
get
{
return Path.Combine(ApplicationPaths.PluginConfigurationsPath, ConfigurationFileName);
}
}
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="BasePlugin{TConfigurationType}" /> class. /// Initializes a new instance of the <see cref="BasePlugin{TConfigurationType}" /> class.
@ -253,10 +229,7 @@ namespace MediaBrowser.Common.Plugins
/// Gets the plugin's configuration /// Gets the plugin's configuration
/// </summary> /// </summary>
/// <value>The configuration.</value> /// <value>The configuration.</value>
BasePluginConfiguration IHasPluginConfiguration.Configuration BasePluginConfiguration IHasPluginConfiguration.Configuration => Configuration;
{
get { return Configuration; }
}
public override PluginInfo GetPluginInfo() public override PluginInfo GetPluginInfo()
{ {

@ -31,19 +31,10 @@ namespace MediaBrowser.Controller.Channels
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override SourceType SourceType public override SourceType SourceType => SourceType.Channel;
{
get { return SourceType.Channel; }
}
protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query) protected override QueryResult<BaseItem> GetItemsInternal(InternalItemsQuery query)
{ {

@ -24,10 +24,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsPhysicalRoot public override bool IsPhysicalRoot => true;
{
get { return true; }
}
public override bool CanDelete() public override bool CanDelete()
{ {
@ -35,13 +32,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => false;
{
get
{
return false;
}
}
/// <summary> /// <summary>
/// The _virtual children /// The _virtual children
@ -52,19 +43,10 @@ namespace MediaBrowser.Controller.Entities
/// Gets the virtual children. /// Gets the virtual children.
/// </summary> /// </summary>
/// <value>The virtual children.</value> /// <value>The virtual children.</value>
public ConcurrentBag<BaseItem> VirtualChildren public ConcurrentBag<BaseItem> VirtualChildren => _virtualChildren;
{
get { return _virtualChildren; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override string[] PhysicalLocations public override string[] PhysicalLocations => PhysicalLocationsList;
{
get
{
return PhysicalLocationsList;
}
}
public string[] PhysicalLocationsList { get; set; } public string[] PhysicalLocationsList { get; set; }

@ -41,49 +41,22 @@ namespace MediaBrowser.Controller.Entities.Audio
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get { return false; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAddingToPlaylist public override bool SupportsAddingToPlaylist => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
protected override bool SupportsOwnedItems protected override bool SupportsOwnedItems => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override Folder LatestItemsIndexContainer public override Folder LatestItemsIndexContainer => AlbumEntity;
{
get
{
return AlbumEntity;
}
}
public override bool CanDownload() public override bool CanDownload()
{ {
@ -115,23 +88,14 @@ namespace MediaBrowser.Controller.Entities.Audio
} }
[IgnoreDataMember] [IgnoreDataMember]
public MusicAlbum AlbumEntity public MusicAlbum AlbumEntity => FindParent<MusicAlbum>();
{
get { return FindParent<MusicAlbum>(); }
}
/// <summary> /// <summary>
/// Gets the type of the media. /// Gets the type of the media.
/// </summary> /// </summary>
/// <value>The type of the media.</value> /// <value>The type of the media.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string MediaType public override string MediaType => Model.Entities.MediaType.Audio;
{
get
{
return Model.Entities.MediaType.Audio;
}
}
/// <summary> /// <summary>
/// Creates the name of the sort. /// Creates the name of the sort.

@ -28,22 +28,13 @@ namespace MediaBrowser.Controller.Entities.Audio
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAddingToPlaylist public override bool SupportsAddingToPlaylist => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public MusicArtist MusicArtist public MusicArtist MusicArtist => GetMusicArtist(new DtoOptions(true));
{
get { return GetMusicArtist(new DtoOptions(true)); }
}
public MusicArtist GetMusicArtist(DtoOptions options) public MusicArtist GetMusicArtist(DtoOptions options)
{ {
@ -66,22 +57,10 @@ namespace MediaBrowser.Controller.Entities.Audio
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsCumulativeRunTimeTicks public override bool SupportsCumulativeRunTimeTicks => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public string[] AllArtists public string[] AllArtists
@ -107,29 +86,17 @@ namespace MediaBrowser.Controller.Entities.Audio
} }
[IgnoreDataMember] [IgnoreDataMember]
public string AlbumArtist public string AlbumArtist => AlbumArtists.Length == 0 ? null : AlbumArtists[0];
{
get { return AlbumArtists.Length == 0 ? null : AlbumArtists[0]; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get { return false; }
}
/// <summary> /// <summary>
/// Gets the tracks. /// Gets the tracks.
/// </summary> /// </summary>
/// <value>The tracks.</value> /// <value>The tracks.</value>
[IgnoreDataMember] [IgnoreDataMember]
public IEnumerable<BaseItem> Tracks public IEnumerable<BaseItem> Tracks => GetRecursiveChildren(i => i is Audio);
{
get
{
return GetRecursiveChildren(i => i is Audio);
}
}
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user) protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
{ {

@ -19,61 +19,25 @@ namespace MediaBrowser.Controller.Entities.Audio
public class MusicArtist : Folder, IItemByName, IHasMusicGenres, IHasDualAccess, IHasLookupInfo<ArtistInfo> public class MusicArtist : Folder, IItemByName, IHasMusicGenres, IHasDualAccess, IHasLookupInfo<ArtistInfo>
{ {
[IgnoreDataMember] [IgnoreDataMember]
public bool IsAccessedByName public bool IsAccessedByName => ParentId.Equals(Guid.Empty);
{
get { return ParentId.Equals(Guid.Empty); }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsFolder public override bool IsFolder => !IsAccessedByName;
{
get
{
return !IsAccessedByName;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsCumulativeRunTimeTicks public override bool SupportsCumulativeRunTimeTicks => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsDisplayedAsFolder public override bool IsDisplayedAsFolder => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAddingToPlaylist public override bool SupportsAddingToPlaylist => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => false;
{
get
{
return false;
}
}
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
{ {
@ -154,13 +118,7 @@ namespace MediaBrowser.Controller.Entities.Audio
/// </summary> /// </summary>
/// <value>The containing folder path.</value> /// <value>The containing folder path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string ContainingFolderPath public override string ContainingFolderPath => Path;
{
get
{
return Path;
}
}
/// <summary> /// <summary>
/// Gets the user data key. /// Gets the user data key.
@ -207,13 +165,7 @@ namespace MediaBrowser.Controller.Entities.Audio
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
public static string GetPath(string name) public static string GetPath(string name)
{ {

@ -24,28 +24,13 @@ namespace MediaBrowser.Controller.Entities.Audio
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAddingToPlaylist public override bool SupportsAddingToPlaylist => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAncestors public override bool SupportsAncestors => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsDisplayedAsFolder public override bool IsDisplayedAsFolder => true;
{
get
{
return true;
}
}
/// <summary> /// <summary>
/// Returns the folder containing the item. /// Returns the folder containing the item.
@ -53,13 +38,7 @@ namespace MediaBrowser.Controller.Entities.Audio
/// </summary> /// </summary>
/// <value>The containing folder path.</value> /// <value>The containing folder path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string ContainingFolderPath public override string ContainingFolderPath => Path;
{
get
{
return Path;
}
}
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
{ {
@ -77,13 +56,7 @@ namespace MediaBrowser.Controller.Entities.Audio
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
public IList<BaseItem> GetTaggedItems(InternalItemsQuery query) public IList<BaseItem> GetTaggedItems(InternalItemsQuery query)
{ {

@ -8,22 +8,10 @@ namespace MediaBrowser.Controller.Entities
public class AudioBook : Audio.Audio, IHasSeries, IHasLookupInfo<SongInfo> public class AudioBook : Audio.Audio, IHasSeries, IHasLookupInfo<SongInfo>
{ {
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPositionTicksResume public override bool SupportsPositionTicksResume => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public string SeriesPresentationUniqueKey { get; set; } public string SeriesPresentationUniqueKey { get; set; }

@ -108,19 +108,10 @@ namespace MediaBrowser.Controller.Entities
public Guid ChannelId { get; set; } public Guid ChannelId { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsAddingToPlaylist public virtual bool SupportsAddingToPlaylist => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool AlwaysScanInternalMetadataPath public virtual bool AlwaysScanInternalMetadataPath => false;
{
get { return false; }
}
/// <summary> /// <summary>
/// Gets a value indicating whether this instance is in mixed folder. /// Gets a value indicating whether this instance is in mixed folder.
@ -130,31 +121,13 @@ namespace MediaBrowser.Controller.Entities
public bool IsInMixedFolder { get; set; } public bool IsInMixedFolder { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsPlayedStatus public virtual bool SupportsPlayedStatus => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsPositionTicksResume public virtual bool SupportsPositionTicksResume => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsRemoteImageDownloading public virtual bool SupportsRemoteImageDownloading => true;
{
get
{
return true;
}
}
private string _name; private string _name;
/// <summary> /// <summary>
@ -164,10 +137,7 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember] [IgnoreDataMember]
public virtual string Name public virtual string Name
{ {
get get => _name;
{
return _name;
}
set set
{ {
_name = value; _name = value;
@ -178,10 +148,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsUnaired public bool IsUnaired => PremiereDate.HasValue && PremiereDate.Value.ToLocalTime().Date >= DateTime.Now.Date;
{
get { return PremiereDate.HasValue && PremiereDate.Value.ToLocalTime().Date >= DateTime.Now.Date; }
}
[IgnoreDataMember] [IgnoreDataMember]
public int? TotalBitrate { get; set; } public int? TotalBitrate { get; set; }
@ -189,13 +156,7 @@ namespace MediaBrowser.Controller.Entities
public ExtraType? ExtraType { get; set; } public ExtraType? ExtraType { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsThemeMedia public bool IsThemeMedia => ExtraType.HasValue && (ExtraType.Value == Model.Entities.ExtraType.ThemeSong || ExtraType.Value == Model.Entities.ExtraType.ThemeVideo);
{
get
{
return ExtraType.HasValue && (ExtraType.Value == Model.Entities.ExtraType.ThemeSong || ExtraType.Value == Model.Entities.ExtraType.ThemeVideo);
}
}
[IgnoreDataMember] [IgnoreDataMember]
public string OriginalTitle { get; set; } public string OriginalTitle { get; set; }
@ -295,13 +256,7 @@ namespace MediaBrowser.Controller.Entities
public string ExternalEtag { get; set; } public string ExternalEtag { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool IsHidden public virtual bool IsHidden => false;
{
get
{
return false;
}
}
public BaseItem GetOwner() public BaseItem GetOwner()
{ {
@ -362,22 +317,10 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsFileProtocol public bool IsFileProtocol => IsPathProtocol(MediaProtocol.File);
{
get
{
return IsPathProtocol(MediaProtocol.File);
}
}
[IgnoreDataMember] [IgnoreDataMember]
public bool HasPathProtocol public bool HasPathProtocol => PathProtocol.HasValue;
{
get
{
return PathProtocol.HasValue;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsLocalMetadata public virtual bool SupportsLocalMetadata
@ -408,13 +351,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool EnableAlphaNumericSorting public virtual bool EnableAlphaNumericSorting => true;
{
get
{
return true;
}
}
private List<Tuple<StringBuilder, bool>> GetSortChunks(string s1) private List<Tuple<StringBuilder, bool>> GetSortChunks(string s1)
{ {
@ -455,10 +392,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The primary image path.</value> /// <value>The primary image path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public string PrimaryImagePath public string PrimaryImagePath => this.GetImagePath(ImageType.Primary);
{
get { return this.GetImagePath(ImageType.Primary); }
}
public bool IsMetadataFetcherEnabled(LibraryOptions libraryOptions, string name) public bool IsMetadataFetcherEnabled(LibraryOptions libraryOptions, string name)
{ {
@ -637,13 +571,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The type of the media.</value> /// <value>The type of the media.</value>
[IgnoreDataMember] [IgnoreDataMember]
public virtual string MediaType public virtual string MediaType => null;
{
get
{
return null;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual string[] PhysicalLocations public virtual string[] PhysicalLocations
@ -667,7 +595,7 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember] [IgnoreDataMember]
public string ForcedSortName public string ForcedSortName
{ {
get { return _forcedSortName; } get => _forcedSortName;
set { _forcedSortName = value; _sortName = null; } set { _forcedSortName = value; _sortName = null; }
} }
@ -695,10 +623,7 @@ namespace MediaBrowser.Controller.Entities
} }
return _sortName; return _sortName;
} }
set set => _sortName = value;
{
_sortName = value;
}
} }
public string GetInternalMetadataPath() public string GetInternalMetadataPath()
@ -816,7 +741,7 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember] [IgnoreDataMember]
public Folder Parent public Folder Parent
{ {
get { return GetParent() as Folder; } get => GetParent() as Folder;
set set
{ {
@ -1007,10 +932,7 @@ namespace MediaBrowser.Controller.Entities
public int? ParentIndexNumber { get; set; } public int? ParentIndexNumber { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool HasLocalAlternateVersions public virtual bool HasLocalAlternateVersions => false;
{
get { return false; }
}
[IgnoreDataMember] [IgnoreDataMember]
public string OfficialRatingForComparison public string OfficialRatingForComparison
@ -1426,22 +1348,13 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
protected virtual bool SupportsOwnedItems protected virtual bool SupportsOwnedItems => !ParentId.Equals(Guid.Empty) && IsFileProtocol;
{
get { return !ParentId.Equals(Guid.Empty) && IsFileProtocol; }
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsPeople public virtual bool SupportsPeople => false;
{
get { return false; }
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsThemeMedia public virtual bool SupportsThemeMedia => false;
{
get { return false; }
}
/// <summary> /// <summary>
/// Refreshes owned items such as trailers, theme videos, special features, etc. /// Refreshes owned items such as trailers, theme videos, special features, etc.
@ -1602,10 +1515,7 @@ namespace MediaBrowser.Controller.Entities
public Dictionary<string, string> ProviderIds { get; set; } public Dictionary<string, string> ProviderIds { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public virtual Folder LatestItemsIndexContainer public virtual Folder LatestItemsIndexContainer => null;
{
get { return null; }
}
public virtual double GetDefaultPrimaryImageAspectRatio() public virtual double GetDefaultPrimaryImageAspectRatio()
{ {
@ -1923,10 +1833,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsInheritedParentImages public virtual bool SupportsInheritedParentImages => false;
{
get { return false; }
}
protected bool IsVisibleStandaloneInternal(User user, bool checkFolders) protected bool IsVisibleStandaloneInternal(User user, bool checkFolders)
{ {
@ -1969,22 +1876,10 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is folder; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is folder; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool IsFolder public virtual bool IsFolder => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool IsDisplayedAsFolder public virtual bool IsDisplayedAsFolder => false;
{
get
{
return false;
}
}
public virtual string GetClientTypeName() public virtual string GetClientTypeName()
{ {
@ -2070,13 +1965,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool EnableRememberingTrackSelections public virtual bool EnableRememberingTrackSelections => true;
{
get
{
return true;
}
}
/// <summary> /// <summary>
/// Adds a studio to the item /// Adds a studio to the item
@ -2813,22 +2702,10 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsAncestors public virtual bool SupportsAncestors => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool StopRefreshIfLocalMetadataFound public virtual bool StopRefreshIfLocalMetadataFound => true;
{
get
{
return true;
}
}
public virtual IEnumerable<Guid> GetIdsForAncestorQuery() public virtual IEnumerable<Guid> GetIdsForAncestorQuery()
{ {
@ -2915,13 +2792,7 @@ namespace MediaBrowser.Controller.Entities
return GetExtras(); return GetExtras();
} }
public virtual bool IsHD public virtual bool IsHD => Height >= 720;
{
get
{
return Height >= 720;
}
}
public bool IsShortcut { get; set; } public bool IsShortcut { get; set; }
public string ShortcutPath { get; set; } public string ShortcutPath { get; set; }
public int Width { get; set; } public int Width { get; set; }
@ -2933,12 +2804,6 @@ namespace MediaBrowser.Controller.Entities
} }
// what does this do? // what does this do?
public static ExtraType[] DisplayExtraTypes = new[] { Model.Entities.ExtraType.ThemeSong, Model.Entities.ExtraType.ThemeVideo }; public static ExtraType[] DisplayExtraTypes = new[] { Model.Entities.ExtraType.ThemeSong, Model.Entities.ExtraType.ThemeVideo };
public virtual bool SupportsExternalTransfer public virtual bool SupportsExternalTransfer => false;
{
get
{
return false;
}
}
} }
} }

@ -10,10 +10,7 @@ namespace MediaBrowser.Controller.Entities
public abstract class BasePluginFolder : Folder, ICollectionFolder public abstract class BasePluginFolder : Folder, ICollectionFolder
{ {
[IgnoreDataMember] [IgnoreDataMember]
public virtual string CollectionType public virtual string CollectionType => null;
{
get { return null; }
}
public override bool CanDelete() public override bool CanDelete()
{ {
@ -26,22 +23,10 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
//public override double? GetDefaultPrimaryImageAspectRatio() //public override double? GetDefaultPrimaryImageAspectRatio()
//{ //{

@ -9,13 +9,7 @@ namespace MediaBrowser.Controller.Entities
public class Book : BaseItem, IHasLookupInfo<BookInfo>, IHasSeries public class Book : BaseItem, IHasLookupInfo<BookInfo>, IHasSeries
{ {
[IgnoreDataMember] [IgnoreDataMember]
public override string MediaType public override string MediaType => Model.Entities.MediaType.Book;
{
get
{
return Model.Entities.MediaType.Book;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public string SeriesPresentationUniqueKey { get; set; } public string SeriesPresentationUniqueKey { get; set; }

@ -34,22 +34,10 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
public override bool CanDelete() public override bool CanDelete()
{ {
@ -158,22 +146,10 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The display prefs id.</value> /// <value>The display prefs id.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override Guid DisplayPreferencesId public override Guid DisplayPreferencesId => Id;
{
get
{
return Id;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override string[] PhysicalLocations public override string[] PhysicalLocations => PhysicalLocationsList;
{
get
{
return PhysicalLocationsList;
}
}
public override bool IsSaveLocalMetadataEnabled() public override bool IsSaveLocalMetadataEnabled()
{ {
@ -337,10 +313,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The actual children.</value> /// <value>The actual children.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override IEnumerable<BaseItem> Children public override IEnumerable<BaseItem> Children => GetActualChildren();
{
get { return GetActualChildren(); }
}
public IEnumerable<BaseItem> GetActualChildren() public IEnumerable<BaseItem> GetActualChildren()
{ {
@ -386,12 +359,6 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
} }
} }

@ -47,80 +47,35 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsThemeMedia public override bool SupportsThemeMedia => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool IsPreSorted public virtual bool IsPreSorted => false;
{
get { return false; }
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool IsPhysicalRoot public virtual bool IsPhysicalRoot => false;
{
get { return false; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => true;
{
get
{
return true;
}
}
/// <summary> /// <summary>
/// Gets a value indicating whether this instance is folder. /// Gets a value indicating whether this instance is folder.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is folder; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is folder; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsFolder public override bool IsFolder => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsDisplayedAsFolder public override bool IsDisplayedAsFolder => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsCumulativeRunTimeTicks public virtual bool SupportsCumulativeRunTimeTicks => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public virtual bool SupportsDateLastMediaAdded public virtual bool SupportsDateLastMediaAdded => false;
{
get
{
return false;
}
}
public override bool CanDelete() public override bool CanDelete()
{ {
@ -172,10 +127,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
protected virtual bool SupportsShortcutChildren protected virtual bool SupportsShortcutChildren => false;
{
get { return false; }
}
/// <summary> /// <summary>
/// Adds the child. /// Adds the child.
@ -210,23 +162,14 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The actual children.</value> /// <value>The actual children.</value>
[IgnoreDataMember] [IgnoreDataMember]
public virtual IEnumerable<BaseItem> Children public virtual IEnumerable<BaseItem> Children => LoadChildren();
{
get
{
return LoadChildren();
}
}
/// <summary> /// <summary>
/// thread-safe access to all recursive children of this folder - without regard to user /// thread-safe access to all recursive children of this folder - without regard to user
/// </summary> /// </summary>
/// <value>The recursive children.</value> /// <value>The recursive children.</value>
[IgnoreDataMember] [IgnoreDataMember]
public IEnumerable<BaseItem> RecursiveChildren public IEnumerable<BaseItem> RecursiveChildren => GetRecursiveChildren();
{
get { return GetRecursiveChildren(); }
}
public override bool IsVisible(User user) public override bool IsVisible(User user)
{ {
@ -1421,13 +1364,7 @@ namespace MediaBrowser.Controller.Entities
return list; return list;
} }
protected virtual bool FilterLinkedChildrenPerUser protected virtual bool FilterLinkedChildrenPerUser => false;
{
get
{
return false;
}
}
public bool ContainsLinkedChildByItemId(Guid itemId) public bool ContainsLinkedChildByItemId(Guid itemId)
{ {
@ -1524,13 +1461,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
protected override bool SupportsOwnedItems protected override bool SupportsOwnedItems => base.SupportsOwnedItems || SupportsShortcutChildren;
{
get
{
return base.SupportsOwnedItems || SupportsShortcutChildren;
}
}
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken) protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
{ {

@ -27,26 +27,17 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsThemeMedia public override bool SupportsThemeMedia => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get { return false; }
}
/// <summary> /// <summary>
/// Gets the type of the media. /// Gets the type of the media.
/// </summary> /// </summary>
/// <value>The type of the media.</value> /// <value>The type of the media.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string MediaType public override string MediaType => Model.Entities.MediaType.Game;
{
get { return Model.Entities.MediaType.Game; }
}
/// <summary> /// <summary>
/// Gets or sets the players supported. /// Gets or sets the players supported.

@ -32,22 +32,10 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The containing folder path.</value> /// <value>The containing folder path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string ContainingFolderPath public override string ContainingFolderPath => Path;
{
get
{
return Path;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAncestors public override bool SupportsAncestors => false;
{
get
{
return false;
}
}
public override bool IsSaveLocalMetadataEnabled() public override bool IsSaveLocalMetadataEnabled()
{ {
@ -68,13 +56,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
public static string GetPath(string name) public static string GetPath(string name)
{ {

@ -18,31 +18,13 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The display prefs id.</value> /// <value>The display prefs id.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override Guid DisplayPreferencesId public override Guid DisplayPreferencesId => Id;
{
get
{
return Id;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
{ {
@ -90,12 +72,6 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
} }
} }

@ -35,31 +35,13 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The containing folder path.</value> /// <value>The containing folder path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string ContainingFolderPath public override string ContainingFolderPath => Path;
{
get
{
return Path;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsDisplayedAsFolder public override bool IsDisplayedAsFolder => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAncestors public override bool SupportsAncestors => false;
{
get
{
return false;
}
}
public override bool IsSaveLocalMetadataEnabled() public override bool IsSaveLocalMetadataEnabled()
{ {
@ -80,13 +62,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
public static string GetPath(string name) public static string GetPath(string name)
{ {

@ -25,28 +25,13 @@ namespace MediaBrowser.Controller.Entities.Movies
} }
[IgnoreDataMember] [IgnoreDataMember]
protected override bool FilterLinkedChildrenPerUser protected override bool FilterLinkedChildrenPerUser => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => true;
{
get { return true; }
}
public Guid[] LocalTrailerIds { get; set; } public Guid[] LocalTrailerIds { get; set; }
public Guid[] RemoteTrailerIds { get; set; } public Guid[] RemoteTrailerIds { get; set; }
@ -110,13 +95,7 @@ namespace MediaBrowser.Controller.Entities.Movies
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsPreSorted public override bool IsPreSorted => true;
{
get
{
return true;
}
}
public override bool IsAuthorizedToDelete(User user, List<Folder> allCollectionFolders) public override bool IsAuthorizedToDelete(User user, List<Folder> allCollectionFolders)
{ {

@ -39,8 +39,8 @@ namespace MediaBrowser.Controller.Entities.Movies
[IgnoreDataMember] [IgnoreDataMember]
public string CollectionName public string CollectionName
{ {
get { return TmdbCollectionName; } get => TmdbCollectionName;
set { TmdbCollectionName = value; } set => TmdbCollectionName = value;
} }
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
@ -184,13 +184,6 @@ namespace MediaBrowser.Controller.Entities.Movies
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool StopRefreshIfLocalMetadataFound public override bool StopRefreshIfLocalMetadataFound => false;
{
get
{
// Need people id's from internet metadata
return false;
}
}
} }
} }

@ -17,13 +17,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public string[] AllArtists public string[] AllArtists => Artists;
{
get
{
return Artists;
}
}
public override UnratedItem GetBlockUnratedType() public override UnratedItem GetBlockUnratedType()
{ {

@ -51,13 +51,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The containing folder path.</value> /// <value>The containing folder path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string ContainingFolderPath public override string ContainingFolderPath => Path;
{
get
{
return Path;
}
}
public override bool CanDelete() public override bool CanDelete()
{ {
@ -70,31 +64,13 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool EnableAlphaNumericSorting public override bool EnableAlphaNumericSorting => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAncestors public override bool SupportsAncestors => false;
{
get
{
return false;
}
}
public static string GetPath(string name) public static string GetPath(string name)
{ {

@ -6,31 +6,13 @@ namespace MediaBrowser.Controller.Entities
public class Photo : BaseItem public class Photo : BaseItem
{ {
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsLocalMetadata public override bool SupportsLocalMetadata => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override string MediaType public override string MediaType => Model.Entities.MediaType.Photo;
{
get
{
return Model.Entities.MediaType.Photo;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override Folder LatestItemsIndexContainer public override Folder LatestItemsIndexContainer => AlbumEntity;
{
get
{
return AlbumEntity;
}
}
[IgnoreDataMember] [IgnoreDataMember]

@ -5,30 +5,12 @@ namespace MediaBrowser.Controller.Entities
public class PhotoAlbum : Folder public class PhotoAlbum : Folder
{ {
[IgnoreDataMember] [IgnoreDataMember]
public override bool AlwaysScanInternalMetadataPath public override bool AlwaysScanInternalMetadataPath => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
} }
} }

@ -29,31 +29,13 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The containing folder path.</value> /// <value>The containing folder path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string ContainingFolderPath public override string ContainingFolderPath => Path;
{
get
{
return Path;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsDisplayedAsFolder public override bool IsDisplayedAsFolder => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAncestors public override bool SupportsAncestors => false;
{
get
{
return false;
}
}
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
{ {
@ -81,13 +63,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
public static string GetPath(string name) public static string GetPath(string name)
{ {

@ -47,61 +47,25 @@ namespace MediaBrowser.Controller.Entities.TV
} }
[IgnoreDataMember] [IgnoreDataMember]
protected override bool SupportsOwnedItems protected override bool SupportsOwnedItems => IsStacked || MediaSourceCount > 1;
{
get
{
return IsStacked || MediaSourceCount > 1;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public int? AiredSeasonNumber public int? AiredSeasonNumber => AirsAfterSeasonNumber ?? AirsBeforeSeasonNumber ?? ParentIndexNumber;
{
get
{
return AirsAfterSeasonNumber ?? AirsBeforeSeasonNumber ?? ParentIndexNumber;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override Folder LatestItemsIndexContainer public override Folder LatestItemsIndexContainer => Series;
{
get
{
return Series;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override Guid DisplayParentId public override Guid DisplayParentId => SeasonId;
{
get
{
return SeasonId;
}
}
[IgnoreDataMember] [IgnoreDataMember]
protected override bool EnableDefaultVideoUserDataKeys protected override bool EnableDefaultVideoUserDataKeys => false;
{
get
{
return false;
}
}
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
{ {
@ -166,13 +130,7 @@ namespace MediaBrowser.Controller.Entities.TV
} }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsInSeasonFolder public bool IsInSeasonFolder => FindParent<Season>() != null;
{
get
{
return FindParent<Season>() != null;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public string SeriesPresentationUniqueKey { get; set; } public string SeriesPresentationUniqueKey { get; set; }
@ -278,13 +236,7 @@ namespace MediaBrowser.Controller.Entities.TV
} }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsMissingEpisode public bool IsMissingEpisode => LocationType == LocationType.Virtual;
{
get
{
return LocationType == LocationType.Virtual;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public Guid SeasonId { get; set; } public Guid SeasonId { get; set; }

@ -16,46 +16,22 @@ namespace MediaBrowser.Controller.Entities.TV
public class Season : Folder, IHasSeries, IHasLookupInfo<SeasonInfo> public class Season : Folder, IHasSeries, IHasLookupInfo<SeasonInfo>
{ {
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAddingToPlaylist public override bool SupportsAddingToPlaylist => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsPreSorted public override bool IsPreSorted => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsDateLastMediaAdded public override bool SupportsDateLastMediaAdded => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override Guid DisplayParentId public override Guid DisplayParentId => SeriesId;
{
get { return SeriesId; }
}
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
{ {

@ -32,43 +32,19 @@ namespace MediaBrowser.Controller.Entities.TV
public string AirTime { get; set; } public string AirTime { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAddingToPlaylist public override bool SupportsAddingToPlaylist => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsPreSorted public override bool IsPreSorted => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsDateLastMediaAdded public override bool SupportsDateLastMediaAdded => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => true;
{
get { return true; }
}
public Guid[] LocalTrailerIds { get; set; } public Guid[] LocalTrailerIds { get; set; }
public Guid[] RemoteTrailerIds { get; set; } public Guid[] RemoteTrailerIds { get; set; }
@ -526,13 +502,6 @@ namespace MediaBrowser.Controller.Entities.TV
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool StopRefreshIfLocalMetadataFound public override bool StopRefreshIfLocalMetadataFound => false;
{
get
{
// Need people id's from internet metadata
return false;
}
}
} }
} }

@ -94,13 +94,6 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool StopRefreshIfLocalMetadataFound public override bool StopRefreshIfLocalMetadataFound => false;
{
get
{
// Need people id's from internet metadata
return false;
}
}
} }
} }

@ -40,14 +40,8 @@ namespace MediaBrowser.Controller.Entities
// Strictly to remove IgnoreDataMember // Strictly to remove IgnoreDataMember
public override ItemImageInfo[] ImageInfos public override ItemImageInfo[] ImageInfos
{ {
get get => base.ImageInfos;
{ set => base.ImageInfos = value;
return base.ImageInfos;
}
set
{
base.ImageInfos = value;
}
} }
/// <summary> /// <summary>
@ -57,15 +51,8 @@ namespace MediaBrowser.Controller.Entities
[IgnoreDataMember] [IgnoreDataMember]
public override string Path public override string Path
{ {
get get => ConfigurationDirectoryPath;
{ set => base.Path = value;
// Return this so that metadata providers will look in here
return ConfigurationDirectoryPath;
}
set
{
base.Path = value;
}
} }
private string _name; private string _name;
@ -75,10 +62,7 @@ namespace MediaBrowser.Controller.Entities
/// <value>The name.</value> /// <value>The name.</value>
public override string Name public override string Name
{ {
get get => _name;
{
return _name;
}
set set
{ {
_name = value; _name = value;
@ -94,26 +78,14 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The containing folder path.</value> /// <value>The containing folder path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string ContainingFolderPath public override string ContainingFolderPath => Path;
{
get
{
return Path;
}
}
/// <summary> /// <summary>
/// Gets the root folder. /// Gets the root folder.
/// </summary> /// </summary>
/// <value>The root folder.</value> /// <value>The root folder.</value>
[IgnoreDataMember] [IgnoreDataMember]
public Folder RootFolder public Folder RootFolder => LibraryManager.GetUserRootFolder();
{
get
{
return LibraryManager.GetUserRootFolder();
}
}
/// <summary> /// <summary>
/// Gets or sets the last login date. /// Gets or sets the last login date.
@ -146,7 +118,7 @@ namespace MediaBrowser.Controller.Entities
return _config; return _config;
} }
set { _config = value; } set => _config = value;
} }
private volatile UserPolicy _policy; private volatile UserPolicy _policy;
@ -169,7 +141,7 @@ namespace MediaBrowser.Controller.Entities
return _policy; return _policy;
} }
set { _policy = value; } set => _policy = value;
} }
/// <summary> /// <summary>
@ -232,13 +204,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The configuration directory path.</value> /// <value>The configuration directory path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public string ConfigurationDirectoryPath public string ConfigurationDirectoryPath => GetConfigurationDirectoryPath(Name);
{
get
{
return GetConfigurationDirectoryPath(Name);
}
}
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
{ {
@ -327,13 +293,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
public long InternalId { get; set; } public long InternalId { get; set; }

@ -31,10 +31,7 @@ namespace MediaBrowser.Controller.Entities
/// <exception cref="System.ArgumentOutOfRangeException">Rating;A 0 to 10 rating is required for UserItemData.</exception> /// <exception cref="System.ArgumentOutOfRangeException">Rating;A 0 to 10 rating is required for UserItemData.</exception>
public double? Rating public double? Rating
{ {
get get => _rating;
{
return _rating;
}
set set
{ {
if (value.HasValue) if (value.HasValue)

@ -34,22 +34,10 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => false;
{
get
{
return false;
}
}
private void ClearCache() private void ClearCache()
{ {
@ -88,22 +76,10 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
protected override bool SupportsShortcutChildren protected override bool SupportsShortcutChildren => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsPreSorted public override bool IsPreSorted => true;
{
get
{
return true;
}
}
protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user) protected override IEnumerable<BaseItem> GetEligibleChildrenForRecursiveChildren(User user)
{ {

@ -20,13 +20,7 @@ namespace MediaBrowser.Controller.Entities
public static IPlaylistManager PlaylistManager; public static IPlaylistManager PlaylistManager;
[IgnoreDataMember] [IgnoreDataMember]
public string CollectionType public string CollectionType => ViewType;
{
get
{
return ViewType;
}
}
public override IEnumerable<Guid> GetIdsForAncestorQuery() public override IEnumerable<Guid> GetIdsForAncestorQuery()
{ {
@ -48,22 +42,10 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => false;
{
get
{
return false;
}
}
public override int GetChildCount(User user) public override int GetChildCount(User user)
{ {
@ -188,12 +170,6 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
} }
} }

@ -33,28 +33,13 @@ namespace MediaBrowser.Controller.Entities
public LinkedChild[] LinkedAlternateVersions { get; set; } public LinkedChild[] LinkedAlternateVersions { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPositionTicksResume public override bool SupportsPositionTicksResume
@ -106,10 +91,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsThemeMedia public override bool SupportsThemeMedia => true;
{
get { return true; }
}
/// <summary> /// <summary>
/// Gets or sets the timestamp. /// Gets or sets the timestamp.
@ -199,10 +181,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAddingToPlaylist public override bool SupportsAddingToPlaylist => true;
{
get { return true; }
}
[IgnoreDataMember] [IgnoreDataMember]
public int MediaSourceCount public int MediaSourceCount
@ -222,16 +201,10 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsStacked public bool IsStacked => AdditionalParts.Length > 0;
{
get { return AdditionalParts.Length > 0; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool HasLocalAlternateVersions public override bool HasLocalAlternateVersions => LocalAlternateVersions.Length > 0;
{
get { return LocalAlternateVersions.Length > 0; }
}
public IEnumerable<Guid> GetAdditionalPartIds() public IEnumerable<Guid> GetAdditionalPartIds()
{ {
@ -289,13 +262,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
protected virtual bool EnableDefaultVideoUserDataKeys protected virtual bool EnableDefaultVideoUserDataKeys => true;
{
get
{
return true;
}
}
public override List<string> GetUserDataKeys() public override List<string> GetUserDataKeys()
{ {
@ -466,23 +433,14 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value><c>true</c> if [is3 D]; otherwise, <c>false</c>.</value> /// <value><c>true</c> if [is3 D]; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public bool Is3D public bool Is3D => Video3DFormat.HasValue;
{
get { return Video3DFormat.HasValue; }
}
/// <summary> /// <summary>
/// Gets the type of the media. /// Gets the type of the media.
/// </summary> /// </summary>
/// <value>The type of the media.</value> /// <value>The type of the media.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string MediaType public override string MediaType => Model.Entities.MediaType.Video;
{
get
{
return Model.Entities.MediaType.Video;
}
}
protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken) protected override async Task<bool> RefreshedOwnedItems(MetadataRefreshOptions options, List<FileSystemMetadata> fileSystemChildren, CancellationToken cancellationToken)
{ {

@ -25,13 +25,7 @@ namespace MediaBrowser.Controller.Entities
/// </summary> /// </summary>
/// <value>The containing folder path.</value> /// <value>The containing folder path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string ContainingFolderPath public override string ContainingFolderPath => Path;
{
get
{
return Path;
}
}
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
{ {
@ -42,13 +36,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAncestors public override bool SupportsAncestors => false;
{
get
{
return false;
}
}
public override bool CanDelete() public override bool CanDelete()
{ {
@ -89,13 +77,7 @@ namespace MediaBrowser.Controller.Entities
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPeople public override bool SupportsPeople => false;
{
get
{
return false;
}
}
public static string GetPath(string name) public static string GetPath(string name)
{ {

@ -67,13 +67,7 @@ namespace MediaBrowser.Controller.Library
/// Gets a value indicating whether this instance is directory. /// Gets a value indicating whether this instance is directory.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is directory; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is directory; otherwise, <c>false</c>.</value>
public bool IsDirectory public bool IsDirectory => FileInfo.IsDirectory;
{
get
{
return FileInfo.IsDirectory;
}
}
/// <summary> /// <summary>
/// Gets a value indicating whether this instance is vf. /// Gets a value indicating whether this instance is vf.
@ -103,13 +97,7 @@ namespace MediaBrowser.Controller.Library
/// Gets a value indicating whether this instance is physical root. /// Gets a value indicating whether this instance is physical root.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is physical root; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is physical root; otherwise, <c>false</c>.</value>
public bool IsPhysicalRoot public bool IsPhysicalRoot => IsDirectory && BaseItem.FileSystem.AreEqual(Path, _appPaths.RootFolderPath);
{
get
{
return IsDirectory && BaseItem.FileSystem.AreEqual(Path, _appPaths.RootFolderPath);
}
}
/// <summary> /// <summary>
/// Gets or sets the additional locations. /// Gets or sets the additional locations.

@ -32,28 +32,13 @@ namespace MediaBrowser.Controller.LiveTv
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPositionTicksResume public override bool SupportsPositionTicksResume => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override SourceType SourceType public override SourceType SourceType => SourceType.LiveTV;
{
get { return SourceType.LiveTV; }
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool EnableRememberingTrackSelections public override bool EnableRememberingTrackSelections => false;
{
get
{
return false;
}
}
/// <summary> /// <summary>
/// Gets or sets the number. /// Gets or sets the number.
@ -68,14 +53,7 @@ namespace MediaBrowser.Controller.LiveTv
public ChannelType ChannelType { get; set; } public ChannelType ChannelType { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public override LocationType LocationType public override LocationType LocationType => LocationType.Remote;
{
get
{
// TODO: This should be removed
return LocationType.Remote;
}
}
protected override string CreateSortName() protected override string CreateSortName()
{ {
@ -93,13 +71,7 @@ namespace MediaBrowser.Controller.LiveTv
} }
[IgnoreDataMember] [IgnoreDataMember]
public override string MediaType public override string MediaType => ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video;
{
get
{
return ChannelType == ChannelType.Radio ? Model.Entities.MediaType.Audio : Model.Entities.MediaType.Video;
}
}
public override string GetClientTypeName() public override string GetClientTypeName()
{ {
@ -176,13 +148,7 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public bool IsKids public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase);
{
get
{
return Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase);
}
}
[IgnoreDataMember] [IgnoreDataMember]
public bool IsRepeat { get; set; } public bool IsRepeat { get; set; }

@ -63,10 +63,7 @@ namespace MediaBrowser.Controller.LiveTv
} }
[IgnoreDataMember] [IgnoreDataMember]
public override SourceType SourceType public override SourceType SourceType => SourceType.LiveTV;
{
get { return SourceType.LiveTV; }
}
/// <summary> /// <summary>
/// The start date of the program, in UTC. /// The start date of the program, in UTC.
@ -103,13 +100,7 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public bool IsSports public bool IsSports => Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase);
{
get
{
return Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase);
}
}
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance is series. /// Gets or sets a value indicating whether this instance is series.
@ -123,52 +114,28 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public bool IsLive public bool IsLive => Tags.Contains("Live", StringComparer.OrdinalIgnoreCase);
{
get
{
return Tags.Contains("Live", StringComparer.OrdinalIgnoreCase);
}
}
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance is news. /// Gets or sets a value indicating whether this instance is news.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is news; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public bool IsNews public bool IsNews => Tags.Contains("News", StringComparer.OrdinalIgnoreCase);
{
get
{
return Tags.Contains("News", StringComparer.OrdinalIgnoreCase);
}
}
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance is kids. /// Gets or sets a value indicating whether this instance is kids.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public bool IsKids public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase);
{
get
{
return Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase);
}
}
/// <summary> /// <summary>
/// Gets or sets a value indicating whether this instance is premiere. /// Gets or sets a value indicating whether this instance is premiere.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is premiere; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public bool IsPremiere public bool IsPremiere => Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase);
{
get
{
return Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase);
}
}
/// <summary> /// <summary>
/// Returns the folder containing the item. /// Returns the folder containing the item.
@ -176,13 +143,7 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary> /// </summary>
/// <value>The containing folder path.</value> /// <value>The containing folder path.</value>
[IgnoreDataMember] [IgnoreDataMember]
public override string ContainingFolderPath public override string ContainingFolderPath => Path;
{
get
{
return Path;
}
}
//[IgnoreDataMember] //[IgnoreDataMember]
//public override string MediaType //public override string MediaType
@ -251,13 +212,7 @@ namespace MediaBrowser.Controller.LiveTv
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsAncestors public override bool SupportsAncestors => false;
{
get
{
return false;
}
}
private LiveTvOptions GetConfiguration() private LiveTvOptions GetConfiguration()
{ {

@ -115,27 +115,11 @@ namespace MediaBrowser.Controller.LiveTv
/// <value>The episode number.</value> /// <value>The episode number.</value>
public int? EpisodeNumber { get; set; } public int? EpisodeNumber { get; set; }
public bool IsMovie { get; set; } public bool IsMovie { get; set; }
public bool IsKids public bool IsKids => Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase);
{
get public bool IsSports => Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase);
{
return Tags.Contains("Kids", StringComparer.OrdinalIgnoreCase); public bool IsNews => Tags.Contains("News", StringComparer.OrdinalIgnoreCase);
}
}
public bool IsSports
{
get
{
return Tags.Contains("Sports", StringComparer.OrdinalIgnoreCase);
}
}
public bool IsNews
{
get
{
return Tags.Contains("News", StringComparer.OrdinalIgnoreCase);
}
}
public bool IsSeries { get; set; } public bool IsSeries { get; set; }
/// <summary> /// <summary>
@ -143,22 +127,10 @@ namespace MediaBrowser.Controller.LiveTv
/// </summary> /// </summary>
/// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance is live; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public bool IsLive public bool IsLive => Tags.Contains("Live", StringComparer.OrdinalIgnoreCase);
{
get
{
return Tags.Contains("Live", StringComparer.OrdinalIgnoreCase);
}
}
[IgnoreDataMember] [IgnoreDataMember]
public bool IsPremiere public bool IsPremiere => Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase);
{
get
{
return Tags.Contains("Premiere", StringComparer.OrdinalIgnoreCase);
}
}
public int? ProductionYear { get; set; } public int? ProductionYear { get; set; }
public string EpisodeTitle { get; set; } public string EpisodeTitle { get; set; }

@ -61,53 +61,17 @@ namespace MediaBrowser.Controller.MediaEncoding
} }
} }
public bool IgnoreInputDts public bool IgnoreInputDts => MediaSource.IgnoreDts;
{
get
{
return MediaSource.IgnoreDts;
}
}
public bool IgnoreInputIndex public bool IgnoreInputIndex => MediaSource.IgnoreIndex;
{
get
{
return MediaSource.IgnoreIndex;
}
}
public bool GenPtsInput public bool GenPtsInput => MediaSource.GenPtsInput;
{
get
{
return MediaSource.GenPtsInput;
}
}
public bool DiscardCorruptFramesInput public bool DiscardCorruptFramesInput => false;
{
get
{
return false;
}
}
public bool EnableFastSeekInput public bool EnableFastSeekInput => false;
{
get
{
return false;
}
}
public bool GenPtsOutput public bool GenPtsOutput => false;
{
get
{
return false;
}
}
public string OutputContainer { get; set; } public string OutputContainer { get; set; }
@ -142,15 +106,9 @@ namespace MediaBrowser.Controller.MediaEncoding
public BaseEncodingJobOptions BaseRequest { get; set; } public BaseEncodingJobOptions BaseRequest { get; set; }
public long? StartTimeTicks public long? StartTimeTicks => BaseRequest.StartTimeTicks;
{
get { return BaseRequest.StartTimeTicks; }
}
public bool CopyTimestamps public bool CopyTimestamps => BaseRequest.CopyTimestamps;
{
get { return BaseRequest.CopyTimestamps; }
}
public int? OutputAudioBitrate; public int? OutputAudioBitrate;
public int? OutputAudioChannels; public int? OutputAudioChannels;
@ -323,13 +281,7 @@ namespace MediaBrowser.Controller.MediaEncoding
SupportedSubtitleCodecs = Array.Empty<string>(); SupportedSubtitleCodecs = Array.Empty<string>();
} }
public bool IsSegmentedLiveStream public bool IsSegmentedLiveStream => TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue;
{
get
{
return TranscodingType != TranscodingJobType.Progressive && !RunTimeTicks.HasValue;
}
}
public bool EnableBreakOnNonKeyFrames(string videoCodec) public bool EnableBreakOnNonKeyFrames(string videoCodec)
{ {
@ -346,13 +298,7 @@ namespace MediaBrowser.Controller.MediaEncoding
return false; return false;
} }
public int? TotalOutputBitrate public int? TotalOutputBitrate => (OutputAudioBitrate ?? 0) + (OutputVideoBitrate ?? 0);
{
get
{
return (OutputAudioBitrate ?? 0) + (OutputVideoBitrate ?? 0);
}
}
public int? OutputWidth public int? OutputWidth
{ {

@ -20,13 +20,7 @@ namespace MediaBrowser.Controller.MediaEncoding
/// Gets a value indicating whether this instance has fixed resolution. /// Gets a value indicating whether this instance has fixed resolution.
/// </summary> /// </summary>
/// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance has fixed resolution; otherwise, <c>false</c>.</value>
public bool HasFixedResolution public bool HasFixedResolution => Width.HasValue || Height.HasValue;
{
get
{
return Width.HasValue || Height.HasValue;
}
}
private readonly CultureInfo _usCulture = new CultureInfo("en-US"); private readonly CultureInfo _usCulture = new CultureInfo("en-US");
public EncodingJobOptions(StreamInfo info, DeviceProfile deviceProfile) public EncodingJobOptions(StreamInfo info, DeviceProfile deviceProfile)

@ -44,10 +44,7 @@ namespace MediaBrowser.Controller.Net
/// &gt;0 Executed after global request filters /// &gt;0 Executed after global request filters
/// </summary> /// </summary>
/// <value>The priority.</value> /// <value>The priority.</value>
public int Priority public int Priority => 0;
{
get { return 0; }
}
public string[] GetRoles() public string[] GetRoles()
{ {

@ -9,13 +9,7 @@ namespace MediaBrowser.Controller.Net
/// Gets or sets the user identifier. /// Gets or sets the user identifier.
/// </summary> /// </summary>
/// <value>The user identifier.</value> /// <value>The user identifier.</value>
public Guid UserId public Guid UserId => User == null ? Guid.Empty : User.Id;
{
get
{
return User == null ? Guid.Empty : User.Id;
}
}
/// <summary> /// <summary>
/// Gets or sets the device identifier. /// Gets or sets the device identifier.

@ -83,13 +83,7 @@ namespace MediaBrowser.Controller.Net
protected readonly CultureInfo UsCulture = new CultureInfo("en-US"); protected readonly CultureInfo UsCulture = new CultureInfo("en-US");
protected virtual bool SendOnTimer protected virtual bool SendOnTimer => false;
{
get
{
return false;
}
}
protected virtual void ParseMessageParams(string[] values) protected virtual void ParseMessageParams(string[] values)
{ {

@ -34,13 +34,7 @@ namespace MediaBrowser.Controller.Playlists
} }
[IgnoreDataMember] [IgnoreDataMember]
public bool IsFile public bool IsFile => IsPlaylistFile(Path);
{
get
{
return IsPlaylistFile(Path);
}
}
public static bool IsPlaylistFile(string path) public static bool IsPlaylistFile(string path)
{ {
@ -64,49 +58,19 @@ namespace MediaBrowser.Controller.Playlists
} }
[IgnoreDataMember] [IgnoreDataMember]
protected override bool FilterLinkedChildrenPerUser protected override bool FilterLinkedChildrenPerUser => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsInheritedParentImages public override bool SupportsInheritedParentImages => false;
{
get
{
return false;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsPlayedStatus public override bool SupportsPlayedStatus => string.Equals(MediaType, "Video", StringComparison.OrdinalIgnoreCase);
{
get
{
return string.Equals(MediaType, "Video", StringComparison.OrdinalIgnoreCase);
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool AlwaysScanInternalMetadataPath public override bool AlwaysScanInternalMetadataPath => true;
{
get
{
return true;
}
}
[IgnoreDataMember] [IgnoreDataMember]
public override bool SupportsCumulativeRunTimeTicks public override bool SupportsCumulativeRunTimeTicks => true;
{
get
{
return true;
}
}
public override double GetDefaultPrimaryImageAspectRatio() public override double GetDefaultPrimaryImageAspectRatio()
{ {
@ -229,24 +193,12 @@ namespace MediaBrowser.Controller.Playlists
} }
[IgnoreDataMember] [IgnoreDataMember]
public override bool IsPreSorted public override bool IsPreSorted => true;
{
get
{
return true;
}
}
public string PlaylistMediaType { get; set; } public string PlaylistMediaType { get; set; }
[IgnoreDataMember] [IgnoreDataMember]
public override string MediaType public override string MediaType => PlaylistMediaType;
{
get
{
return PlaylistMediaType;
}
}
public void SetMediaType(string value) public void SetMediaType(string value)
{ {

@ -24,13 +24,7 @@ namespace MediaBrowser.Controller.Resolvers
/// Gets the priority. /// Gets the priority.
/// </summary> /// </summary>
/// <value>The priority.</value> /// <value>The priority.</value>
public virtual ResolverPriority Priority public virtual ResolverPriority Priority => ResolverPriority.First;
{
get
{
return ResolverPriority.First;
}
}
/// <summary> /// <summary>
/// Sets initial values on the newly resolved item /// Sets initial values on the newly resolved item

@ -67,32 +67,13 @@ namespace MediaBrowser.LocalMetadata
return file.Exists && FileSystem.GetLastWriteTimeUtc(file) > item.DateLastSaved; return file.Exists && FileSystem.GetLastWriteTimeUtc(file) > item.DateLastSaved;
} }
public string Name public string Name => XmlProviderUtils.Name;
{
get
{
return XmlProviderUtils.Name;
}
}
public virtual int Order public virtual int Order => 1;
{
get
{
// After Nfo
return 1;
}
}
} }
static class XmlProviderUtils static class XmlProviderUtils
{ {
public static string Name public static string Name => "Emby Xml";
{
get
{
return "Emby Xml";
}
}
} }
} }

@ -14,24 +14,14 @@ namespace MediaBrowser.LocalMetadata.Images
_fileSystem = fileSystem; _fileSystem = fileSystem;
} }
public string Name public string Name => "Collection Folder Images";
{
get { return "Collection Folder Images"; }
}
public bool Supports(BaseItem item) public bool Supports(BaseItem item)
{ {
return item is CollectionFolder && item.SupportsLocalMetadata; return item is CollectionFolder && item.SupportsLocalMetadata;
} }
public int Order public int Order => 1;
{
get
{
// Run after LocalImageProvider
return 1;
}
}
public List<LocalImageInfo> GetImages(BaseItem item, IDirectoryService directoryService) public List<LocalImageInfo> GetImages(BaseItem item, IDirectoryService directoryService)
{ {

@ -18,15 +18,9 @@ namespace MediaBrowser.LocalMetadata.Images
_fileSystem = fileSystem; _fileSystem = fileSystem;
} }
public string Name public string Name => "Local Images";
{
get { return "Local Images"; }
}
public int Order public int Order => 0;
{
get { return 0; }
}
public bool Supports(BaseItem item) public bool Supports(BaseItem item)
{ {

@ -19,10 +19,7 @@ namespace MediaBrowser.LocalMetadata.Images
_fileSystem = fileSystem; _fileSystem = fileSystem;
} }
public string Name public string Name => "Internal Images";
{
get { return "Internal Images"; }
}
public bool Supports(BaseItem item) public bool Supports(BaseItem item)
{ {
@ -50,14 +47,7 @@ namespace MediaBrowser.LocalMetadata.Images
return true; return true;
} }
public int Order public int Order => 1000;
{
get
{
// Make sure this is last so that all other locations are scanned first
return 1000;
}
}
public List<LocalImageInfo> GetImages(BaseItem item, IDirectoryService directoryService) public List<LocalImageInfo> GetImages(BaseItem item, IDirectoryService directoryService)
{ {

@ -21,15 +21,9 @@ namespace MediaBrowser.LocalMetadata.Images
_fileSystem = fileSystem; _fileSystem = fileSystem;
} }
public string Name public string Name => "Local Images";
{
get { return "Local Images"; }
}
public int Order public int Order => 0;
{
get { return 0; }
}
public bool Supports(BaseItem item) public bool Supports(BaseItem item)
{ {

@ -42,21 +42,9 @@ namespace MediaBrowser.LocalMetadata.Savers
protected ILogger Logger { get; private set; } protected ILogger Logger { get; private set; }
protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; } protected IXmlReaderSettingsFactory XmlReaderSettingsFactory { get; private set; }
protected ItemUpdateType MinimumUpdateType protected ItemUpdateType MinimumUpdateType => ItemUpdateType.MetadataDownload;
{
get
{
return ItemUpdateType.MetadataDownload;
}
}
public string Name public string Name => XmlProviderUtils.Name;
{
get
{
return XmlProviderUtils.Name;
}
}
public string GetSavePath(BaseItem item) public string GetSavePath(BaseItem item)
{ {

@ -53,10 +53,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
return null; return null;
} }
protected override bool IsVideoEncoder protected override bool IsVideoEncoder => false;
{
get { return false; }
}
} }
} }

@ -20,8 +20,8 @@ namespace MediaBrowser.MediaEncoding.Encoder
public EncodingJobOptions Options public EncodingJobOptions Options
{ {
get { return (EncodingJobOptions)BaseRequest; } get => (EncodingJobOptions)BaseRequest;
set { BaseRequest = value; } set => BaseRequest = value;
} }
public string Id { get; set; } public string Id { get; set; }

@ -415,10 +415,7 @@ namespace MediaBrowser.MediaEncoding.Encoder
/// Gets the encoder path. /// Gets the encoder path.
/// </summary> /// </summary>
/// <value>The encoder path.</value> /// <value>The encoder path.</value>
public string EncoderPath public string EncoderPath => FFMpegPath;
{
get { return FFMpegPath; }
}
/// <summary> /// <summary>
/// Gets the media info. /// Gets the media info.

@ -54,10 +54,6 @@ namespace MediaBrowser.MediaEncoding.Encoder
return null; return null;
} }
protected override bool IsVideoEncoder protected override bool IsVideoEncoder => true;
{
get { return true; }
}
} }
} }

@ -83,10 +83,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
return _encryption.DecryptString(password.Substring(2)); return _encryption.DecryptString(password.Substring(2));
} }
public string Name public string Name => "Open Subtitles";
{
get { return "Open Subtitles"; }
}
private SubtitleOptions GetOptions() private SubtitleOptions GetOptions()
{ {

@ -60,13 +60,7 @@ namespace MediaBrowser.MediaEncoding.Subtitles
_textEncoding = textEncoding; _textEncoding = textEncoding;
} }
private string SubtitleCachePath private string SubtitleCachePath => Path.Combine(_appPaths.DataPath, "subtitles");
{
get
{
return Path.Combine(_appPaths.DataPath, "subtitles");
}
}
private Stream ConvertSubtitles(Stream stream, private Stream ConvertSubtitles(Stream stream,
string inputFormat, string inputFormat,

@ -4,10 +4,7 @@ namespace MediaBrowser.Model.Dlna
{ {
public class SortCriteria public class SortCriteria
{ {
public SortOrder SortOrder public SortOrder SortOrder => SortOrder.Ascending;
{
get { return SortOrder.Ascending; }
}
public SortCriteria(string value) public SortCriteria(string value)
{ {

@ -127,22 +127,11 @@ namespace MediaBrowser.Model.Dlna
public Dictionary<string, string> StreamOptions { get; private set; } public Dictionary<string, string> StreamOptions { get; private set; }
public string MediaSourceId public string MediaSourceId => MediaSource == null ? null : MediaSource.Id;
{
get
{
return MediaSource == null ? null : MediaSource.Id;
}
}
public bool IsDirectStream public bool IsDirectStream =>
{ PlayMethod == PlayMethod.DirectStream ||
get PlayMethod == PlayMethod.DirectPlay;
{
return PlayMethod == PlayMethod.DirectStream ||
PlayMethod == PlayMethod.DirectPlay;
}
}
public string ToUrl(string baseUrl, string accessToken) public string ToUrl(string baseUrl, string accessToken)
{ {
@ -911,13 +900,7 @@ namespace MediaBrowser.Model.Dlna
} }
} }
public int? TargetTotalBitrate public int? TargetTotalBitrate => (TargetAudioBitrate ?? 0) + (TargetVideoBitrate ?? 0);
{
get
{
return (TargetAudioBitrate ?? 0) + (TargetVideoBitrate ?? 0);
}
}
public bool? IsTargetAnamorphic public bool? IsTargetAnamorphic
{ {

@ -16,14 +16,8 @@ namespace MediaBrowser.Model.Drawing
/// <value>The height.</value> /// <value>The height.</value>
public double Height public double Height
{ {
get get => _height;
{ set => _height = value;
return _height;
}
set
{
_height = value;
}
} }
/// <summary> /// <summary>
@ -32,8 +26,8 @@ namespace MediaBrowser.Model.Drawing
/// <value>The width.</value> /// <value>The width.</value>
public double Width public double Width
{ {
get { return _width; } get => _width;
set { _width = value; } set => _width = value;
} }
public bool Equals(ImageSize size) public bool Equals(ImageSize size)

@ -42,12 +42,6 @@ namespace MediaBrowser.Model.Dto
/// </summary> /// </summary>
/// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value> /// <value><c>true</c> if this instance has primary image; otherwise, <c>false</c>.</value>
[IgnoreDataMember] [IgnoreDataMember]
public bool HasPrimaryImage public bool HasPrimaryImage => PrimaryImageTag != null;
{
get
{
return PrimaryImageTag != null;
}
}
} }
} }

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save