From e0c387446b2562ac6b153d36d357a71e70fa736b Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Fri, 9 Aug 2013 21:16:31 -0400 Subject: reworked iso manager --- MediaBrowser.Model/ApiClient/IApiClient.cs | 28 +++++++++++++++++++ MediaBrowser.Model/IO/IIsoManager.cs | 34 ++++++++++++++++++++++++ MediaBrowser.Model/IO/IIsoMount.cs | 22 +++++++++++++++ MediaBrowser.Model/IO/IIsoMounter.cs | 27 +++++++++++++++++++ MediaBrowser.Model/MediaBrowser.Model.csproj | 3 +++ MediaBrowser.Model/Querying/SimilarItemsQuery.cs | 27 +++++++++++++++++++ 6 files changed, 141 insertions(+) create mode 100644 MediaBrowser.Model/IO/IIsoManager.cs create mode 100644 MediaBrowser.Model/IO/IIsoMount.cs create mode 100644 MediaBrowser.Model/IO/IIsoMounter.cs (limited to 'MediaBrowser.Model') diff --git a/MediaBrowser.Model/ApiClient/IApiClient.cs b/MediaBrowser.Model/ApiClient/IApiClient.cs index c2b0289eab..7180ed5bcd 100644 --- a/MediaBrowser.Model/ApiClient/IApiClient.cs +++ b/MediaBrowser.Model/ApiClient/IApiClient.cs @@ -176,6 +176,34 @@ namespace MediaBrowser.Model.ApiClient /// query Task GetItemsAsync(ItemQuery query); + /// + /// Gets the instant mix from song async. + /// + /// The query. + /// Task{ItemsResult}. + Task GetInstantMixFromSongAsync(SimilarItemsQuery query); + + /// + /// Gets the instant mix from album async. + /// + /// The query. + /// Task{ItemsResult}. + Task GetInstantMixFromAlbumAsync(SimilarItemsQuery query); + + /// + /// Gets the instant mix from artist async. + /// + /// The query. + /// Task{ItemsResult}. + Task GetInstantMixFromArtistAsync(SimilarItemsByNameQuery query); + + /// + /// Gets the instant mix from music genre async. + /// + /// The query. + /// Task{ItemsResult}. + Task GetInstantMixFromMusicGenreAsync(SimilarItemsByNameQuery query); + /// /// Gets the similar movies async. /// diff --git a/MediaBrowser.Model/IO/IIsoManager.cs b/MediaBrowser.Model/IO/IIsoManager.cs new file mode 100644 index 0000000000..92c4d5aee8 --- /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 + { + /// + /// Mounts the specified iso path. + /// + /// The iso path. + /// The cancellation token. + /// IsoMount. + /// isoPath + /// Unable to create mount. + Task Mount(string isoPath, CancellationToken cancellationToken); + + /// + /// Determines whether this instance can mount the specified path. + /// + /// The path. + /// true if this instance can mount the specified path; otherwise, false. + bool CanMount(string path); + + /// + /// Adds the parts. + /// + /// The mounters. + void AddParts(IEnumerable mounters); + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/IO/IIsoMount.cs b/MediaBrowser.Model/IO/IIsoMount.cs new file mode 100644 index 0000000000..4f8f8b5d25 --- /dev/null +++ b/MediaBrowser.Model/IO/IIsoMount.cs @@ -0,0 +1,22 @@ +using System; + +namespace MediaBrowser.Model.IO +{ + /// + /// Interface IIsoMount + /// + public interface IIsoMount : IDisposable + { + /// + /// Gets or sets the iso path. + /// + /// The iso path. + string IsoPath { get; } + + /// + /// Gets the mounted path. + /// + /// The mounted path. + string MountedPath { get; } + } +} \ No newline at end of file diff --git a/MediaBrowser.Model/IO/IIsoMounter.cs b/MediaBrowser.Model/IO/IIsoMounter.cs new file mode 100644 index 0000000000..91a0453681 --- /dev/null +++ b/MediaBrowser.Model/IO/IIsoMounter.cs @@ -0,0 +1,27 @@ +using System; +using System.IO; +using System.Threading; +using System.Threading.Tasks; + +namespace MediaBrowser.Model.IO +{ + public interface IIsoMounter : IDisposable + { + /// + /// Mounts the specified iso path. + /// + /// The iso path. + /// The cancellation token. + /// IsoMount. + /// isoPath + /// Unable to create mount. + Task Mount(string isoPath, CancellationToken cancellationToken); + + /// + /// Determines whether this instance can mount the specified path. + /// + /// The path. + /// true if this instance can mount the specified path; otherwise, false. + bool CanMount(string path); + } +} diff --git a/MediaBrowser.Model/MediaBrowser.Model.csproj b/MediaBrowser.Model/MediaBrowser.Model.csproj index 9a1caceeaf..1c4f798f49 100644 --- a/MediaBrowser.Model/MediaBrowser.Model.csproj +++ b/MediaBrowser.Model/MediaBrowser.Model.csproj @@ -56,6 +56,9 @@ + + + diff --git a/MediaBrowser.Model/Querying/SimilarItemsQuery.cs b/MediaBrowser.Model/Querying/SimilarItemsQuery.cs index 0dd4915508..d792aa76dc 100644 --- a/MediaBrowser.Model/Querying/SimilarItemsQuery.cs +++ b/MediaBrowser.Model/Querying/SimilarItemsQuery.cs @@ -26,4 +26,31 @@ /// The fields. public ItemFields[] Fields { get; set; } } + + public class SimilarItemsByNameQuery + { + /// + /// The user to localize search results for + /// + /// The user id. + public string UserId { get; set; } + + /// + /// Gets or sets the name. + /// + /// The name. + public string Name { get; set; } + + /// + /// The maximum number of items to return + /// + /// The limit. + public int? Limit { get; set; } + + /// + /// Fields to return within the items, in addition to basic information + /// + /// The fields. + public ItemFields[] Fields { get; set; } + } } -- cgit v1.2.3