< Summary - Jellyfin

Line coverage
98%
Covered lines: 519
Uncovered lines: 10
Coverable lines: 529
Total lines: 591
Line coverage: 98.1%
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/16/2026 - 12:15:55 AM Line coverage: 98.1% (519/529) Total lines: 591

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/20200728005145_AddDisplayPreferences.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 AddDisplayPreferences : Migration
 10    {
 11        protected override void Up(MigrationBuilder migrationBuilder)
 12        {
 2713            migrationBuilder.CreateTable(
 2714                name: "DisplayPreferences",
 2715                schema: "jellyfin",
 2716                columns: table => new
 2717                {
 2718                    Id = table.Column<int>(nullable: false)
 2719                        .Annotation("Sqlite:Autoincrement", true),
 2720                    UserId = table.Column<Guid>(nullable: false),
 2721                    Client = table.Column<string>(maxLength: 32, nullable: false),
 2722                    ShowSidebar = table.Column<bool>(nullable: false),
 2723                    ShowBackdrop = table.Column<bool>(nullable: false),
 2724                    ScrollDirection = table.Column<int>(nullable: false),
 2725                    IndexBy = table.Column<int>(nullable: true),
 2726                    SkipForwardLength = table.Column<int>(nullable: false),
 2727                    SkipBackwardLength = table.Column<int>(nullable: false),
 2728                    ChromecastVersion = table.Column<int>(nullable: false),
 2729                    EnableNextVideoInfoOverlay = table.Column<bool>(nullable: false),
 2730                    DashboardTheme = table.Column<string>(maxLength: 32, nullable: true),
 2731                    TvHome = table.Column<string>(maxLength: 32, nullable: true)
 2732                },
 2733                constraints: table =>
 2734                {
 2735                    table.PrimaryKey("PK_DisplayPreferences", x => x.Id);
 2736                    table.ForeignKey(
 2737                        name: "FK_DisplayPreferences_Users_UserId",
 2738                        column: x => x.UserId,
 2739                        principalSchema: "jellyfin",
 2740                        principalTable: "Users",
 2741                        principalColumn: "Id",
 2742                        onDelete: ReferentialAction.Cascade);
 2743                });
 44
 2745            migrationBuilder.CreateTable(
 2746                name: "ItemDisplayPreferences",
 2747                schema: "jellyfin",
 2748                columns: table => new
 2749                {
 2750                    Id = table.Column<int>(nullable: false)
 2751                        .Annotation("Sqlite:Autoincrement", true),
 2752                    UserId = table.Column<Guid>(nullable: false),
 2753                    ItemId = table.Column<Guid>(nullable: false),
 2754                    Client = table.Column<string>(maxLength: 32, nullable: false),
 2755                    ViewType = table.Column<int>(nullable: false),
 2756                    RememberIndexing = table.Column<bool>(nullable: false),
 2757                    IndexBy = table.Column<int>(nullable: true),
 2758                    RememberSorting = table.Column<bool>(nullable: false),
 2759                    SortBy = table.Column<string>(maxLength: 64, nullable: false),
 2760                    SortOrder = table.Column<int>(nullable: false)
 2761                },
 2762                constraints: table =>
 2763                {
 2764                    table.PrimaryKey("PK_ItemDisplayPreferences", x => x.Id);
 2765                    table.ForeignKey(
 2766                        name: "FK_ItemDisplayPreferences_Users_UserId",
 2767                        column: x => x.UserId,
 2768                        principalSchema: "jellyfin",
 2769                        principalTable: "Users",
 2770                        principalColumn: "Id",
 2771                        onDelete: ReferentialAction.Cascade);
 2772                });
 73
 2774            migrationBuilder.CreateTable(
 2775                name: "HomeSection",
 2776                schema: "jellyfin",
 2777                columns: table => new
 2778                {
 2779                    Id = table.Column<int>(nullable: false)
 2780                        .Annotation("Sqlite:Autoincrement", true),
 2781                    DisplayPreferencesId = table.Column<int>(nullable: false),
 2782                    Order = table.Column<int>(nullable: false),
 2783                    Type = table.Column<int>(nullable: false)
 2784                },
 2785                constraints: table =>
 2786                {
 2787                    table.PrimaryKey("PK_HomeSection", x => x.Id);
 2788                    table.ForeignKey(
 2789                        name: "FK_HomeSection_DisplayPreferences_DisplayPreferencesId",
 2790                        column: x => x.DisplayPreferencesId,
 2791                        principalSchema: "jellyfin",
 2792                        principalTable: "DisplayPreferences",
 2793                        principalColumn: "Id",
 2794                        onDelete: ReferentialAction.Cascade);
 2795                });
 96
 2797            migrationBuilder.CreateIndex(
 2798                name: "IX_DisplayPreferences_UserId",
 2799                schema: "jellyfin",
 27100                table: "DisplayPreferences",
 27101                column: "UserId",
 27102                unique: true);
 103
 27104            migrationBuilder.CreateIndex(
 27105                name: "IX_HomeSection_DisplayPreferencesId",
 27106                schema: "jellyfin",
 27107                table: "HomeSection",
 27108                column: "DisplayPreferencesId");
 109
 27110            migrationBuilder.CreateIndex(
 27111                name: "IX_ItemDisplayPreferences_UserId",
 27112                schema: "jellyfin",
 27113                table: "ItemDisplayPreferences",
 27114                column: "UserId");
 27115        }
 116
 117        protected override void Down(MigrationBuilder migrationBuilder)
 118        {
 0119            migrationBuilder.DropTable(
 0120                name: "HomeSection",
 0121                schema: "jellyfin");
 122
 0123            migrationBuilder.DropTable(
 0124                name: "ItemDisplayPreferences",
 0125                schema: "jellyfin");
 126
 0127            migrationBuilder.DropTable(
 0128                name: "DisplayPreferences",
 0129                schema: "jellyfin");
 0130        }
 131    }
 132}

