aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2015-03-25 00:59:49 -0400
committerLuke <luke.pulverenti@gmail.com>2015-03-25 00:59:49 -0400
commitaa079120059699f4778d80f55e68883d75d26b3a (patch)
tree90ef957908152d11333fde96b95d609309560bb2 /MediaBrowser.Controller
parent9926be0d9de688c04065c916e44ada4177b38a80 (diff)
parent29b6ee4b6f336f08807a7ed7bdb22a1ef68269c0 (diff)
Merge pull request #1051 from MediaBrowser/dev
3.0.5557.20000 Beta
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Diagnostics/IProcessManager.cs28
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs22
-rw-r--r--MediaBrowser.Controller/Entities/ItemImageInfo.cs6
-rw-r--r--MediaBrowser.Controller/Entities/TV/Series.cs8
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvManager.cs4
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvService.cs23
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj1
-rw-r--r--MediaBrowser.Controller/Persistence/IItemRepository.cs2
-rw-r--r--MediaBrowser.Controller/Session/ISessionController.cs5
9 files changed, 56 insertions, 43 deletions
diff --git a/MediaBrowser.Controller/Diagnostics/IProcessManager.cs b/MediaBrowser.Controller/Diagnostics/IProcessManager.cs
deleted file mode 100644
index 2e076bd88..000000000
--- a/MediaBrowser.Controller/Diagnostics/IProcessManager.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-using System.Diagnostics;
-
-namespace MediaBrowser.Controller.Diagnostics
-{
- /// <summary>
- /// Interface IProcessManager
- /// </summary>
- public interface IProcessManager
- {
- /// <summary>
- /// Gets a value indicating whether [supports suspension].
- /// </summary>
- /// <value><c>true</c> if [supports suspension]; otherwise, <c>false</c>.</value>
- bool SupportsSuspension { get; }
-
- /// <summary>
- /// Suspends the process.
- /// </summary>
- /// <param name="process">The process.</param>
- void SuspendProcess(Process process);
-
- /// <summary>
- /// Resumes the process.
- /// </summary>
- /// <param name="process">The process.</param>
- void ResumeProcess(Process process);
- }
-}
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index dd6189bc5..cdb52ec66 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -1519,6 +1519,7 @@ namespace MediaBrowser.Controller.Entities
image.Path = file.FullName;
image.DateModified = imageInfo.DateModified;
+ image.Length = imageInfo.Length;
}
}
@@ -1623,11 +1624,14 @@ namespace MediaBrowser.Controller.Entities
return null;
}
+ var fileInfo = new FileInfo(path);
+
return new ItemImageInfo
{
Path = path,
- DateModified = FileSystem.GetLastWriteTimeUtc(path),
- Type = imageType
+ DateModified = FileSystem.GetLastWriteTimeUtc(fileInfo),
+ Type = imageType,
+ Length = fileInfo.Length
};
}
@@ -1686,6 +1690,7 @@ namespace MediaBrowser.Controller.Entities
else
{
existing.DateModified = FileSystem.GetLastWriteTimeUtc(newImage);
+ existing.Length = ((FileInfo) newImage).Length;
}
}
@@ -1700,7 +1705,8 @@ namespace MediaBrowser.Controller.Entities
{
Path = file.FullName,
Type = type,
- DateModified = FileSystem.GetLastWriteTimeUtc(file)
+ DateModified = FileSystem.GetLastWriteTimeUtc(file),
+ Length = ((FileInfo)file).Length
};
}
@@ -1739,9 +1745,15 @@ namespace MediaBrowser.Controller.Entities
FileSystem.SwapFiles(path1, path2);
+ var file1 = new FileInfo(info1.Path);
+ var file2 = new FileInfo(info2.Path);
+
// Refresh these values
- info1.DateModified = FileSystem.GetLastWriteTimeUtc(info1.Path);
- info2.DateModified = FileSystem.GetLastWriteTimeUtc(info2.Path);
+ info1.DateModified = FileSystem.GetLastWriteTimeUtc(file1);
+ info2.DateModified = FileSystem.GetLastWriteTimeUtc(file2);
+
+ info1.Length = file1.Length;
+ info2.Length = file2.Length;
return UpdateToRepository(ItemUpdateType.ImageUpdate, CancellationToken.None);
}
diff --git a/MediaBrowser.Controller/Entities/ItemImageInfo.cs b/MediaBrowser.Controller/Entities/ItemImageInfo.cs
index b36b818ff..1122de403 100644
--- a/MediaBrowser.Controller/Entities/ItemImageInfo.cs
+++ b/MediaBrowser.Controller/Entities/ItemImageInfo.cs
@@ -12,6 +12,12 @@ namespace MediaBrowser.Controller.Entities
public string Path { get; set; }
/// <summary>
+ /// Gets or sets the length.
+ /// </summary>
+ /// <value>The length.</value>
+ public long Length { get; set; }
+
+ /// <summary>
/// Gets or sets the type.
/// </summary>
/// <value>The type.</value>
diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs
index b4e1d9d6e..91014ccda 100644
--- a/MediaBrowser.Controller/Entities/TV/Series.cs
+++ b/MediaBrowser.Controller/Entities/TV/Series.cs
@@ -232,7 +232,10 @@ namespace MediaBrowser.Controller.Entities.TV
refreshOptions = new MetadataRefreshOptions(refreshOptions);
refreshOptions.IsPostRecursiveRefresh = true;
- // Refresh songs
+ // Refresh current item
+ await RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
+
+ // Refresh TV
foreach (var item in seasons)
{
cancellationToken.ThrowIfCancellationRequested();
@@ -245,9 +248,6 @@ namespace MediaBrowser.Controller.Entities.TV
progress.Report(percent * 100);
}
- // Refresh current item
- await RefreshMetadata(refreshOptions, cancellationToken).ConfigureAwait(false);
-
// Refresh all non-songs
foreach (var item in otherItems)
{
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
index 9b36454d2..0b58a9232 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
@@ -149,7 +149,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
- Task<ChannelMediaInfo> GetRecordingStream(string id, CancellationToken cancellationToken);
+ Task<MediaSourceInfo> GetRecordingStream(string id, CancellationToken cancellationToken);
/// <summary>
/// Gets the channel stream.
@@ -157,7 +157,7 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="id">The identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{StreamResponseInfo}.</returns>
- Task<ChannelMediaInfo> GetChannelStream(string id, CancellationToken cancellationToken);
+ Task<MediaSourceInfo> GetChannelStream(string id, CancellationToken cancellationToken);
/// <summary>
/// Gets the program.
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
index 993db0004..d7e3df4e2 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvService.cs
@@ -4,6 +4,7 @@ using System.Threading;
using System.Threading.Tasks;
using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Drawing;
+using MediaBrowser.Model.Dto;
namespace MediaBrowser.Controller.LiveTv
{
@@ -172,19 +173,37 @@ namespace MediaBrowser.Controller.LiveTv
/// Gets the recording stream.
/// </summary>
/// <param name="recordingId">The recording identifier.</param>
+ /// <param name="streamId">The stream identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
- Task<ChannelMediaInfo> GetRecordingStream(string recordingId, CancellationToken cancellationToken);
+ Task<MediaSourceInfo> GetRecordingStream(string recordingId, string streamId, CancellationToken cancellationToken);
/// <summary>
/// Gets the channel stream.
/// </summary>
/// <param name="channelId">The channel identifier.</param>
+ /// <param name="streamId">The stream identifier.</param>
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task{Stream}.</returns>
- Task<ChannelMediaInfo> GetChannelStream(string channelId, CancellationToken cancellationToken);
+ Task<MediaSourceInfo> GetChannelStream(string channelId, string streamId, CancellationToken cancellationToken);
/// <summary>
+ /// Gets the channel stream media sources.
+ /// </summary>
+ /// <param name="channelId">The channel identifier.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task&lt;List&lt;MediaSourceInfo&gt;&gt;.</returns>
+ Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Gets the recording stream media sources.
+ /// </summary>
+ /// <param name="recordingId">The recording identifier.</param>
+ /// <param name="cancellationToken">The cancellation token.</param>
+ /// <returns>Task&lt;List&lt;MediaSourceInfo&gt;&gt;.</returns>
+ Task<List<MediaSourceInfo>> GetRecordingStreamMediaSources(string recordingId, CancellationToken cancellationToken);
+
+ /// <summary>
/// Closes the live stream.
/// </summary>
/// <param name="id">The identifier.</param>
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index e4a31c82d..d7a69ceb2 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -105,7 +105,6 @@
<Compile Include="Devices\CameraImageUploadInfo.cs" />
<Compile Include="Devices\IDeviceManager.cs" />
<Compile Include="Devices\IDeviceRepository.cs" />
- <Compile Include="Diagnostics\IProcessManager.cs" />
<Compile Include="Dlna\ControlRequest.cs" />
<Compile Include="Dlna\ControlResponse.cs" />
<Compile Include="Dlna\EventSubscriptionResponse.cs" />
diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs
index edaa15c9d..f306518df 100644
--- a/MediaBrowser.Controller/Persistence/IItemRepository.cs
+++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs
@@ -107,7 +107,7 @@ namespace MediaBrowser.Controller.Persistence
/// </summary>
/// <param name="type">The type.</param>
/// <returns>IEnumerable{Guid}.</returns>
- IEnumerable<BaseItem> GetItemsOfType(Type type);
+ IEnumerable<Guid> GetItemsOfType(Type type);
/// <summary>
/// Saves the children.
diff --git a/MediaBrowser.Controller/Session/ISessionController.cs b/MediaBrowser.Controller/Session/ISessionController.cs
index a4badee47..f8a6ed1fc 100644
--- a/MediaBrowser.Controller/Session/ISessionController.cs
+++ b/MediaBrowser.Controller/Session/ISessionController.cs
@@ -115,5 +115,10 @@ namespace MediaBrowser.Controller.Session
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task.</returns>
Task SendMessage<T>(string name, T data, CancellationToken cancellationToken);
+
+ /// <summary>
+ /// Called when [activity].
+ /// </summary>
+ void OnActivity();
}
}