updated nuget
This commit is contained in:
parent
e3c52b6f73
commit
284bd3e9f5
|
@ -41,6 +41,9 @@ namespace MediaBrowser.Api
|
|||
{
|
||||
[ApiMember(Name = "Id", IsRequired = true, DataType = "string", ParameterType = "path", Verb = "DELETE")]
|
||||
public string Id { get; set; }
|
||||
|
||||
[ApiMember(Name = "EntryIds", IsRequired = true, DataType = "string", ParameterType = "query", Verb = "DELETE")]
|
||||
public string EntryIds { get; set; }
|
||||
}
|
||||
|
||||
[Route("/Playlists/{Id}/Items", "GET", Summary = "Gets the original items of a playlist")]
|
||||
|
@ -122,9 +125,9 @@ namespace MediaBrowser.Api
|
|||
|
||||
public void Delete(RemoveFromPlaylist request)
|
||||
{
|
||||
//var task = _playlistManager.RemoveFromPlaylist(request.Id, request.Ids.Split(',').Select(i => new Guid(i)));
|
||||
var task = _playlistManager.RemoveFromPlaylist(request.Id, request.EntryIds.Split(','));
|
||||
|
||||
//Task.WaitAll(task);
|
||||
Task.WaitAll(task);
|
||||
}
|
||||
|
||||
public object Get(GetPlaylistItems request)
|
||||
|
|
|
@ -13,6 +13,9 @@ namespace MediaBrowser.Controller.Entities
|
|||
public string ItemType { get; set; }
|
||||
public int? ItemYear { get; set; }
|
||||
|
||||
[IgnoreDataMember]
|
||||
public string Id { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Serves as a cache
|
||||
/// </summary>
|
||||
|
@ -27,6 +30,11 @@ namespace MediaBrowser.Controller.Entities
|
|||
Type = LinkedChildType.Manual
|
||||
};
|
||||
}
|
||||
|
||||
public LinkedChild()
|
||||
{
|
||||
Id = Guid.NewGuid().ToString("N");
|
||||
}
|
||||
}
|
||||
|
||||
public enum LinkedChildType
|
||||
|
|
|
@ -32,9 +32,9 @@ namespace MediaBrowser.Controller.Playlists
|
|||
/// Removes from playlist.
|
||||
/// </summary>
|
||||
/// <param name="playlistId">The playlist identifier.</param>
|
||||
/// <param name="indeces">The indeces.</param>
|
||||
/// <param name="entryIds">The entry ids.</param>
|
||||
/// <returns>Task.</returns>
|
||||
Task RemoveFromPlaylist(string playlistId, IEnumerable<int> indeces);
|
||||
Task RemoveFromPlaylist(string playlistId, IEnumerable<string> entryIds);
|
||||
|
||||
/// <summary>
|
||||
/// Gets the playlists folder.
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using MediaBrowser.Common.Net;
|
||||
using System.IO;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Controller.Channels;
|
||||
using MediaBrowser.Controller.Drawing;
|
||||
using MediaBrowser.Controller.Entities;
|
||||
|
@ -13,6 +14,7 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Xml;
|
||||
using MediaBrowser.Common.Extensions;
|
||||
|
||||
namespace MediaBrowser.Dlna.Didl
|
||||
{
|
||||
|
@ -615,9 +617,11 @@ namespace MediaBrowser.Dlna.Didl
|
|||
}
|
||||
|
||||
AddImageResElement(item, element, 4096, 4096, "jpg");
|
||||
AddImageResElement(item, element, 4096, 4096, "png");
|
||||
AddImageResElement(item, element, 1024, 768, "jpg");
|
||||
AddImageResElement(item, element, 640, 480, "jpg");
|
||||
AddImageResElement(item, element, 160, 160, "jpg");
|
||||
AddImageResElement(item, element, 160, 160, "png");
|
||||
}
|
||||
|
||||
private void AddImageResElement(BaseItem item, XmlElement element, int maxWidth, int maxHeight, string format)
|
||||
|
@ -640,7 +644,7 @@ namespace MediaBrowser.Dlna.Didl
|
|||
var width = albumartUrlInfo.Width;
|
||||
var height = albumartUrlInfo.Height;
|
||||
|
||||
var contentFeatures = new ContentFeatureBuilder(_profile).BuildImageHeader(format, width, height);
|
||||
var contentFeatures = new ContentFeatureBuilder(_profile).BuildImageHeader(format, width, height, imageInfo.IsDirectStream);
|
||||
|
||||
res.SetAttribute("protocolInfo", String.Format(
|
||||
"http-get:*:{0}:{1}",
|
||||
|
@ -648,6 +652,14 @@ namespace MediaBrowser.Dlna.Didl
|
|||
contentFeatures
|
||||
));
|
||||
|
||||
res.SetAttribute("colorDepth", "24");
|
||||
|
||||
if (imageInfo.IsDirectStream)
|
||||
{
|
||||
// TODO: Add file size
|
||||
//res.SetAttribute("size", imageInfo.Size.Value.ToString(_usCulture));
|
||||
}
|
||||
|
||||
if (width.HasValue && height.HasValue)
|
||||
{
|
||||
res.SetAttribute("resolution", string.Format("{0}x{1}", width.Value, height.Value));
|
||||
|
@ -722,7 +734,8 @@ namespace MediaBrowser.Dlna.Didl
|
|||
Type = type,
|
||||
ImageTag = tag,
|
||||
Width = width,
|
||||
Height = height
|
||||
Height = height,
|
||||
File = imageInfo.Path
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -734,6 +747,10 @@ namespace MediaBrowser.Dlna.Didl
|
|||
|
||||
internal int? Width;
|
||||
internal int? Height;
|
||||
|
||||
internal bool IsDirectStream;
|
||||
|
||||
internal string File;
|
||||
}
|
||||
|
||||
class ImageUrlInfo
|
||||
|
@ -758,6 +775,8 @@ namespace MediaBrowser.Dlna.Didl
|
|||
var width = info.Width;
|
||||
var height = info.Height;
|
||||
|
||||
info.IsDirectStream = false;
|
||||
|
||||
if (width.HasValue && height.HasValue)
|
||||
{
|
||||
var newSize = DrawingUtils.Resize(new ImageSize
|
||||
|
@ -769,6 +788,18 @@ namespace MediaBrowser.Dlna.Didl
|
|||
|
||||
width = Convert.ToInt32(newSize.Width);
|
||||
height = Convert.ToInt32(newSize.Height);
|
||||
|
||||
var inputFormat = (Path.GetExtension(info.File) ?? string.Empty)
|
||||
.TrimStart('.')
|
||||
.Replace("jpeg", "jpg", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
var normalizedFormat = format
|
||||
.Replace("jpeg", "jpg", StringComparison.OrdinalIgnoreCase);
|
||||
|
||||
if (string.Equals(inputFormat, normalizedFormat, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
info.IsDirectStream = maxWidth >= width.Value && maxHeight >= height.Value;
|
||||
}
|
||||
}
|
||||
|
||||
return new ImageUrlInfo
|
||||
|
|
|
@ -14,12 +14,13 @@ namespace MediaBrowser.Model.Dlna
|
|||
|
||||
public string BuildImageHeader(string container,
|
||||
int? width,
|
||||
int? height)
|
||||
int? height,
|
||||
bool isDirectStream)
|
||||
{
|
||||
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetImageOrgOpValue();
|
||||
|
||||
// 0 = native, 1 = transcoded
|
||||
const string orgCi = ";DLNA.ORG_CI=0";
|
||||
var orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
|
||||
|
||||
DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |
|
||||
DlnaFlags.BackgroundTransferMode |
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
orgOp += "0";
|
||||
|
||||
// Byte-based seeking only possible when not transcoding
|
||||
orgOp += "1";
|
||||
orgOp += "0";
|
||||
|
||||
return orgOp;
|
||||
}
|
||||
|
|
|
@ -385,7 +385,7 @@ namespace MediaBrowser.Model.Dlna
|
|||
return ResolveImageJPGFormat(width, height);
|
||||
|
||||
if (StringHelper.EqualsIgnoreCase(container, "png"))
|
||||
return MediaFormatProfile.PNG_LRG;
|
||||
return ResolveImagePNGFormat(width, height);
|
||||
|
||||
if (StringHelper.EqualsIgnoreCase(container, "gif"))
|
||||
return MediaFormatProfile.GIF_LRG;
|
||||
|
@ -401,7 +401,7 @@ namespace MediaBrowser.Model.Dlna
|
|||
if (width.HasValue && height.HasValue)
|
||||
{
|
||||
if ((width.Value <= 160) && (height.Value <= 160))
|
||||
return MediaFormatProfile.JPEG_SM;
|
||||
return MediaFormatProfile.JPEG_TN;
|
||||
|
||||
if ((width.Value <= 640) && (height.Value <= 480))
|
||||
return MediaFormatProfile.JPEG_SM;
|
||||
|
@ -416,5 +416,16 @@ namespace MediaBrowser.Model.Dlna
|
|||
|
||||
return MediaFormatProfile.JPEG_SM;
|
||||
}
|
||||
|
||||
private MediaFormatProfile ResolveImagePNGFormat(int? width, int? height)
|
||||
{
|
||||
if (width.HasValue && height.HasValue)
|
||||
{
|
||||
if ((width.Value <= 160) && (height.Value <= 160))
|
||||
return MediaFormatProfile.PNG_TN;
|
||||
}
|
||||
|
||||
return MediaFormatProfile.PNG_LRG;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -133,14 +133,21 @@ namespace MediaBrowser.Model.Dlna
|
|||
|
||||
public List<SubtitleStreamInfo> GetExternalSubtitles(string baseUrl)
|
||||
{
|
||||
if (string.IsNullOrEmpty(baseUrl))
|
||||
{
|
||||
throw new ArgumentNullException(baseUrl);
|
||||
}
|
||||
|
||||
List<SubtitleStreamInfo> list = new List<SubtitleStreamInfo>();
|
||||
|
||||
if (SubtitleDeliveryMethod != SubtitleDeliveryMethod.External)
|
||||
{
|
||||
return null;
|
||||
return list;
|
||||
}
|
||||
|
||||
if (!SubtitleStreamIndex.HasValue)
|
||||
{
|
||||
return null;
|
||||
return list;
|
||||
}
|
||||
|
||||
// HLS will preserve timestamps so we can just grab the full subtitle stream
|
||||
|
@ -156,8 +163,6 @@ namespace MediaBrowser.Model.Dlna
|
|||
StringHelper.ToStringCultureInvariant(startPositionTicks),
|
||||
SubtitleFormat);
|
||||
|
||||
List<SubtitleStreamInfo> list = new List<SubtitleStreamInfo>();
|
||||
|
||||
foreach (MediaStream stream in MediaSource.MediaStreams)
|
||||
{
|
||||
if (stream.Type == MediaStreamType.Subtitle && stream.Index == SubtitleStreamIndex.Value)
|
||||
|
|
|
@ -334,5 +334,6 @@
|
|||
"OptionNewPlaylist": "New playlist...",
|
||||
"MessageAddedToPlaylistSuccess": "Ok",
|
||||
"ButtonViewSeriesRecording": "View series recording",
|
||||
"ValueOriginalAirDate": "Original air date: {0}"
|
||||
"ValueOriginalAirDate": "Original air date: {0}",
|
||||
"ButtonRemoveFromPlaylist": "Remove from playlist"
|
||||
}
|
||||
|
|
|
@ -190,9 +190,29 @@ namespace MediaBrowser.Server.Implementations.Playlists
|
|||
}, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public Task RemoveFromPlaylist(string playlistId, IEnumerable<int> indeces)
|
||||
public async Task RemoveFromPlaylist(string playlistId, IEnumerable<string> entryIds)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
var playlist = _libraryManager.GetItemById(playlistId) as Playlist;
|
||||
|
||||
if (playlist == null)
|
||||
{
|
||||
throw new ArgumentException("No Playlist exists with the supplied Id");
|
||||
}
|
||||
|
||||
var children = playlist.LinkedChildren.ToList();
|
||||
|
||||
var idList = entryIds.ToList();
|
||||
|
||||
var removals = children.Where(i => idList.Contains(i.Id));
|
||||
|
||||
playlist.LinkedChildren = children.Except(removals)
|
||||
.ToList();
|
||||
|
||||
await playlist.UpdateToRepository(ItemUpdateType.MetadataEdit, CancellationToken.None).ConfigureAwait(false);
|
||||
await playlist.RefreshMetadata(new MetadataRefreshOptions
|
||||
{
|
||||
ForceSave = true
|
||||
}, CancellationToken.None).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
public Folder GetPlaylistsFolder(string userId)
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common.Internal</id>
|
||||
<version>3.0.422</version>
|
||||
<version>3.0.423</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.422" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.423" />
|
||||
<dependency id="NLog" version="3.1.0.0" />
|
||||
<dependency id="SimpleInjector" version="2.5.2" />
|
||||
<dependency id="sharpcompress" version="0.10.2" />
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Common</id>
|
||||
<version>3.0.422</version>
|
||||
<version>3.0.423</version>
|
||||
<title>MediaBrowser.Common</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Model.Signed</id>
|
||||
<version>3.0.422</version>
|
||||
<version>3.0.423</version>
|
||||
<title>MediaBrowser.Model - Signed Edition</title>
|
||||
<authors>Media Browser Team</authors>
|
||||
<owners>ebr,Luke,scottisafool</owners>
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||
<metadata>
|
||||
<id>MediaBrowser.Server.Core</id>
|
||||
<version>3.0.422</version>
|
||||
<version>3.0.423</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.422" />
|
||||
<dependency id="MediaBrowser.Common" version="3.0.423" />
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
|
|
Loading…
Reference in New Issue
Block a user