diff options
33 files changed, 196 insertions, 268 deletions
diff --git a/.drone.yml b/.drone.yml index bacce407b..13762ba0a 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,14 +1,11 @@ kind: pipeline name: build:debian -clone: - depth: 1 - steps: - name: submodules image: docker:git commands: - - git submodule update --init + - git submodule update --init --recursive - name: build:debian image: plugins/docker group: build @@ -22,14 +19,11 @@ steps: kind: pipeline name: build:docker -clone: - depth: 1 - steps: - name: submodules image: docker:git commands: - - git submodule update --init + - git submodule update --init --recursive - name: build:docker image: plugins/docker group: build diff --git a/Emby.Dlna/Api/DlnaServerService.cs b/Emby.Dlna/Api/DlnaServerService.cs index 663728f36..194ae73e0 100644 --- a/Emby.Dlna/Api/DlnaServerService.cs +++ b/Emby.Dlna/Api/DlnaServerService.cs @@ -224,8 +224,10 @@ namespace Emby.Dlna.Api var first = pathInfo[0]; // backwards compatibility + // TODO: Work out what this is doing. if (string.Equals(first, "mediabrowser", StringComparison.OrdinalIgnoreCase) || - string.Equals(first, "emby", StringComparison.OrdinalIgnoreCase)) + string.Equals(first, "emby", StringComparison.OrdinalIgnoreCase) || + string.Equals(first, "jellyfin", StringComparison.OrdinalIgnoreCase )) { index++; } diff --git a/Emby.Dlna/Main/DlnaEntryPoint.cs b/Emby.Dlna/Main/DlnaEntryPoint.cs index 4bab30337..cd535a98a 100644 --- a/Emby.Dlna/Main/DlnaEntryPoint.cs +++ b/Emby.Dlna/Main/DlnaEntryPoint.cs @@ -272,9 +272,9 @@ namespace Emby.Dlna.Main { CacheLifetime = TimeSpan.FromSeconds(1800), //How long SSDP clients can cache this info. Location = uri, // Must point to the URL that serves your devices UPnP description document. - FriendlyName = "Emby Server", - Manufacturer = "Emby", - ModelName = "Emby Server", + FriendlyName = "Jellyfin", + Manufacturer = "Jellyfin", + ModelName = "Jellyfin Server", Uuid = udn // This must be a globally unique value that survives reboots etc. Get from storage or embedded hardware etc. }; diff --git a/Emby.Dlna/PlayTo/SsdpHttpClient.cs b/Emby.Dlna/PlayTo/SsdpHttpClient.cs index eaafaa65b..bfd163bf1 100644 --- a/Emby.Dlna/PlayTo/SsdpHttpClient.cs +++ b/Emby.Dlna/PlayTo/SsdpHttpClient.cs @@ -14,7 +14,7 @@ namespace Emby.Dlna.PlayTo public class SsdpHttpClient { private const string USERAGENT = "Microsoft-Windows/6.2 UPnP/1.0 Microsoft-DLNA DLNADOC/1.50"; - private const string FriendlyName = "Emby"; + private const string FriendlyName = "Jellyfin"; private readonly IHttpClient _httpClient; private readonly IServerConfigurationManager _config; diff --git a/Emby.Dlna/Profiles/DefaultProfile.cs b/Emby.Dlna/Profiles/DefaultProfile.cs index ddc575700..b60a664ba 100644 --- a/Emby.Dlna/Profiles/DefaultProfile.cs +++ b/Emby.Dlna/Profiles/DefaultProfile.cs @@ -14,9 +14,9 @@ namespace Emby.Dlna.Profiles ProtocolInfo = "http-get:*:video/mpeg:*,http-get:*:video/mp4:*,http-get:*:video/vnd.dlna.mpeg-tts:*,http-get:*:video/avi:*,http-get:*:video/x-matroska:*,http-get:*:video/x-ms-wmv:*,http-get:*:video/wtv:*,http-get:*:audio/mpeg:*,http-get:*:audio/mp3:*,http-get:*:audio/mp4:*,http-get:*:audio/x-ms-wma*,http-get:*:audio/wav:*,http-get:*:audio/L16:*,http-get:*image/jpeg:*,http-get:*image/png:*,http-get:*image/gif:*,http-get:*image/tiff:*"; - Manufacturer = "Emby"; + Manufacturer = "Jellyfin"; ModelDescription = "UPnP/AV 1.0 Compliant Media Server"; - ModelName = "Emby Server"; + ModelName = "Jellyfin Server"; ModelNumber = "01"; ModelUrl = "https://github.com/jellyfin/jellyfin"; ManufacturerUrl = "https://github.com/jellyfin/jellyfin"; diff --git a/Emby.Dlna/Profiles/Xml/Default.xml b/Emby.Dlna/Profiles/Xml/Default.xml index 5d23a71ff..9b862fec3 100644 --- a/Emby.Dlna/Profiles/Xml/Default.xml +++ b/Emby.Dlna/Profiles/Xml/Default.xml @@ -1,9 +1,9 @@ <?xml version="1.0"?> <Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Name>Generic Device</Name> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Denon AVR.xml b/Emby.Dlna/Profiles/Xml/Denon AVR.xml index ff341e56f..599726c51 100644 --- a/Emby.Dlna/Profiles/Xml/Denon AVR.xml +++ b/Emby.Dlna/Profiles/Xml/Denon AVR.xml @@ -6,9 +6,9 @@ <Manufacturer>Denon</Manufacturer> <Headers /> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml b/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml index 211d5a131..e640e86bf 100644 --- a/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml +++ b/Emby.Dlna/Profiles/Xml/DirecTV HD-DVR.xml @@ -7,9 +7,9 @@ <HttpHeaderInfo name="User-Agent" value="DIRECTV" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Dish Hopper-Joey.xml b/Emby.Dlna/Profiles/Xml/Dish Hopper-Joey.xml index 865f8dd6a..615774adf 100644 --- a/Emby.Dlna/Profiles/Xml/Dish Hopper-Joey.xml +++ b/Emby.Dlna/Profiles/Xml/Dish Hopper-Joey.xml @@ -8,9 +8,9 @@ <HttpHeaderInfo name="User-Agent" value="Zip_" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/LG Smart TV.xml b/Emby.Dlna/Profiles/Xml/LG Smart TV.xml index ee4634e76..21dccf531 100644 --- a/Emby.Dlna/Profiles/Xml/LG Smart TV.xml +++ b/Emby.Dlna/Profiles/Xml/LG Smart TV.xml @@ -7,9 +7,9 @@ <HttpHeaderInfo name="User-Agent" value="LG" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml b/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml index 17dc336a7..ac081bba3 100644 --- a/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml +++ b/Emby.Dlna/Profiles/Xml/Linksys DMA2100.xml @@ -5,9 +5,9 @@ <ModelName>DMA2100us</ModelName> <Headers /> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Marantz.xml b/Emby.Dlna/Profiles/Xml/Marantz.xml index b672d77a5..2bbdecde8 100644 --- a/Emby.Dlna/Profiles/Xml/Marantz.xml +++ b/Emby.Dlna/Profiles/Xml/Marantz.xml @@ -7,9 +7,9 @@ <HttpHeaderInfo name="User-Agent" value="Marantz" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/MediaMonkey.xml b/Emby.Dlna/Profiles/Xml/MediaMonkey.xml index 83ddb6ac0..955c30e85 100644 --- a/Emby.Dlna/Profiles/Xml/MediaMonkey.xml +++ b/Emby.Dlna/Profiles/Xml/MediaMonkey.xml @@ -7,9 +7,9 @@ <HttpHeaderInfo name="User-Agent" value="MediaMonkey" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml b/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml index 59d1fdd17..0da0e0926 100644 --- a/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml +++ b/Emby.Dlna/Profiles/Xml/Panasonic Viera.xml @@ -8,9 +8,9 @@ <HttpHeaderInfo name="User-Agent" value="Panasonic MIL DLNA" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml b/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml index a435d1484..775d40b74 100644 --- a/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml +++ b/Emby.Dlna/Profiles/Xml/Popcorn Hour.xml @@ -1,9 +1,9 @@ <?xml version="1.0"?> <Profile xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <Name>Popcorn Hour</Name> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml b/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml index 89167c9aa..1362d8c38 100644 --- a/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml +++ b/Emby.Dlna/Profiles/Xml/Samsung Smart TV.xml @@ -7,9 +7,9 @@ <HttpHeaderInfo name="User-Agent" value="SEC_" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml b/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml index c9d428e57..dac2fdea4 100644 --- a/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml +++ b/Emby.Dlna/Profiles/Xml/Sharp Smart TV.xml @@ -7,9 +7,9 @@ <HttpHeaderInfo name="User-Agent" value="Sharp" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml b/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml index 01d4bc086..d1afc162c 100644 --- a/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml +++ b/Emby.Dlna/Profiles/Xml/Sony PlayStation 3.xml @@ -8,9 +8,9 @@ <HttpHeaderInfo name="X-AV-Client-Info" value="PLAYSTATION 3" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml b/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml index 47aa84488..090abe417 100644 --- a/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml +++ b/Emby.Dlna/Profiles/Xml/Sony PlayStation 4.xml @@ -8,9 +8,9 @@ <HttpHeaderInfo name="X-AV-Client-Info" value="PLAYSTATION 4" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/WDTV Live.xml b/Emby.Dlna/Profiles/Xml/WDTV Live.xml index f7e43368a..db4ce4722 100644 --- a/Emby.Dlna/Profiles/Xml/WDTV Live.xml +++ b/Emby.Dlna/Profiles/Xml/WDTV Live.xml @@ -8,9 +8,9 @@ <HttpHeaderInfo name="User-Agent" value="ALPHA Networks" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/Xbox One.xml b/Emby.Dlna/Profiles/Xml/Xbox One.xml index a9a302854..40e05f7fc 100644 --- a/Emby.Dlna/Profiles/Xml/Xbox One.xml +++ b/Emby.Dlna/Profiles/Xml/Xbox One.xml @@ -8,9 +8,9 @@ <HttpHeaderInfo name="User-Agent" value="NSPlayer/12" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Profiles/Xml/foobar2000.xml b/Emby.Dlna/Profiles/Xml/foobar2000.xml index ba0fcf739..19dc10e83 100644 --- a/Emby.Dlna/Profiles/Xml/foobar2000.xml +++ b/Emby.Dlna/Profiles/Xml/foobar2000.xml @@ -7,9 +7,9 @@ <HttpHeaderInfo name="User-Agent" value="foobar" match="Substring" /> </Headers> </Identification> - <Manufacturer>Emby</Manufacturer> + <Manufacturer>Jellyfin</Manufacturer> <ManufacturerUrl>https://github.com/jellyfin/jellyfin</ManufacturerUrl> - <ModelName>Emby Server</ModelName> + <ModelName>Jellyfin Server</ModelName> <ModelDescription>UPnP/AV 1.0 Compliant Media Server</ModelDescription> <ModelNumber>01</ModelNumber> <ModelUrl>https://github.com/jellyfin/jellyfin</ModelUrl> diff --git a/Emby.Dlna/Server/DescriptionXmlBuilder.cs b/Emby.Dlna/Server/DescriptionXmlBuilder.cs index 988d45e07..0c0c367e4 100644 --- a/Emby.Dlna/Server/DescriptionXmlBuilder.cs +++ b/Emby.Dlna/Server/DescriptionXmlBuilder.cs @@ -217,7 +217,7 @@ namespace Emby.Dlna.Server { if (string.IsNullOrEmpty(_profile.FriendlyName)) { - return "Emby - " + _serverName; + return "Jellyfin - " + _serverName; } var characterList = new List<char>(); diff --git a/Emby.Drawing.Skia/SkiaEncoder.cs b/Emby.Drawing.Skia/SkiaEncoder.cs index 7ccb75ec4..9eb7055b4 100644 --- a/Emby.Drawing.Skia/SkiaEncoder.cs +++ b/Emby.Drawing.Skia/SkiaEncoder.cs @@ -174,28 +174,24 @@ namespace Emby.Drawing.Skia var newRect = SKRectI.Create(leftmost, topmost, rightmost - leftmost, bottommost - topmost); using (var image = SKImage.FromBitmap(bitmap)) + using (var subset = image.Subset(newRect)) { - using (var subset = image.Subset(newRect)) - { - return SKBitmap.FromImage(subset); - } + return SKBitmap.FromImage(subset); } } public ImageSize GetImageSize(string path) { using (var s = new SKFileStream(path)) + using (var codec = SKCodec.Create(s)) { - using (var codec = SKCodec.Create(s)) - { - var info = codec.Info; + var info = codec.Info; - return new ImageSize - { - Width = info.Width, - Height = info.Height - }; - } + return new ImageSize + { + Width = info.Width, + Height = info.Height + }; } } @@ -234,36 +230,36 @@ namespace Emby.Drawing.Skia return tempPath; } - private static SKCodecOrigin GetSKCodecOrigin(ImageOrientation? orientation) + private static SKEncodedOrigin GetSKEncodedOrigin(ImageOrientation? orientation) { if (!orientation.HasValue) { - return SKCodecOrigin.TopLeft; + return SKEncodedOrigin.TopLeft; } switch (orientation.Value) { case ImageOrientation.TopRight: - return SKCodecOrigin.TopRight; + return SKEncodedOrigin.TopRight; case ImageOrientation.RightTop: - return SKCodecOrigin.RightTop; + return SKEncodedOrigin.RightTop; case ImageOrientation.RightBottom: - return SKCodecOrigin.RightBottom; + return SKEncodedOrigin.RightBottom; case ImageOrientation.LeftTop: - return SKCodecOrigin.LeftTop; + return SKEncodedOrigin.LeftTop; case ImageOrientation.LeftBottom: - return SKCodecOrigin.LeftBottom; + return SKEncodedOrigin.LeftBottom; case ImageOrientation.BottomRight: - return SKCodecOrigin.BottomRight; + return SKEncodedOrigin.BottomRight; case ImageOrientation.BottomLeft: - return SKCodecOrigin.BottomLeft; + return SKEncodedOrigin.BottomLeft; default: - return SKCodecOrigin.TopLeft; + return SKEncodedOrigin.TopLeft; } } private static string[] TransparentImageTypes = new string[] { ".png", ".gif", ".webp" }; - internal static SKBitmap Decode(string path, bool forceCleanBitmap, IFileSystem fileSystem, ImageOrientation? orientation, out SKCodecOrigin origin) + internal static SKBitmap Decode(string path, bool forceCleanBitmap, IFileSystem fileSystem, ImageOrientation? orientation, out SKEncodedOrigin origin) { if (!fileSystem.FileExists(path)) { @@ -275,32 +271,30 @@ namespace Emby.Drawing.Skia if (requiresTransparencyHack || forceCleanBitmap) { using (var stream = new SKFileStream(NormalizePath(path, fileSystem))) + using (var codec = SKCodec.Create(stream)) { - using (var codec = SKCodec.Create(stream)) + if (codec == null) { - if (codec == null) - { - origin = GetSKCodecOrigin(orientation); - return null; - } + origin = GetSKEncodedOrigin(orientation); + return null; + } - // create the bitmap - var bitmap = new SKBitmap(codec.Info.Width, codec.Info.Height, !requiresTransparencyHack); + // create the bitmap + var bitmap = new SKBitmap(codec.Info.Width, codec.Info.Height, !requiresTransparencyHack); - if (bitmap != null) - { - // decode - codec.GetPixels(bitmap.Info, bitmap.GetPixels()); - - origin = codec.Origin; - } - else - { - origin = GetSKCodecOrigin(orientation); - } + if (bitmap != null) + { + // decode + codec.GetPixels(bitmap.Info, bitmap.GetPixels()); - return bitmap; + origin = codec.EncodedOrigin; } + else + { + origin = GetSKEncodedOrigin(orientation); + } + + return bitmap; } } @@ -320,11 +314,11 @@ namespace Emby.Drawing.Skia } } - origin = SKCodecOrigin.TopLeft; + origin = SKEncodedOrigin.TopLeft; return resultBitmap; } - private SKBitmap GetBitmap(string path, bool cropWhitespace, bool forceAnalyzeBitmap, ImageOrientation? orientation, out SKCodecOrigin origin) + private SKBitmap GetBitmap(string path, bool cropWhitespace, bool forceAnalyzeBitmap, ImageOrientation? orientation, out SKEncodedOrigin origin) { if (cropWhitespace) { @@ -339,7 +333,7 @@ namespace Emby.Drawing.Skia private SKBitmap GetBitmap(string path, bool cropWhitespace, bool autoOrient, ImageOrientation? orientation) { - SKCodecOrigin origin; + SKEncodedOrigin origin; if (autoOrient) { @@ -347,7 +341,7 @@ namespace Emby.Drawing.Skia if (bitmap != null) { - if (origin != SKCodecOrigin.TopLeft) + if (origin != SKEncodedOrigin.TopLeft) { using (bitmap) { @@ -362,7 +356,7 @@ namespace Emby.Drawing.Skia return GetBitmap(path, cropWhitespace, false, orientation, out origin); } - private SKBitmap OrientImage(SKBitmap bitmap, SKCodecOrigin origin) + private SKBitmap OrientImage(SKBitmap bitmap, SKEncodedOrigin origin) { //var transformations = { // 2: { rotate: 0, flip: true}, @@ -377,7 +371,7 @@ namespace Emby.Drawing.Skia switch (origin) { - case SKCodecOrigin.TopRight: + case SKEncodedOrigin.TopRight: { var rotated = new SKBitmap(bitmap.Width, bitmap.Height); using (var surface = new SKCanvas(rotated)) @@ -390,7 +384,7 @@ namespace Emby.Drawing.Skia return rotated; } - case SKCodecOrigin.BottomRight: + case SKEncodedOrigin.BottomRight: { var rotated = new SKBitmap(bitmap.Width, bitmap.Height); using (var surface = new SKCanvas(rotated)) @@ -408,7 +402,7 @@ namespace Emby.Drawing.Skia return rotated; } - case SKCodecOrigin.BottomLeft: + case SKEncodedOrigin.BottomLeft: { var rotated = new SKBitmap(bitmap.Width, bitmap.Height); using (var surface = new SKCanvas(rotated)) @@ -429,7 +423,7 @@ namespace Emby.Drawing.Skia return rotated; } - case SKCodecOrigin.LeftTop: + case SKEncodedOrigin.LeftTop: { // TODO: Remove dual canvases, had trouble with flipping using (var rotated = new SKBitmap(bitmap.Height, bitmap.Width)) @@ -456,7 +450,7 @@ namespace Emby.Drawing.Skia } } - case SKCodecOrigin.RightTop: + case SKEncodedOrigin.RightTop: { var rotated = new SKBitmap(bitmap.Height, bitmap.Width); using (var surface = new SKCanvas(rotated)) @@ -469,7 +463,7 @@ namespace Emby.Drawing.Skia return rotated; } - case SKCodecOrigin.RightBottom: + case SKEncodedOrigin.RightBottom: { // TODO: Remove dual canvases, had trouble with flipping using (var rotated = new SKBitmap(bitmap.Height, bitmap.Width)) @@ -493,7 +487,7 @@ namespace Emby.Drawing.Skia } } - case SKCodecOrigin.LeftBottom: + case SKEncodedOrigin.LeftBottom: { var rotated = new SKBitmap(bitmap.Height, bitmap.Width); using (var surface = new SKCanvas(rotated)) @@ -569,56 +563,54 @@ namespace Emby.Drawing.Skia } } - // create bitmap to use for canvas drawing + // create bitmap to use for canvas drawing used to draw into bitmap using (var saveBitmap = new SKBitmap(width, height))//, bitmap.ColorType, bitmap.AlphaType)) + using (var canvas = new SKCanvas(saveBitmap)) { - // create canvas used to draw into bitmap - using (var canvas = new SKCanvas(saveBitmap)) + // set background color if present + if (hasBackgroundColor) { - // set background color if present - if (hasBackgroundColor) - { - canvas.Clear(SKColor.Parse(options.BackgroundColor)); - } + canvas.Clear(SKColor.Parse(options.BackgroundColor)); + } - // Add blur if option is present - if (blur > 0) - { - using (var paint = new SKPaint()) - { - // create image from resized bitmap to apply blur - using (var filter = SKImageFilter.CreateBlur(blur, blur)) - { - paint.ImageFilter = filter; - canvas.DrawBitmap(resizedBitmap, SKRect.Create(width, height), paint); - } - } - } - else + // Add blur if option is present + if (blur > 0) + { + // create image from resized bitmap to apply blur + using (var paint = new SKPaint()) + using (var filter = SKImageFilter.CreateBlur(blur, blur)) { - // draw resized bitmap onto canvas - canvas.DrawBitmap(resizedBitmap, SKRect.Create(width, height)); + paint.ImageFilter = filter; + canvas.DrawBitmap(resizedBitmap, SKRect.Create(width, height), paint); } + } + else + { + // draw resized bitmap onto canvas + canvas.DrawBitmap(resizedBitmap, SKRect.Create(width, height)); + } - // If foreground layer present then draw - if (hasForegroundColor) + // If foreground layer present then draw + if (hasForegroundColor) + { + Double opacity; + if (!Double.TryParse(options.ForegroundLayer, out opacity)) { - Double opacity; - if (!Double.TryParse(options.ForegroundLayer, out opacity)) opacity = .4; - - canvas.DrawColor(new SKColor(0, 0, 0, (Byte)((1 - opacity) * 0xFF)), SKBlendMode.SrcOver); + opacity = .4; } - if (hasIndicator) - { - DrawIndicator(canvas, width, height, options); - } + canvas.DrawColor(new SKColor(0, 0, 0, (Byte)((1 - opacity) * 0xFF)), SKBlendMode.SrcOver); + } - _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(outputPath)); - using (var outputStream = new SKFileWStream(outputPath)) - { - saveBitmap.Encode(outputStream, skiaOutputFormat, quality); - } + if (hasIndicator) + { + DrawIndicator(canvas, width, height, options); + } + + _fileSystem.CreateDirectory(_fileSystem.GetDirectoryName(outputPath)); + using (var outputStream = new SKFileWStream(outputPath)) + { + saveBitmap.Encode(outputStream, skiaOutputFormat, quality); } } } @@ -687,4 +679,4 @@ namespace Emby.Drawing.Skia get { return true; } } } -}
\ No newline at end of file +} diff --git a/Emby.Drawing.Skia/StripCollageBuilder.cs b/Emby.Drawing.Skia/StripCollageBuilder.cs index 85eeaa9f5..32f0b6585 100644 --- a/Emby.Drawing.Skia/StripCollageBuilder.cs +++ b/Emby.Drawing.Skia/StripCollageBuilder.cs @@ -99,56 +99,48 @@ namespace Emby.Drawing.Skia using (var resizeBitmap = new SKBitmap(iWidth, iHeight, currentBitmap.ColorType, currentBitmap.AlphaType)) { currentBitmap.Resize(resizeBitmap, SKBitmapResizeMethod.Lanczos3); - // determine how much to crop + // crop image int ix = (int)Math.Abs((iWidth - iSlice) / 2); using (var image = SKImage.FromBitmap(resizeBitmap)) + using (var subset = image.Subset(SKRectI.Create(ix, 0, iSlice, iHeight))) { - // crop image - using (var subset = image.Subset(SKRectI.Create(ix, 0, iSlice, iHeight))) - { - // draw image onto canvas - canvas.DrawImage(subset ?? image, (horizontalImagePadding * (i + 1)) + (iSlice * i), verticalSpacing); + // draw image onto canvas + canvas.DrawImage(subset ?? image, (horizontalImagePadding * (i + 1)) + (iSlice * i), verticalSpacing); - if (subset == null) - { - continue; - } + if (subset == null) + { + continue; + } + // create reflection of image below the drawn image + using (var croppedBitmap = SKBitmap.FromImage(subset)) + using (var reflectionBitmap = new SKBitmap(croppedBitmap.Width, croppedBitmap.Height / 2, croppedBitmap.ColorType, croppedBitmap.AlphaType)) + { + // resize to half height + croppedBitmap.Resize(reflectionBitmap, SKBitmapResizeMethod.Lanczos3); - using (var croppedBitmap = SKBitmap.FromImage(subset)) + using (var flippedBitmap = new SKBitmap(reflectionBitmap.Width, reflectionBitmap.Height, reflectionBitmap.ColorType, reflectionBitmap.AlphaType)) + using (var flippedCanvas = new SKCanvas(flippedBitmap)) { - // create reflection of image below the drawn image - using (var reflectionBitmap = new SKBitmap(croppedBitmap.Width, croppedBitmap.Height / 2, croppedBitmap.ColorType, croppedBitmap.AlphaType)) + // flip image vertically + var matrix = SKMatrix.MakeScale(1, -1); + matrix.SetScaleTranslate(1, -1, 0, flippedBitmap.Height); + flippedCanvas.SetMatrix(matrix); + flippedCanvas.DrawBitmap(reflectionBitmap, 0, 0); + flippedCanvas.ResetMatrix(); + + // create gradient to make image appear as a reflection + var remainingHeight = height - (iHeight + (2 * verticalSpacing)); + flippedCanvas.ClipRect(SKRect.Create(reflectionBitmap.Width, remainingHeight)); + using (var gradient = new SKPaint()) { - // resize to half height - croppedBitmap.Resize(reflectionBitmap, SKBitmapResizeMethod.Lanczos3); - - using (var flippedBitmap = new SKBitmap(reflectionBitmap.Width, reflectionBitmap.Height, reflectionBitmap.ColorType, reflectionBitmap.AlphaType)) - { - using (var flippedCanvas = new SKCanvas(flippedBitmap)) - { - // flip image vertically - var matrix = SKMatrix.MakeScale(1, -1); - matrix.SetScaleTranslate(1, -1, 0, flippedBitmap.Height); - flippedCanvas.SetMatrix(matrix); - flippedCanvas.DrawBitmap(reflectionBitmap, 0, 0); - flippedCanvas.ResetMatrix(); - - // create gradient to make image appear as a reflection - var remainingHeight = height - (iHeight + (2 * verticalSpacing)); - flippedCanvas.ClipRect(SKRect.Create(reflectionBitmap.Width, remainingHeight)); - using (var gradient = new SKPaint()) - { - gradient.IsAntialias = true; - gradient.BlendMode = SKBlendMode.SrcOver; - gradient.Shader = SKShader.CreateLinearGradient(new SKPoint(0, 0), new SKPoint(0, remainingHeight), new[] { new SKColor(0, 0, 0, 128), new SKColor(0, 0, 0, 208), new SKColor(0, 0, 0, 240), new SKColor(0, 0, 0, 255) }, null, SKShaderTileMode.Clamp); - flippedCanvas.DrawPaint(gradient); - } - - // finally draw reflection onto canvas - canvas.DrawBitmap(flippedBitmap, (horizontalImagePadding * (i + 1)) + (iSlice * i), iHeight + (2 * verticalSpacing)); - } - } + gradient.IsAntialias = true; + gradient.BlendMode = SKBlendMode.SrcOver; + gradient.Shader = SKShader.CreateLinearGradient(new SKPoint(0, 0), new SKPoint(0, remainingHeight), new[] { new SKColor(0, 0, 0, 128), new SKColor(0, 0, 0, 208), new SKColor(0, 0, 0, 240), new SKColor(0, 0, 0, 255) }, null, SKShaderTileMode.Clamp); + flippedCanvas.DrawPaint(gradient); } + + // finally draw reflection onto canvas + canvas.DrawBitmap(flippedBitmap, (horizontalImagePadding * (i + 1)) + (iSlice * i), iHeight + (2 * verticalSpacing)); } } } @@ -172,7 +164,7 @@ namespace Emby.Drawing.Skia currentIndex = 0; } - SKCodecOrigin origin; + SKEncodedOrigin origin; bitmap = SkiaEncoder.Decode(paths[currentIndex], false, _fileSystem, null, out origin); imagesTested[currentIndex] = 0; @@ -202,7 +194,6 @@ namespace Emby.Drawing.Skia { for (var y = 0; y < 2; y++) { - SKCodecOrigin origin; int newIndex; using (var currentBitmap = GetNextValidImage(paths, imageIndex, out newIndex)) @@ -232,4 +223,4 @@ namespace Emby.Drawing.Skia return bitmap; } } -}
\ No newline at end of file +} diff --git a/Emby.IsoMounting/README.md b/Emby.IsoMounting/README.md index 90cdc01ba..78bab9936 100644 --- a/Emby.IsoMounting/README.md +++ b/Emby.IsoMounting/README.md @@ -1,8 +1,8 @@ -#MediaBrowser.IsoMounting.Linux +# MediaBrowser.IsoMounting.Linux This implements two core interfaces, IIsoManager, and IIsoMount. -###IIsoManager +### IIsoManager The manager class can be used to create a mount, and also determine if the mounter is capable of mounting a given file. -###IIsoMount +### IIsoMount IIsoMount then represents a mount instance, which will be unmounted on disposal. *** This Linux version use sudo, mount and umount. diff --git a/MediaBrowser.Server.Mono/ApplicationPathHelper.cs b/MediaBrowser.Server.Mono/ApplicationPathHelper.cs deleted file mode 100644 index ac55693fa..000000000 --- a/MediaBrowser.Server.Mono/ApplicationPathHelper.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.Configuration; -using System.IO; -using System.Runtime.InteropServices; - -namespace MediaBrowser.Server.Mono -{ - public static class ApplicationPathHelper - { - /// <summary> - /// Gets the path to the application's ProgramDataFolder - /// </summary> - /// <returns>System.String.</returns> - public static string GetProgramDataPath(string applicationPath) - { - var useDebugPath = false; - -#if DEBUG - useDebugPath = true; -#endif - - var programDataPath = useDebugPath ? - ConfigurationManager.AppSettings["DebugProgramDataPath"] : - ConfigurationManager.AppSettings["ReleaseProgramDataPath"]; - - if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) - { - programDataPath = programDataPath.Replace("%ApplicationData%", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)); - } - else - { - programDataPath = programDataPath.Replace("%ApplicationData%", "/var/lib"); - } - - - programDataPath = programDataPath - .Replace('/', Path.DirectorySeparatorChar) - .Replace('\\', Path.DirectorySeparatorChar); - - // If it's a relative path, e.g. "..\" - if (!Path.IsPathRooted(programDataPath)) - { - var path = Path.GetDirectoryName(applicationPath); - - if (string.IsNullOrEmpty(path)) - { - throw new ApplicationException("Unable to determine running assembly location"); - } - - programDataPath = Path.Combine(path, programDataPath); - - programDataPath = Path.GetFullPath(programDataPath); - } - - Directory.CreateDirectory(programDataPath); - - return programDataPath; - } - } -} diff --git a/MediaBrowser.Server.Mono/EmbyServer.csproj b/MediaBrowser.Server.Mono/EmbyServer.csproj index cafee872b..480b422bc 100644 --- a/MediaBrowser.Server.Mono/EmbyServer.csproj +++ b/MediaBrowser.Server.Mono/EmbyServer.csproj @@ -22,7 +22,6 @@ <PackageReference Include="SQLitePCLRaw.bundle_e_sqlite3" Version="1.1.11" /> <PackageReference Include="SQLitePCLRaw.core" Version="1.1.11" /> <PackageReference Include="SQLitePCLRaw.provider.sqlite3.netstandard11" Version="1.1.11" /> - <PackageReference Include="System.Configuration.ConfigurationManager" Version="4.5.0" /> </ItemGroup> <ItemGroup> diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs index 3bcfff983..887a9545f 100644 --- a/MediaBrowser.Server.Mono/Program.cs +++ b/MediaBrowser.Server.Mono/Program.cs @@ -24,6 +24,7 @@ using Mono.Unix.Native; using ILogger = MediaBrowser.Model.Logging.ILogger; using X509Certificate = System.Security.Cryptography.X509Certificates.X509Certificate; using System.Threading; +using InteropServices = System.Runtime.InteropServices; namespace MediaBrowser.Server.Mono { @@ -87,12 +88,25 @@ namespace MediaBrowser.Server.Mono { if (string.IsNullOrEmpty(programDataPath)) { - programDataPath = ApplicationPathHelper.GetProgramDataPath(applicationPath); + if (InteropServices.RuntimeInformation.IsOSPlatform(InteropServices.OSPlatform.Windows)) + { + programDataPath = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData); + } + else + { + // $XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. + programDataPath = Environment.GetEnvironmentVariable("XDG_DATA_HOME"); + // If $XDG_DATA_HOME is either not set or empty, $HOME/.local/share should be used. + if (string.IsNullOrEmpty(programDataPath)){ + programDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".local", "share"); + } + } + programDataPath = Path.Combine(programDataPath, "jellyfin"); } var appFolderPath = Path.GetDirectoryName(applicationPath); - return new ServerApplicationPaths(programDataPath, appFolderPath, Path.GetDirectoryName(applicationPath)); + return new ServerApplicationPaths(programDataPath, appFolderPath, appFolderPath); } private static void RunApplication(ServerApplicationPaths appPaths, ILogManager logManager, StartupOptions options) diff --git a/MediaBrowser.Server.Mono/app.config b/MediaBrowser.Server.Mono/app.config deleted file mode 100644 index a93871625..000000000 --- a/MediaBrowser.Server.Mono/app.config +++ /dev/null @@ -1,7 +0,0 @@ -<?xml version="1.0" encoding="utf-8" ?> -<configuration> - <appSettings> - <add key="DebugProgramDataPath" value="%ApplicationData%/jellyfin-debug/" /> - <add key="ReleaseProgramDataPath" value="%ApplicationData%/jellyfin/" /> - </appSettings> -</configuration>
\ No newline at end of file diff --git a/RSSDP/SsdpRootDevice.cs b/RSSDP/SsdpRootDevice.cs index 6d0fcafbb..eaf3f6a38 100644 --- a/RSSDP/SsdpRootDevice.cs +++ b/RSSDP/SsdpRootDevice.cs @@ -76,4 +76,4 @@ namespace Rssdp #endregion } -}
\ No newline at end of file +} diff --git a/debian/changelog b/debian/changelog index e41c6b8e6..3abd5c9b4 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +jellyfin (3.5.2-2) unstable; urgency=medium + + * Major code updates related to rebranding and cleanup + + -- Joshua Boniface <joshua@boniface.me> Fri, 14 Dec 2018 00:07:46 -0500 + jellyfin (3.5.2-1) unstable; urgency=medium * Add ffmpeg dependency and cleanup work diff --git a/debian/postinst b/debian/postinst index 222f616b2..ad7363db4 100644 --- a/debian/postinst +++ b/debian/postinst @@ -37,9 +37,6 @@ case "$1" in chmod +x ${JELLYFIN_DIR}/restart.sh > /dev/null 2>&1 || true - # Link hardcoded /var/lib/emby to /var/lib/jellyfin (TEMPORARY) - ln -sf /var/lib/jellyfin /var/lib/emby - ;; abort-upgrade|abort-remove|abort-deconfigure) ;; |
