update image magick encoder

release-10.1.0
Luke Pulverenti 8 years ago
parent 7815d65e5c
commit 98ee28bda4

@ -9,6 +9,7 @@ using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.System;
namespace Emby.Drawing.ImageMagick namespace Emby.Drawing.ImageMagick
{ {
@ -18,13 +19,15 @@ namespace Emby.Drawing.ImageMagick
private readonly IApplicationPaths _appPaths; private readonly IApplicationPaths _appPaths;
private readonly Func<IHttpClient> _httpClientFactory; private readonly Func<IHttpClient> _httpClientFactory;
private readonly IFileSystem _fileSystem; private readonly IFileSystem _fileSystem;
private readonly IEnvironmentInfo _environment;
public ImageMagickEncoder(ILogger logger, IApplicationPaths appPaths, Func<IHttpClient> httpClientFactory, IFileSystem fileSystem) public ImageMagickEncoder(ILogger logger, IApplicationPaths appPaths, Func<IHttpClient> httpClientFactory, IFileSystem fileSystem, IEnvironmentInfo environment)
{ {
_logger = logger; _logger = logger;
_appPaths = appPaths; _appPaths = appPaths;
_httpClientFactory = httpClientFactory; _httpClientFactory = httpClientFactory;
_fileSystem = fileSystem; _fileSystem = fileSystem;
_environment = environment;
LogVersion(); LogVersion();
} }
@ -337,7 +340,17 @@ namespace Emby.Drawing.ImageMagick
public bool SupportsImageCollageCreation public bool SupportsImageCollageCreation
{ {
get { return true; } get
{
// too heavy. seeing crashes on RPI.
if (_environment.SystemArchitecture == Architecture.Arm ||
_environment.SystemArchitecture == Architecture.Arm64)
{
return false;
}
return true;
}
} }
public bool SupportsImageEncoding public bool SupportsImageEncoding

@ -237,8 +237,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
private bool IsMovie(ScheduleDirect.ProgramDetails programInfo) private bool IsMovie(ScheduleDirect.ProgramDetails programInfo)
{ {
var showType = programInfo.showType ?? string.Empty; return string.Equals(programInfo.entityType, "movie", StringComparison.OrdinalIgnoreCase);
return showType.IndexOf("movie", StringComparison.OrdinalIgnoreCase) != -1 || showType.IndexOf("film", StringComparison.OrdinalIgnoreCase) != -1;
} }
private ProgramInfo GetProgram(string channelId, ScheduleDirect.Program programInfo, ScheduleDirect.ProgramDetails details) private ProgramInfo GetProgram(string channelId, ScheduleDirect.Program programInfo, ScheduleDirect.ProgramDetails details)
@ -280,8 +279,6 @@ namespace Emby.Server.Implementations.LiveTv.Listings
episodeTitle = details.episodeTitle150; episodeTitle = details.episodeTitle150;
} }
var showType = details.showType ?? string.Empty;
var info = new ProgramInfo var info = new ProgramInfo
{ {
ChannelId = channelId, ChannelId = channelId,
@ -294,11 +291,11 @@ namespace Emby.Server.Implementations.LiveTv.Listings
EpisodeTitle = episodeTitle, EpisodeTitle = episodeTitle,
Audio = audioType, Audio = audioType,
IsRepeat = repeat, IsRepeat = repeat,
IsSeries = showType.IndexOf("series", StringComparison.OrdinalIgnoreCase) != -1, IsSeries = string.Equals(details.entityType, "episode", StringComparison.OrdinalIgnoreCase),
ImageUrl = details.primaryImage, ImageUrl = details.primaryImage,
ThumbImageUrl = details.thumbImage, ThumbImageUrl = details.thumbImage,
IsKids = string.Equals(details.audience, "children", StringComparison.OrdinalIgnoreCase), IsKids = string.Equals(details.audience, "children", StringComparison.OrdinalIgnoreCase),
IsSports = showType.IndexOf("sports", StringComparison.OrdinalIgnoreCase) != -1, IsSports = string.Equals(details.entityType, "sports", StringComparison.OrdinalIgnoreCase),
IsMovie = IsMovie(details), IsMovie = IsMovie(details),
Etag = programInfo.md5 Etag = programInfo.md5
}; };
@ -1199,6 +1196,7 @@ namespace Emby.Server.Implementations.LiveTv.Listings
public List<ContentRating> contentRating { get; set; } public List<ContentRating> contentRating { get; set; }
public List<Cast> cast { get; set; } public List<Cast> cast { get; set; }
public List<Crew> crew { get; set; } public List<Crew> crew { get; set; }
public string entityType { get; set; }
public string showType { get; set; } public string showType { get; set; }
public bool hasImageArtwork { get; set; } public bool hasImageArtwork { get; set; }
public string primaryImage { get; set; } public string primaryImage { get; set; }

@ -742,7 +742,7 @@ namespace Emby.Server.Implementations.LiveTv
else else
{ {
// Increment this whenver some internal change deems it necessary // Increment this whenver some internal change deems it necessary
var etag = info.Etag + "5"; var etag = info.Etag + "6";
if (!string.Equals(etag, item.ExternalEtag, StringComparison.OrdinalIgnoreCase)) if (!string.Equals(etag, item.ExternalEtag, StringComparison.OrdinalIgnoreCase))
{ {

@ -118,6 +118,11 @@ namespace MediaBrowser.Controller.Entities.Movies
{ {
get get
{ {
if (string.IsNullOrWhiteSpace(Path))
{
return false;
}
return !FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.DataPath, Path); return !FileSystem.ContainsSubPath(ConfigurationManager.ApplicationPaths.DataPath, Path);
} }
} }

@ -9,6 +9,7 @@ using MediaBrowser.Controller.Drawing;
using MediaBrowser.Model.IO; using MediaBrowser.Model.IO;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using Emby.Drawing.Skia; using Emby.Drawing.Skia;
using MediaBrowser.Model.System;
namespace MediaBrowser.Server.Startup.Common namespace MediaBrowser.Server.Startup.Common
{ {
@ -19,7 +20,8 @@ namespace MediaBrowser.Server.Startup.Common
IFileSystem fileSystem, IFileSystem fileSystem,
StartupOptions startupOptions, StartupOptions startupOptions,
Func<IHttpClient> httpClient, Func<IHttpClient> httpClient,
IApplicationPaths appPaths) IApplicationPaths appPaths,
IEnvironmentInfo environment)
{ {
if (!startupOptions.ContainsOption("-enablegdi")) if (!startupOptions.ContainsOption("-enablegdi"))
{ {
@ -34,7 +36,7 @@ namespace MediaBrowser.Server.Startup.Common
try try
{ {
return new ImageMagickEncoder(logManager.GetLogger("ImageMagick"), appPaths, httpClient, fileSystem); return new ImageMagickEncoder(logManager.GetLogger("ImageMagick"), appPaths, httpClient, fileSystem, environment);
} }
catch catch
{ {

Loading…
Cancel
Save