update didl xml

This commit is contained in:
Luke Pulverenti 2016-11-06 12:30:44 -05:00
parent 6aa106f1b7
commit 1539836ca1
11 changed files with 68 additions and 51 deletions

View File

@ -232,10 +232,7 @@ namespace Emby.Dlna.ContentDirectory
writer.WriteAttributeString("xmlns", "upnp", null, NS_UPNP);
//didl.SetAttribute("xmlns:sec", NS_SEC);
foreach (var att in _profile.XmlRootAttributes)
{
writer.WriteAttributeString(att.Name, att.Value);
}
DidlBuilder.WriteXmlRootAttributes(_profile, writer);
var serverItem = GetItemFromObjectId(id, user);
var item = serverItem.Item;
@ -282,7 +279,7 @@ namespace Emby.Dlna.ContentDirectory
}
}
}
writer.WriteEndElement();
writer.WriteFullEndElement();
//writer.WriteEndDocument();
}
@ -345,10 +342,7 @@ namespace Emby.Dlna.ContentDirectory
writer.WriteAttributeString("xmlns", "upnp", null, NS_UPNP);
//didl.SetAttribute("xmlns:sec", NS_SEC);
foreach (var att in _profile.XmlRootAttributes)
{
writer.WriteAttributeString(att.Name, att.Value);
}
DidlBuilder.WriteXmlRootAttributes(_profile, writer);
var serverItem = GetItemFromObjectId(sparams["ContainerID"], user);
@ -375,7 +369,7 @@ namespace Emby.Dlna.ContentDirectory
}
}
writer.WriteEndElement();
writer.WriteFullEndElement();
//writer.WriteEndDocument();
}

View File

