< Summary - Jellyfin

Information
Class: MediaBrowser.Controller.Entities.LinkedChildComparer
Assembly: MediaBrowser.Controller
File(s): /srv/git/jellyfin/MediaBrowser.Controller/Entities/LinkedChildComparer.cs
Line coverage
33%
Covered lines: 2
Uncovered lines: 4
Coverable lines: 6
Total lines: 35
Line coverage: 33.3%
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

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Equals(...)0%620%
GetHashCode(...)0%2040%

File(s)

/srv/git/jellyfin/MediaBrowser.Controller/Entities/LinkedChildComparer.cs

#LineLine coverage
 1#nullable disable
 2
 3#pragma warning disable CS1591
 4
 5using System;
 6using System.Collections.Generic;
 7using MediaBrowser.Model.IO;
 8
 9namespace MediaBrowser.Controller.Entities
 10{
 11    public class LinkedChildComparer : IEqualityComparer<LinkedChild>
 12    {
 13        private readonly IFileSystem _fileSystem;
 14
 15        public LinkedChildComparer(IFileSystem fileSystem)
 16        {
 2517            _fileSystem = fileSystem;
 2518        }
 19
 20        public bool Equals(LinkedChild x, LinkedChild y)
 21        {
 022            if (x.Type == y.Type)
 23            {
 024                return _fileSystem.AreEqual(x.Path, y.Path);
 25            }
 26
 027            return false;
 28        }
 29
 30        public int GetHashCode(LinkedChild obj)
 31        {
 032            return ((obj.Path ?? string.Empty) + (obj.LibraryItemId ?? string.Empty) + obj.Type).GetHashCode(StringCompa
 33        }
 34    }
 35}