From 6d8062116cc89a66a66352a8ed44cfad2f3a00ba Mon Sep 17 00:00:00 2001 From: Patrick Barron Date: Tue, 6 Feb 2024 10:15:29 -0500 Subject: Remove some unused model code --- MediaBrowser.Model/Net/SocketReceiveResult.cs | 32 --------------------------- 1 file changed, 32 deletions(-) delete mode 100644 MediaBrowser.Model/Net/SocketReceiveResult.cs (limited to 'MediaBrowser.Model/Net') diff --git a/MediaBrowser.Model/Net/SocketReceiveResult.cs b/MediaBrowser.Model/Net/SocketReceiveResult.cs deleted file mode 100644 index 1524786ea..000000000 --- a/MediaBrowser.Model/Net/SocketReceiveResult.cs +++ /dev/null @@ -1,32 +0,0 @@ -#nullable disable - -using System.Net; - -namespace MediaBrowser.Model.Net -{ - /// - /// Used by the sockets wrapper to hold raw data received from a UDP socket. - /// - public sealed class SocketReceiveResult - { - /// - /// Gets or sets the buffer to place received data into. - /// - public byte[] Buffer { get; set; } - - /// - /// Gets or sets the number of bytes received. - /// - public int ReceivedBytes { get; set; } - - /// - /// Gets or sets the the data was received from. - /// - public IPEndPoint RemoteEndPoint { get; set; } - - /// - /// Gets or sets the local . - /// - public IPAddress LocalIPAddress { get; set; } - } -} -- cgit v1.2.3 From aaa9345a533d6e8c3fa10b12672de4766ef12070 Mon Sep 17 00:00:00 2001 From: felix920506 Date: Sat, 10 Feb 2024 23:39:30 -0500 Subject: Correct m4b mimetype (#10980) --- CONTRIBUTORS.md | 1 + MediaBrowser.Model/Net/MimeTypes.cs | 2 +- tests/Jellyfin.Model.Tests/Net/MimeTypesTests.cs | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'MediaBrowser.Model/Net') diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 3be6331c8..a8ee693ec 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -179,6 +179,7 @@ - [Çağrı Sakaoğlu](https://github.com/ilovepilav) _ [Barasingha](https://github.com/MaVdbussche) - [Gauvino](https://github.com/Gauvino) + - [felix920506](https://github.com/felix920506) # Emby Contributors diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs index 5a1871070..7b510a337 100644 --- a/MediaBrowser.Model/Net/MimeTypes.cs +++ b/MediaBrowser.Model/Net/MimeTypes.cs @@ -87,7 +87,7 @@ namespace MediaBrowser.Model.Net { ".dsf", "audio/dsf" }, { ".dsp", "audio/dsp" }, { ".flac", "audio/flac" }, - { ".m4b", "audio/m4b" }, + { ".m4b", "audio/mp4" }, { ".mp3", "audio/mpeg" }, { ".vorbis", "audio/vorbis" }, { ".webma", "audio/webm" }, diff --git a/tests/Jellyfin.Model.Tests/Net/MimeTypesTests.cs b/tests/Jellyfin.Model.Tests/Net/MimeTypesTests.cs index 371c3811a..ccdf01758 100644 --- a/tests/Jellyfin.Model.Tests/Net/MimeTypesTests.cs +++ b/tests/Jellyfin.Model.Tests/Net/MimeTypesTests.cs @@ -69,7 +69,7 @@ namespace Jellyfin.Model.Tests.Net [InlineData(".dsp", "audio/dsp")] [InlineData(".flac", "audio/flac")] [InlineData(".m4a", "audio/mp4")] - [InlineData(".m4b", "audio/m4b")] + [InlineData(".m4b", "audio/mp4")] [InlineData(".mid", "audio/midi")] [InlineData(".midi", "audio/midi")] [InlineData(".mp3", "audio/mpeg")] -- cgit v1.2.3 From 2bd85df383ec70251a8cdf9802963e29b52b60a4 Mon Sep 17 00:00:00 2001 From: Robert Lützner Date: Thu, 15 Feb 2024 22:15:14 +0000 Subject: Add missing MIME types for comicbook formats (#11010) * Correct MIME types for comicbook file extensions cb7, cba, cbr, cbt and cbz all refer to different types of digital comicbooks. The last letter of the extension indicates the compression algorithm that was used: 7zip, arc, rar, tar or zip. All these filetypes used to have the `application/x-cbr` MIME type assigned to them. However, that has since been deprecated and was replaced with - `application/vnd.comicbook-rar` for rar compressed files and - `application/vnd.comicbook+zip` for rar compressed files. Only these two are officially listed by IANA https://www.iana.org/assignments/media-types/application/vnd.comicbook+zip . cbr and cbz are by far the most common file extensions for comicbooks. There's no official MIME type for cb7, cba or cbt files. However, with rar being a proprietary compression algorithm, FOSS applications will often refuse to handle files that identify themselves as `application/x-cbr`, so I decided to assign extension specific MIME types to them. I've seen these being used by other applications, specifically comic book readers. I've read through the docs on iana.org, but haven't figured out why they chose `-rar`, but `+zip`. * Add conversions from MIME type to file extensions for comicbook formats cb7, cba, cbr, cbt and cbz all refer to different types of digital comicbooks. The last letter of the extension indicates the compression algorithm that was used: 7zip, arc, rar, tar or zip. All these filetypes used to have the `application/x-cbr` MIME type assigned to them. However, that has since been deprecated and was replaced with - `application/vnd.comicbook-rar` for rar compressed files and - `application/vnd.comicbook+zip` for rar compressed files. Only these two are officially listed by IANA https://www.iana.org/assignments/media-types/application/vnd.comicbook+zip . cbr and cbz are by far the most common file extensions for comicbooks. There's no official MIME type for cb7, cba or cbt files. However, with rar being a proprietary compression algorithm, FOSS applications will often refuse to handle files that identify themselves as `application/x-cbr`, so I decided to assign extension specific MIME types to them. I've seen these being used by other applications, specifically comic book readers. * Update CONTRIBUTORS.md --- CONTRIBUTORS.md | 1 + MediaBrowser.Model/Net/MimeTypes.cs | 11 +++++++++++ tests/Jellyfin.Model.Tests/Net/MimeTypesTests.cs | 11 +++++++++++ 3 files changed, 23 insertions(+) (limited to 'MediaBrowser.Model/Net') diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a8ee693ec..55642e4e2 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -251,3 +251,4 @@ - [Utku Özdemir](https://github.com/utkuozdemir) - [JPUC1143](https://github.com/Jpuc1143/) - [0x25CBFC4F](https://github.com/0x25CBFC4F) + - [Robert Lützner](https://github.com/rluetzner) diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs index 7b510a337..90035f18f 100644 --- a/MediaBrowser.Model/Net/MimeTypes.cs +++ b/MediaBrowser.Model/Net/MimeTypes.cs @@ -66,6 +66,11 @@ namespace MediaBrowser.Model.Net { // Type application { ".azw3", "application/vnd.amazon.ebook" }, + { ".cb7", "application/x-cb7" }, + { ".cba", "application/x-cba" }, + { ".cbr", "application/vnd.comicbook-rar" }, + { ".cbt", "application/x-cbt" }, + { ".cbz", "application/vnd.comicbook+zip" }, // Type image { ".tbn", "image/jpeg" }, @@ -98,6 +103,12 @@ namespace MediaBrowser.Model.Net private static readonly Dictionary _extensionLookup = new Dictionary(StringComparer.OrdinalIgnoreCase) { // Type application + { "application/vnd.comicbook-rar", ".cbr" }, + { "application/vnd.comicbook+zip", ".cbz" }, + { "application/x-cb7", ".cb7" }, + { "application/x-cba", ".cba" }, + { "application/x-cbr", ".cbr" }, + { "application/x-cbt", ".cbt" }, { "application/x-cbz", ".cbz" }, { "application/x-javascript", ".js" }, { "application/xml", ".xml" }, diff --git a/tests/Jellyfin.Model.Tests/Net/MimeTypesTests.cs b/tests/Jellyfin.Model.Tests/Net/MimeTypesTests.cs index ccdf01758..a18a85ec0 100644 --- a/tests/Jellyfin.Model.Tests/Net/MimeTypesTests.cs +++ b/tests/Jellyfin.Model.Tests/Net/MimeTypesTests.cs @@ -6,6 +6,11 @@ namespace Jellyfin.Model.Tests.Net public class MimeTypesTests { [Theory] + [InlineData(".cb7", "application/x-cb7")] + [InlineData(".cba", "application/x-cba")] + [InlineData(".cbr", "application/vnd.comicbook-rar")] + [InlineData(".cbt", "application/x-cbt")] + [InlineData(".cbz", "application/vnd.comicbook+zip")] [InlineData(".dll", "application/octet-stream")] [InlineData(".log", "text/plain")] [InlineData(".srt", "application/x-subrip")] @@ -94,10 +99,16 @@ namespace Jellyfin.Model.Tests.Net [InlineData("application/pdf", ".pdf")] [InlineData("application/ttml+xml", ".ttml")] [InlineData("application/vnd.amazon.ebook", ".azw")] + [InlineData("application/vnd.comicbook-rar", ".cbr")] + [InlineData("application/vnd.comicbook+zip", ".cbz")] [InlineData("application/vnd.ms-fontobject", ".eot")] [InlineData("application/vnd.rar", ".rar")] [InlineData("application/wasm", ".wasm")] [InlineData("application/x-7z-compressed", ".7z")] + [InlineData("application/x-cb7", ".cb7")] + [InlineData("application/x-cba", ".cba")] + [InlineData("application/x-cbr", ".cbr")] + [InlineData("application/x-cbt", ".cbt")] [InlineData("application/x-cbz", ".cbz")] [InlineData("application/x-javascript", ".js")] [InlineData("application/x-mobipocket-ebook", ".mobi")] -- cgit v1.2.3