@ -84,28 +84,39 @@ namespace Emby.Dlna.Didl
writer.WriteAttributeString("xmlns", "upnp", null, NS_UPNP);
//didl.SetAttribute("xmlns:sec", NS_SEC);
foreach (var att in _profile.XmlRootAttributes)
{
writer.WriteAttributeString(att.Name, att.Value);
}
WriteXmlRootAttributes(_profile, writer);
WriteItemElement(options, writer, item, context, null, deviceId, filter, streamInfo);
writer.WriteEndElement();
writer.WriteFullEndElement();
//writer.WriteEndDocument();
}
return builder.ToString();
}
public static void WriteXmlRootAttributes(DeviceProfile profile, XmlWriter writer)
{
foreach (var att in profile.XmlRootAttributes)
{
var parts = att.Name.Split(new[] { ':' }, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 2)
{
writer.WriteAttributeString(parts[0], parts[1], null, att.Value);
}
else
{
writer.WriteAttributeString(att.Name, att.Value);
}
}
}
public void WriteItemElement(DlnaOptions options, XmlWriter writer, BaseItem item, BaseItem context, StubType? contextStubType, string deviceId, Filter filter, StreamInfo streamInfo = null)
{
var clientId = GetClientId(item, null);
writer.WriteStartElement(string.Empty, "item", NS_DIDL);
AddGeneralProperties(item, null, context, writer, filter);
writer.WriteAttributeString("restricted", "1");
writer.WriteAttributeString("id", clientId);
@ -122,6 +133,8 @@ namespace Emby.Dlna.Didl
}
}
AddGeneralProperties(item, null, context, writer, filter);
//AddBookmarkInfo(item, user, element);
// refID?
@ -142,7 +155,7 @@ namespace Emby.Dlna.Didl
}
AddCover(item, context, null, writer);
writer.WriteEndElement();
writer.WriteFullEndElement();
}
private ILogger GetStreamBuilderLogger(DlnaOptions options)
@ -236,7 +249,7 @@ namespace Emby.Dlna.Didl
writer.WriteAttributeString("sec", "type", null, info.Format.ToLower());
writer.WriteString(info.Url);
writer.WriteEndElement();
writer.WriteFullEndElement();
}
else if (string.Equals(subtitleMode, "smi", StringComparison.OrdinalIgnoreCase))
{
@ -245,7 +258,7 @@ namespace Emby.Dlna.Didl
writer.WriteAttributeString("protocolInfo", "http-get:*:smi/caption:*");
writer.WriteString(info.Url);
writer.WriteEndElement();
writer.WriteFullEndElement();
}
else
{
@ -254,7 +267,7 @@ namespace Emby.Dlna.Didl
writer.WriteAttributeString("protocolInfo", protocolInfo);
writer.WriteString(info.Url);
writer.WriteEndElement();
writer.WriteFullEndElement();
}
return true;
@ -349,7 +362,7 @@ namespace Emby.Dlna.Didl
writer.WriteString(url);
writer.WriteEndElement();
writer.WriteFullEndElement();
}
private string GetDisplayName(BaseItem item, StubType? itemStubType, BaseItem context)
@ -479,7 +492,7 @@ namespace Emby.Dlna.Didl
writer.WriteString(url);
writer.WriteEndElement();
writer.WriteFullEndElement();
}
public static bool IsIdRoot(string id)
@ -501,8 +514,6 @@ namespace Emby.Dlna.Didl
{
writer.WriteStartElement(string.Empty, "container", NS_DIDL);
AddGeneralProperties(folder, stubType, context, writer, filter);
writer.WriteAttributeString("restricted", "0");
writer.WriteAttributeString("searchable", "1");
writer.WriteAttributeString("childCount", childCount.ToString(_usCulture));
@ -536,9 +547,11 @@ namespace Emby.Dlna.Didl
}
}
AddGeneralProperties(folder, stubType, context, writer, filter);
AddCover(folder, context, stubType, writer);
writer.WriteEndElement();
writer.WriteFullEndElement();
}
//private void AddBookmarkInfo(BaseItem item, User user, XmlElement element)
@ -698,7 +711,7 @@ namespace Emby.Dlna.Didl
writer.WriteString("object.item");
}
writer.WriteEndElement();
writer.WriteFullEndElement();
}
private void AddPeople(BaseItem item, XmlWriter writer)
@ -811,7 +824,7 @@ namespace Emby.Dlna.Didl
writer.WriteString(name);
writer.WriteEndElement();
writer.WriteFullEndElement();
}
catch (XmlException)
{
@ -897,7 +910,7 @@ namespace Emby.Dlna.Didl
writer.WriteStartElement("upnp", "albumArtURI", NS_UPNP);
writer.WriteAttributeString("dlna", "profileID", NS_DLNA, _profile.AlbumArtPn);
writer.WriteString(albumartUrlInfo.Url);
writer.WriteEndElement();
writer.WriteFullEndElement();
// TOOD: Remove these default values
var iconUrlInfo = GetImageUrl(imageInfo, _profile.MaxIconWidth ?? 48, _profile.MaxIconHeight ?? 48, playbackPercentage, unplayedCount, "jpg");
@ -932,7 +945,7 @@ namespace Emby.Dlna.Didl
writer.WriteStartElement("upnp", "albumArtURI", NS_UPNP);
writer.WriteAttributeString("dlna", "profileID", NS_DLNA, _profile.AlbumArtPn);
writer.WriteString(_serverAddress + "/Dlna/icons/people480.jpg");
writer.WriteEndElement();
writer.WriteFullEndElement();
writer.WriteElementString("upnp", "icon", NS_UPNP, _serverAddress + "/Dlna/icons/people48.jpg");
}
@ -976,7 +989,7 @@ namespace Emby.Dlna.Didl
writer.WriteString(albumartUrlInfo.Url);
writer.WriteEndElement();
writer.WriteFullEndElement();
}
private ImageDownloadInfo GetImageInfo(BaseItem item)

View File

