< Summary - Jellyfin

Information
Class: Jellyfin.Server.Implementations.ModelConfiguration.DeviceConfiguration
Assembly: Jellyfin.Server.Implementations
File(s): /srv/git/jellyfin/Jellyfin.Server.Implementations/ModelConfiguration/DeviceConfiguration.cs
Line coverage
100%
Covered lines: 9
Uncovered lines: 0
Coverable lines: 9
Total lines: 28
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
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
Configure(...)100%11100%

File(s)

/srv/git/jellyfin/Jellyfin.Server.Implementations/ModelConfiguration/DeviceConfiguration.cs

#LineLine coverage
 1using Jellyfin.Data.Entities.Security;
 2using Microsoft.EntityFrameworkCore;
 3using Microsoft.EntityFrameworkCore.Metadata.Builders;
 4
 5namespace Jellyfin.Server.Implementations.ModelConfiguration
 6{
 7    /// <summary>
 8    /// FluentAPI configuration for the Device entity.
 9    /// </summary>
 10    public class DeviceConfiguration : IEntityTypeConfiguration<Device>
 11    {
 12        /// <inheritdoc/>
 13        public void Configure(EntityTypeBuilder<Device> builder)
 14        {
 115            builder
 116                .HasIndex(entity => new { entity.DeviceId, entity.DateLastActivity });
 17
 118            builder
 119                .HasIndex(entity => new { entity.AccessToken, entity.DateLastActivity });
 20
 121            builder
 122                .HasIndex(entity => new { entity.UserId, entity.DeviceId });
 23
 124            builder
 125                .HasIndex(entity => entity.DeviceId);
 126        }
 27    }
 28}