< Summary - Jellyfin

Information
Class: MediaBrowser.Providers.Books.OpenPackagingFormat.EpubUtils
Assembly: MediaBrowser.Providers
File(s): /srv/git/jellyfin/MediaBrowser.Providers/Books/OpenPackagingFormat/EpubUtils.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 9
Coverable lines: 9
Total lines: 35
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 6
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 1/29/2026 - 12:13:32 AM Line coverage: 0% (0/9) Branch coverage: 0% (0/6) Total lines: 35 1/29/2026 - 12:13:32 AM Line coverage: 0% (0/9) Branch coverage: 0% (0/6) Total lines: 35

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ReadContentFilePath(...)0%4260%

File(s)

/srv/git/jellyfin/MediaBrowser.Providers/Books/OpenPackagingFormat/EpubUtils.cs

#LineLine coverage
 1using System.IO;
 2using System.IO.Compression;
 3using System.Linq;
 4using System.Xml.Linq;
 5
 6namespace MediaBrowser.Providers.Books.OpenPackagingFormat
 7{
 8    /// <summary>
 9    /// Utilities for EPUB files.
 10    /// </summary>
 11    public static class EpubUtils
 12    {
 13        /// <summary>
 14        /// Attempt to read content from ZIP archive.
 15        /// </summary>
 16        /// <param name="epub">The ZIP archive.</param>
 17        /// <returns>The content file path.</returns>
 18        public static string? ReadContentFilePath(ZipArchive epub)
 19        {
 020            var container = epub.GetEntry(Path.Combine("META-INF", "container.xml"));
 021            if (container == null)
 22            {
 023                return null;
 24            }
 25
 026            using var containerStream = container.Open();
 27
 028            XNamespace containerNamespace = "urn:oasis:names:tc:opendocument:xmlns:container";
 029            var containerDocument = XDocument.Load(containerStream);
 030            var element = containerDocument.Descendants(containerNamespace + "rootfile").FirstOrDefault();
 31
 032            return element?.Attribute("full-path")?.Value;
 033        }
 34    }
 35}