mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-07-08 23:00:51 +02:00
add additional playlist buttons
This commit is contained in:
parent
515f21cc4f
commit
0f508dab47
|
@ -14,7 +14,6 @@ using ServiceStack.Text.Controller;
|
||||||
using ServiceStack.Web;
|
using ServiceStack.Web;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Globalization;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Threading;
|
using System.Threading;
|
||||||
|
@ -341,7 +340,7 @@ namespace MediaBrowser.Api.Images
|
||||||
ImageIndex = imageIndex,
|
ImageIndex = imageIndex,
|
||||||
ImageType = info.Type,
|
ImageType = info.Type,
|
||||||
ImageTag = _imageProcessor.GetImageCacheTag(item, info),
|
ImageTag = _imageProcessor.GetImageCacheTag(item, info),
|
||||||
Size = info.Length ?? fileInfo.Length,
|
Size = fileInfo.Length,
|
||||||
Width = Convert.ToInt32(size.Width),
|
Width = Convert.ToInt32(size.Width),
|
||||||
Height = Convert.ToInt32(size.Height)
|
Height = Convert.ToInt32(size.Height)
|
||||||
};
|
};
|
||||||
|
@ -365,7 +364,21 @@ namespace MediaBrowser.Api.Images
|
||||||
_libraryManager.RootFolder :
|
_libraryManager.RootFolder :
|
||||||
_libraryManager.GetItemById(request.Id);
|
_libraryManager.GetItemById(request.Id);
|
||||||
|
|
||||||
return GetImage(request, item);
|
return GetImage(request, item, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Gets the specified request.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="request">The request.</param>
|
||||||
|
/// <returns>System.Object.</returns>
|
||||||
|
public object Head(GetItemImage request)
|
||||||
|
{
|
||||||
|
var item = string.IsNullOrEmpty(request.Id) ?
|
||||||
|
_libraryManager.RootFolder :
|
||||||
|
_libraryManager.GetItemById(request.Id);
|
||||||
|
|
||||||
|
return GetImage(request, item, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -377,7 +390,7 @@ namespace MediaBrowser.Api.Images
|
||||||
{
|
{
|
||||||
var item = _userManager.Users.First(i => i.Id == request.Id);
|
var item = _userManager.Users.First(i => i.Id == request.Id);
|
||||||
|
|
||||||
return GetImage(request, item);
|
return GetImage(request, item, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object Get(GetItemByNameImage request)
|
public object Get(GetItemByNameImage request)
|
||||||
|
@ -387,7 +400,7 @@ namespace MediaBrowser.Api.Images
|
||||||
|
|
||||||
var item = GetItemByName(request.Name, type, _libraryManager);
|
var item = GetItemByName(request.Name, type, _libraryManager);
|
||||||
|
|
||||||
return GetImage(request, item);
|
return GetImage(request, item, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -484,10 +497,10 @@ namespace MediaBrowser.Api.Images
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="request">The request.</param>
|
/// <param name="request">The request.</param>
|
||||||
/// <param name="item">The item.</param>
|
/// <param name="item">The item.</param>
|
||||||
|
/// <param name="isHeadRequest">if set to <c>true</c> [is head request].</param>
|
||||||
/// <returns>System.Object.</returns>
|
/// <returns>System.Object.</returns>
|
||||||
/// <exception cref="ResourceNotFoundException">
|
/// <exception cref="ResourceNotFoundException"></exception>
|
||||||
/// </exception>
|
public object GetImage(ImageRequest request, IHasImages item, bool isHeadRequest)
|
||||||
public object GetImage(ImageRequest request, IHasImages item)
|
|
||||||
{
|
{
|
||||||
var imageInfo = GetImageInfo(request, item);
|
var imageInfo = GetImageInfo(request, item);
|
||||||
|
|
||||||
|
@ -534,7 +547,8 @@ namespace MediaBrowser.Api.Images
|
||||||
supportedImageEnhancers,
|
supportedImageEnhancers,
|
||||||
contentType,
|
contentType,
|
||||||
cacheDuration,
|
cacheDuration,
|
||||||
responseHeaders)
|
responseHeaders,
|
||||||
|
isHeadRequest)
|
||||||
.Result;
|
.Result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -544,7 +558,8 @@ namespace MediaBrowser.Api.Images
|
||||||
List<IImageEnhancer> enhancers,
|
List<IImageEnhancer> enhancers,
|
||||||
string contentType,
|
string contentType,
|
||||||
TimeSpan? cacheDuration,
|
TimeSpan? cacheDuration,
|
||||||
IDictionary<string,string> headers)
|
IDictionary<string,string> headers,
|
||||||
|
bool isHeadRequest)
|
||||||
{
|
{
|
||||||
var cropwhitespace = request.Type == ImageType.Logo || request.Type == ImageType.Art;
|
var cropwhitespace = request.Type == ImageType.Logo || request.Type == ImageType.Art;
|
||||||
|
|
||||||
|
@ -574,7 +589,7 @@ namespace MediaBrowser.Api.Images
|
||||||
|
|
||||||
var file = await _imageProcessor.ProcessImage(options).ConfigureAwait(false);
|
var file = await _imageProcessor.ProcessImage(options).ConfigureAwait(false);
|
||||||
|
|
||||||
return ResultFactory.GetStaticFileResult(Request, file, contentType, cacheDuration, FileShare.Read, headers);
|
return ResultFactory.GetStaticFileResult(Request, file, contentType, cacheDuration, FileShare.Read, headers, isHeadRequest);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string GetMimeType(ImageOutputFormat format, string path)
|
private string GetMimeType(ImageOutputFormat format, string path)
|
||||||
|
|
|
@ -1309,8 +1309,7 @@ namespace MediaBrowser.Controller.Entities
|
||||||
{
|
{
|
||||||
Path = file.FullName,
|
Path = file.FullName,
|
||||||
Type = type,
|
Type = type,
|
||||||
DateModified = FileSystem.GetLastWriteTimeUtc(file),
|
DateModified = FileSystem.GetLastWriteTimeUtc(file)
|
||||||
Length = ((FileInfo)file).Length
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1421,14 +1420,11 @@ namespace MediaBrowser.Controller.Entities
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var info = new FileInfo(path);
|
|
||||||
|
|
||||||
return new ItemImageInfo
|
return new ItemImageInfo
|
||||||
{
|
{
|
||||||
Path = path,
|
Path = path,
|
||||||
DateModified = FileSystem.GetLastWriteTimeUtc(info),
|
DateModified = FileSystem.GetLastWriteTimeUtc(path),
|
||||||
Type = imageType,
|
Type = imageType
|
||||||
Length = info.Length
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,5 @@ namespace MediaBrowser.Controller.Entities
|
||||||
public ImageType Type { get; set; }
|
public ImageType Type { get; set; }
|
||||||
|
|
||||||
public DateTime DateModified { get; set; }
|
public DateTime DateModified { get; set; }
|
||||||
|
|
||||||
public long? Length { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -636,18 +636,26 @@ namespace MediaBrowser.Dlna.Didl
|
||||||
|
|
||||||
if (!_profile.EnableAlbumArtInDidl)
|
if (!_profile.EnableAlbumArtInDidl)
|
||||||
{
|
{
|
||||||
return;
|
if (!(item is Photo) && !(item is Video))
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AddImageResElement(item, element, 4096, 4096, "jpg");
|
AddImageResElement(item, element, 4096, 4096, "jpg", "JPEG_LRG");
|
||||||
AddImageResElement(item, element, 4096, 4096, "png");
|
AddImageResElement(item, element, 4096, 4096, "png", "PNG_LRG");
|
||||||
AddImageResElement(item, element, 1024, 768, "jpg");
|
AddImageResElement(item, element, 1024, 768, "jpg", "JPEG_MED");
|
||||||
AddImageResElement(item, element, 640, 480, "jpg");
|
AddImageResElement(item, element, 640, 480, "jpg", "JPEG_SM");
|
||||||
AddImageResElement(item, element, 160, 160, "jpg");
|
AddImageResElement(item, element, 160, 160, "jpg", "JPEG_TN");
|
||||||
AddImageResElement(item, element, 160, 160, "png");
|
AddImageResElement(item, element, 160, 160, "png", "PNG_TN");
|
||||||
}
|
}
|
||||||
|
|
||||||
private void AddImageResElement(BaseItem item, XmlElement element, int maxWidth, int maxHeight, string format)
|
private void AddImageResElement(BaseItem item,
|
||||||
|
XmlElement element,
|
||||||
|
int maxWidth,
|
||||||
|
int maxHeight,
|
||||||
|
string format,
|
||||||
|
string org_Pn)
|
||||||
{
|
{
|
||||||
var imageInfo = GetImageInfo(item);
|
var imageInfo = GetImageInfo(item);
|
||||||
|
|
||||||
|
@ -667,7 +675,8 @@ namespace MediaBrowser.Dlna.Didl
|
||||||
var width = albumartUrlInfo.Width;
|
var width = albumartUrlInfo.Width;
|
||||||
var height = albumartUrlInfo.Height;
|
var height = albumartUrlInfo.Height;
|
||||||
|
|
||||||
var contentFeatures = new ContentFeatureBuilder(_profile).BuildImageHeader(format, width, height, imageInfo.IsDirectStream);
|
var contentFeatures = new ContentFeatureBuilder(_profile)
|
||||||
|
.BuildImageHeader(format, width, height, imageInfo.IsDirectStream, org_Pn);
|
||||||
|
|
||||||
res.SetAttribute("protocolInfo", String.Format(
|
res.SetAttribute("protocolInfo", String.Format(
|
||||||
"http-get:*:{0}:{1}",
|
"http-get:*:{0}:{1}",
|
||||||
|
@ -675,14 +684,6 @@ namespace MediaBrowser.Dlna.Didl
|
||||||
contentFeatures
|
contentFeatures
|
||||||
));
|
));
|
||||||
|
|
||||||
res.SetAttribute("colorDepth", "24");
|
|
||||||
|
|
||||||
if (imageInfo.IsDirectStream)
|
|
||||||
{
|
|
||||||
var length = imageInfo.ItemImageInfo.Length ?? new FileInfo(imageInfo.File).Length;
|
|
||||||
res.SetAttribute("size", length.ToString(_usCulture));
|
|
||||||
}
|
|
||||||
|
|
||||||
if (width.HasValue && height.HasValue)
|
if (width.HasValue && height.HasValue)
|
||||||
{
|
{
|
||||||
res.SetAttribute("resolution", string.Format("{0}x{1}", width.Value, height.Value));
|
res.SetAttribute("resolution", string.Format("{0}x{1}", width.Value, height.Value));
|
||||||
|
|
|
@ -15,15 +15,15 @@ namespace MediaBrowser.Model.Dlna
|
||||||
public string BuildImageHeader(string container,
|
public string BuildImageHeader(string container,
|
||||||
int? width,
|
int? width,
|
||||||
int? height,
|
int? height,
|
||||||
bool isDirectStream)
|
bool isDirectStream,
|
||||||
|
string orgPn = null)
|
||||||
{
|
{
|
||||||
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetImageOrgOpValue();
|
string orgOp = ";DLNA.ORG_OP=" + DlnaMaps.GetImageOrgOpValue();
|
||||||
|
|
||||||
// 0 = native, 1 = transcoded
|
// 0 = native, 1 = transcoded
|
||||||
var orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
|
var orgCi = isDirectStream ? ";DLNA.ORG_CI=0" : ";DLNA.ORG_CI=1";
|
||||||
|
|
||||||
DlnaFlags flagValue = DlnaFlags.StreamingTransferMode |
|
DlnaFlags flagValue = DlnaFlags.BackgroundTransferMode |
|
||||||
DlnaFlags.BackgroundTransferMode |
|
|
||||||
DlnaFlags.InteractiveTransferMode |
|
DlnaFlags.InteractiveTransferMode |
|
||||||
DlnaFlags.DlnaV15;
|
DlnaFlags.DlnaV15;
|
||||||
|
|
||||||
|
@ -34,7 +34,10 @@ namespace MediaBrowser.Model.Dlna
|
||||||
width,
|
width,
|
||||||
height);
|
height);
|
||||||
|
|
||||||
string orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
|
if (string.IsNullOrEmpty(orgPn))
|
||||||
|
{
|
||||||
|
orgPn = mediaProfile == null ? null : mediaProfile.OrgPn;
|
||||||
|
}
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(orgPn))
|
if (string.IsNullOrEmpty(orgPn))
|
||||||
{
|
{
|
||||||
|
@ -66,10 +69,10 @@ namespace MediaBrowser.Model.Dlna
|
||||||
DlnaFlags.InteractiveTransferMode |
|
DlnaFlags.InteractiveTransferMode |
|
||||||
DlnaFlags.DlnaV15;
|
DlnaFlags.DlnaV15;
|
||||||
|
|
||||||
if (isDirectStream)
|
//if (isDirectStream)
|
||||||
{
|
//{
|
||||||
flagValue = flagValue | DlnaFlags.ByteBasedSeek;
|
// flagValue = flagValue | DlnaFlags.ByteBasedSeek;
|
||||||
}
|
//}
|
||||||
//else if (runtimeTicks.HasValue)
|
//else if (runtimeTicks.HasValue)
|
||||||
//{
|
//{
|
||||||
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
|
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
|
||||||
|
@ -125,10 +128,10 @@ namespace MediaBrowser.Model.Dlna
|
||||||
DlnaFlags.InteractiveTransferMode |
|
DlnaFlags.InteractiveTransferMode |
|
||||||
DlnaFlags.DlnaV15;
|
DlnaFlags.DlnaV15;
|
||||||
|
|
||||||
if (isDirectStream)
|
//if (isDirectStream)
|
||||||
{
|
//{
|
||||||
flagValue = flagValue | DlnaFlags.ByteBasedSeek;
|
// flagValue = flagValue | DlnaFlags.ByteBasedSeek;
|
||||||
}
|
//}
|
||||||
//else if (runtimeTicks.HasValue)
|
//else if (runtimeTicks.HasValue)
|
||||||
//{
|
//{
|
||||||
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
|
// flagValue = flagValue | DlnaFlags.TimeBasedSeek;
|
||||||
|
|
|
@ -123,7 +123,8 @@
|
||||||
"HeaderMyViews": "My Views",
|
"HeaderMyViews": "My Views",
|
||||||
"HeaderLibraryFolders": "Media Folders",
|
"HeaderLibraryFolders": "Media Folders",
|
||||||
"HeaderLatestMedia": "Latest Media",
|
"HeaderLatestMedia": "Latest Media",
|
||||||
"ButtonMore": "More...",
|
"ButtonMoreItems": "More...",
|
||||||
|
"ButtonMore": "More",
|
||||||
"HeaderFavoriteMovies": "Favorite Movies",
|
"HeaderFavoriteMovies": "Favorite Movies",
|
||||||
"HeaderFavoriteShows": "Favorite Shows",
|
"HeaderFavoriteShows": "Favorite Shows",
|
||||||
"HeaderFavoriteEpisodes": "Favorite Episodes",
|
"HeaderFavoriteEpisodes": "Favorite Episodes",
|
||||||
|
|
|
@ -964,5 +964,6 @@
|
||||||
"OptionReportBooks": "Books",
|
"OptionReportBooks": "Books",
|
||||||
"OptionReportArtists": "Artists",
|
"OptionReportArtists": "Artists",
|
||||||
"OptionReportAlbums": "Albums",
|
"OptionReportAlbums": "Albums",
|
||||||
"OptionReportAdultVideos": "Adult videos"
|
"OptionReportAdultVideos": "Adult videos",
|
||||||
|
"ButtonMore": "More"
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common.Internal</id>
|
<id>MediaBrowser.Common.Internal</id>
|
||||||
<version>3.0.424</version>
|
<version>3.0.425</version>
|
||||||
<title>MediaBrowser.Common.Internal</title>
|
<title>MediaBrowser.Common.Internal</title>
|
||||||
<authors>Luke</authors>
|
<authors>Luke</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<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>
|
<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>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.424" />
|
<dependency id="MediaBrowser.Common" version="3.0.425" />
|
||||||
<dependency id="NLog" version="3.1.0.0" />
|
<dependency id="NLog" version="3.1.0.0" />
|
||||||
<dependency id="SimpleInjector" version="2.5.2" />
|
<dependency id="SimpleInjector" version="2.5.2" />
|
||||||
<dependency id="sharpcompress" version="0.10.2" />
|
<dependency id="sharpcompress" version="0.10.2" />
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Common</id>
|
<id>MediaBrowser.Common</id>
|
||||||
<version>3.0.424</version>
|
<version>3.0.425</version>
|
||||||
<title>MediaBrowser.Common</title>
|
<title>MediaBrowser.Common</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2011/08/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Model.Signed</id>
|
<id>MediaBrowser.Model.Signed</id>
|
||||||
<version>3.0.424</version>
|
<version>3.0.425</version>
|
||||||
<title>MediaBrowser.Model - Signed Edition</title>
|
<title>MediaBrowser.Model - Signed Edition</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
|
||||||
<metadata>
|
<metadata>
|
||||||
<id>MediaBrowser.Server.Core</id>
|
<id>MediaBrowser.Server.Core</id>
|
||||||
<version>3.0.424</version>
|
<version>3.0.425</version>
|
||||||
<title>Media Browser.Server.Core</title>
|
<title>Media Browser.Server.Core</title>
|
||||||
<authors>Media Browser Team</authors>
|
<authors>Media Browser Team</authors>
|
||||||
<owners>ebr,Luke,scottisafool</owners>
|
<owners>ebr,Luke,scottisafool</owners>
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
<description>Contains core components required to build plugins for Media Browser Server.</description>
|
||||||
<copyright>Copyright © Media Browser 2013</copyright>
|
<copyright>Copyright © Media Browser 2013</copyright>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency id="MediaBrowser.Common" version="3.0.424" />
|
<dependency id="MediaBrowser.Common" version="3.0.425" />
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</metadata>
|
</metadata>
|
||||||
<files>
|
<files>
|
||||||
|
|
Loading…
Reference in a new issue