reworked iso manager

This commit is contained in:
Luke Pulverenti 2013-08-09 21:16:31 -04:00
parent 3b25b4d5b2
commit e0c387446b
26 changed files with 122 additions and 24 deletions

View File

@ -18,6 +18,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.IO;
namespace MediaBrowser.Api.Playback namespace MediaBrowser.Api.Playback
{ {

View File

@ -3,6 +3,7 @@ using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller; using MediaBrowser.Controller;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Model.Dto; using MediaBrowser.Model.Dto;
using MediaBrowser.Model.IO;
using ServiceStack.ServiceHost; using ServiceStack.ServiceHost;
using System; using System;
using System.IO; using System.IO;

View File

@ -8,6 +8,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.IO;
namespace MediaBrowser.Api.Playback.Hls namespace MediaBrowser.Api.Playback.Hls
{ {

View File

@ -2,6 +2,7 @@
using MediaBrowser.Common.MediaInfo; using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller; using MediaBrowser.Controller;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Model.IO;
using ServiceStack.ServiceHost; using ServiceStack.ServiceHost;
using System; using System;
using System.IO; using System.IO;

View File

@ -3,6 +3,7 @@ using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller; using MediaBrowser.Controller;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.IO;
using ServiceStack.ServiceHost; using ServiceStack.ServiceHost;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;

View File

@ -16,6 +16,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.IO;
namespace MediaBrowser.Api.Playback.Progressive namespace MediaBrowser.Api.Playback.Progressive
{ {

View File

@ -4,6 +4,7 @@ using MediaBrowser.Controller;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.IO;
using ServiceStack.ServiceHost; using ServiceStack.ServiceHost;
using System; using System;
using System.IO; using System.IO;

View File

@ -2,6 +2,7 @@
using MediaBrowser.Common.IO; using MediaBrowser.Common.IO;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
namespace MediaBrowser.Api.Playback namespace MediaBrowser.Api.Playback
{ {

View File

@ -65,8 +65,6 @@
<Compile Include="Events\GenericEventArgs.cs" /> <Compile Include="Events\GenericEventArgs.cs" />
<Compile Include="Extensions\ResourceNotFoundException.cs" /> <Compile Include="Extensions\ResourceNotFoundException.cs" />
<Compile Include="IO\FileSystemRepository.cs" /> <Compile Include="IO\FileSystemRepository.cs" />
<Compile Include="IO\IIsoManager.cs" />
<Compile Include="IO\IIsoMount.cs" />
<Compile Include="IO\ProgressStream.cs" /> <Compile Include="IO\ProgressStream.cs" />
<Compile Include="IO\StreamDefaults.cs" /> <Compile Include="IO\StreamDefaults.cs" />
<Compile Include="MediaInfo\MediaInfoResult.cs" /> <Compile Include="MediaInfo\MediaInfoResult.cs" />

View File

@ -2,6 +2,7 @@
using MediaBrowser.Common.MediaInfo; using MediaBrowser.Common.MediaInfo;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
namespace MediaBrowser.Controller.MediaInfo namespace MediaBrowser.Controller.MediaInfo
{ {

View File

@ -176,6 +176,34 @@ namespace MediaBrowser.Model.ApiClient
/// <exception cref="ArgumentNullException">query</exception> /// <exception cref="ArgumentNullException">query</exception>
Task<ItemsResult> GetItemsAsync(ItemQuery query); 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> /// <summary>
/// Gets the similar movies async. /// Gets the similar movies async.
/// </summary> /// </summary>

View File

@ -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);
}
}

View File

@ -1,6 +1,6 @@
using System; using System;
namespace MediaBrowser.Common.IO namespace MediaBrowser.Model.IO
{ {
/// <summary> /// <summary>
/// Interface IIsoMount /// Interface IIsoMount

View File

@ -1,21 +1,21 @@
using System; using System;
using System.IO;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
namespace MediaBrowser.Common.IO namespace MediaBrowser.Model.IO
{ {
public interface IIsoManager : IDisposable public interface IIsoMounter : IDisposable
{ {
/// <summary> /// <summary>
/// Mounts the specified iso path. /// Mounts the specified iso path.
/// </summary> /// </summary>
/// <param name="isoPath">The iso path.</param> /// <param name="isoPath">The iso path.</param>
/// <param name="cancellationToken">The cancellation token.</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> /// <returns>IsoMount.</returns>
/// <exception cref="System.ArgumentNullException">isoPath</exception> /// <exception cref="ArgumentNullException">isoPath</exception>
/// <exception cref="System.IO.IOException">Unable to create mount.</exception> /// <exception cref="IOException">Unable to create mount.</exception>
Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken, bool visibleToAllProcesses = true); Task<IIsoMount> Mount(string isoPath, CancellationToken cancellationToken);
/// <summary> /// <summary>
/// Determines whether this instance can mount the specified path. /// 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> /// <returns><c>true</c> if this instance can mount the specified path; otherwise, <c>false</c>.</returns>
bool CanMount(string path); bool CanMount(string path);
} }
} }

View File

@ -56,6 +56,9 @@
<Compile Include="Entities\MediaUrl.cs" /> <Compile Include="Entities\MediaUrl.cs" />
<Compile Include="Entities\MetadataFields.cs" /> <Compile Include="Entities\MetadataFields.cs" />
<Compile Include="Entities\Video3DFormat.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\WebSocketMessage.cs" />
<Compile Include="Net\WebSocketMessageType.cs" /> <Compile Include="Net\WebSocketMessageType.cs" />
<Compile Include="Net\WebSocketState.cs" /> <Compile Include="Net\WebSocketState.cs" />

View File

@ -26,4 +26,31 @@
/// <value>The fields.</value> /// <value>The fields.</value>
public ItemFields[] Fields { get; set; } 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; }
}
} }

View File

@ -4,6 +4,7 @@ using MediaBrowser.Controller.Configuration;
using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;

View File

@ -5,6 +5,7 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.MediaInfo; using MediaBrowser.Controller.MediaInfo;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;
using System; using System;

View File

@ -8,6 +8,7 @@ using MediaBrowser.Controller.Entities.Movies;
using MediaBrowser.Controller.Localization; using MediaBrowser.Controller.Localization;
using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.MediaInfo; using MediaBrowser.Model.MediaInfo;
using MediaBrowser.Model.Serialization; using MediaBrowser.Model.Serialization;

View File

@ -586,7 +586,7 @@ namespace MediaBrowser.Server.Implementations.Library
if (folder.Id == Guid.Empty) 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); rootFolder.AddVirtualChild(folder);

View File

@ -1,9 +1,9 @@
using System; using MediaBrowser.Model.Logging;
using System;
using System.Data; using System.Data;
using System.Data.SQLite; using System.Data.SQLite;
using System.IO; using System.IO;
using System.Threading.Tasks; using System.Threading.Tasks;
using MediaBrowser.Model.Logging;
namespace MediaBrowser.Server.Implementations.Persistence namespace MediaBrowser.Server.Implementations.Persistence
{ {
@ -41,11 +41,6 @@ namespace MediaBrowser.Server.Implementations.Persistence
/// <exception cref="System.ArgumentNullException"></exception> /// <exception cref="System.ArgumentNullException"></exception>
public static SQLiteParameter AddParam(this SQLiteCommand cmd, string param, object data) public static SQLiteParameter AddParam(this SQLiteCommand cmd, string param, object data)
{ {
if (string.IsNullOrEmpty(param))
{
throw new ArgumentNullException();
}
var sqliteParam = AddParam(cmd, param); var sqliteParam = AddParam(cmd, param);
sqliteParam.Value = data; sqliteParam.Value = data;
return sqliteParam; return sqliteParam;

View File

@ -8,6 +8,7 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.MediaInfo; using MediaBrowser.Controller.MediaInfo;
using MediaBrowser.Controller.Persistence; using MediaBrowser.Controller.Persistence;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MoreLinq; using MoreLinq;
using System; using System;

View File

@ -238,7 +238,7 @@ namespace MediaBrowser.ServerApplication
RegisterSingleInstance<IWebSocketServer>(() => new AlchemyServer(Logger)); RegisterSingleInstance<IWebSocketServer>(() => new AlchemyServer(Logger));
RegisterSingleInstance<IIsoManager>(() => new PismoIsoManager(Logger)); //RegisterSingleInstance<IIsoManager>(() => new PismoIsoManager(Logger));
RegisterSingleInstance<IBlurayExaminer>(() => new BdInfoExaminer()); RegisterSingleInstance<IBlurayExaminer>(() => new BdInfoExaminer());
ZipClient = new DotNetZipClient(); ZipClient = new DotNetZipClient();

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common.Internal</id> <id>MediaBrowser.Common.Internal</id>
<version>3.0.175</version> <version>3.0.176</version>
<title>MediaBrowser.Common.Internal</title> <title>MediaBrowser.Common.Internal</title>
<authors>Luke</authors> <authors>Luke</authors>
<owners>ebr,Luke,scottisafool</owners> <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> <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> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <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="NLog" version="2.0.1.2" />
<dependency id="ServiceStack.Text" version="3.9.45" /> <dependency id="ServiceStack.Text" version="3.9.45" />
<dependency id="SimpleInjector" version="2.2.3" /> <dependency id="SimpleInjector" version="2.2.3" />

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Common</id> <id>MediaBrowser.Common</id>
<version>3.0.175</version> <version>3.0.176</version>
<title>MediaBrowser.Common</title> <title>MediaBrowser.Common</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>

View File

@ -2,7 +2,7 @@
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<metadata> <metadata>
<id>MediaBrowser.Server.Core</id> <id>MediaBrowser.Server.Core</id>
<version>3.0.175</version> <version>3.0.176</version>
<title>Media Browser.Server.Core</title> <title>Media Browser.Server.Core</title>
<authors>Media Browser Team</authors> <authors>Media Browser Team</authors>
<owners>ebr,Luke,scottisafool</owners> <owners>ebr,Luke,scottisafool</owners>
@ -12,7 +12,7 @@
<description>Contains core components required to build plugins for Media Browser Server.</description> <description>Contains core components required to build plugins for Media Browser Server.</description>
<copyright>Copyright © Media Browser 2013</copyright> <copyright>Copyright © Media Browser 2013</copyright>
<dependencies> <dependencies>
<dependency id="MediaBrowser.Common" version="3.0.175" /> <dependency id="MediaBrowser.Common" version="3.0.176" />
</dependencies> </dependencies>
</metadata> </metadata>
<files> <files>