aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Controller
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2015-02-07 16:03:09 -0500
committerLuke Pulverenti <luke.pulverenti@gmail.com>2015-02-07 16:03:09 -0500
commit9110d23710980eecc112753af46f7fcda7558364 (patch)
tree91582bcfd727600f8b9f3c2a6815899891c098ac /MediaBrowser.Controller
parent49c0878a4b295e7882613b989953f2c753fc8bca (diff)
added SupportsExternalStream to MediaStream
Diffstat (limited to 'MediaBrowser.Controller')
-rw-r--r--MediaBrowser.Controller/Entities/Audio/Audio.cs2
-rw-r--r--MediaBrowser.Controller/Entities/BaseItem.cs1
-rw-r--r--MediaBrowser.Controller/Entities/Video.cs7
-rw-r--r--MediaBrowser.Controller/Library/IMediaSourceManager.cs11
-rw-r--r--MediaBrowser.Controller/MediaBrowser.Controller.csproj1
-rw-r--r--MediaBrowser.Controller/MediaEncoding/MediaStreamSelector.cs12
6 files changed, 27 insertions, 7 deletions
diff --git a/MediaBrowser.Controller/Entities/Audio/Audio.cs b/MediaBrowser.Controller/Entities/Audio/Audio.cs
index a7b91b868..902447999 100644
--- a/MediaBrowser.Controller/Entities/Audio/Audio.cs
+++ b/MediaBrowser.Controller/Entities/Audio/Audio.cs
@@ -239,7 +239,7 @@ namespace MediaBrowser.Controller.Entities.Audio
{
Id = i.Id.ToString("N"),
Protocol = locationType == LocationType.Remote ? MediaProtocol.Http : MediaProtocol.File,
- MediaStreams = ItemRepository.GetMediaStreams(new MediaStreamQuery { ItemId = i.Id }).ToList(),
+ MediaStreams = MediaSourceManager.GetMediaStreams(new MediaStreamQuery { ItemId = i.Id }).ToList(),
Name = i.Name,
Path = enablePathSubstituion ? GetMappedPath(i.Path, locationType) : i.Path,
RunTimeTicks = i.RunTimeTicks,
diff --git a/MediaBrowser.Controller/Entities/BaseItem.cs b/MediaBrowser.Controller/Entities/BaseItem.cs
index 1443d99d3..1379ba829 100644
--- a/MediaBrowser.Controller/Entities/BaseItem.cs
+++ b/MediaBrowser.Controller/Entities/BaseItem.cs
@@ -300,6 +300,7 @@ namespace MediaBrowser.Controller.Entities
public static IChannelManager ChannelManager { get; set; }
public static ICollectionManager CollectionManager { get; set; }
public static IImageProcessor ImageProcessor { get; set; }
+ public static IMediaSourceManager MediaSourceManager { get; set; }
/// <summary>
/// Returns a <see cref="System.String" /> that represents this instance.
diff --git a/MediaBrowser.Controller/Entities/Video.cs b/MediaBrowser.Controller/Entities/Video.cs
index 12c377c90..d4507bc33 100644
--- a/MediaBrowser.Controller/Entities/Video.cs
+++ b/MediaBrowser.Controller/Entities/Video.cs
@@ -422,7 +422,7 @@ namespace MediaBrowser.Controller.Entities
public virtual IEnumerable<MediaStream> GetMediaStreams()
{
- return ItemRepository.GetMediaStreams(new MediaStreamQuery
+ return MediaSourceManager.GetMediaStreams(new MediaStreamQuery
{
ItemId = Id
});
@@ -435,7 +435,7 @@ namespace MediaBrowser.Controller.Entities
return null;
}
- return ItemRepository.GetMediaStreams(new MediaStreamQuery
+ return MediaSourceManager.GetMediaStreams(new MediaStreamQuery
{
ItemId = Id,
Index = DefaultVideoStreamIndex.Value
@@ -474,7 +474,8 @@ namespace MediaBrowser.Controller.Entities
private static MediaSourceInfo GetVersionInfo(bool enablePathSubstitution, Video i, MediaSourceType type)
{
- var mediaStreams = ItemRepository.GetMediaStreams(new MediaStreamQuery { ItemId = i.Id }).ToList();
+ var mediaStreams = MediaSourceManager.GetMediaStreams(new MediaStreamQuery { ItemId = i.Id })
+ .ToList();
var locationType = i.LocationType;
diff --git a/MediaBrowser.Controller/Library/IMediaSourceManager.cs b/MediaBrowser.Controller/Library/IMediaSourceManager.cs
new file mode 100644
index 000000000..4378bc85d
--- /dev/null
+++ b/MediaBrowser.Controller/Library/IMediaSourceManager.cs
@@ -0,0 +1,11 @@
+using MediaBrowser.Controller.Persistence;
+using MediaBrowser.Model.Entities;
+using System.Collections.Generic;
+
+namespace MediaBrowser.Controller.Library
+{
+ public interface IMediaSourceManager
+ {
+ IEnumerable<MediaStream> GetMediaStreams(MediaStreamQuery query);
+ }
+}
diff --git a/MediaBrowser.Controller/MediaBrowser.Controller.csproj b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
index 27beabcc1..e9531e057 100644
--- a/MediaBrowser.Controller/MediaBrowser.Controller.csproj
+++ b/MediaBrowser.Controller/MediaBrowser.Controller.csproj
@@ -170,6 +170,7 @@
<Compile Include="FileOrganization\IFileOrganizationService.cs" />
<Compile Include="Library\DeleteOptions.cs" />
<Compile Include="Library\ILibraryPostScanTask.cs" />
+ <Compile Include="Library\IMediaSourceManager.cs" />
<Compile Include="Library\IMetadataFileSaver.cs" />
<Compile Include="Library\IMetadataSaver.cs" />
<Compile Include="Library\IMusicManager.cs" />
diff --git a/MediaBrowser.Controller/MediaEncoding/MediaStreamSelector.cs b/MediaBrowser.Controller/MediaEncoding/MediaStreamSelector.cs
index b18651a68..57fddb2b1 100644
--- a/MediaBrowser.Controller/MediaEncoding/MediaStreamSelector.cs
+++ b/MediaBrowser.Controller/MediaEncoding/MediaStreamSelector.cs
@@ -90,10 +90,16 @@ namespace MediaBrowser.Controller.MediaEncoding
return index == -1 ? 100 : index;
})
- .ThenBy(i => i.IsDefault)
- .ThenBy(i => i.IsTextSubtitleStream)
- .ThenBy(i => i.IsExternal)
+ .ThenBy(i => GetBooleanOrderBy(i.IsDefault))
+ .ThenBy(i => GetBooleanOrderBy(i.SupportsExternalStream))
+ .ThenBy(i => GetBooleanOrderBy(i.IsTextSubtitleStream))
+ .ThenBy(i => GetBooleanOrderBy(i.IsExternal))
.ThenBy(i => i.Index);
}
+
+ private static int GetBooleanOrderBy(bool value)
+ {
+ return value ? 0 : 1;
+ }
}
}