diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-08-09 21:16:31 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-08-09 21:16:31 -0400 |
| commit | e0c387446b2562ac6b153d36d357a71e70fa736b (patch) | |
| tree | 4cf750dfbfa6882986f9f1c8e8581a30a6d6977e | |
| parent | 3b25b4d5b2030977bdc2deaf9093621c82d50835 (diff) | |
reworked iso manager
26 files changed, 122 insertions, 24 deletions
diff --git a/MediaBrowser.Api/Playback/BaseStreamingService.cs b/MediaBrowser.Api/Playback/BaseStreamingService.cs index 10570d911..b4ba31d72 100644 --- a/MediaBrowser.Api/Playback/BaseStreamingService.cs +++ b/MediaBrowser.Api/Playback/BaseStreamingService.cs @@ -18,6 +18,7 @@ using System.IO; using System.Linq; using System.Threading; using System.Threading.Tasks; +using MediaBrowser.Model.IO; namespace MediaBrowser.Api.Playback { diff --git a/MediaBrowser.Api/Playback/Hls/AudioHlsService.cs b/MediaBrowser.Api/Playback/Hls/AudioHlsService.cs index a666d4628..df80d1f42 100644 --- a/MediaBrowser.Api/Playback/Hls/AudioHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/AudioHlsService.cs @@ -3,6 +3,7 @@ using MediaBrowser.Common.MediaInfo; using MediaBrowser.Controller; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Dto; +using MediaBrowser.Model.IO; using ServiceStack.ServiceHost; using System; using System.IO; diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs index 749b090e0..e616ca2d2 100644 --- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs @@ -8,6 +8,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using MediaBrowser.Model.IO; namespace MediaBrowser.Api.Playback.Hls { diff --git a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs index 46093e0fc..44d319465 100644 --- a/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs +++ b/MediaBrowser.Api/Playback/Hls/VideoHlsService.cs @@ -2,6 +2,7 @@ using MediaBrowser.Common.MediaInfo; using MediaBrowser.Controller; using MediaBrowser.Controller.Library; +using MediaBrowser.Model.IO; using ServiceStack.ServiceHost; using System; using System.IO; diff --git a/MediaBrowser.Api/Playback/Progressive/AudioService.cs b/MediaBrowser.Api/Playback/Progressive/AudioService.cs index 1c4c3d70e..202318cfe 100644 --- a/MediaBrowser.Api/Playback/Progressive/AudioService.cs +++ b/MediaBrowser.Api/Playback/Progressive/AudioService.cs @@ -3,6 +3,7 @@ using MediaBrowser.Common.MediaInfo; using MediaBrowser.Controller; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Persistence; +using MediaBrowser.Model.IO; using ServiceStack.ServiceHost; using System; using System.Collections.Generic; diff --git a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs index c4f258d8a..0d5c07cbe 100644 --- a/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs +++ b/MediaBrowser.Api/Playback/Progressive/BaseProgressiveStreamingService.cs @@ -16,6 +16,7 @@ using System; using System.Collections.Generic; using System.IO; using System.Threading.Tasks; +using MediaBrowser.Model.IO; namespace MediaBrowser.Api.Playback.Progressive { diff --git a/MediaBrowser.Api/Playback/Progressive/VideoService.cs b/MediaBrowser.Api/Playback/Progressive/VideoService.cs index 742fba1c3..b091065b6 100644 --- a/MediaBrowser.Api/Playback/Progressive/VideoService.cs +++ b/MediaBrowser.Api/Playback/Progressive/VideoService.cs @@ -4,6 +4,7 @@ using MediaBrowser.Controller; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Persistence; +using MediaBrowser.Model.IO; using ServiceStack.ServiceHost; using System; using System.IO; diff --git a/MediaBrowser.Api/Playback/StreamState.cs b/MediaBrowser.Api/Playback/StreamState.cs index 653c4d57b..3c2ea5a13 100644 --- a/MediaBrowser.Api/Playback/StreamState.cs +++ b/MediaBrowser.Api/Playback/StreamState.cs @@ -2,6 +2,7 @@ using MediaBrowser.Common.IO; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.IO; namespace MediaBrowser.Api.Playback { diff --git a/MediaBrowser.Common/MediaBrowser.Common.csproj b/MediaBrowser.Common/MediaBrowser.Common.csproj index cbacda1f9..91391d175 100644 --- a/MediaBrowser.Common/MediaBrowser.Common.csproj +++ b/MediaBrowser.Common/MediaBrowser.Common.csproj @@ -65,8 +65,6 @@ <Compile Include="Events\GenericEventArgs.cs" /> <Compile Include="Extensions\ResourceNotFoundException.cs" /> <Compile Include="IO\FileSystemRepository.cs" /> - <Compile Include="IO\IIsoManager.cs" /> - <Compile Include="IO\IIsoMount.cs" /> <Compile Include="IO\ProgressStream.cs" /> <Compile Include="IO\StreamDefaults.cs" /> <Compile Include="MediaInfo\MediaInfoResult.cs" /> diff --git a/MediaBrowser.Controller/MediaInfo/MediaEncoderHelpers.cs b/MediaBrowser.Controller/MediaInfo/MediaEncoderHelpers.cs index e20a425aa..4485c4072 100644 --- a/MediaBrowser.Controller/MediaInfo/MediaEncoderHelpers.cs +++ b/MediaBrowser.Controller/MediaInfo/MediaEncoderHelpers.cs @@ -2,6 +2,7 @@ using MediaBrowser.Common.MediaInfo; using MediaBrowser.Controller.Entities; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.IO; namespace MediaBrowser.Controller.MediaInfo { diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index c2b0289ea..7180ed5bc 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -177,6 +177,34 @@ namespace MediaBrowser.Model.ApiClient Task<ItemsResult> GetItemsAsync(ItemQuery query); /// <summary> + /// Gets the instant mix from song async. + /// </summary> + /// <param name="query">The query.</param> + /// <returns>Task{ItemsResult}.</returns> + Task<ItemsResult> GetInstantMixFromSongAsync(SimilarItemsQuery query); + + /// <summary> + /// Gets the instant mix from album async. + /// </summary> + /// <param name="query">The query.</param> + /// <returns>Task{ItemsResult}.</returns> + Task<ItemsResult> GetInstantMixFromAlbumAsync(SimilarItemsQuery query); + + /// <summary> + /// Gets the instant mix from artist async. + /// </summary> + /// <param name="query">The query.</param> + /// <returns>Task{ItemsResult}.</returns> + Task<ItemsResult> GetInstantMixFromArtistAsync(SimilarItemsByNameQuery query); + + /// <summary> + /// Gets the instant mix from music genre async. + /// </summary> + /// <param name="query">The query.</param> + /// <returns>Task{ItemsResult}.</returns> + Task<ItemsResult> GetInstantMixFromMusicGenreAsync(SimilarItemsByNameQuery query); + + /// <summary> /// Gets the similar movies async. /// </summary> /// <param name="query">The query.</param> diff --git a/MediaBrowser.Model/IO/IIsoManager.cs b/MediaBrowser.Model/IO/IIsoManager.cs new file mode 100644 index 000000000..92c4d5aee --- /dev/null +++ b/MediaBrowser.Model/IO/IIsoManager.cs @@ -0,0 +1,34 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Model.IO +{ + public interface IIsoManager : IDisposable + { + /// <summary> + /// Mounts the specified iso path. + /// </summary> + /// <param name="isoPath">The iso path.</param> + /// <param name="cancellationToken">The cancellation token.</param> + /// <returns>IsoMount.</returns> + /// <exception cref="ArgumentNullException">isoPath</exception> + /// <exception cref="IOException">Unable to create mount.</exception> + Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken); + + /// <summary> + /// Determines whether this instance can mount the specified path. + /// </summary> + /// <param name="path">The path.</param> + /// <returns><c>true</c> if this instance can mount the specified path; otherwise, <c>false</c>.</returns> + bool CanMount(string path); + + /// <summary> + /// Adds the parts. + /// </summary> + /// <param name="mounters">The mounters.</param> + void AddParts(IEnumerable<IIsoMounter> mounters); + } +}
\ No newline at end of file diff --git a/MediaBrowser.Common/IO/IIsoMount.cs b/MediaBrowser.Model/IO/IIsoMount.cs index c6dabc3b9..4f8f8b5d2 100644 --- a/MediaBrowser.Common/IO/IIsoMount.cs +++ b/MediaBrowser.Model/IO/IIsoMount.cs @@ -1,6 +1,6 @@ using System; -namespace MediaBrowser.Common.IO +namespace MediaBrowser.Model.IO { /// <summary> /// Interface IIsoMount diff --git a/MediaBrowser.Common/IO/IIsoManager.cs b/MediaBrowser.Model/IO/IIsoMounter.cs index 8e94189c4..91a045368 100644 --- a/MediaBrowser.Common/IO/IIsoManager.cs +++ b/MediaBrowser.Model/IO/IIsoMounter.cs @@ -1,21 +1,21 @@ using System; +using System.IO; using System.Threading; using System.Threading.Tasks; -namespace MediaBrowser.Common.IO +namespace MediaBrowser.Model.IO { - public interface IIsoManager : IDisposable + public interface IIsoMounter : IDisposable { /// <summary> /// Mounts the specified iso path. /// </summary> /// <param name="isoPath">The iso path.</param> /// <param name="cancellationToken">The cancellation token.</param> - /// <param name="visibleToAllProcesses">if set to <c>true</c> [visible to all processes].</param> /// <returns>IsoMount.</returns> - /// <exception cref="System.ArgumentNullException">isoPath</exception> - /// <exception cref="System.IO.IOException">Unable to create mount.</exception> - Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken, bool visibleToAllProcesses = true); + /// <exception cref="ArgumentNullException">isoPath</exception> + /// <exception cref="IOException">Unable to create mount.</exception> + Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken); /// <summary> /// Determines whether this instance can mount the specified path. @@ -24,4 +24,4 @@ namespace MediaBrowser.Common.IO /// <returns><c>true</c> if this instance can mount the specified path; otherwise, <c>false</c>.</returns> bool CanMount(string path); } -}
\ No newline at end of file +} diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 9a1caceea..1c4f798f4 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -56,6 +56,9 @@ <Compile Include="Entities\MediaUrl.cs" /> <Compile Include="Entities\MetadataFields.cs" /> <Compile Include="Entities\Video3DFormat.cs" /> + <Compile Include="IO\IIsoManager.cs" /> + <Compile Include="IO\IIsoMount.cs" /> + <Compile Include="IO\IIsoMounter.cs" /> <Compile Include="Net\WebSocketMessage.cs" /> <Compile Include="Net\WebSocketMessageType.cs" /> <Compile Include="Net\WebSocketState.cs" /> diff --git a/MediaBrowser.Model/Querying/SimilarItemsQuery.cs b/MediaBrowser.Model/Querying/SimilarItemsQuery.cs index 0dd491550..d792aa76d 100644 --- a/MediaBrowser.Model/Querying/SimilarItemsQuery.cs +++ b/MediaBrowser.Model/Querying/SimilarItemsQuery.cs @@ -26,4 +26,31 @@ /// <value>The fields.</value> public ItemFields[] Fields { get; set; } } + + public class SimilarItemsByNameQuery + { + /// <summary> + /// The user to localize search results for + /// </summary> + /// <value>The user id.</value> + public string UserId { get; set; } + + /// <summary> + /// Gets or sets the name. + /// </summary> + /// <value>The name.</value> + public string Name { get; set; } + + /// <summary> + /// The maximum number of items to return + /// </summary> + /// <value>The limit.</value> + public int? Limit { get; set; } + + /// <summary> + /// Fields to return within the items, in addition to basic information + /// </summary> + /// <value>The fields.</value> + public ItemFields[] Fields { get; set; } + } } diff --git a/MediaBrowser.Providers/MediaInfo/BaseFFMpegProvider.cs b/MediaBrowser.Providers/MediaInfo/BaseFFMpegProvider.cs index 98baa44e3..c692f1238 100644 --- a/MediaBrowser.Providers/MediaInfo/BaseFFMpegProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/BaseFFMpegProvider.cs @@ -4,6 +4,7 @@ using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.IO; using MediaBrowser.Model.Logging; using System; using System.Threading.Tasks; diff --git a/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs b/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs index 643bcf2cd..b99586367 100644 --- a/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/BaseFFProbeProvider.cs @@ -5,6 +5,7 @@ using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.MediaInfo; using MediaBrowser.Controller.Providers; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.IO; using MediaBrowser.Model.Logging; using MediaBrowser.Model.Serialization; using System; diff --git a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs index 1b1812033..39beda9ce 100644 --- a/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs +++ b/MediaBrowser.Providers/MediaInfo/FFProbeVideoInfoProvider.cs @@ -8,6 +8,7 @@ using MediaBrowser.Controller.Entities.Movies; using MediaBrowser.Controller.Localization; using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.IO; using MediaBrowser.Model.Logging; using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.Serialization; diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs index 58c89141f..0e0597ed6 100644 --- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs +++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs @@ -586,7 +586,7 @@ namespace MediaBrowser.Server.Implementations.Library if (folder.Id == Guid.Empty) { - folder.Id = (folder.Path ?? folder.Name ?? folder.GetType().Name).GetMBId(folder.GetType()); + folder.Id = (folder.Path ?? folder.GetType().Name).GetMBId(folder.GetType()); } rootFolder.AddVirtualChild(folder); diff --git a/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs b/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs index 7795f27b1..fa5e016c1 100644 --- a/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs +++ b/MediaBrowser.Server.Implementations/Persistence/SqliteExtensions.cs @@ -1,9 +1,9 @@ -using System; +using MediaBrowser.Model.Logging; +using System; using System.Data; using System.Data.SQLite; using System.IO; using System.Threading.Tasks; -using MediaBrowser.Model.Logging; namespace MediaBrowser.Server.Implementations.Persistence { @@ -41,11 +41,6 @@ namespace MediaBrowser.Server.Implementations.Persistence /// <exception cref="System.ArgumentNullException"></exception> public static SQLiteParameter AddParam(this SQLiteCommand cmd, string param, object data) { - if (string.IsNullOrEmpty(param)) - { - throw new ArgumentNullException(); - } - var sqliteParam = AddParam(cmd, param); sqliteParam.Value = data; return sqliteParam; diff --git a/MediaBrowser.Server.Implementations/ScheduledTasks/VideoImagesTask.cs b/MediaBrowser.Server.Implementations/ScheduledTasks/VideoImagesTask.cs index 09eb66361..39b610925 100644 --- a/MediaBrowser.Server.Implementations/ScheduledTasks/VideoImagesTask.cs +++ b/MediaBrowser.Server.Implementations/ScheduledTasks/VideoImagesTask.cs @@ -8,6 +8,7 @@ using MediaBrowser.Controller.Library; using MediaBrowser.Controller.MediaInfo; using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Entities; +using MediaBrowser.Model.IO; using MediaBrowser.Model.Logging; using MoreLinq; using System; diff --git a/MediaBrowser.ServerApplication/ApplicationHost.cs b/MediaBrowser.ServerApplication/ApplicationHost.cs index 52c01d4a9..1ef3adb13 100644 --- a/MediaBrowser.ServerApplication/ApplicationHost.cs +++ b/MediaBrowser.ServerApplication/ApplicationHost.cs @@ -238,7 +238,7 @@ namespace MediaBrowser.ServerApplication RegisterSingleInstance<IWebSocketServer>(() => new AlchemyServer(Logger)); - RegisterSingleInstance<IIsoManager>(() => new PismoIsoManager(Logger)); + //RegisterSingleInstance<IIsoManager>(() => new PismoIsoManager(Logger)); RegisterSingleInstance<IBlurayExaminer>(() => new BdInfoExaminer()); ZipClient = new DotNetZipClient(); diff --git a/Nuget/MediaBrowser.Common.Internal.nuspec b/Nuget/MediaBrowser.Common.Internal.nuspec index eb9fbc88e..e9beca2ba 100644 --- a/Nuget/MediaBrowser.Common.Internal.nuspec +++ b/Nuget/MediaBrowser.Common.Internal.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common.Internal</id> - <version>3.0.175</version> + <version>3.0.176</version> <title>MediaBrowser.Common.Internal</title> <authors>Luke</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains common components shared by Media Browser Theater and Media Browser Server. Not intended for plugin developer consumption.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.175" /> + <dependency id="MediaBrowser.Common" version="3.0.176" /> <dependency id="NLog" version="2.0.1.2" /> <dependency id="ServiceStack.Text" version="3.9.45" /> <dependency id="SimpleInjector" version="2.2.3" /> diff --git a/Nuget/MediaBrowser.Common.nuspec b/Nuget/MediaBrowser.Common.nuspec index fbad490cf..79d4ab40d 100644 --- a/Nuget/MediaBrowser.Common.nuspec +++ b/Nuget/MediaBrowser.Common.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <metadata> <id>MediaBrowser.Common</id> - <version>3.0.175</version> + <version>3.0.176</version> <title>MediaBrowser.Common</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> diff --git a/Nuget/MediaBrowser.Server.Core.nuspec b/Nuget/MediaBrowser.Server.Core.nuspec index 8c9563bc9..2e7fa8bf5 100644 --- a/Nuget/MediaBrowser.Server.Core.nuspec +++ b/Nuget/MediaBrowser.Server.Core.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata> <id>MediaBrowser.Server.Core</id> - <version>3.0.175</version> + <version>3.0.176</version> <title>Media Browser.Server.Core</title> <authors>Media Browser Team</authors> <owners>ebr,Luke,scottisafool</owners> @@ -12,7 +12,7 @@ <description>Contains core components required to build plugins for Media Browser Server.</description> <copyright>Copyright © Media Browser 2013</copyright> <dependencies> - <dependency id="MediaBrowser.Common" version="3.0.175" /> + <dependency id="MediaBrowser.Common" version="3.0.176" /> </dependencies> </metadata> <files> |
