< 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
88%
Covered lines: 8
Uncovered lines: 1
Coverable lines: 9
Total lines: 34
Line coverage: 88.8%
Branch coverage
50%
Covered branches: 3
Total branches: 6
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 5/16/2026 - 12:15:55 AM Line coverage: 0% (0/9) Branch coverage: 0% (0/6) Total lines: 3510/29/2026 - 12:17:11 AM Line coverage: 88.8% (8/9) Branch coverage: 50% (3/6) Total lines: 34 5/16/2026 - 12:15:55 AM Line coverage: 0% (0/9) Branch coverage: 0% (0/6) Total lines: 3510/29/2026 - 12:17:11 AM Line coverage: 88.8% (8/9) Branch coverage: 50% (3/6) Total lines: 34

Coverage delta

Coverage delta 89 -89

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
ReadContentFilePath(...)50%6688.88%

File(s)

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

#LineLine coverage
 1using System.IO.Compression;
 2using System.Linq;
 3using System.Xml.Linq;
 4
 5namespace MediaBrowser.Providers.Books.OpenPackagingFormat
 6{
 7    /// <summary>
 8    /// Utilities for EPUB files.
 9    /// </summary>
 10    public static class EpubUtils
 11    {
 12        /// <summary>
 13        /// Attempt to read content from ZIP archive.
 14        /// </summary>
 15        /// <param name="epub">The ZIP archive.</param>
 16        /// <returns>The content file path.</returns>
 17        public static string? ReadContentFilePath(ZipArchive epub)
 18        {
 119            var container = epub.GetEntry("META-INF/container.xml");
 120            if (container == null)
 21            {
 022                return null;
 23            }
 24
 125            using var containerStream = container.Open();
 26
 127            XNamespace containerNamespace = "urn:oasis:names:tc:opendocument:xmlns:container";
 128            var containerDocument = XDocument.Load(containerStream);
 129            var element = containerDocument.Descendants(containerNamespace + "rootfile").FirstOrDefault();
 30
 131            return element?.Attribute("full-path")?.Value;
 132        }
 33    }
 34}