aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Drawing/IImageEncoder.cs5
-rw-r--r--MediaBrowser.Controller/Drawing/IImageProcessor.cs29
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvService.cs5
-rw-r--r--MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs19
-rw-r--r--MediaBrowser.Controller/Session/SessionInfo.cs8
5 files changed, 36 insertions, 30 deletions
diff --git a/MediaBrowser.Controller/Drawing/IImageEncoder.cs b/MediaBrowser.Controller/Drawing/IImageEncoder.cs
index 5b8c9da6f..4eaecd0a0 100644
--- a/MediaBrowser.Controller/Drawing/IImageEncoder.cs
+++ b/MediaBrowser.Controller/Drawing/IImageEncoder.cs
@@ -1,4 +1,5 @@
using System;
+using System.Collections.Generic;
using MediaBrowser.Model.Drawing;
namespace MediaBrowser.Controller.Drawing
@@ -9,12 +10,12 @@ namespace MediaBrowser.Controller.Drawing
/// Gets the supported input formats.
/// </summary>
/// <value>The supported input formats.</value>
- string[] SupportedInputFormats { get; }
+ IReadOnlyCollection<string> SupportedInputFormats { get; }
/// <summary>
/// Gets the supported output formats.
/// </summary>
/// <value>The supported output formats.</value>
- ImageFormat[] SupportedOutputFormats { get; }
+ IReadOnlyCollection<ImageFormat> SupportedOutputFormats { get; }
/// <summary>
/// Encodes the image.
diff --git a/MediaBrowser.Controller/Drawing/IImageProcessor.cs b/MediaBrowser.Controller/Drawing/IImageProcessor.cs
index 783182730..a11e2186f 100644
--- a/MediaBrowser.Controller/Drawing/IImageProcessor.cs
+++ b/MediaBrowser.Controller/Drawing/IImageProcessor.cs
@@ -18,7 +18,7 @@ namespace MediaBrowser.Controller.Drawing
/// Gets the supported input formats.
/// </summary>
/// <value>The supported input formats.</value>
- string[] SupportedInputFormats { get; }
+ IReadOnlyCollection<string> SupportedInputFormats { get; }
/// <summary>
/// Gets the image enhancers.
@@ -26,16 +26,29 @@ namespace MediaBrowser.Controller.Drawing
/// <value>The image enhancers.</value>
IImageEnhancer[] ImageEnhancers { get; }
- ImageDimensions GetImageSize(string path);
+ /// <summary>
+ /// Gets the dimensions of the image.
+ /// </summary>
+ /// <param name="path">Path to the image file.</param>
+ /// <returns>ImageDimensions</returns>
+ ImageDimensions GetImageDimensions(string path);
/// <summary>
- /// Gets the size of the image.
+ /// Gets the dimensions of the image.
/// </summary>
+ /// <param name="item">The base item.</param>
/// <param name="info">The information.</param>
- /// <returns>ImageSize.</returns>
- ImageDimensions GetImageSize(BaseItem item, ItemImageInfo info);
+ /// <returns>ImageDimensions</returns>
+ ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info);
- ImageDimensions GetImageSize(BaseItem item, ItemImageInfo info, bool updateItem);
+ /// <summary>
+ /// Gets the dimensions of the image.
+ /// </summary>
+ /// <param name="item">The base item.</param>
+ /// <param name="info">The information.</param>
+ /// <param name="updateItem">Whether or not the item info should be updated.</param>
+ /// <returns>ImageDimensions</returns>
+ ImageDimensions GetImageDimensions(BaseItem item, ItemImageInfo info, bool updateItem);
/// <summary>
/// Adds the parts.
@@ -96,8 +109,8 @@ namespace MediaBrowser.Controller.Drawing
/// <summary>
/// Gets the supported image output formats.
/// </summary>
- /// <returns>ImageOutputFormat[].</returns>
- ImageFormat[] GetSupportedImageOutputFormats();
+ /// <returns>IReadOnlyCollection{ImageOutput}.</returns>
+ IReadOnlyCollection<ImageFormat> GetSupportedImageOutputFormats();
/// <summary>
/// Creates the image collage.
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
index ba3813d8a..b71a76648 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
@@ -13,11 +13,6 @@ namespace MediaBrowser.Controller.LiveTv
public interface ILiveTvService
{
/// <summary>
- /// Occurs when [data source changed].
- /// </summary>
- event EventHandler DataSourceChanged;
-
- /// <summary>
/// Gets the name.
/// </summary>
/// <value>The name.</value>
diff --git a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs
index 4e7e1c8ed..4242a00e2 100644
--- a/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs
+++ b/MediaBrowser.Controller/Net/BasePeriodicWebSocketListener.cs
@@ -6,7 +6,6 @@ using System.Net.WebSockets;
using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Model.Net;
-using MediaBrowser.Model.Threading;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Controller.Net
@@ -23,8 +22,8 @@ namespace MediaBrowser.Controller.Net
/// <summary>
/// The _active connections
/// </summary>
- protected readonly List<Tuple<IWebSocketConnection, CancellationTokenSource, ITimer, TStateType>> ActiveConnections =
- new List<Tuple<IWebSocketConnection, CancellationTokenSource, ITimer, TStateType>>();
+ protected readonly List<Tuple<IWebSocketConnection, CancellationTokenSource, Timer, TStateType>> ActiveConnections =
+ new List<Tuple<IWebSocketConnection, CancellationTokenSource, Timer, TStateType>>();
/// <summary>
/// Gets the name.
@@ -44,8 +43,6 @@ namespace MediaBrowser.Controller.Net
/// </summary>
protected ILogger Logger;
- protected ITimerFactory TimerFactory { get; private set; }
-
protected BasePeriodicWebSocketListener(ILogger logger)
{
if (logger == null)
@@ -111,7 +108,7 @@ namespace MediaBrowser.Controller.Net
Logger.LogDebug("{1} Begin transmitting over websocket to {0}", message.Connection.RemoteEndPoint, GetType().Name);
var timer = SendOnTimer ?
- TimerFactory.Create(TimerCallback, message.Connection, Timeout.Infinite, Timeout.Infinite) :
+ new Timer(TimerCallback, message.Connection, Timeout.Infinite, Timeout.Infinite) :
null;
var state = new TStateType
@@ -122,7 +119,7 @@ namespace MediaBrowser.Controller.Net
lock (ActiveConnections)
{
- ActiveConnections.Add(new Tuple<IWebSocketConnection, CancellationTokenSource, ITimer, TStateType>(message.Connection, cancellationTokenSource, timer, state));
+ ActiveConnections.Add(new Tuple<IWebSocketConnection, CancellationTokenSource, Timer, TStateType>(message.Connection, cancellationTokenSource, timer, state));
}
if (timer != null)
@@ -139,7 +136,7 @@ namespace MediaBrowser.Controller.Net
{
var connection = (IWebSocketConnection)state;
- Tuple<IWebSocketConnection, CancellationTokenSource, ITimer, TStateType> tuple;
+ Tuple<IWebSocketConnection, CancellationTokenSource, Timer, TStateType> tuple;
lock (ActiveConnections)
{
@@ -162,7 +159,7 @@ namespace MediaBrowser.Controller.Net
protected void SendData(bool force)
{
- Tuple<IWebSocketConnection, CancellationTokenSource, ITimer, TStateType>[] tuples;
+ Tuple<IWebSocketConnection, CancellationTokenSource, Timer, TStateType>[] tuples;
lock (ActiveConnections)
{
@@ -190,7 +187,7 @@ namespace MediaBrowser.Controller.Net
}
}
- private async void SendData(Tuple<IWebSocketConnection, CancellationTokenSource, ITimer, TStateType> tuple)
+ private async void SendData(Tuple<IWebSocketConnection, CancellationTokenSource, Timer, TStateType> tuple)
{
var connection = tuple.Item1;
@@ -249,7 +246,7 @@ namespace MediaBrowser.Controller.Net
/// Disposes the connection.
/// </summary>
/// <param name="connection">The connection.</param>
- private void DisposeConnection(Tuple<IWebSocketConnection, CancellationTokenSource, ITimer, TStateType> connection)
+ private void DisposeConnection(Tuple<IWebSocketConnection, CancellationTokenSource, Timer, TStateType> connection)
{
Logger.LogDebug("{1} stop transmitting over websocket to {0}", connection.Item1.RemoteEndPoint, GetType().Name);
diff --git a/MediaBrowser.Controller/Session/SessionInfo.cs b/MediaBrowser.Controller/Session/SessionInfo.cs
index d698795dd..f0e81e8e7 100644
--- a/MediaBrowser.Controller/Session/SessionInfo.cs
+++ b/MediaBrowser.Controller/Session/SessionInfo.cs
@@ -1,10 +1,10 @@
using System;
using System.Linq;
+using System.Threading;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dto;
using MediaBrowser.Model.Serialization;
using MediaBrowser.Model.Session;
-using MediaBrowser.Model.Threading;
using Microsoft.Extensions.Logging;
namespace MediaBrowser.Controller.Session
@@ -268,10 +268,10 @@ namespace MediaBrowser.Controller.Session
}
private readonly object _progressLock = new object();
- private ITimer _progressTimer;
+ private Timer _progressTimer;
private PlaybackProgressInfo _lastProgressInfo;
- public void StartAutomaticProgress(ITimerFactory timerFactory, PlaybackProgressInfo progressInfo)
+ public void StartAutomaticProgress(PlaybackProgressInfo progressInfo)
{
if (_disposed)
{
@@ -284,7 +284,7 @@ namespace MediaBrowser.Controller.Session
if (_progressTimer == null)
{
- _progressTimer = timerFactory.Create(OnProgressTimerCallback, null, 1000, 1000);
+ _progressTimer = new Timer(OnProgressTimerCallback, null, 1000, 1000);
}
else
{