@ -99,12 +99,12 @@ namespace Emby.Dlna.Service
{
writer.WriteStartElement(i.Key);
writer.WriteString(i.Value);
writer.WriteEndElement();
writer.WriteFullEndElement();
}
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteFullEndElement();
writer.WriteFullEndElement();
writer.WriteEndElement();
writer.WriteFullEndElement();
writer.WriteEndDocument();
}

View File

@ -36,12 +36,12 @@ namespace Emby.Dlna.Service
writer.WriteStartElement("detail");
writer.WriteRaw("<UPnPError xmlns=\"urn:schemas-upnp-org:control-1-0\"><errorCode>401</errorCode><errorDescription>Invalid Action</errorDescription></UPnPError>");
writer.WriteEndElement();
writer.WriteFullEndElement();
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteFullEndElement();
writer.WriteFullEndElement();
writer.WriteEndElement();
writer.WriteFullEndElement();
writer.WriteEndDocument();
}

View File

@ -33,7 +33,7 @@ namespace Emby.Server.Implementations.LiveTv
Protocol = mediaSource.Protocol,
MediaType = isAudio ? DlnaProfileType.Audio : DlnaProfileType.Video,
ExtractChapters = false,
AnalyzeDurationSections = 3
AnalyzeDurationSections = 2
}, cancellationToken).ConfigureAwait(false);

View File

@ -40,10 +40,6 @@ namespace MediaBrowser.Controller.Sync
/// <returns>Task&lt;Stream&gt;.</returns>
Task<Stream> GetFile(string id, SyncTarget target, IProgress<double> progress, CancellationToken cancellationToken);
/// <summary>
/// Gets the files.
/// </summary>
Task<QueryResult<FileSystemMetadata>> GetFiles(string id, SyncTarget target, CancellationToken cancellationToken);
Task<QueryResult<FileSystemMetadata>> GetFiles(string[] pathParts, SyncTarget target, CancellationToken cancellationToken);
Task<QueryResult<FileSystemMetadata>> GetFiles(SyncTarget target, CancellationToken cancellationToken);
}

View File

@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using MediaBrowser.Model.Diagnostics;
using MediaBrowser.Model.Logging;
@ -40,9 +41,11 @@ namespace MediaBrowser.MediaEncoding.Encoder
{
}
output = output ?? string.Empty;
if (logOutput)
{
_logger.Info("ffmpeg info: {0}", output ?? string.Empty);
_logger.Info("ffmpeg info: {0}", output);
}
if (string.IsNullOrWhiteSpace(output))
@ -55,6 +58,17 @@ namespace MediaBrowser.MediaEncoding.Encoder
return false;
}
output = " " + output + " ";
for (var i = 2013; i <= 2015; i++)
{
var yearString = i.ToString(CultureInfo.InvariantCulture);
if (output.IndexOf(" " + yearString + " ", StringComparison.OrdinalIgnoreCase) != -1)
{
return false;
}
}
return true;
}

View File

@ -76,8 +76,8 @@
<SpecificVersion>False</SpecificVersion>
<HintPath>..\ThirdParty\SharpCompress\SharpCompress.dll</HintPath>
</Reference>
<Reference Include="SocketHttpListener, Version=1.0.6109.26162, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SocketHttpListener.1.0.0.40\lib\net45\SocketHttpListener.dll</HintPath>
<Reference Include="SocketHttpListener, Version=1.0.6153.41639, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\SocketHttpListener.1.0.0.43\lib\net45\SocketHttpListener.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System" />

View File

@ -5,6 +5,6 @@
<package id="MediaBrowser.Naming" version="1.0.0.59" targetFramework="net46" />
<package id="Microsoft.IO.RecyclableMemoryStream" version="1.1.0.0" targetFramework="net46" />
<package id="Patterns.Logging" version="1.0.0.6" targetFramework="net46" />
<package id="SocketHttpListener" version="1.0.0.40" targetFramework="net45" />
<package id="SocketHttpListener" version="1.0.0.43" targetFramework="net46" />
<package id="UniversalDetector" version="1.0.1" targetFramework="net46" />
</packages>

View File

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

View File

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