aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MediaBrowser.Api/Images/ImageService.cs28
-rw-r--r--MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs2
-rw-r--r--MediaBrowser.Dlna/Didl/DidlBuilder.cs50
-rw-r--r--MediaBrowser.Dlna/MediaBrowser.Dlna.csproj5
-rw-r--r--MediaBrowser.Dlna/PlayTo/PlayToController.cs2
-rw-r--r--MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs2
-rw-r--r--MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs23
-rw-r--r--MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs44
-rw-r--r--MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs44
-rw-r--r--MediaBrowser.Dlna/Profiles/WindowsMediaCenterProfile.cs274
-rw-r--r--MediaBrowser.Dlna/Profiles/XboxOneProfile.cs98
-rw-r--r--MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml4
-rw-r--r--MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml9
-rw-r--r--MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml14
-rw-r--r--MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml14
-rw-r--r--MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml26
-rw-r--r--MediaBrowser.Model/Dlna/StreamInfo.cs18
-rw-r--r--MediaBrowser.Providers/TV/TvdbSeriesProvider.cs24
-rw-r--r--MediaBrowser.Server.Implementations/Library/LibraryManager.cs6
-rw-r--r--MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs22
-rw-r--r--SharedVersion.cs4
21 files changed, 338 insertions, 375 deletions
diff --git a/MediaBrowser.Api/Images/ImageService.cs b/MediaBrowser.Api/Images/ImageService.cs
index ec9b2571e..7da11a405 100644
--- a/MediaBrowser.Api/Images/ImageService.cs
+++ b/MediaBrowser.Api/Images/ImageService.cs
@@ -40,8 +40,8 @@ namespace MediaBrowser.Api.Images
[Route("/Items/{Id}/Images/{Type}/{Index}", "GET")]
[Route("/Items/{Id}/Images/{Type}", "HEAD")]
[Route("/Items/{Id}/Images/{Type}/{Index}", "HEAD")]
- [Route("/Items/{Id}/Images/{Type}/{Index}/{Tag}/{Format}/{MaxWidth}/{MaxHeight}/{PercentPlayed}", "GET")]
- [Route("/Items/{Id}/Images/{Type}/{Index}/{Tag}/{Format}/{MaxWidth}/{MaxHeight}/{PercentPlayed}", "HEAD")]
+ [Route("/Items/{Id}/Images/{Type}/{Index}/{Tag}/{Format}/{MaxWidth}/{MaxHeight}/{PercentPlayed}/{UnplayedCount}", "GET")]
+ [Route("/Items/{Id}/Images/{Type}/{Index}/{Tag}/{Format}/{MaxWidth}/{MaxHeight}/{PercentPlayed}/{UnplayedCount}", "HEAD")]
public class GetItemImage : ImageRequest
{
/// <summary>
@@ -511,6 +511,30 @@ namespace MediaBrowser.Api.Images
/// <exception cref="ResourceNotFoundException"></exception>
public object GetImage(ImageRequest request, IHasImages item, bool isHeadRequest)
{
+ if (request.PercentPlayed.HasValue)
+ {
+ if (request.PercentPlayed.Value <= 0)
+ {
+ request.PercentPlayed = null;
+ }
+ else if (request.PercentPlayed.Value >= 100)
+ {
+ request.PercentPlayed = null;
+ request.AddPlayedIndicator = true;
+ }
+ }
+ if (request.PercentPlayed.HasValue)
+ {
+ request.UnplayedCount = null;
+ }
+ if (request.UnplayedCount.HasValue)
+ {
+ if (request.UnplayedCount.Value <= 0)
+ {
+ request.UnplayedCount = null;
+ }
+ }
+
var imageInfo = GetImageInfo(request, item);
if (imageInfo == null)
diff --git a/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs b/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs
index abd649ad7..3d7ae8cc4 100644
--- a/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs
+++ b/MediaBrowser.Dlna/ContentDirectory/ControlHandler.cs
@@ -58,7 +58,7 @@ namespace MediaBrowser.Dlna.ContentDirectory
_profile = profile;
_config = config;
- _didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization, mediaSourceManager);
+ _didlBuilder = new DidlBuilder(profile, user, imageProcessor, serverAddress, accessToken, userDataManager, localization, mediaSourceManager, Logger);
}
protected override IEnumerable<KeyValuePair<string, string>> GetResult(string methodName, Headers methodParams)
diff --git a/MediaBrowser.Dlna/Didl/DidlBuilder.cs b/MediaBrowser.Dlna/Didl/DidlBuilder.cs
index 629b95f67..52791822b 100644
--- a/MediaBrowser.Dlna/Didl/DidlBuilder.cs
+++ b/MediaBrowser.Dlna/Didl/DidlBuilder.cs
@@ -39,8 +39,9 @@ namespace MediaBrowser.Dlna.Didl
private readonly IUserDataManager _userDataManager;
private readonly ILocalizationManager _localization;
private readonly IMediaSourceManager _mediaSourceManager;
+ private readonly ILogger _logger;
- public DidlBuilder(DeviceProfile profile, User user, IImageProcessor imageProcessor, string serverAddress, string accessToken, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager)
+ public DidlBuilder(DeviceProfile profile, User user, IImageProcessor imageProcessor, string serverAddress, string accessToken, IUserDataManager userDataManager, ILocalizationManager localization, IMediaSourceManager mediaSourceManager, ILogger logger)
{
_profile = profile;
_imageProcessor = imageProcessor;
@@ -48,6 +49,7 @@ namespace MediaBrowser.Dlna.Didl
_userDataManager = userDataManager;
_localization = localization;
_mediaSourceManager = mediaSourceManager;
+ _logger = logger;
_accessToken = accessToken;
_user = user;
}
@@ -127,7 +129,7 @@ namespace MediaBrowser.Dlna.Didl
{
var sources = _mediaSourceManager.GetStaticMediaSources(video, true, _user).ToList();
- streamInfo = new StreamBuilder(new NullLogger()).BuildVideoItem(new VideoOptions
+ streamInfo = new StreamBuilder(_logger).BuildVideoItem(new VideoOptions
{
ItemId = GetClientId(video),
MediaSources = sources,
@@ -780,19 +782,33 @@ namespace MediaBrowser.Dlna.Didl
var result = element.OwnerDocument;
var playbackPercentage = 0;
+ var unplayedCount = 0;
if (item is Video)
{
var userData = _userDataManager.GetUserDataDto(item, _user);
playbackPercentage = Convert.ToInt32(userData.PlayedPercentage ?? 0);
- if (playbackPercentage >= 100)
+ if (playbackPercentage >= 100 || userData.Played)
{
- playbackPercentage = 0;
+ playbackPercentage = 100;
+ }
+ }
+ else if (item is Series || item is Season || item is BoxSet)
+ {
+ var userData = _userDataManager.GetUserDataDto(item, _user);
+
+ if (userData.Played)
+ {
+ playbackPercentage = 100;
+ }
+ else
+ {
+ unplayedCount = userData.UnplayedItemCount ?? 0;
}
}
- var albumartUrlInfo = GetImageUrl(imageInfo, _profile.MaxAlbumArtWidth, _profile.MaxAlbumArtHeight, playbackPercentage, "jpg");
+ var albumartUrlInfo = GetImageUrl(imageInfo, _profile.MaxAlbumArtWidth, _profile.MaxAlbumArtHeight, playbackPercentage, unplayedCount, "jpg");
var icon = result.CreateElement("upnp", "albumArtURI", NS_UPNP);
var profile = result.CreateAttribute("dlna", "profileID", NS_DLNA);
@@ -802,7 +818,7 @@ namespace MediaBrowser.Dlna.Didl
element.AppendChild(icon);
// TOOD: Remove these default values
- var iconUrlInfo = GetImageUrl(imageInfo, _profile.MaxIconWidth ?? 48, _profile.MaxIconHeight ?? 48, playbackPercentage, "jpg");
+ var iconUrlInfo = GetImageUrl(imageInfo, _profile.MaxIconWidth ?? 48, _profile.MaxIconHeight ?? 48, playbackPercentage, unplayedCount, "jpg");
icon = result.CreateElement("upnp", "icon", NS_UPNP);
icon.InnerText = iconUrlInfo.Url;
element.AppendChild(icon);
@@ -819,15 +835,15 @@ namespace MediaBrowser.Dlna.Didl
}
}
- AddImageResElement(item, element, 160, 160, playbackPercentage, "jpg", "JPEG_TN");
+ AddImageResElement(item, element, 160, 160, playbackPercentage, unplayedCount, "jpg", "JPEG_TN");
if (!_profile.EnableSingleAlbumArtLimit)
{
- AddImageResElement(item, element, 4096, 4096, playbackPercentage, "jpg", "JPEG_LRG");
- AddImageResElement(item, element, 1024, 768, playbackPercentage, "jpg", "JPEG_MED");
- AddImageResElement(item, element, 640, 480, playbackPercentage, "jpg", "JPEG_SM");
- AddImageResElement(item, element, 4096, 4096, playbackPercentage, "png", "PNG_LRG");
- AddImageResElement(item, element, 160, 160, playbackPercentage, "png", "PNG_TN");
+ AddImageResElement(item, element, 4096, 4096, playbackPercentage, unplayedCount, "jpg", "JPEG_LRG");
+ AddImageResElement(item, element, 1024, 768, playbackPercentage, unplayedCount, "jpg", "JPEG_MED");
+ AddImageResElement(item, element, 640, 480, playbackPercentage, unplayedCount, "jpg", "JPEG_SM");
+ AddImageResElement(item, element, 4096, 4096, playbackPercentage, unplayedCount, "png", "PNG_LRG");
+ AddImageResElement(item, element, 160, 160, playbackPercentage, unplayedCount, "png", "PNG_TN");
}
}
@@ -852,6 +868,7 @@ namespace MediaBrowser.Dlna.Didl
int maxWidth,
int maxHeight,
int playbackPercentage,
+ int unplayedCount,
string format,
string org_Pn)
{
@@ -864,7 +881,7 @@ namespace MediaBrowser.Dlna.Didl
var result = element.OwnerDocument;
- var albumartUrlInfo = GetImageUrl(imageInfo, maxWidth, maxHeight, playbackPercentage, format);
+ var albumartUrlInfo = GetImageUrl(imageInfo, maxWidth, maxHeight, playbackPercentage, unplayedCount, format);
var res = result.CreateElement(string.Empty, "res", NS_DIDL);
@@ -1005,9 +1022,9 @@ namespace MediaBrowser.Dlna.Didl
return id;
}
- private ImageUrlInfo GetImageUrl(ImageDownloadInfo info, int maxWidth, int maxHeight, int playbackPercentage, string format)
+ private ImageUrlInfo GetImageUrl(ImageDownloadInfo info, int maxWidth, int maxHeight, int playbackPercentage, int unplayedCount, string format)
{
- var url = string.Format("{0}/Items/{1}/Images/{2}/0/{3}/{4}/{5}/{6}/{7}",
+ var url = string.Format("{0}/Items/{1}/Images/{2}/0/{3}/{4}/{5}/{6}/{7}/{8}",
_serverAddress,
info.ItemId,
info.Type,
@@ -1015,7 +1032,8 @@ namespace MediaBrowser.Dlna.Didl
format,
maxWidth.ToString(CultureInfo.InvariantCulture),
maxHeight.ToString(CultureInfo.InvariantCulture),
- playbackPercentage.ToString(CultureInfo.InvariantCulture)
+ playbackPercentage.ToString(CultureInfo.InvariantCulture),
+ unplayedCount.ToString(CultureInfo.InvariantCulture)
);
var width = info.Width;
diff --git a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj
index 2f4d44418..0cbe36398 100644
--- a/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj
+++ b/MediaBrowser.Dlna/MediaBrowser.Dlna.csproj
@@ -94,7 +94,6 @@
<Compile Include="PlayTo\uParserObject.cs" />
<Compile Include="Profiles\Foobar2000Profile.cs" />
<Compile Include="Profiles\MediaMonkeyProfile.cs" />
- <Compile Include="Profiles\WindowsMediaCenterProfile.cs" />
<Compile Include="ContentDirectory\ContentDirectory.cs" />
<Compile Include="ContentDirectory\ControlHandler.cs" />
<Compile Include="ContentDirectory\ServiceActionListBuilder.cs" />
@@ -167,7 +166,9 @@
<EmbeddedResource Include="Profiles\Xml\Sony Bravia %282013%29.xml" />
<EmbeddedResource Include="Profiles\Xml\Sony PlayStation 3.xml" />
<EmbeddedResource Include="Profiles\Xml\WDTV Live.xml" />
- <EmbeddedResource Include="Profiles\Xml\Xbox 360.xml" />
+ <EmbeddedResource Include="Profiles\Xml\Xbox 360.xml">
+ <SubType>Designer</SubType>
+ </EmbeddedResource>
<EmbeddedResource Include="Profiles\Xml\Xbox One.xml" />
</ItemGroup>
<ItemGroup>
diff --git a/MediaBrowser.Dlna/PlayTo/PlayToController.cs b/MediaBrowser.Dlna/PlayTo/PlayToController.cs
index 9df69b115..66cdc51af 100644
--- a/MediaBrowser.Dlna/PlayTo/PlayToController.cs
+++ b/MediaBrowser.Dlna/PlayTo/PlayToController.cs
@@ -478,7 +478,7 @@ namespace MediaBrowser.Dlna.PlayTo
playlistItem.StreamUrl = playlistItem.StreamInfo.ToDlnaUrl(_serverAddress, _accessToken);
- var itemXml = new DidlBuilder(profile, user, _imageProcessor, _serverAddress, _accessToken, _userDataManager, _localization, _mediaSourceManager)
+ var itemXml = new DidlBuilder(profile, user, _imageProcessor, _serverAddress, _accessToken, _userDataManager, _localization, _mediaSourceManager, _logger)
.GetItemDidl(item, null, _session.DeviceId, new Filter(), playlistItem.StreamInfo);
playlistItem.Didl = itemXml;
diff --git a/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs b/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs
index 07936688d..ab887a3bf 100644
--- a/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs
+++ b/MediaBrowser.Dlna/Profiles/DishHopperJoeyProfile.cs
@@ -95,6 +95,7 @@ namespace MediaBrowser.Dlna.Profiles
new CodecProfile
{
Type = CodecType.Video,
+ Codec = "h264",
Conditions = new []
{
new ProfileCondition
@@ -138,7 +139,6 @@ namespace MediaBrowser.Dlna.Profiles
new CodecProfile
{
Type = CodecType.Video,
- Codec = "mpeg2video",
Conditions = new []
{
new ProfileCondition
diff --git a/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs b/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs
index 6cf06d41f..883af57d2 100644
--- a/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs
+++ b/MediaBrowser.Dlna/Profiles/PopcornHourProfile.cs
@@ -93,8 +93,10 @@ namespace MediaBrowser.Dlna.Profiles
new CodecProfile
{
Type = CodecType.Video,
+ Codec="h264",
Conditions = new []
{
+ new ProfileCondition(ProfileConditionType.EqualsAny, ProfileConditionValue.VideoProfile, "baseline|constrained baseline"),
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
@@ -120,10 +122,27 @@ namespace MediaBrowser.Dlna.Profiles
new CodecProfile
{
Type = CodecType.Video,
- Codec="h264",
Conditions = new []
{
- new ProfileCondition(ProfileConditionType.EqualsAny, ProfileConditionValue.VideoProfile, "baseline|constrained baseline")
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Width,
+ Value = "1920"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Height,
+ Value = "1080"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.NotEquals,
+ Property = ProfileConditionValue.IsAnamorphic,
+ Value = "true",
+ IsRequired = false
+ }
}
},
diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs
index 6f175ccd6..46549040f 100644
--- a/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs
+++ b/MediaBrowser.Dlna/Profiles/SonyBravia2010Profile.cs
@@ -209,6 +209,7 @@ namespace MediaBrowser.Dlna.Profiles
new CodecProfile
{
Type = CodecType.Video,
+ Codec = "h264",
Conditions = new []
{
new ProfileCondition
@@ -222,16 +223,7 @@ namespace MediaBrowser.Dlna.Profiles
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.Height,
Value = "1080"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new []
- {
+ },
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
@@ -262,6 +254,18 @@ namespace MediaBrowser.Dlna.Profiles
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Width,
+ Value = "1920"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Height,
+ Value = "1080"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoFramerate,
Value = "30"
},
@@ -276,6 +280,26 @@ namespace MediaBrowser.Dlna.Profiles
new CodecProfile
{
+ Type = CodecType.Video,
+ Conditions = new []
+ {
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Width,
+ Value = "1920"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Height,
+ Value = "1080"
+ }
+ }
+ },
+
+ new CodecProfile
+ {
Type = CodecType.VideoAudio,
Codec = "ac3",
diff --git a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs
index 32cf8b554..d9891e87b 100644
--- a/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs
+++ b/MediaBrowser.Dlna/Profiles/SonyBravia2011Profile.cs
@@ -226,6 +226,7 @@ namespace MediaBrowser.Dlna.Profiles
new CodecProfile
{
Type = CodecType.Video,
+ Codec = "h264",
Conditions = new []
{
new ProfileCondition
@@ -239,16 +240,7 @@ namespace MediaBrowser.Dlna.Profiles
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.Height,
Value = "1080"
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new []
- {
+ },
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
@@ -279,6 +271,18 @@ namespace MediaBrowser.Dlna.Profiles
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Width,
+ Value = "1920"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Height,
+ Value = "1080"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.VideoFramerate,
Value = "30"
},
@@ -293,6 +297,26 @@ namespace MediaBrowser.Dlna.Profiles
new CodecProfile
{
+ Type = CodecType.Video,
+ Conditions = new []
+ {
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Width,
+ Value = "1920"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.Height,
+ Value = "1080"
+ }
+ }
+ },
+
+ new CodecProfile
+ {
Type = CodecType.VideoAudio,
Codec = "ac3",
diff --git a/MediaBrowser.Dlna/Profiles/WindowsMediaCenterProfile.cs b/MediaBrowser.Dlna/Profiles/WindowsMediaCenterProfile.cs
deleted file mode 100644
index a318b193b..000000000
--- a/MediaBrowser.Dlna/Profiles/WindowsMediaCenterProfile.cs
+++ /dev/null
@@ -1,274 +0,0 @@
-using System.Xml.Serialization;
-using MediaBrowser.Model.Dlna;
-using MediaBrowser.Model.Dlna.Profiles;
-
-namespace MediaBrowser.Dlna.Profiles
-{
- [XmlRoot("Profile")]
- public class WindowsMediaCenterProfile : DefaultProfile
- {
- public WindowsMediaCenterProfile()
- {
- Name = "Windows Media Center";
-
- TranscodingProfiles = new[]
- {
- new TranscodingProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new TranscodingProfile
- {
- Container = "asf",
- VideoCodec = "msmpeg4",
- AudioCodec = "wmav2",
- Type = DlnaProfileType.Video
- }
- };
-
- DirectPlayProfiles = new[]
- {
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "mpeg4",
- AudioCodec = "ac3,mp3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "avi",
- VideoCodec = "h264",
- AudioCodec = "aac",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "mp4,mov",
- VideoCodec = "h264,mpeg4",
- AudioCodec = "aac,ac3",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "asf",
- VideoCodec = "wmv2,wmv3,vc1",
- AudioCodec = "wmav2,wmapro",
- Type = DlnaProfileType.Video
- },
- new DirectPlayProfile
- {
- Container = "asf",
- AudioCodec = "wmav2,wmapro,wmavoice",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "mp3",
- AudioCodec = "mp3",
- Type = DlnaProfileType.Audio
- },
- new DirectPlayProfile
- {
- Container = "jpeg",
- Type = DlnaProfileType.Photo
- }
- };
-
- ResponseProfiles = new[]
- {
- new ResponseProfile
- {
- Container = "avi",
- MimeType = "video/avi",
- Type = DlnaProfileType.Video
- }
- };
-
- ContainerProfiles = new[]
- {
- new ContainerProfile
- {
- Type = DlnaProfileType.Video,
- Container = "mp4,mov",
-
- Conditions = new []
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.Has64BitOffsets,
- Value = "false",
- IsRequired = false
- }
- }
- }
- };
-
- CodecProfiles = new[]
- {
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "mpeg4",
- Conditions = new []
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1280"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "720"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "5120000",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "h264",
- Conditions = new []
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoLevel,
- Value = "41",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "10240000",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "wmv2,wmv3,vc1",
- Conditions = new []
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Width,
- Value = "1920"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.Height,
- Value = "1080"
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoFramerate,
- Value = "30",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.VideoBitrate,
- Value = "15360000",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "ac3",
- Conditions = new []
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "6",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "wmav2,wmapro",
- Conditions = new []
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2",
- IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.VideoAudio,
- Codec = "aac",
- Conditions = new []
- {
- new ProfileCondition
- {
- Condition = ProfileConditionType.LessThanEqual,
- Property = ProfileConditionValue.AudioChannels,
- Value = "2",
- IsRequired = false
- },
- new ProfileCondition
- {
- Condition = ProfileConditionType.Equals,
- Property = ProfileConditionValue.AudioProfile,
- Value = "lc",
- IsRequired = false
- }
- }
- }
- };
- }
- }
-}
diff --git a/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs b/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs
index 4399462cf..3427d75f7 100644
--- a/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs
+++ b/MediaBrowser.Dlna/Profiles/XboxOneProfile.cs
@@ -12,18 +12,27 @@ namespace MediaBrowser.Dlna.Profiles
Name = "Xbox One";
TimelineOffsetSeconds = 40;
-
+
Identification = new DeviceIdentification
{
- ModelName = "Xbox One",
- FriendlyName = "Xbox-SystemOS",
+ FriendlyName = "XboxOne",
Headers = new[]
{
- new HttpHeaderInfo {Name = "User-Agent", Value = "NSPlayer", Match = HeaderMatchType.Substring}
+ new HttpHeaderInfo
+ {
+ Name = "FriendlyName.DLNA.ORG", Value = "XboxOne", Match = HeaderMatchType.Substring
+ },
+ new HttpHeaderInfo
+ {
+ Name = "User-Agent", Value = "NSPlayer/12", Match = HeaderMatchType.Substring
+ }
}
};
+ var videoProfile = "high|main|baseline|constrained baseline";
+ var videoLevel = "41";
+
TranscodingProfiles = new[]
{
new TranscodingProfile
@@ -43,8 +52,7 @@ namespace MediaBrowser.Dlna.Profiles
Container = "ts",
VideoCodec = "h264",
AudioCodec = "aac",
- Type = DlnaProfileType.Video,
- EstimateContentLength = true
+ Type = DlnaProfileType.Video
}
};
@@ -129,6 +137,7 @@ namespace MediaBrowser.Dlna.Profiles
new CodecProfile
{
Type = CodecType.Video,
+ Codec = "mpeg4",
Conditions = new []
{
new ProfileCondition
@@ -144,16 +153,7 @@ namespace MediaBrowser.Dlna.Profiles
Property = ProfileConditionValue.VideoBitDepth,
Value = "8",
IsRequired = false
- }
- }
- },
-
- new CodecProfile
- {
- Type = CodecType.Video,
- Codec = "mpeg4",
- Conditions = new []
- {
+ },
new ProfileCondition
{
Condition = ProfileConditionType.LessThanEqual,
@@ -191,6 +191,20 @@ namespace MediaBrowser.Dlna.Profiles
{
new ProfileCondition
{
+ Condition = ProfileConditionType.NotEquals,
+ Property = ProfileConditionValue.IsAnamorphic,
+ Value = "true",
+ IsRequired = false
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.VideoBitDepth,
+ Value = "8",
+ IsRequired = false
+ },
+ new ProfileCondition
+ {
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.Width,
Value = "1920"
@@ -200,6 +214,20 @@ namespace MediaBrowser.Dlna.Profiles
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.Height,
Value = "1080"
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.VideoLevel,
+ Value = videoLevel,
+ IsRequired = false
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.EqualsAny,
+ Property = ProfileConditionValue.VideoProfile,
+ Value = videoProfile,
+ IsRequired = false
}
}
},
@@ -212,6 +240,20 @@ namespace MediaBrowser.Dlna.Profiles
{
new ProfileCondition
{
+ Condition = ProfileConditionType.NotEquals,
+ Property = ProfileConditionValue.IsAnamorphic,
+ Value = "true",
+ IsRequired = false
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.VideoBitDepth,
+ Value = "8",
+ IsRequired = false
+ },
+ new ProfileCondition
+ {
Condition = ProfileConditionType.LessThanEqual,
Property = ProfileConditionValue.Width,
Value = "1920"
@@ -241,6 +283,28 @@ namespace MediaBrowser.Dlna.Profiles
new CodecProfile
{
+ Type = CodecType.Video,
+ Conditions = new []
+ {
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.NotEquals,
+ Property = ProfileConditionValue.IsAnamorphic,
+ Value = "true",
+ IsRequired = false
+ },
+ new ProfileCondition
+ {
+ Condition = ProfileConditionType.LessThanEqual,
+ Property = ProfileConditionValue.VideoBitDepth,
+ Value = "8",
+ IsRequired = false
+ }
+ }
+ },
+
+ new CodecProfile
+ {
Type = CodecType.VideoAudio,
Codec = "ac3,wmav2,wmapro",
Conditions = new []
@@ -278,7 +342,7 @@ namespace MediaBrowser.Dlna.Profiles
}
}
};
-
+
ResponseProfiles = new[]
{
new ResponseProfile
diff --git a/MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml b/MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml
index d7ad1ac30..21f2b1ad5 100644
--- a/MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml
+++ b/MediaBrowser.Dlna/Profiles/Xml/Dish Hopper-Joey.xml
@@ -49,7 +49,7 @@
</TranscodingProfiles>
<ContainerProfiles />
<CodecProfiles>
- <CodecProfile type="Video">
+ <CodecProfile type="Video" codec="h264">
<Conditions>
<ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
@@ -58,7 +58,7 @@
<ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" />
</Conditions>
</CodecProfile>
- <CodecProfile type="Video" codec="mpeg2video">
+ <CodecProfile type="Video">
<Conditions>
<ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
diff --git a/MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml b/MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml
index 8470f601a..2df2da98b 100644
--- a/MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml
+++ b/MediaBrowser.Dlna/Profiles/Xml/Popcorn Hour.xml
@@ -44,16 +44,19 @@
</TranscodingProfiles>
<ContainerProfiles />
<CodecProfiles>
- <CodecProfile type="Video">
+ <CodecProfile type="Video" codec="h264">
<Conditions>
+ <ProfileCondition condition="EqualsAny" property="VideoProfile" value="baseline|constrained baseline" isRequired="false" />
<ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
<ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
</Conditions>
</CodecProfile>
- <CodecProfile type="Video" codec="h264">
+ <CodecProfile type="Video">
<Conditions>
- <ProfileCondition condition="EqualsAny" property="VideoProfile" value="baseline|constrained baseline" isRequired="false" />
+ <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
+ <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
+ <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
</Conditions>
</CodecProfile>
<CodecProfile type="VideoAudio" codec="aac">
diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml
index ba993ca3e..19cb5670a 100644
--- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml
+++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2010).xml
@@ -58,14 +58,10 @@
</ContainerProfile>
</ContainerProfiles>
<CodecProfiles>
- <CodecProfile type="Video">
+ <CodecProfile type="Video" codec="h264">
<Conditions>
<ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
- </Conditions>
- </CodecProfile>
- <CodecProfile type="Video" codec="h264">
- <Conditions>
<ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" />
@@ -73,10 +69,18 @@
</CodecProfile>
<CodecProfile type="Video" codec="mpeg2video">
<Conditions>
+ <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
+ <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" />
</Conditions>
</CodecProfile>
+ <CodecProfile type="Video">
+ <Conditions>
+ <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
+ <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
+ </Conditions>
+ </CodecProfile>
<CodecProfile type="VideoAudio" codec="ac3">
<Conditions>
<ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="true" />
diff --git a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml
index 271cf1132..78c99d366 100644
--- a/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml
+++ b/MediaBrowser.Dlna/Profiles/Xml/Sony Bravia (2011).xml
@@ -61,14 +61,10 @@
</ContainerProfile>
</ContainerProfiles>
<CodecProfiles>
- <CodecProfile type="Video">
+ <CodecProfile type="Video" codec="h264">
<Conditions>
<ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
- </Conditions>
- </CodecProfile>
- <CodecProfile type="Video" codec="h264">
- <Conditions>
<ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="true" />
@@ -76,10 +72,18 @@
</CodecProfile>
<CodecProfile type="Video" codec="mpeg2video">
<Conditions>
+ <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
+ <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="20000000" isRequired="true" />
</Conditions>
</CodecProfile>
+ <CodecProfile type="Video">
+ <Conditions>
+ <ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
+ <ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
+ </Conditions>
+ </CodecProfile>
<CodecProfile type="VideoAudio" codec="ac3">
<Conditions>
<ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="true" />
diff --git a/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml b/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml
index 2595ffbdf..d22356646 100644
--- a/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml
+++ b/MediaBrowser.Dlna/Profiles/Xml/Xbox One.xml
@@ -2,10 +2,10 @@
<Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Name>Xbox One</Name>
<Identification>
- <FriendlyName>Xbox-SystemOS</FriendlyName>
- <ModelName>Xbox One</ModelName>
+ <FriendlyName>XboxOne</FriendlyName>
<Headers>
- <HttpHeaderInfo name="User-Agent" value="NSPlayer" match="Substring" />
+ <HttpHeaderInfo name="FriendlyName.DLNA.ORG" value="XboxOne" match="Substring" />
+ <HttpHeaderInfo name="User-Agent" value="NSPlayer/12" match="Substring" />
</Headers>
</Identification>
<FriendlyName>Emby</FriendlyName>
@@ -48,7 +48,7 @@
<TranscodingProfiles>
<TranscodingProfile container="mp3" type="Audio" audioCodec="mp3" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" context="Streaming" />
<TranscodingProfile container="jpeg" type="Photo" videoCodec="jpeg" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" context="Streaming" />
- <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="true" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" context="Streaming" />
+ <TranscodingProfile container="ts" type="Video" videoCodec="h264" audioCodec="aac" estimateContentLength="false" enableMpegtsM2TsMode="false" transcodeSeekInfo="Auto" context="Streaming" />
</TranscodingProfiles>
<ContainerProfiles>
<ContainerProfile type="Video" container="mp4,mov">
@@ -58,14 +58,10 @@
</ContainerProfile>
</ContainerProfiles>
<CodecProfiles>
- <CodecProfile type="Video">
+ <CodecProfile type="Video" codec="mpeg4">
<Conditions>
<ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
<ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" />
- </Conditions>
- </CodecProfile>
- <CodecProfile type="Video" codec="mpeg4">
- <Conditions>
<ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="false" />
@@ -74,18 +70,30 @@
</CodecProfile>
<CodecProfile type="Video" codec="h264">
<Conditions>
+ <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
+ <ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" />
<ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
+ <ProfileCondition condition="LessThanEqual" property="VideoLevel" value="41" isRequired="false" />
+ <ProfileCondition condition="EqualsAny" property="VideoProfile" value="high|main|baseline|constrained baseline" isRequired="false" />
</Conditions>
</CodecProfile>
<CodecProfile type="Video" codec="wmv2,wmv3,vc1">
<Conditions>
+ <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
+ <ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" />
<ProfileCondition condition="LessThanEqual" property="Width" value="1920" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="Height" value="1080" isRequired="true" />
<ProfileCondition condition="LessThanEqual" property="VideoFramerate" value="30" isRequired="false" />
<ProfileCondition condition="LessThanEqual" property="VideoBitrate" value="15360000" isRequired="false" />
</Conditions>
</CodecProfile>
+ <CodecProfile type="Video">
+ <Conditions>
+ <ProfileCondition condition="NotEquals" property="IsAnamorphic" value="true" isRequired="false" />
+ <ProfileCondition condition="LessThanEqual" property="VideoBitDepth" value="8" isRequired="false" />
+ </Conditions>
+ </CodecProfile>
<CodecProfile type="VideoAudio" codec="ac3,wmav2,wmapro">
<Conditions>
<ProfileCondition condition="LessThanEqual" property="AudioChannels" value="6" isRequired="false" />
diff --git a/MediaBrowser.Model/Dlna/StreamInfo.cs b/MediaBrowser.Model/Dlna/StreamInfo.cs
index f6ff79b11..b062bc240 100644
--- a/MediaBrowser.Model/Dlna/StreamInfo.cs
+++ b/MediaBrowser.Model/Dlna/StreamInfo.cs
@@ -102,7 +102,7 @@ namespace MediaBrowser.Model.Dlna
}
List<string> list = new List<string>();
- foreach (NameValuePair pair in BuildParams(this, accessToken))
+ foreach (NameValuePair pair in BuildParams(this, accessToken, false))
{
if (string.IsNullOrEmpty(pair.Value))
{
@@ -173,7 +173,7 @@ namespace MediaBrowser.Model.Dlna
{
List<string> list = new List<string>();
- foreach (NameValuePair pair in BuildParams(item, accessToken))
+ foreach (NameValuePair pair in BuildParams(item, accessToken, true))
{
list.Add(pair.Value);
}
@@ -181,7 +181,7 @@ namespace MediaBrowser.Model.Dlna
return string.Format("Params={0}", string.Join(";", list.ToArray()));
}
- private static List<NameValuePair> BuildParams(StreamInfo item, string accessToken)
+ private static List<NameValuePair> BuildParams(StreamInfo item, string accessToken, bool isDlna)
{
List<NameValuePair> list = new List<NameValuePair>();
@@ -211,7 +211,17 @@ namespace MediaBrowser.Model.Dlna
list.Add(new NameValuePair("Level", item.VideoLevel.HasValue ? StringHelper.ToStringCultureInvariant(item.VideoLevel.Value) : string.Empty));
- list.Add(new NameValuePair("ClientTime", item.IsDirectStream ? string.Empty : DateTime.UtcNow.Ticks.ToString(CultureInfo.InvariantCulture)));
+ if (isDlna)
+ {
+ // The player may see it as separate resources due to url differences
+ // And then try to request more than one at playback
+ list.Add(new NameValuePair("ClientTime", string.Empty));
+ }
+ else
+ {
+ list.Add(new NameValuePair("ClientTime", item.IsDirectStream ? string.Empty : DateTime.UtcNow.Ticks.ToString(CultureInfo.InvariantCulture)));
+ }
+
list.Add(new NameValuePair("MaxRefFrames", item.MaxRefFrames.HasValue ? StringHelper.ToStringCultureInvariant(item.MaxRefFrames.Value) : string.Empty));
list.Add(new NameValuePair("MaxVideoBitDepth", item.MaxVideoBitDepth.HasValue ? StringHelper.ToStringCultureInvariant(item.MaxVideoBitDepth.Value) : string.Empty));
list.Add(new NameValuePair("Profile", item.VideoProfile ?? string.Empty));
diff --git a/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs b/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs
index c644da0b8..de1a4c6f9 100644
--- a/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs
+++ b/MediaBrowser.Providers/TV/TvdbSeriesProvider.cs
@@ -10,6 +10,7 @@ using MediaBrowser.Model.Configuration;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging;
+using MediaBrowser.Model.Net;
using MediaBrowser.Model.Providers;
using System;
using System.Collections.Generic;
@@ -191,6 +192,27 @@ namespace MediaBrowser.Providers.TV
/// <returns>Task.</returns>
internal async Task DownloadSeriesZip(string seriesId, string seriesDataPath, long? lastTvDbUpdateTime, string preferredMetadataLanguage, CancellationToken cancellationToken)
{
+ try
+ {
+ await DownloadSeriesZip(seriesId, seriesDataPath, lastTvDbUpdateTime, preferredMetadataLanguage, preferredMetadataLanguage, cancellationToken).ConfigureAwait(false);
+ return;
+ }
+ catch (HttpException ex)
+ {
+ if (!ex.StatusCode.HasValue || ex.StatusCode.Value != HttpStatusCode.NotFound)
+ {
+ throw;
+ }
+ }
+
+ if (!string.Equals(preferredMetadataLanguage, "en", StringComparison.OrdinalIgnoreCase))
+ {
+ await DownloadSeriesZip(seriesId, seriesDataPath, lastTvDbUpdateTime, "en", preferredMetadataLanguage, cancellationToken).ConfigureAwait(false);
+ }
+ }
+
+ private async Task DownloadSeriesZip(string seriesId, string seriesDataPath, long? lastTvDbUpdateTime, string preferredMetadataLanguage, string saveAsMetadataLanguage, CancellationToken cancellationToken)
+ {
var url = string.Format(SeriesGetZip, TVUtils.TvdbApiKey, seriesId, preferredMetadataLanguage);
using (var zipStream = await _httpClient.Get(new HttpRequestOptions
@@ -221,7 +243,7 @@ namespace MediaBrowser.Providers.TV
await SanitizeXmlFile(file).ConfigureAwait(false);
}
- await ExtractEpisodes(seriesDataPath, Path.Combine(seriesDataPath, preferredMetadataLanguage + ".xml"), lastTvDbUpdateTime).ConfigureAwait(false);
+ await ExtractEpisodes(seriesDataPath, Path.Combine(seriesDataPath, saveAsMetadataLanguage + ".xml"), lastTvDbUpdateTime).ConfigureAwait(false);
}
public TvdbOptions GetTvDbOptions()
diff --git a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
index 8285fb7e5..313985d9d 100644
--- a/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
+++ b/MediaBrowser.Server.Implementations/Library/LibraryManager.cs
@@ -1637,6 +1637,12 @@ namespace MediaBrowser.Server.Implementations.Library
refresh = true;
}
+ if (!string.Equals(viewType, item.ViewType, StringComparison.OrdinalIgnoreCase))
+ {
+ item.ViewType = viewType;
+ await item.UpdateToRepository(ItemUpdateType.MetadataEdit, cancellationToken).ConfigureAwait(false);
+ }
+
if (!refresh && item != null)
{
refresh = (DateTime.UtcNow - item.DateLastSaved).TotalHours >= 24;
diff --git a/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs b/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs
index 4b7bfad3f..f84b16510 100644
--- a/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs
+++ b/MediaBrowser.Server.Implementations/Photos/BaseDynamicImageProvider.cs
@@ -94,7 +94,7 @@ namespace MediaBrowser.Server.Implementations.Photos
protected abstract Task<List<BaseItem>> GetItemsWithImages(IHasImages item);
- private const string Version = "29";
+ private const string Version = "31";
protected string GetConfigurationCacheKey(List<BaseItem> items, string itemName)
{
var parts = Version + "_" + (itemName ?? string.Empty) + "_" +
@@ -103,9 +103,9 @@ namespace MediaBrowser.Server.Implementations.Photos
return parts.GetMD5().ToString("N");
}
- protected void CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath)
+ protected void CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, bool drawText)
{
- CreateCollage(primaryItem, items, outputPath, 960, 540, true, primaryItem.Name);
+ CreateCollage(primaryItem, items, outputPath, 960, 540, drawText, primaryItem.Name);
}
protected virtual IEnumerable<string> GetStripCollageImagePaths(IHasImages primaryItem, IEnumerable<BaseItem> items)
@@ -120,9 +120,9 @@ namespace MediaBrowser.Server.Implementations.Photos
CreateCollage(primaryItem, items, outputPath, 600, 900, true, primaryItem.Name);
}
- protected void CreateSquareCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath)
+ protected void CreateSquareCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, bool drawText)
{
- CreateCollage(primaryItem, items, outputPath, 800, 800, true, primaryItem.Name);
+ CreateCollage(primaryItem, items, outputPath, 800, 800, drawText, primaryItem.Name);
}
protected void CreateThumbCollage(IHasImages primaryItem, List<BaseItem> items, string outputPath, int width, int height, bool drawText, string text)
@@ -162,17 +162,23 @@ namespace MediaBrowser.Server.Implementations.Photos
return false;
}
+ var drawText = !(item is UserView);
+
if (imageType == ImageType.Thumb)
{
- CreateThumbCollage(item, itemsWithImages, outputPath);
+ CreateThumbCollage(item, itemsWithImages, outputPath, drawText);
return true;
}
if (imageType == ImageType.Primary)
{
- if (item is PhotoAlbum || item is Playlist)
+ if (item is UserView)
+ {
+ CreateSquareCollage(item, itemsWithImages, outputPath, drawText);
+ }
+ else if (item is PhotoAlbum || item is Playlist)
{
- CreateSquareCollage(item, itemsWithImages, outputPath);
+ CreateSquareCollage(item, itemsWithImages, outputPath, drawText);
}
else
{
diff --git a/SharedVersion.cs b/SharedVersion.cs
index e922d7591..8c5b01420 100644
--- a/SharedVersion.cs
+++ b/SharedVersion.cs
@@ -1,4 +1,4 @@
using System.Reflection;
-//[assembly: AssemblyVersion("3.0.*")]
-[assembly: AssemblyVersion("3.0.5582.2")]
+[assembly: AssemblyVersion("3.0.*")]
+//[assembly: AssemblyVersion("3.0.5582.2")]