< Summary - Jellyfin

Line coverage
96%
Covered lines: 432
Uncovered lines: 16
Coverable lines: 448
Total lines: 509
Line coverage: 96.4%
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 5/12/2026 - 12:15:57 AM Line coverage: 96.4% (432/448) Total lines: 509

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
File 1: Up(...)100%11100%
File 1: Down(...)100%210%
File 2: BuildTargetModel(...)100%11100%

File(s)

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20200613202153_AddUsers.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2#pragma warning disable SA1601
 3
 4using System;
 5using Microsoft.EntityFrameworkCore.Migrations;
 6
 7namespace Jellyfin.Server.Implementations.Migrations
 8{
 9    public partial class AddUsers : Migration
 10    {
 11        protected override void Up(MigrationBuilder migrationBuilder)
 12        {
 2713            migrationBuilder.CreateTable(
 2714                name: "Users",
 2715                schema: "jellyfin",
 2716                columns: table => new
 2717                {
 2718                    Id = table.Column<Guid>(nullable: false),
 2719                    Username = table.Column<string>(maxLength: 255, nullable: false),
 2720                    Password = table.Column<string>(maxLength: 65535, nullable: true),
 2721                    EasyPassword = table.Column<string>(maxLength: 65535, nullable: true),
 2722                    MustUpdatePassword = table.Column<bool>(nullable: false),
 2723                    AudioLanguagePreference = table.Column<string>(maxLength: 255, nullable: true),
 2724                    AuthenticationProviderId = table.Column<string>(maxLength: 255, nullable: false),
 2725                    PasswordResetProviderId = table.Column<string>(maxLength: 255, nullable: false),
 2726                    InvalidLoginAttemptCount = table.Column<int>(nullable: false),
 2727                    LastActivityDate = table.Column<DateTime>(nullable: true),
 2728                    LastLoginDate = table.Column<DateTime>(nullable: true),
 2729                    LoginAttemptsBeforeLockout = table.Column<int>(nullable: true),
 2730                    SubtitleMode = table.Column<int>(nullable: false),
 2731                    PlayDefaultAudioTrack = table.Column<bool>(nullable: false),
 2732                    SubtitleLanguagePreference = table.Column<string>(maxLength: 255, nullable: true),
 2733                    DisplayMissingEpisodes = table.Column<bool>(nullable: false),
 2734                    DisplayCollectionsView = table.Column<bool>(nullable: false),
 2735                    EnableLocalPassword = table.Column<bool>(nullable: false),
 2736                    HidePlayedInLatest = table.Column<bool>(nullable: false),
 2737                    RememberAudioSelections = table.Column<bool>(nullable: false),
 2738                    RememberSubtitleSelections = table.Column<bool>(nullable: false),
 2739                    EnableNextEpisodeAutoPlay = table.Column<bool>(nullable: false),
 2740                    EnableAutoLogin = table.Column<bool>(nullable: false),
 2741                    EnableUserPreferenceAccess = table.Column<bool>(nullable: false),
 2742                    MaxParentalAgeRating = table.Column<int>(nullable: true),
 2743                    RemoteClientBitrateLimit = table.Column<int>(nullable: true),
 2744                    InternalId = table.Column<long>(nullable: false),
 2745                    SyncPlayAccess = table.Column<int>(nullable: false),
 2746                    RowVersion = table.Column<uint>(nullable: false)
 2747                },
 2748                constraints: table =>
 2749                {
 2750                    table.PrimaryKey("PK_Users", x => x.Id);
 2751                });
 52
 2753            migrationBuilder.CreateTable(
 2754                name: "AccessSchedules",
 2755                schema: "jellyfin",
 2756                columns: table => new
 2757                {
 2758                    Id = table.Column<int>(nullable: false)
 2759                        .Annotation("Sqlite:Autoincrement", true),
 2760                    UserId = table.Column<Guid>(nullable: false),
 2761                    DayOfWeek = table.Column<int>(nullable: false),
 2762                    StartHour = table.Column<double>(nullable: false),
 2763                    EndHour = table.Column<double>(nullable: false)
 2764                },
 2765                constraints: table =>
 2766                {
 2767                    table.PrimaryKey("PK_AccessSchedules", x => x.Id);
 2768                    table.ForeignKey(
 2769                        name: "FK_AccessSchedules_Users_UserId",
 2770                        column: x => x.UserId,
 2771                        principalSchema: "jellyfin",
 2772                        principalTable: "Users",
 2773                        principalColumn: "Id",
 2774                        onDelete: ReferentialAction.Cascade);
 2775                });
 76
 2777            migrationBuilder.CreateTable(
 2778                name: "ImageInfos",
 2779                schema: "jellyfin",
 2780                columns: table => new
 2781                {
 2782                    Id = table.Column<int>(nullable: false)
 2783                        .Annotation("Sqlite:Autoincrement", true),
 2784                    UserId = table.Column<Guid>(nullable: true),
 2785                    Path = table.Column<string>(maxLength: 512, nullable: false),
 2786                    LastModified = table.Column<DateTime>(nullable: false)
 2787                },
 2788                constraints: table =>
 2789                {
 2790                    table.PrimaryKey("PK_ImageInfos", x => x.Id);
 2791                    table.ForeignKey(
 2792                        name: "FK_ImageInfos_Users_UserId",
 2793                        column: x => x.UserId,
 2794                        principalSchema: "jellyfin",
 2795                        principalTable: "Users",
 2796                        principalColumn: "Id",
 2797                        onDelete: ReferentialAction.Restrict);
 2798                });
 99
 27100            migrationBuilder.CreateTable(
 27101                name: "Permissions",
 27102                schema: "jellyfin",
 27103                columns: table => new
 27104                {
 27105                    Id = table.Column<int>(nullable: false)
 27106                        .Annotation("Sqlite:Autoincrement", true),
 27107                    Kind = table.Column<int>(nullable: false),
 27108                    Value = table.Column<bool>(nullable: false),
 27109                    RowVersion = table.Column<uint>(nullable: false),
 27110                    Permission_Permissions_Guid = table.Column<Guid>(nullable: true)
 27111                },
 27112                constraints: table =>
 27113                {
 27114                    table.PrimaryKey("PK_Permissions", x => x.Id);
 27115                    table.ForeignKey(
 27116                        name: "FK_Permissions_Users_Permission_Permissions_Guid",
 27117                        column: x => x.Permission_Permissions_Guid,
 27118                        principalSchema: "jellyfin",
 27119                        principalTable: "Users",
 27120                        principalColumn: "Id",
 27121                        onDelete: ReferentialAction.Restrict);
 27122                });
 123
 27124            migrationBuilder.CreateTable(
 27125                name: "Preferences",
 27126                schema: "jellyfin",
 27127                columns: table => new
 27128                {
 27129                    Id = table.Column<int>(nullable: false)
 27130                        .Annotation("Sqlite:Autoincrement", true),
 27131                    Kind = table.Column<int>(nullable: false),
 27132                    Value = table.Column<string>(maxLength: 65535, nullable: false),
 27133                    RowVersion = table.Column<uint>(nullable: false),
 27134                    Preference_Preferences_Guid = table.Column<Guid>(nullable: true)
 27135                },
 27136                constraints: table =>
 27137                {
 27138                    table.PrimaryKey("PK_Preferences", x => x.Id);
 27139                    table.ForeignKey(
 27140                        name: "FK_Preferences_Users_Preference_Preferences_Guid",
 27141                        column: x => x.Preference_Preferences_Guid,
 27142                        principalSchema: "jellyfin",
 27143                        principalTable: "Users",
 27144                        principalColumn: "Id",
 27145                        onDelete: ReferentialAction.Restrict);
 27146                });
 147
 27148            migrationBuilder.CreateIndex(
 27149                name: "IX_AccessSchedules_UserId",
 27150                schema: "jellyfin",
 27151                table: "AccessSchedules",
 27152                column: "UserId");
 153
 27154            migrationBuilder.CreateIndex(
 27155                name: "IX_ImageInfos_UserId",
 27156                schema: "jellyfin",
 27157                table: "ImageInfos",
 27158                column: "UserId",
 27159                unique: true);
 160
 27161            migrationBuilder.CreateIndex(
 27162                name: "IX_Permissions_Permission_Permissions_Guid",
 27163                schema: "jellyfin",
 27164                table: "Permissions",
 27165                column: "Permission_Permissions_Guid");
 166
 27167            migrationBuilder.CreateIndex(
 27168                name: "IX_Preferences_Preference_Preferences_Guid",
 27169                schema: "jellyfin",
 27170                table: "Preferences",
 27171                column: "Preference_Preferences_Guid");
 27172        }
 173
 174        protected override void Down(MigrationBuilder migrationBuilder)
 175        {
 0176            migrationBuilder.DropTable(
 0177                name: "AccessSchedules",
 0178                schema: "jellyfin");
 179
 0180            migrationBuilder.DropTable(
 0181                name: "ImageInfos",
 0182                schema: "jellyfin");
 183
 0184            migrationBuilder.DropTable(
 0185                name: "Permissions",
 0186                schema: "jellyfin");
 187
 0188            migrationBuilder.DropTable(
 0189                name: "Preferences",
 0190                schema: "jellyfin");
 191
 0192            migrationBuilder.DropTable(
 0193                name: "Users",
 0194                schema: "jellyfin");
 0195        }
 196    }
 197}

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20200613202153_AddUsers.Designer.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2
 3// <auto-generated />
 4using System;
 5using Jellyfin.Database.Implementations;
 6using Microsoft.EntityFrameworkCore;
 7using Microsoft.EntityFrameworkCore.Infrastructure;
 8using Microsoft.EntityFrameworkCore.Migrations;
 9using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 10
 11namespace Jellyfin.Server.Implementations.Migrations
 12{
 13    [DbContext(typeof(JellyfinDbContext))]
 14    [Migration("20200613202153_AddUsers")]
 15    partial class AddUsers
 16    {
 17        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 18        {
 19#pragma warning disable 612, 618
 2720            modelBuilder
 2721                .HasDefaultSchema("jellyfin")
 2722                .HasAnnotation("ProductVersion", "3.1.4");
 23
 2724            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 2725                {
 2726                    b.Property<int>("Id")
 2727                        .ValueGeneratedOnAdd()
 2728                        .HasColumnType("INTEGER");
 2729
 2730                    b.Property<int>("DayOfWeek")
 2731                        .HasColumnType("INTEGER");
 2732
 2733                    b.Property<double>("EndHour")
 2734                        .HasColumnType("REAL");
 2735
 2736                    b.Property<double>("StartHour")
 2737                        .HasColumnType("REAL");
 2738
 2739                    b.Property<Guid>("UserId")
 2740                        .HasColumnType("TEXT");
 2741
 2742                    b.HasKey("Id");
 2743
 2744                    b.HasIndex("UserId");
 2745
 2746                    b.ToTable("AccessSchedules");
 2747                });
 48
 2749            modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b =>
 2750                {
 2751                    b.Property<int>("Id")
 2752                        .ValueGeneratedOnAdd()
 2753                        .HasColumnType("INTEGER");
 2754
 2755                    b.Property<DateTime>("DateCreated")
 2756                        .HasColumnType("TEXT");
 2757
 2758                    b.Property<string>("ItemId")
 2759                        .HasColumnType("TEXT")
 2760                        .HasMaxLength(256);
 2761
 2762                    b.Property<int>("LogSeverity")
 2763                        .HasColumnType("INTEGER");
 2764
 2765                    b.Property<string>("Name")
 2766                        .IsRequired()
 2767                        .HasColumnType("TEXT")
 2768                        .HasMaxLength(512);
 2769
 2770                    b.Property<string>("Overview")
 2771                        .HasColumnType("TEXT")
 2772                        .HasMaxLength(512);
 2773
 2774                    b.Property<uint>("RowVersion")
 2775                        .IsConcurrencyToken()
 2776                        .HasColumnType("INTEGER");
 2777
 2778                    b.Property<string>("ShortOverview")
 2779                        .HasColumnType("TEXT")
 2780                        .HasMaxLength(512);
 2781
 2782                    b.Property<string>("Type")
 2783                        .IsRequired()
 2784                        .HasColumnType("TEXT")
 2785                        .HasMaxLength(256);
 2786
 2787                    b.Property<Guid>("UserId")
 2788                        .HasColumnType("TEXT");
 2789
 2790                    b.HasKey("Id");
 2791
 2792                    b.ToTable("ActivityLogs");
 2793                });
 94
 2795            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 2796                {
 2797                    b.Property<int>("Id")
 2798                        .ValueGeneratedOnAdd()
 2799                        .HasColumnType("INTEGER");
 27100
 27101                    b.Property<DateTime>("LastModified")
 27102                        .HasColumnType("TEXT");
 27103
 27104                    b.Property<string>("Path")
 27105                        .IsRequired()
 27106                        .HasColumnType("TEXT")
 27107                        .HasMaxLength(512);
 27108
 27109                    b.Property<Guid?>("UserId")
 27110                        .HasColumnType("TEXT");
 27111
 27112                    b.HasKey("Id");
 27113
 27114                    b.HasIndex("UserId")
 27115                        .IsUnique();
 27116
 27117                    b.ToTable("ImageInfos");
 27118                });
 119
 27120            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 27121                {
 27122                    b.Property<int>("Id")
 27123                        .ValueGeneratedOnAdd()
 27124                        .HasColumnType("INTEGER");
 27125
 27126                    b.Property<int>("Kind")
 27127                        .HasColumnType("INTEGER");
 27128
 27129                    b.Property<Guid?>("Permission_Permissions_Guid")
 27130                        .HasColumnType("TEXT");
 27131
 27132                    b.Property<uint>("RowVersion")
 27133                        .IsConcurrencyToken()
 27134                        .HasColumnType("INTEGER");
 27135
 27136                    b.Property<bool>("Value")
 27137                        .HasColumnType("INTEGER");
 27138
 27139                    b.HasKey("Id");
 27140
 27141                    b.HasIndex("Permission_Permissions_Guid");
 27142
 27143                    b.ToTable("Permissions");
 27144                });
 145
 27146            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 27147                {
 27148                    b.Property<int>("Id")
 27149                        .ValueGeneratedOnAdd()
 27150                        .HasColumnType("INTEGER");
 27151
 27152                    b.Property<int>("Kind")
 27153                        .HasColumnType("INTEGER");
 27154
 27155                    b.Property<Guid?>("Preference_Preferences_Guid")
 27156                        .HasColumnType("TEXT");
 27157
 27158                    b.Property<uint>("RowVersion")
 27159                        .IsConcurrencyToken()
 27160                        .HasColumnType("INTEGER");
 27161
 27162                    b.Property<string>("Value")
 27163                        .IsRequired()
 27164                        .HasColumnType("TEXT")
 27165                        .HasMaxLength(65535);
 27166
 27167                    b.HasKey("Id");
 27168
 27169                    b.HasIndex("Preference_Preferences_Guid");
 27170
 27171                    b.ToTable("Preferences");
 27172                });
 173
 27174            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 27175                {
 27176                    b.Property<Guid>("Id")
 27177                        .ValueGeneratedOnAdd()
 27178                        .HasColumnType("TEXT");
 27179
 27180                    b.Property<string>("AudioLanguagePreference")
 27181                        .HasColumnType("TEXT")
 27182                        .HasMaxLength(255);
 27183
 27184                    b.Property<string>("AuthenticationProviderId")
 27185                        .IsRequired()
 27186                        .HasColumnType("TEXT")
 27187                        .HasMaxLength(255);
 27188
 27189                    b.Property<bool>("DisplayCollectionsView")
 27190                        .HasColumnType("INTEGER");
 27191
 27192                    b.Property<bool>("DisplayMissingEpisodes")
 27193                        .HasColumnType("INTEGER");
 27194
 27195                    b.Property<string>("EasyPassword")
 27196                        .HasColumnType("TEXT")
 27197                        .HasMaxLength(65535);
 27198
 27199                    b.Property<bool>("EnableAutoLogin")
 27200                        .HasColumnType("INTEGER");
 27201
 27202                    b.Property<bool>("EnableLocalPassword")
 27203                        .HasColumnType("INTEGER");
 27204
 27205                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 27206                        .HasColumnType("INTEGER");
 27207
 27208                    b.Property<bool>("EnableUserPreferenceAccess")
 27209                        .HasColumnType("INTEGER");
 27210
 27211                    b.Property<bool>("HidePlayedInLatest")
 27212                        .HasColumnType("INTEGER");
 27213
 27214                    b.Property<long>("InternalId")
 27215                        .HasColumnType("INTEGER");
 27216
 27217                    b.Property<int>("InvalidLoginAttemptCount")
 27218                        .HasColumnType("INTEGER");
 27219
 27220                    b.Property<DateTime?>("LastActivityDate")
 27221                        .HasColumnType("TEXT");
 27222
 27223                    b.Property<DateTime?>("LastLoginDate")
 27224                        .HasColumnType("TEXT");
 27225
 27226                    b.Property<int?>("LoginAttemptsBeforeLockout")
 27227                        .HasColumnType("INTEGER");
 27228
 27229                    b.Property<int?>("MaxParentalAgeRating")
 27230                        .HasColumnType("INTEGER");
 27231
 27232                    b.Property<bool>("MustUpdatePassword")
 27233                        .HasColumnType("INTEGER");
 27234
 27235                    b.Property<string>("Password")
 27236                        .HasColumnType("TEXT")
 27237                        .HasMaxLength(65535);
 27238
 27239                    b.Property<string>("PasswordResetProviderId")
 27240                        .IsRequired()
 27241                        .HasColumnType("TEXT")
 27242                        .HasMaxLength(255);
 27243
 27244                    b.Property<bool>("PlayDefaultAudioTrack")
 27245                        .HasColumnType("INTEGER");
 27246
 27247                    b.Property<bool>("RememberAudioSelections")
 27248                        .HasColumnType("INTEGER");
 27249
 27250                    b.Property<bool>("RememberSubtitleSelections")
 27251                        .HasColumnType("INTEGER");
 27252
 27253                    b.Property<int?>("RemoteClientBitrateLimit")
 27254                        .HasColumnType("INTEGER");
 27255
 27256                    b.Property<uint>("RowVersion")
 27257                        .IsConcurrencyToken()
 27258                        .HasColumnType("INTEGER");
 27259
 27260                    b.Property<string>("SubtitleLanguagePreference")
 27261                        .HasColumnType("TEXT")
 27262                        .HasMaxLength(255);
 27263
 27264                    b.Property<int>("SubtitleMode")
 27265                        .HasColumnType("INTEGER");
 27266
 27267                    b.Property<int>("SyncPlayAccess")
 27268                        .HasColumnType("INTEGER");
 27269
 27270                    b.Property<string>("Username")
 27271                        .IsRequired()
 27272                        .HasColumnType("TEXT")
 27273                        .HasMaxLength(255);
 27274
 27275                    b.HasKey("Id");
 27276
 27277                    b.ToTable("Users");
 27278                });
 279
 27280            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 27281                {
 27282                    b.HasOne("Jellyfin.Data.Entities.User", null)
 27283                        .WithMany("AccessSchedules")
 27284                        .HasForeignKey("UserId")
 27285                        .OnDelete(DeleteBehavior.Cascade)
 27286                        .IsRequired();
 27287                });
 288
 27289            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 27290                {
 27291                    b.HasOne("Jellyfin.Data.Entities.User", null)
 27292                        .WithOne("ProfileImage")
 27293                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId");
 27294                });
 295
 27296            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 27297                {
 27298                    b.HasOne("Jellyfin.Data.Entities.User", null)
 27299                        .WithMany("Permissions")
 27300                        .HasForeignKey("Permission_Permissions_Guid");
 27301                });
 302
 27303            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 27304                {
 27305                    b.HasOne("Jellyfin.Data.Entities.User", null)
 27306                        .WithMany("Preferences")
 27307                        .HasForeignKey("Preference_Preferences_Guid");
 27308                });
 309#pragma warning restore 612, 618
 27310        }
 311    }
 312}