diff options
Diffstat (limited to 'MediaBrowser.Controller')
21 files changed, 167 insertions, 185 deletions
diff --git a/MediaBrowser.Controller/Channels/IChannelFactory.cs b/MediaBrowser.Controller/Channels/IChannelFactory.cs deleted file mode 100644 index c7ed92586..000000000 --- a/MediaBrowser.Controller/Channels/IChannelFactory.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Channels -{ - public interface IChannelFactory - { - IEnumerable<IChannel> GetChannels(); - } - - public interface IFactoryChannel - { - - } -}
\ No newline at end of file diff --git a/MediaBrowser.Controller/Channels/IChannelManager.cs b/MediaBrowser.Controller/Channels/IChannelManager.cs index 8d3e0f596..fec550df8 100644 --- a/MediaBrowser.Controller/Channels/IChannelManager.cs +++ b/MediaBrowser.Controller/Channels/IChannelManager.cs @@ -16,7 +16,7 @@ namespace MediaBrowser.Controller.Channels /// </summary> /// <param name="channels">The channels.</param> /// <param name="factories">The factories.</param> - void AddParts(IEnumerable<IChannel> channels, IEnumerable<IChannelFactory> factories); + void AddParts(IEnumerable<IChannel> channels); /// <summary> /// Gets the channel download path. diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs index 594b5ca93..25e742e7c 100644 --- a/MediaBrowser.Controller/Entities/BaseItem.cs +++ b/MediaBrowser.Controller/Entities/BaseItem.cs @@ -62,6 +62,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the channel identifier. /// </summary> /// <value>The channel identifier.</value> + [IgnoreDataMember] public string ChannelId { get; set; } [IgnoreDataMember] @@ -183,7 +184,7 @@ namespace MediaBrowser.Controller.Entities { // Local trailer, special feature, theme video, etc. // An item that belongs to another item but is not part of the Parent-Child tree - return !IsFolder && Parent == null && LocationType == LocationType.FileSystem; + return !IsFolder && ParentId == Guid.Empty && LocationType == LocationType.FileSystem; } } @@ -331,25 +332,8 @@ namespace MediaBrowser.Controller.Entities return Name; } - /// <summary> - /// Returns true if this item should not attempt to fetch metadata - /// </summary> - /// <value><c>true</c> if [dont fetch meta]; otherwise, <c>false</c>.</value> - [Obsolete("Please use IsLocked instead of DontFetchMeta")] - public bool DontFetchMeta { get; set; } - [IgnoreDataMember] - public bool IsLocked - { - get - { - return DontFetchMeta; - } - set - { - DontFetchMeta = value; - } - } + public bool IsLocked { get; set; } public bool IsUnidentified { get; set; } @@ -484,7 +468,6 @@ namespace MediaBrowser.Controller.Entities public Guid ParentId { get; set; } - private Folder _parent; /// <summary> /// Gets or sets the parent. /// </summary> @@ -494,11 +477,6 @@ namespace MediaBrowser.Controller.Entities { get { - if (_parent != null) - { - return _parent; - } - if (ParentId != Guid.Empty) { return LibraryManager.GetItemById(ParentId) as Folder; @@ -506,12 +484,14 @@ namespace MediaBrowser.Controller.Entities return null; } - set { _parent = value; } + set + { + + } } public void SetParent(Folder parent) { - Parent = parent; ParentId = parent == null ? Guid.Empty : parent.Id; } @@ -558,6 +538,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the end date. /// </summary> /// <value>The end date.</value> + [IgnoreDataMember] public DateTime? EndDate { get; set; } /// <summary> @@ -582,6 +563,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the custom rating. /// </summary> /// <value>The custom rating.</value> + [IgnoreDataMember] public string CustomRating { get; set; } /// <summary> @@ -591,12 +573,6 @@ namespace MediaBrowser.Controller.Entities public string Overview { get; set; } /// <summary> - /// Gets or sets the people. - /// </summary> - /// <value>The people.</value> - public List<PersonInfo> People { get; set; } - - /// <summary> /// Gets or sets the studios. /// </summary> /// <value>The studios.</value> @@ -618,6 +594,7 @@ namespace MediaBrowser.Controller.Entities /// Gets or sets the community rating. /// </summary> /// <value>The community rating.</value> + [IgnoreDataMember] public float? CommunityRating { get; set; } /// <summary> @@ -643,6 +620,7 @@ namespace MediaBrowser.Controller.Entities /// This could be episode number, album track number, etc. /// </summary> /// <value>The index number.</value> + [IgnoreDataMember] public int? IndexNumber { get; set; } /// <summary> @@ -705,7 +683,7 @@ namespace MediaBrowser.Controller.Entities { var files = fileSystemChildren.OfType<DirectoryInfo>() .Where(i => string.Equals(i.Name, ThemeSongsFolderName, StringComparison.OrdinalIgnoreCase)) - .SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly)) + .SelectMany(i => directoryService.GetFiles(i.FullName)) .ToList(); // Support plex/xbmc convention @@ -741,7 +719,7 @@ namespace MediaBrowser.Controller.Entities { var files = fileSystemChildren.OfType<DirectoryInfo>() .Where(i => string.Equals(i.Name, ThemeVideosFolderName, StringComparison.OrdinalIgnoreCase)) - .SelectMany(i => i.EnumerateFiles("*", SearchOption.TopDirectoryOnly)); + .SelectMany(i => directoryService.GetFiles(i.FullName)); return LibraryManager.ResolvePaths(files, directoryService, null) .OfType<Video>() @@ -765,7 +743,7 @@ namespace MediaBrowser.Controller.Entities public Task RefreshMetadata(CancellationToken cancellationToken) { - return RefreshMetadata(new MetadataRefreshOptions(new DirectoryService()), cancellationToken); + return RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(FileSystem)), cancellationToken); } /// <summary> @@ -1114,7 +1092,7 @@ namespace MediaBrowser.Controller.Entities // Could not determine the integer value if (!value.HasValue) { - return true; + return !GetBlockUnratedValue(user.Policy); } return value.Value <= maxAllowedRating.Value; @@ -1418,7 +1396,7 @@ namespace MediaBrowser.Controller.Entities /// <returns>Task.</returns> public virtual Task ChangedExternally() { - ProviderManager.QueueRefresh(Id, new MetadataRefreshOptions()); + ProviderManager.QueueRefresh(Id, new MetadataRefreshOptions(FileSystem)); return Task.FromResult(true); } @@ -1635,7 +1613,7 @@ namespace MediaBrowser.Controller.Entities var newImagePaths = images.Select(i => i.FullName).ToList(); var deleted = existingImages - .Where(i => !newImagePaths.Contains(i.Path, StringComparer.OrdinalIgnoreCase) && !File.Exists(i.Path)) + .Where(i => !newImagePaths.Contains(i.Path, StringComparer.OrdinalIgnoreCase) && !FileSystem.FileExists(i.Path)) .ToList(); ImageInfos = ImageInfos.Except(deleted).ToList(); diff --git a/MediaBrowser.Controller/Entities/Folder.cs b/MediaBrowser.Controller/Entities/Folder.cs index c3ac77328..4cdc4657e 100644 --- a/MediaBrowser.Controller/Entities/Folder.cs +++ b/MediaBrowser.Controller/Entities/Folder.cs @@ -48,7 +48,7 @@ namespace MediaBrowser.Controller.Entities [IgnoreDataMember] public virtual bool IsPreSorted { - get { return ConfigurationManager.Configuration.EnableWindowsShortcuts; } + get { return false; } } /// <summary> @@ -120,7 +120,7 @@ namespace MediaBrowser.Controller.Entities [IgnoreDataMember] protected virtual bool SupportsShortcutChildren { - get { return false; } + get { return ConfigurationManager.Configuration.EnableWindowsShortcuts; } } /// <summary> @@ -371,7 +371,7 @@ namespace MediaBrowser.Controller.Entities public Task ValidateChildren(IProgress<double> progress, CancellationToken cancellationToken) { - return ValidateChildren(progress, cancellationToken, new MetadataRefreshOptions(new DirectoryService())); + return ValidateChildren(progress, cancellationToken, new MetadataRefreshOptions(new DirectoryService(FileSystem))); } /// <summary> @@ -474,7 +474,7 @@ namespace MediaBrowser.Controller.Entities currentChild.DateModified = child.DateModified; } - currentChild.IsOffline = false; + await UpdateIsOffline(currentChild, false).ConfigureAwait(false); validChildren.Add(currentChild); } else @@ -509,12 +509,12 @@ namespace MediaBrowser.Controller.Entities else if (!string.IsNullOrEmpty(item.Path) && IsPathOffline(item.Path)) { - item.IsOffline = true; + await UpdateIsOffline(item, true).ConfigureAwait(false); validChildren.Add(item); } else { - item.IsOffline = false; + await UpdateIsOffline(item, false).ConfigureAwait(false); actualRemovals.Add(item); } } @@ -569,6 +569,17 @@ namespace MediaBrowser.Controller.Entities progress.Report(100); } + private Task UpdateIsOffline(BaseItem item, bool newValue) + { + if (item.IsOffline != newValue) + { + item.IsOffline = newValue; + return item.UpdateToRepository(ItemUpdateType.None, CancellationToken.None); + } + + return Task.FromResult(true); + } + private async Task RefreshMetadataRecursive(MetadataRefreshOptions refreshOptions, bool recursive, IProgress<double> progress, CancellationToken cancellationToken) { var children = ActualChildren.ToList(); @@ -693,7 +704,7 @@ namespace MediaBrowser.Controller.Entities /// <returns><c>true</c> if the specified path is offline; otherwise, <c>false</c>.</returns> private bool IsPathOffline(string path) { - if (File.Exists(path)) + if (FileSystem.FileExists(path)) { return false; } @@ -703,7 +714,7 @@ namespace MediaBrowser.Controller.Entities // Depending on whether the path is local or unc, it may return either null or '\' at the top while (!string.IsNullOrEmpty(path) && path.Length > 1) { - if (Directory.Exists(path)) + if (FileSystem.DirectoryExists(path)) { return false; } diff --git a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs index 0af4972f7..bde4d0f45 100644 --- a/MediaBrowser.Controller/Entities/InternalItemsQuery.cs +++ b/MediaBrowser.Controller/Entities/InternalItemsQuery.cs @@ -98,7 +98,9 @@ namespace MediaBrowser.Controller.Entities public bool? IsCurrentSchema { get; set; } public bool? HasDeadParentId { get; set; } - + public bool? IsOffline { get; set; } + public LocationType? LocationType { get; set; } + public InternalItemsQuery() { Tags = new string[] { }; diff --git a/MediaBrowser.Controller/Entities/User.cs b/MediaBrowser.Controller/Entities/User.cs index 71e3d1ce0..bf0f7a2a8 100644 --- a/MediaBrowser.Controller/Entities/User.cs +++ b/MediaBrowser.Controller/Entities/User.cs @@ -177,24 +177,24 @@ namespace MediaBrowser.Controller.Entities var oldConfigurationDirectory = ConfigurationDirectoryPath; // Exceptions will be thrown if these paths already exist - if (Directory.Exists(newConfigDirectory)) + if (FileSystem.DirectoryExists(newConfigDirectory)) { FileSystem.DeleteDirectory(newConfigDirectory, true); } - if (Directory.Exists(oldConfigurationDirectory)) + if (FileSystem.DirectoryExists(oldConfigurationDirectory)) { - Directory.Move(oldConfigurationDirectory, newConfigDirectory); + FileSystem.MoveDirectory(oldConfigurationDirectory, newConfigDirectory); } else { - Directory.CreateDirectory(newConfigDirectory); + FileSystem.CreateDirectory(newConfigDirectory); } } Name = newName; - return RefreshMetadata(new MetadataRefreshOptions(new DirectoryService()) + return RefreshMetadata(new MetadataRefreshOptions(new DirectoryService(FileSystem)) { ReplaceAllMetadata = true, ImageRefreshMode = ImageRefreshMode.FullRefresh, diff --git a/MediaBrowser.Controller/Entities/UserView.cs b/MediaBrowser.Controller/Entities/UserView.cs index 488e54cc3..f4577435f 100644 --- a/MediaBrowser.Controller/Entities/UserView.cs +++ b/MediaBrowser.Controller/Entities/UserView.cs @@ -82,7 +82,27 @@ namespace MediaBrowser.Controller.Entities { CollectionType.Books, CollectionType.HomeVideos, - CollectionType.Photos + CollectionType.Photos, + CollectionType.Playlists, + CollectionType.BoxSets + }; + + var collectionFolder = folder as ICollectionFolder; + + if (collectionFolder == null) + { + return false; + } + + return standaloneTypes.Contains(collectionFolder.CollectionType ?? string.Empty); + } + + public static bool IsUserSpecific(Folder folder) + { + var standaloneTypes = new List<string> + { + CollectionType.Playlists, + CollectionType.BoxSets }; var collectionFolder = folder as ICollectionFolder; diff --git a/MediaBrowser.Controller/Entities/UserViewBuilder.cs b/MediaBrowser.Controller/Entities/UserViewBuilder.cs index cee5dadd2..e05b838d0 100644 --- a/MediaBrowser.Controller/Entities/UserViewBuilder.cs +++ b/MediaBrowser.Controller/Entities/UserViewBuilder.cs @@ -577,19 +577,9 @@ namespace MediaBrowser.Controller.Entities private async Task<QueryResult<BaseItem>> GetBoxsetView(Folder parent, User user, InternalItemsQuery query) { - return GetResult(GetMediaFolders(user).SelectMany(i => - { - var hasCollectionType = i as ICollectionFolder; - Func<BaseItem, bool> filter = b => b is BoxSet; - - if (hasCollectionType != null && string.Equals(hasCollectionType.CollectionType, CollectionType.BoxSets, StringComparison.OrdinalIgnoreCase)) - { - return i.GetChildren(user, true).Where(filter); - } - - return i.GetRecursiveChildren(user, filter); + var collections = _collectionManager.GetCollections(user); - }), parent, query); + return GetResult(collections, parent, query); } private async Task<QueryResult<BaseItem>> GetPhotosView(Folder queryParent, User user, InternalItemsQuery query) @@ -1041,12 +1031,12 @@ namespace MediaBrowser.Controller.Entities return false; } - if (request.IsUnidentified.HasValue) + if (request.IsYearMismatched.HasValue) { return false; } - if (request.IsYearMismatched.HasValue) + if (request.IsUnidentified.HasValue) { return false; } @@ -1418,15 +1408,6 @@ namespace MediaBrowser.Controller.Entities } } - if (query.IsUnidentified.HasValue) - { - var val = query.IsUnidentified.Value; - if (item.IsUnidentified != val) - { - return false; - } - } - if (query.IsLocked.HasValue) { var val = query.IsLocked.Value; @@ -1448,6 +1429,15 @@ namespace MediaBrowser.Controller.Entities } } + if (query.IsUnidentified.HasValue) + { + var val = query.IsUnidentified.Value; + if (item.IsUnidentified != val) + { + return false; + } + } + if (query.HasImdbId.HasValue) { var filterValue = query.HasImdbId.Value; @@ -1808,6 +1798,13 @@ namespace MediaBrowser.Controller.Entities private IEnumerable<Folder> GetMediaFolders(User user) { + if (user == null) + { + return _libraryManager.RootFolder + .Children + .OfType<Folder>() + .Where(i => !UserView.IsExcludedFromGrouping(i)); + } return user.RootFolder .GetChildren(user, true, true) .OfType<Folder>() @@ -1816,6 +1813,16 @@ namespace MediaBrowser.Controller.Entities private IEnumerable<Folder> GetMediaFolders(User user, IEnumerable<string> viewTypes) { + if (user == null) + { + return GetMediaFolders(null) + .Where(i => + { + var folder = i as ICollectionFolder; + + return folder != null && viewTypes.Contains(folder.CollectionType ?? string.Empty, StringComparer.OrdinalIgnoreCase); + }); + } return GetMediaFolders(user) .Where(i => { @@ -1839,9 +1846,19 @@ namespace MediaBrowser.Controller.Entities { if (parent == null || parent is UserView) { + if (user == null) + { + return GetMediaFolders(null, viewTypes).SelectMany(i => i.GetRecursiveChildren()); + } + return GetMediaFolders(user, viewTypes).SelectMany(i => i.GetRecursiveChildren(user)); } + if (user == null) + { + return parent.GetRecursiveChildren(); + } + return parent.GetRecursiveChildren(user); } @@ -1849,9 +1866,19 @@ namespace MediaBrowser.Controller.Entities { if (parent == null || parent is UserView) { + if (user == null) + { + return GetMediaFolders(null, viewTypes).SelectMany(i => i.GetRecursiveChildren(filter)); + } + return GetMediaFolders(user, viewTypes).SelectMany(i => i.GetRecursiveChildren(user, filter)); } + if (user == null) + { + return parent.GetRecursiveChildren(filter); + } + return parent.GetRecursiveChildren(user, filter); } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs index 2179c5ecd..1be04bb7c 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvAudioRecording.cs @@ -20,12 +20,16 @@ namespace MediaBrowser.Controller.LiveTv public string EpisodeTitle { get; set; } public bool IsSeries { get; set; } public string SeriesTimerId { get; set; } + [IgnoreDataMember] public DateTime StartDate { get; set; } public RecordingStatus Status { get; set; } + [IgnoreDataMember] public bool IsSports { get; set; } public bool IsNews { get; set; } + [IgnoreDataMember] public bool IsKids { get; set; } public bool IsRepeat { get; set; } + [IgnoreDataMember] public bool IsMovie { get; set; } public bool? IsHD { get; set; } public bool IsLive { get; set; } diff --git a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs index 12052905f..0f7d0a6ce 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvProgram.cs @@ -56,6 +56,7 @@ namespace MediaBrowser.Controller.LiveTv /// <summary> /// The start date of the program, in UTC. /// </summary> + [IgnoreDataMember] public DateTime StartDate { get; set; } /// <summary> @@ -110,12 +111,14 @@ namespace MediaBrowser.Controller.LiveTv /// Gets or sets a value indicating whether this instance is movie. /// </summary> /// <value><c>true</c> if this instance is movie; otherwise, <c>false</c>.</value> + [IgnoreDataMember] public bool IsMovie { get; set; } /// <summary> /// Gets or sets a value indicating whether this instance is sports. /// </summary> /// <value><c>true</c> if this instance is sports; otherwise, <c>false</c>.</value> + [IgnoreDataMember] public bool IsSports { get; set; } /// <summary> @@ -140,6 +143,7 @@ namespace MediaBrowser.Controller.LiveTv /// Gets or sets a value indicating whether this instance is kids. /// </summary> /// <value><c>true</c> if this instance is kids; otherwise, <c>false</c>.</value> + [IgnoreDataMember] public bool IsKids { get; set; } /// <summary> diff --git a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs index 960f8054a..a26d8b402 100644 --- a/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs +++ b/MediaBrowser.Controller/LiveTv/LiveTvVideoRecording.cs @@ -20,12 +20,16 @@ namespace MediaBrowser.Controller.LiveTv public string EpisodeTitle { get; set; } public bool IsSeries { get; set; } public string SeriesTimerId { get; set; } + [IgnoreDataMember] public DateTime StartDate { get; set; } public RecordingStatus Status { get; set; } + [IgnoreDataMember] public bool IsSports { get; set; } public bool IsNews { get; set; } + [IgnoreDataMember] public bool IsKids { get; set; } public bool IsRepeat { get; set; } + [IgnoreDataMember] public bool IsMovie { get; set; } public bool? IsHD { get; set; } public bool IsLive { get; set; } diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj index 24309734f..ea6e98ea6 100644 --- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj +++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj @@ -11,10 +11,10 @@ <AssemblyName>MediaBrowser.Controller</AssemblyName> <FileAlignment>512</FileAlignment> <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\</SolutionDir> - <ProductVersion>10.0.0</ProductVersion> - <SchemaVersion>2.0</SchemaVersion> <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <RestorePackages>true</RestorePackages> + <ReleaseVersion> + </ReleaseVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> <DebugSymbols>true</DebugSymbols> @@ -24,7 +24,6 @@ <DefineConstants>DEBUG;TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>none</DebugType> @@ -33,7 +32,6 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> </PropertyGroup> <PropertyGroup> <RunPostBuildEvent>Always</RunPostBuildEvent> @@ -45,16 +43,11 @@ <DefineConstants>TRACE</DefineConstants> <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> </PropertyGroup> <ItemGroup> <Reference Include="Interfaces.IO"> <HintPath>..\packages\Interfaces.IO.1.0.0.5\lib\portable-net45+sl4+wp71+win8+wpa81\Interfaces.IO.dll</HintPath> </Reference> - <Reference Include="MoreLinq, Version=1.1.17511.0, Culture=neutral, PublicKeyToken=384d532d7e88985d, processorArchitecture=MSIL"> - <SpecificVersion>False</SpecificVersion> - <HintPath>..\packages\morelinq.1.1.0\lib\net35\MoreLinq.dll</HintPath> - </Reference> <Reference Include="System" /> <Reference Include="System.Core" /> <Reference Include="System.Data" /> @@ -66,6 +59,9 @@ <Reference Include="ServiceStack.Interfaces"> <HintPath>..\ThirdParty\ServiceStack\ServiceStack.Interfaces.dll</HintPath> </Reference> + <Reference Include="MoreLinq"> + <HintPath>..\packages\morelinq.1.1.1\lib\net35\MoreLinq.dll</HintPath> + </Reference> </ItemGroup> <ItemGroup> <Compile Include="..\SharedVersion.cs"> @@ -81,7 +77,6 @@ <Compile Include="Channels\ChannelParentalRating.cs" /> <Compile Include="Channels\ChannelSearchInfo.cs" /> <Compile Include="Channels\IChannel.cs" /> - <Compile Include="Channels\IChannelFactory.cs" /> <Compile Include="Channels\IChannelManager.cs" /> <Compile Include="Channels\IChannelItem.cs" /> <Compile Include="Channels\ChannelAudioItem.cs" /> @@ -418,8 +413,6 @@ <Compile Include="Sync\ISyncRepository.cs" /> <Compile Include="Sync\SyncedFileInfo.cs" /> <Compile Include="Sync\SyncedItemProgress.cs" /> - <Compile Include="Themes\IAppThemeManager.cs" /> - <Compile Include="Themes\InternalThemeImage.cs" /> <Compile Include="TV\ITVSeriesManager.cs" /> </ItemGroup> <ItemGroup> diff --git a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs index 23285b612..427af6f6d 100644 --- a/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs +++ b/MediaBrowser.Controller/MediaEncoding/IMediaEncoder.cs @@ -25,6 +25,13 @@ namespace MediaBrowser.Controller.MediaEncoding string Version { get; } /// <summary> + /// Supportses the decoder. + /// </summary> + /// <param name="decoder">The decoder.</param> + /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns> + bool SupportsDecoder(string decoder); + + /// <summary> /// Extracts the audio image. /// </summary> /// <param name="path">The path.</param> diff --git a/MediaBrowser.Controller/Net/IHttpServer.cs b/MediaBrowser.Controller/Net/IHttpServer.cs index 37142af19..91da5fab2 100644 --- a/MediaBrowser.Controller/Net/IHttpServer.cs +++ b/MediaBrowser.Controller/Net/IHttpServer.cs @@ -53,5 +53,10 @@ namespace MediaBrowser.Controller.Net /// Inits this instance. /// </summary> void Init(IEnumerable<IRestfulService> services); + + /// <summary> + /// If set, all requests will respond with this message + /// </summary> + string GlobalResponse { get; set; } } }
\ No newline at end of file diff --git a/MediaBrowser.Controller/Persistence/IItemRepository.cs b/MediaBrowser.Controller/Persistence/IItemRepository.cs index a4b9bf120..8fc0aedd3 100644 --- a/MediaBrowser.Controller/Persistence/IItemRepository.cs +++ b/MediaBrowser.Controller/Persistence/IItemRepository.cs @@ -169,6 +169,13 @@ namespace MediaBrowser.Controller.Persistence /// <param name="query">The query.</param> /// <returns>List<System.String>.</returns> List<string> GetPeopleNames(InternalPeopleQuery query); + + /// <summary> + /// Gets the item ids with path. + /// </summary> + /// <param name="query">The query.</param> + /// <returns>QueryResult<Tuple<Guid, System.String>>.</returns> + QueryResult<Tuple<Guid, string>> GetItemIdsWithPath(InternalItemsQuery query); } } diff --git a/MediaBrowser.Controller/Providers/DirectoryService.cs b/MediaBrowser.Controller/Providers/DirectoryService.cs index 79ffb0d01..d320409f4 100644 --- a/MediaBrowser.Controller/Providers/DirectoryService.cs +++ b/MediaBrowser.Controller/Providers/DirectoryService.cs @@ -4,23 +4,26 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.IO; using System.Linq; +using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Providers { public class DirectoryService : IDirectoryService { private readonly ILogger _logger; + private readonly IFileSystem _fileSystem; private readonly ConcurrentDictionary<string, Dictionary<string,FileSystemInfo>> _cache = new ConcurrentDictionary<string, Dictionary<string, FileSystemInfo>>(StringComparer.OrdinalIgnoreCase); - public DirectoryService(ILogger logger) + public DirectoryService(ILogger logger, IFileSystem fileSystem) { _logger = logger; + _fileSystem = fileSystem; } - public DirectoryService() - : this(new NullLogger()) + public DirectoryService(IFileSystem fileSystem) + : this(new NullLogger(), fileSystem) { } @@ -59,8 +62,7 @@ namespace MediaBrowser.Controller.Providers try { // using EnumerateFileSystemInfos doesn't handle reparse points (symlinks) - var list = new DirectoryInfo(path).EnumerateDirectories("*", SearchOption.TopDirectoryOnly) - .Concat<FileSystemInfo>(new DirectoryInfo(path).EnumerateFiles("*", SearchOption.TopDirectoryOnly)); + var list = _fileSystem.GetFileSystemEntries(path); // Seeing dupes on some users file system for some reason foreach (var item in list) diff --git a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs index dbb7fbfcd..097c613cb 100644 --- a/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs +++ b/MediaBrowser.Controller/Providers/MetadataRefreshOptions.cs @@ -1,4 +1,5 @@ using System.Linq; +using MediaBrowser.Common.IO; namespace MediaBrowser.Controller.Providers { @@ -15,8 +16,8 @@ namespace MediaBrowser.Controller.Providers public bool ForceSave { get; set; } - public MetadataRefreshOptions() - : this(new DirectoryService()) + public MetadataRefreshOptions(IFileSystem fileSystem) + : this(new DirectoryService(fileSystem)) { } diff --git a/MediaBrowser.Controller/Providers/MetadataStatus.cs b/MediaBrowser.Controller/Providers/MetadataStatus.cs index 283b9edbc..f395dabf1 100644 --- a/MediaBrowser.Controller/Providers/MetadataStatus.cs +++ b/MediaBrowser.Controller/Providers/MetadataStatus.cs @@ -78,9 +78,9 @@ namespace MediaBrowser.Controller.Providers public bool IsDirty { get; private set; } - public void SetDateLastMetadataRefresh(DateTime date) + public void SetDateLastMetadataRefresh(DateTime? date) { - if (date != (DateLastMetadataRefresh ?? DateTime.MinValue)) + if (date != DateLastMetadataRefresh) { IsDirty = true; } @@ -88,9 +88,9 @@ namespace MediaBrowser.Controller.Providers DateLastMetadataRefresh = date; } - public void SetDateLastImagesRefresh(DateTime date) + public void SetDateLastImagesRefresh(DateTime? date) { - if (date != (DateLastImagesRefresh ?? DateTime.MinValue)) + if (date != DateLastImagesRefresh) { IsDirty = true; } diff --git a/MediaBrowser.Controller/Themes/IAppThemeManager.cs b/MediaBrowser.Controller/Themes/IAppThemeManager.cs deleted file mode 100644 index 1a7c2aaab..000000000 --- a/MediaBrowser.Controller/Themes/IAppThemeManager.cs +++ /dev/null @@ -1,38 +0,0 @@ -using MediaBrowser.Model.Themes; -using System.Collections.Generic; - -namespace MediaBrowser.Controller.Themes -{ - public interface IAppThemeManager - { - /// <summary> - /// Gets the themes. - /// </summary> - /// <param name="applicationName">Name of the application.</param> - /// <returns>IEnumerable{AppThemeInfo}.</returns> - IEnumerable<AppThemeInfo> GetThemes(string applicationName); - - /// <summary> - /// Gets the theme. - /// </summary> - /// <param name="applicationName">Name of the application.</param> - /// <param name="name">The name.</param> - /// <returns>AppTheme.</returns> - AppTheme GetTheme(string applicationName, string name); - - /// <summary> - /// Saves the theme. - /// </summary> - /// <param name="theme">The theme.</param> - void SaveTheme(AppTheme theme); - - /// <summary> - /// Gets the image image information. - /// </summary> - /// <param name="applicationName">Name of the application.</param> - /// <param name="themeName">Name of the theme.</param> - /// <param name="imageName">Name of the image.</param> - /// <returns>InternalThemeImage.</returns> - InternalThemeImage GetImageImageInfo(string applicationName, string themeName, string imageName); - } -} diff --git a/MediaBrowser.Controller/Themes/InternalThemeImage.cs b/MediaBrowser.Controller/Themes/InternalThemeImage.cs deleted file mode 100644 index 2b676c25b..000000000 --- a/MediaBrowser.Controller/Themes/InternalThemeImage.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; - -namespace MediaBrowser.Controller.Themes -{ - public class InternalThemeImage - { - /// <summary> - /// Gets or sets the name. - /// </summary> - /// <value>The name.</value> - public string Name { get; set; } - - /// <summary> - /// Gets or sets the cache tag. - /// </summary> - /// <value>The cache tag.</value> - public string CacheTag { get; set; } - - /// <summary> - /// Gets or sets the path. - /// </summary> - /// <value>The path.</value> - public string Path { get; set; } - - /// <summary> - /// Gets or sets the date modified. - /// </summary> - /// <value>The date modified.</value> - public DateTime DateModified { get; set; } - } -} diff --git a/MediaBrowser.Controller/packages.config b/MediaBrowser.Controller/packages.config index 8846b5a06..c320ed9d9 100644 --- a/MediaBrowser.Controller/packages.config +++ b/MediaBrowser.Controller/packages.config @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> <packages> <package id="Interfaces.IO" version="1.0.0.5" targetFramework="net45" /> - <package id="morelinq" version="1.1.0" targetFramework="net45" /> + <package id="morelinq" version="1.1.1" targetFramework="net45" /> </packages>
\ No newline at end of file |
