aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2016-03-02 16:06:25 -0500
committerLuke <luke.pulverenti@gmail.com>2016-03-02 16:06:25 -0500
commit8fc7d7ba026ed871524055738dc33ddcac5e674d (patch)
treeb29a3df950c4c4d560701dc4bd1a9a2529dc53ea /MediaBrowser.Controller
parent9638b242a4c8f614ed4ffa256422cd0ba3a029e2 (diff)
parent81e96ed4f678b4de114e9d03844141ae65b5856b (diff)
Merge pull request #1514 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Connect/IConnectManager.cs20
-rw-r--r--MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs4
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs2
-rw-r--r--MediaBrowser.Controller/Entities/IHasMediaSources.cs2
-rw-r--r--MediaBrowser.Controller/Entities/InternalItemsQuery.cs10
-rw-r--r--MediaBrowser.Controller/Entities/TV/Season.cs28
-rw-r--r--MediaBrowser.Controller/Entities/TV/Series.cs26
-rw-r--r--MediaBrowser.Controller/Entities/UserItemData.cs12
-rw-r--r--MediaBrowser.Controller/Entities/UserRootFolder.cs3
-rw-r--r--MediaBrowser.Controller/Library/ILibraryManager.cs7
-rw-r--r--MediaBrowser.Controller/Library/ILibraryMonitor.cs7
-rw-r--r--MediaBrowser.Controller/LiveTv/ChannelInfo.cs6
-rw-r--r--MediaBrowser.Controller/LiveTv/ILiveTvManager.cs9
-rw-r--r--MediaBrowser.Controller/LiveTv/ITunerHost.cs3
-rw-r--r--MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs6
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj2
-rw-r--r--MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs1
-rw-r--r--MediaBrowser.Controller/Providers/DirectoryService.cs3
-rw-r--r--MediaBrowser.Controller/Session/ISessionManager.cs7
-rw-r--r--MediaBrowser.Controller/packages.config2
20 files changed, 124 insertions, 36 deletions
diff --git a/MediaBrowser.Controller/Connect/IConnectManager.cs b/MediaBrowser.Controller/Connect/IConnectManager.cs
index 1f7652221..e004eaccf 100644
--- a/MediaBrowser.Controller/Connect/IConnectManager.cs
+++ b/MediaBrowser.Controller/Connect/IConnectManager.cs
@@ -76,25 +76,5 @@ namespace MediaBrowser.Controller.Connect
/// <param name="token">The token.</param>
/// <returns><c>true</c> if [is authorization token valid] [the specified token]; otherwise, <c>false</c>.</returns>
bool IsAuthorizationTokenValid(string token);
-
- /// <summary>
- /// Gets the connect supporter summary.
- /// </summary>
- /// <returns>Task&lt;ConnectSupporterSummary&gt;.</returns>
- Task<ConnectSupporterSummary> GetConnectSupporterSummary();
-
- /// <summary>
- /// Removes the connect supporter.
- /// </summary>
- /// <param name="id">The identifier.</param>
- /// <returns>Task.</returns>
- Task RemoveConnectSupporter(string id);
-
- /// <summary>
- /// Adds the connect supporter.
- /// </summary>
- /// <param name="id">The identifier.</param>
- /// <returns>Task.</returns>
- Task AddConnectSupporter(string id);
}
}
diff --git a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
index 2b80b701e..3fd8d84dd 100644
--- a/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
+++ b/MediaBrowser.Controller/Drawing/ImageProcessingOptions.cs
@@ -39,6 +39,7 @@ namespace MediaBrowser.Controller.Drawing
public double PercentPlayed { get; set; }
public string BackgroundColor { get; set; }
+ public string ForegroundLayer { get; set; }
public bool HasDefaultOptions(string originalImagePath)
{
@@ -83,7 +84,8 @@ namespace MediaBrowser.Controller.Drawing
!AddPlayedIndicator &&
PercentPlayed.Equals(0) &&
!UnplayedCount.HasValue &&
- string.IsNullOrEmpty(BackgroundColor);
+ string.IsNullOrEmpty(BackgroundColor) &&
+ string.IsNullOrEmpty(ForegroundLayer);
}
private bool IsFormatSupported(string originalImagePath)
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index d52e2b37f..3dfbdec56 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -1359,7 +1359,7 @@ namespace MediaBrowser.Controller.Entities
{
if (!string.IsNullOrEmpty(info.Path))
{
- var itemByPath = LibraryManager.RootFolder.FindByPath(info.Path);
+ var itemByPath = LibraryManager.FindByPath(info.Path);
if (itemByPath == null)
{
diff --git a/MediaBrowser.Controller/Entities/IHasMediaSources.cs b/MediaBrowser.Controller/Entities/IHasMediaSources.cs
index 85ce3c781..832b9f6c1 100644
--- a/MediaBrowser.Controller/Entities/IHasMediaSources.cs
+++ b/MediaBrowser.Controller/Entities/IHasMediaSources.cs
@@ -3,7 +3,7 @@ using System.Collections.Generic;
namespace MediaBrowser.Controller.Entities
{
- public interface IHasMediaSources : IHasId
+ public interface IHasMediaSources : IHasUserData
{
/// <summary>
/// Gets the media sources.
diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
index 0595d0569..8b623d64e 100644
--- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
+++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs
@@ -45,6 +45,8 @@ namespace MediaBrowser.Controller.Entities
public string NameLessThan { get; set; }
public string NameContains { get; set; }
+ public string Path { get; set; }
+
public string Person { get; set; }
public string[] PersonIds { get; set; }
public string[] ItemIds { get; set; }
@@ -96,7 +98,7 @@ namespace MediaBrowser.Controller.Entities
public int? MinIndexNumber { get; set; }
public double? MinCriticRating { get; set; }
public double? MinCommunityRating { get; set; }
-
+
public string[] ChannelIds { get; set; }
internal List<Guid> ItemIdsFromPersonFilters { get; set; }
@@ -112,7 +114,8 @@ namespace MediaBrowser.Controller.Entities
public string[] TopParentIds { get; set; }
public LocationType[] ExcludeLocationTypes { get; set; }
-
+ public string[] PresetViews { get; set; }
+
public InternalItemsQuery()
{
BlockUnratedItems = new UnratedItem[] { };
@@ -137,6 +140,7 @@ namespace MediaBrowser.Controller.Entities
TopParentIds = new string[] { };
ExcludeTags = new string[] { };
ExcludeLocationTypes = new LocationType[] { };
+ PresetViews = new string[] { };
}
public InternalItemsQuery(User user)
@@ -153,7 +157,7 @@ namespace MediaBrowser.Controller.Entities
}
ExcludeTags = policy.BlockedTags;
-
+
User = user;
}
}
diff --git a/MediaBrowser.Controller/Entities/TV/Season.cs b/MediaBrowser.Controller/Entities/TV/Season.cs
index 93eac058d..9efa609ef 100644
--- a/MediaBrowser.Controller/Entities/TV/Season.cs
+++ b/MediaBrowser.Controller/Entities/TV/Season.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Controller.Providers;
+using System;
+using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Querying;
using MediaBrowser.Model.Users;
@@ -6,6 +7,7 @@ using MoreLinq;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
+using System.Threading.Tasks;
using MediaBrowser.Model.Configuration;
namespace MediaBrowser.Controller.Entities.TV
@@ -127,6 +129,30 @@ namespace MediaBrowser.Controller.Entities.TV
get { return (IndexNumber ?? -1) == 0; }
}
+ public override Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
+ {
+ var user = query.User;
+
+ Func<BaseItem, bool> filter = i => UserViewBuilder.Filter(i, user, query, UserDataManager, LibraryManager);
+
+ IEnumerable<BaseItem> items;
+
+ if (query.User == null)
+ {
+ items = query.Recursive
+ ? GetRecursiveChildren(filter)
+ : Children.Where(filter);
+ }
+ else
+ {
+ items = GetEpisodes(query.User).Where(filter);
+ }
+
+ var result = PostFilterAndSort(items, query);
+
+ return Task.FromResult(result);
+ }
+
/// <summary>
/// Gets the episodes.
/// </summary>
diff --git a/MediaBrowser.Controller/Entities/TV/Series.cs b/MediaBrowser.Controller/Entities/TV/Series.cs
index 420b3c313..aa07ab378 100644
--- a/MediaBrowser.Controller/Entities/TV/Series.cs
+++ b/MediaBrowser.Controller/Entities/TV/Series.cs
@@ -157,6 +157,32 @@ namespace MediaBrowser.Controller.Entities.TV
return GetSeasons(user, config.DisplayMissingEpisodes, config.DisplayUnairedEpisodes);
}
+ public override Task<QueryResult<BaseItem>> GetItems(InternalItemsQuery query)
+ {
+ var user = query.User;
+
+ Func<BaseItem, bool> filter = i => UserViewBuilder.Filter(i, user, query, UserDataManager, LibraryManager);
+
+ IEnumerable<BaseItem> items;
+
+ if (query.User == null)
+ {
+ items = query.Recursive
+ ? GetRecursiveChildren(filter)
+ : Children.Where(filter);
+ }
+ else
+ {
+ items = query.Recursive
+ ? GetRecursiveChildren(user, filter)
+ : GetSeasons(user).Where(filter);
+ }
+
+ var result = PostFilterAndSort(items, query);
+
+ return Task.FromResult(result);
+ }
+
public IEnumerable<Season> GetSeasons(User user, bool includeMissingSeasons, bool includeVirtualUnaired)
{
var seasons = base.GetChildren(user, true)
diff --git a/MediaBrowser.Controller/Entities/UserItemData.cs b/MediaBrowser.Controller/Entities/UserItemData.cs
index 5f0e62537..16c37e7d3 100644
--- a/MediaBrowser.Controller/Entities/UserItemData.cs
+++ b/MediaBrowser.Controller/Entities/UserItemData.cs
@@ -78,7 +78,17 @@ namespace MediaBrowser.Controller.Entities
/// </summary>
/// <value><c>true</c> if played; otherwise, <c>false</c>.</value>
public bool Played { get; set; }
-
+ /// <summary>
+ /// Gets or sets the index of the audio stream.
+ /// </summary>
+ /// <value>The index of the audio stream.</value>
+ public int? AudioStreamIndex { get; set; }
+ /// <summary>
+ /// Gets or sets the index of the subtitle stream.
+ /// </summary>
+ /// <value>The index of the subtitle stream.</value>
+ public int? SubtitleStreamIndex { get; set; }
+
/// <summary>
/// This is an interpreted property to indicate likes or dislikes
/// This should never be serialized.
diff --git a/MediaBrowser.Controller/Entities/UserRootFolder.cs b/MediaBrowser.Controller/Entities/UserRootFolder.cs
index b7946cb92..daf590871 100644
--- a/MediaBrowser.Controller/Entities/UserRootFolder.cs
+++ b/MediaBrowser.Controller/Entities/UserRootFolder.cs
@@ -30,7 +30,8 @@ namespace MediaBrowser.Controller.Entities
var result = await UserViewManager.GetUserViews(new UserViewQuery
{
- UserId = query.User.Id.ToString("N")
+ UserId = query.User.Id.ToString("N"),
+ PresetViews = query.PresetViews
}, CancellationToken.None).ConfigureAwait(false);
diff --git a/MediaBrowser.Controller/Library/ILibraryManager.cs b/MediaBrowser.Controller/Library/ILibraryManager.cs
index 1c515edd5..ff44953ef 100644
--- a/MediaBrowser.Controller/Library/ILibraryManager.cs
+++ b/MediaBrowser.Controller/Library/ILibraryManager.cs
@@ -57,6 +57,13 @@ namespace MediaBrowser.Controller.Library
Person GetPerson(string name);
/// <summary>
+ /// Finds the by path.
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <returns>BaseItem.</returns>
+ BaseItem FindByPath(string path);
+
+ /// <summary>
/// Gets the artist.
/// </summary>
/// <param name="name">The name.</param>
diff --git a/MediaBrowser.Controller/Library/ILibraryMonitor.cs b/MediaBrowser.Controller/Library/ILibraryMonitor.cs
index 918382f04..e965e47d6 100644
--- a/MediaBrowser.Controller/Library/ILibraryMonitor.cs
+++ b/MediaBrowser.Controller/Library/ILibraryMonitor.cs
@@ -32,5 +32,12 @@ namespace MediaBrowser.Controller.Library
/// </summary>
/// <param name="path">The path.</param>
void ReportFileSystemChanged(string path);
+
+ /// <summary>
+ /// Determines whether [is path locked] [the specified path].
+ /// </summary>
+ /// <param name="path">The path.</param>
+ /// <returns><c>true</c> if [is path locked] [the specified path]; otherwise, <c>false</c>.</returns>
+ bool IsPathLocked(string path);
}
} \ No newline at end of file
diff --git a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs
index 32b8abdc5..7d8df96ed 100644
--- a/MediaBrowser.Controller/LiveTv/ChannelInfo.cs
+++ b/MediaBrowser.Controller/LiveTv/ChannelInfo.cs
@@ -26,6 +26,12 @@ namespace MediaBrowser.Controller.LiveTv
public string Id { get; set; }
/// <summary>
+ /// Gets or sets the tuner host identifier.
+ /// </summary>
+ /// <value>The tuner host identifier.</value>
+ public string TunerHostId { get; set; }
+
+ /// <summary>
/// Gets or sets the type of the channel.
/// </summary>
/// <value>The type of the channel.</value>
diff --git a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
index 05c7448c3..501e48a74 100644
--- a/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
+++ b/MediaBrowser.Controller/LiveTv/ILiveTvManager.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Controller.Channels;
+using System;
+using MediaBrowser.Controller.Channels;
using MediaBrowser.Controller.Dto;
using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Dto;
@@ -343,11 +344,11 @@ namespace MediaBrowser.Controller.LiveTv
/// <summary>
/// Adds the information to program dto.
/// </summary>
- /// <param name="item">The item.</param>
- /// <param name="dto">The dto.</param>
+ /// <param name="programs">The programs.</param>
/// <param name="fields">The fields.</param>
/// <param name="user">The user.</param>
- void AddInfoToProgramDto(BaseItem item, BaseItemDto dto, List<ItemFields> fields, User user = null);
+ /// <returns>Task.</returns>
+ Task AddInfoToProgramDto(List<Tuple<BaseItem,BaseItemDto>> programs, List<ItemFields> fields, User user = null);
/// <summary>
/// Saves the tuner host.
/// </summary>
diff --git a/MediaBrowser.Controller/LiveTv/ITunerHost.cs b/MediaBrowser.Controller/LiveTv/ITunerHost.cs
index 2e3a71f70..498602ddf 100644
--- a/MediaBrowser.Controller/LiveTv/ITunerHost.cs
+++ b/MediaBrowser.Controller/LiveTv/ITunerHost.cs
@@ -46,6 +46,9 @@ namespace MediaBrowser.Controller.LiveTv
/// <param name="cancellationToken">The cancellation token.</param>
/// <returns>Task&lt;List&lt;MediaSourceInfo&gt;&gt;.</returns>
Task<List<MediaSourceInfo>> GetChannelStreamMediaSources(string channelId, CancellationToken cancellationToken);
+ }
+ public interface IConfigurableTunerHost
+ {
/// <summary>
/// Validates the specified information.
/// </summary>
diff --git a/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs b/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs
index 46cf4dd98..5c001f288 100644
--- a/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs
+++ b/MediaBrowser.Controller/LiveTv/LiveTvTunerInfo.cs
@@ -59,6 +59,12 @@ namespace MediaBrowser.Controller.LiveTv
/// <value>The clients.</value>
public List<string> Clients { get; set; }
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance can reset.
+ /// </summary>
+ /// <value><c>true</c> if this instance can reset; otherwise, <c>false</c>.</value>
+ public bool CanReset { get; set; }
+
public LiveTvTunerInfo()
{
Clients = new List<string>();
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index 9c17c8d9b..f74d82caa 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -46,7 +46,7 @@
<ItemGroup>
<Reference Include="CommonIO, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\CommonIO.1.0.0.7\lib\net45\CommonIO.dll</HintPath>
+ <HintPath>..\packages\CommonIO.1.0.0.8\lib\net45\CommonIO.dll</HintPath>
</Reference>
<Reference Include="Interfaces.IO">
<HintPath>..\packages\Interfaces.IO.1.0.0.5\lib\portable-net45+sl4+wp71+win8+wpa81\Interfaces.IO.dll</HintPath>
diff --git a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs
index bb8841222..f8f4e9ec9 100644
--- a/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs
+++ b/MediaBrowser.Controller/MediaEncoding/EncodingJobOptions.cs
@@ -44,6 +44,7 @@ namespace MediaBrowser.Controller.MediaEncoding
public int? CpuCoreLimit { get; set; }
public bool ReadInputAtNativeFramerate { get; set; }
public SubtitleDeliveryMethod SubtitleMethod { get; set; }
+ public bool CopyTimestamps { get; set; }
/// <summary>
/// Gets a value indicating whether this instance has fixed resolution.
diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs
index 36ef6ca1f..2192ebcac 100644
--- a/MediaBrowser.Controller/Providers/DirectoryService.cs
+++ b/MediaBrowser.Controller/Providers/DirectoryService.cs
@@ -63,7 +63,8 @@ namespace MediaBrowser.Controller.Providers
try
{
// using EnumerateFileSystemInfos doesn't handle reparse points (symlinks)
- var list = _fileSystem.GetFileSystemEntries(path);
+ var list = _fileSystem.GetFileSystemEntries(path)
+ .ToList();
// Seeing dupes on some users file system for some reason
foreach (var item in list)
diff --git a/MediaBrowser.Controller/Session/ISessionManager.cs b/MediaBrowser.Controller/Session/ISessionManager.cs
index dc9612c84..fa74c5749 100644
--- a/MediaBrowser.Controller/Session/ISessionManager.cs
+++ b/MediaBrowser.Controller/Session/ISessionManager.cs
@@ -251,6 +251,13 @@ namespace MediaBrowser.Controller.Session
Task<AuthenticationResult> AuthenticateNewSession(AuthenticationRequest request);
/// <summary>
+ /// Creates the new session.
+ /// </summary>
+ /// <param name="request">The request.</param>
+ /// <returns>Task&lt;AuthenticationResult&gt;.</returns>
+ Task<AuthenticationResult> CreateNewSession(AuthenticationRequest request);
+
+ /// <summary>
/// Reports the capabilities.
/// </summary>
/// <param name="sessionId">The session identifier.</param>
diff --git a/MediaBrowser.Controller/packages.config b/MediaBrowser.Controller/packages.config
index 8439bee10..34e16d2ad 100644
--- a/MediaBrowser.Controller/packages.config
+++ b/MediaBrowser.Controller/packages.config
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
- <package id="CommonIO" version="1.0.0.7" targetFramework="net45" />
+ <package id="CommonIO" version="1.0.0.8" targetFramework="net45" />
<package id="Interfaces.IO" version="1.0.0.5" targetFramework="net45" />
<package id="morelinq" version="1.4.0" targetFramework="net45" />
<package id="Patterns.Logging" version="1.0.0.2" targetFramework="net45" />