/srv/git/jellyfin/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20200728005145_AddDisplayPreferences.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("20200728005145_AddDisplayPreferences")]
 15    partial class AddDisplayPreferences
 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.6");
 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.DisplayPreferences", b =>
 2796                {
 2797                    b.Property<int>("Id")
 2798                        .ValueGeneratedOnAdd()
 2799                        .HasColumnType("INTEGER");
 27100
 27101                    b.Property<int>("ChromecastVersion")
 27102                        .HasColumnType("INTEGER");
 27103
 27104                    b.Property<string>("Client")
 27105                        .IsRequired()
 27106                        .HasColumnType("TEXT")
 27107                        .HasMaxLength(32);
 27108
 27109                    b.Property<string>("DashboardTheme")
 27110                        .HasColumnType("TEXT")
 27111                        .HasMaxLength(32);
 27112
 27113                    b.Property<bool>("EnableNextVideoInfoOverlay")
 27114                        .HasColumnType("INTEGER");
 27115
 27116                    b.Property<int?>("IndexBy")
 27117                        .HasColumnType("INTEGER");
 27118
 27119                    b.Property<int>("ScrollDirection")
 27120                        .HasColumnType("INTEGER");
 27121
 27122                    b.Property<bool>("ShowBackdrop")
 27123                        .HasColumnType("INTEGER");
 27124
 27125                    b.Property<bool>("ShowSidebar")
 27126                        .HasColumnType("INTEGER");
 27127
 27128                    b.Property<int>("SkipBackwardLength")
 27129                        .HasColumnType("INTEGER");
 27130
 27131                    b.Property<int>("SkipForwardLength")
 27132                        .HasColumnType("INTEGER");
 27133
 27134                    b.Property<string>("TvHome")
 27135                        .HasColumnType("TEXT")
 27136                        .HasMaxLength(32);
 27137
 27138                    b.Property<Guid>("UserId")
 27139                        .HasColumnType("TEXT");
 27140
 27141                    b.HasKey("Id");
 27142
 27143                    b.HasIndex("UserId")
 27144                        .IsUnique();
 27145
 27146                    b.ToTable("DisplayPreferences");
 27147                });
 148
 27149            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 27150                {
 27151                    b.Property<int>("Id")
 27152                        .ValueGeneratedOnAdd()
 27153                        .HasColumnType("INTEGER");
 27154
 27155                    b.Property<int>("DisplayPreferencesId")
 27156                        .HasColumnType("INTEGER");
 27157
 27158                    b.Property<int>("Order")
 27159                        .HasColumnType("INTEGER");
 27160
 27161                    b.Property<int>("Type")
 27162                        .HasColumnType("INTEGER");
 27163
 27164                    b.HasKey("Id");
 27165
 27166                    b.HasIndex("DisplayPreferencesId");
 27167
 27168                    b.ToTable("HomeSection");
 27169                });
 170
 27171            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 27172                {
 27173                    b.Property<int>("Id")
 27174                        .ValueGeneratedOnAdd()
 27175                        .HasColumnType("INTEGER");
 27176
 27177                    b.Property<DateTime>("LastModified")
 27178                        .HasColumnType("TEXT");
 27179
 27180                    b.Property<string>("Path")
 27181                        .IsRequired()
 27182                        .HasColumnType("TEXT")
 27183                        .HasMaxLength(512);
 27184
 27185                    b.Property<Guid?>("UserId")
 27186                        .HasColumnType("TEXT");
 27187
 27188                    b.HasKey("Id");
 27189
 27190                    b.HasIndex("UserId")
 27191                        .IsUnique();
 27192
 27193                    b.ToTable("ImageInfos");
 27194                });
 195
 27196            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 27197                {
 27198                    b.Property<int>("Id")
 27199                        .ValueGeneratedOnAdd()
 27200                        .HasColumnType("INTEGER");
 27201
 27202                    b.Property<string>("Client")
 27203                        .IsRequired()
 27204                        .HasColumnType("TEXT")
 27205                        .HasMaxLength(32);
 27206
 27207                    b.Property<int?>("IndexBy")
 27208                        .HasColumnType("INTEGER");
 27209
 27210                    b.Property<Guid>("ItemId")
 27211                        .HasColumnType("TEXT");
 27212
 27213                    b.Property<bool>("RememberIndexing")
 27214                        .HasColumnType("INTEGER");
 27215
 27216                    b.Property<bool>("RememberSorting")
 27217                        .HasColumnType("INTEGER");
 27218
 27219                    b.Property<string>("SortBy")
 27220                        .IsRequired()
 27221                        .HasColumnType("TEXT")
 27222                        .HasMaxLength(64);
 27223
 27224                    b.Property<int>("SortOrder")
 27225                        .HasColumnType("INTEGER");
 27226
 27227                    b.Property<Guid>("UserId")
 27228                        .HasColumnType("TEXT");
 27229
 27230                    b.Property<int>("ViewType")
 27231                        .HasColumnType("INTEGER");
 27232
 27233                    b.HasKey("Id");
 27234
 27235                    b.HasIndex("UserId");
 27236
 27237                    b.ToTable("ItemDisplayPreferences");
 27238                });
 239
 27240            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 27241                {
 27242                    b.Property<int>("Id")
 27243                        .ValueGeneratedOnAdd()
 27244                        .HasColumnType("INTEGER");
 27245
 27246                    b.Property<int>("Kind")
 27247                        .HasColumnType("INTEGER");
 27248
 27249                    b.Property<Guid?>("Permission_Permissions_Guid")
 27250                        .HasColumnType("TEXT");
 27251
 27252                    b.Property<uint>("RowVersion")
 27253                        .IsConcurrencyToken()
 27254                        .HasColumnType("INTEGER");
 27255
 27256                    b.Property<bool>("Value")
 27257                        .HasColumnType("INTEGER");
 27258
 27259                    b.HasKey("Id");
 27260
 27261                    b.HasIndex("Permission_Permissions_Guid");
 27262
 27263                    b.ToTable("Permissions");
 27264                });
 265
 27266            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 27267                {
 27268                    b.Property<int>("Id")
 27269                        .ValueGeneratedOnAdd()
 27270                        .HasColumnType("INTEGER");
 27271
 27272                    b.Property<int>("Kind")
 27273                        .HasColumnType("INTEGER");
 27274
 27275                    b.Property<Guid?>("Preference_Preferences_Guid")
 27276                        .HasColumnType("TEXT");
 27277
 27278                    b.Property<uint>("RowVersion")
 27279                        .IsConcurrencyToken()
 27280                        .HasColumnType("INTEGER");
 27281
 27282                    b.Property<string>("Value")
 27283                        .IsRequired()
 27284                        .HasColumnType("TEXT")
 27285                        .HasMaxLength(65535);
 27286
 27287                    b.HasKey("Id");
 27288
 27289                    b.HasIndex("Preference_Preferences_Guid");
 27290
 27291                    b.ToTable("Preferences");
 27292                });
 293
 27294            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 27295                {
 27296                    b.Property<Guid>("Id")
 27297                        .ValueGeneratedOnAdd()
 27298                        .HasColumnType("TEXT");
 27299
 27300                    b.Property<string>("AudioLanguagePreference")
 27301                        .HasColumnType("TEXT")
 27302                        .HasMaxLength(255);
 27303
 27304                    b.Property<string>("AuthenticationProviderId")
 27305                        .IsRequired()
 27306                        .HasColumnType("TEXT")
 27307                        .HasMaxLength(255);
 27308
 27309                    b.Property<bool>("DisplayCollectionsView")
 27310                        .HasColumnType("INTEGER");
 27311
 27312                    b.Property<bool>("DisplayMissingEpisodes")
 27313                        .HasColumnType("INTEGER");
 27314
 27315                    b.Property<string>("EasyPassword")
 27316                        .HasColumnType("TEXT")
 27317                        .HasMaxLength(65535);
 27318
 27319                    b.Property<bool>("EnableAutoLogin")
 27320                        .HasColumnType("INTEGER");
 27321
 27322                    b.Property<bool>("EnableLocalPassword")
 27323                        .HasColumnType("INTEGER");
 27324
 27325                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 27326                        .HasColumnType("INTEGER");
 27327
 27328                    b.Property<bool>("EnableUserPreferenceAccess")
 27329                        .HasColumnType("INTEGER");
 27330
 27331                    b.Property<bool>("HidePlayedInLatest")
 27332                        .HasColumnType("INTEGER");
 27333
 27334                    b.Property<long>("InternalId")
 27335                        .HasColumnType("INTEGER");
 27336
 27337                    b.Property<int>("InvalidLoginAttemptCount")
 27338                        .HasColumnType("INTEGER");
 27339
 27340                    b.Property<DateTime?>("LastActivityDate")
 27341                        .HasColumnType("TEXT");
 27342
 27343                    b.Property<DateTime?>("LastLoginDate")
 27344                        .HasColumnType("TEXT");
 27345
 27346                    b.Property<int?>("LoginAttemptsBeforeLockout")
 27347                        .HasColumnType("INTEGER");
 27348
 27349                    b.Property<int?>("MaxParentalAgeRating")
 27350                        .HasColumnType("INTEGER");
 27351
 27352                    b.Property<bool>("MustUpdatePassword")
 27353                        .HasColumnType("INTEGER");
 27354
 27355                    b.Property<string>("Password")
 27356                        .HasColumnType("TEXT")
 27357                        .HasMaxLength(65535);
 27358
 27359                    b.Property<string>("PasswordResetProviderId")
 27360                        .IsRequired()
 27361                        .HasColumnType("TEXT")
 27362                        .HasMaxLength(255);
 27363
 27364                    b.Property<bool>("PlayDefaultAudioTrack")
 27365                        .HasColumnType("INTEGER");
 27366
 27367                    b.Property<bool>("RememberAudioSelections")
 27368                        .HasColumnType("INTEGER");
 27369
 27370                    b.Property<bool>("RememberSubtitleSelections")
 27371                        .HasColumnType("INTEGER");
 27372
 27373                    b.Property<int?>("RemoteClientBitrateLimit")
 27374                        .HasColumnType("INTEGER");
 27375
 27376                    b.Property<uint>("RowVersion")
 27377                        .IsConcurrencyToken()
 27378                        .HasColumnType("INTEGER");
 27379
 27380                    b.Property<string>("SubtitleLanguagePreference")
 27381                        .HasColumnType("TEXT")
 27382                        .HasMaxLength(255);
 27383
 27384                    b.Property<int>("SubtitleMode")
 27385                        .HasColumnType("INTEGER");
 27386
 27387                    b.Property<int>("SyncPlayAccess")
 27388                        .HasColumnType("INTEGER");
 27389
 27390                    b.Property<string>("Username")
 27391                        .IsRequired()
 27392                        .HasColumnType("TEXT")
 27393                        .HasMaxLength(255);
 27394
 27395                    b.HasKey("Id");
 27396
 27397                    b.ToTable("Users");
 27398                });
 399
 27400            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 27401                {
 27402                    b.HasOne("Jellyfin.Data.Entities.User", null)
 27403                        .WithMany("AccessSchedules")
 27404                        .HasForeignKey("UserId")
 27405                        .OnDelete(DeleteBehavior.Cascade)
 27406                        .IsRequired();
 27407                });
 408
 27409            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 27410                {
 27411                    b.HasOne("Jellyfin.Data.Entities.User", null)
 27412                        .WithOne("DisplayPreferences")
 27413                        .HasForeignKey("Jellyfin.Data.Entities.DisplayPreferences", "UserId")
 27414                        .OnDelete(DeleteBehavior.Cascade)
 27415                        .IsRequired();
 27416                });
 417
 27418            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 27419                {
 27420                    b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null)
 27421                        .WithMany("HomeSections")
 27422                        .HasForeignKey("DisplayPreferencesId")
 27423                        .OnDelete(DeleteBehavior.Cascade)
 27424                        .IsRequired();
 27425                });
 426
 27427            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 27428                {
 27429                    b.HasOne("Jellyfin.Data.Entities.User", null)
 27430                        .WithOne("ProfileImage")
 27431                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId");
 27432                });
 433
 27434            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 27435                {
 27436                    b.HasOne("Jellyfin.Data.Entities.User", null)
 27437                        .WithMany("ItemDisplayPreferences")
 27438                        .HasForeignKey("UserId")
 27439                        .OnDelete(DeleteBehavior.Cascade)
 27440                        .IsRequired();
 27441                });
 442
 27443            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 27444                {
 27445                    b.HasOne("Jellyfin.Data.Entities.User", null)
 27446                        .WithMany("Permissions")
 27447                        .HasForeignKey("Permission_Permissions_Guid");
 27448                });
 449
 27450            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 27451                {
 27452                    b.HasOne("Jellyfin.Data.Entities.User", null)
 27453                        .WithMany("Preferences")
 27454                        .HasForeignKey("Preference_Preferences_Guid");
 27455                });
 456#pragma warning restore 612, 618
 27457        }
 458    }
 459}