< 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

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/Jellyfin.Server.Implementations/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        {
 2213            migrationBuilder.CreateTable(
 2214                name: "DisplayPreferences",
 2215                schema: "jellyfin",
 2216                columns: table => new
 2217                {
 2218                    Id = table.Column<int>(nullable: false)
 2219                        .Annotation("Sqlite:Autoincrement", true),
 2220                    UserId = table.Column<Guid>(nullable: false),
 2221                    Client = table.Column<string>(maxLength: 32, nullable: false),
 2222                    ShowSidebar = table.Column<bool>(nullable: false),
 2223                    ShowBackdrop = table.Column<bool>(nullable: false),
 2224                    ScrollDirection = table.Column<int>(nullable: false),
 2225                    IndexBy = table.Column<int>(nullable: true),
 2226                    SkipForwardLength = table.Column<int>(nullable: false),
 2227                    SkipBackwardLength = table.Column<int>(nullable: false),
 2228                    ChromecastVersion = table.Column<int>(nullable: false),
 2229                    EnableNextVideoInfoOverlay = table.Column<bool>(nullable: false),
 2230                    DashboardTheme = table.Column<string>(maxLength: 32, nullable: true),
 2231                    TvHome = table.Column<string>(maxLength: 32, nullable: true)
 2232                },
 2233                constraints: table =>
 2234                {
 2235                    table.PrimaryKey("PK_DisplayPreferences", x => x.Id);
 2236                    table.ForeignKey(
 2237                        name: "FK_DisplayPreferences_Users_UserId",
 2238                        column: x => x.UserId,
 2239                        principalSchema: "jellyfin",
 2240                        principalTable: "Users",
 2241                        principalColumn: "Id",
 2242                        onDelete: ReferentialAction.Cascade);
 2243                });
 44
 2245            migrationBuilder.CreateTable(
 2246                name: "ItemDisplayPreferences",
 2247                schema: "jellyfin",
 2248                columns: table => new
 2249                {
 2250                    Id = table.Column<int>(nullable: false)
 2251                        .Annotation("Sqlite:Autoincrement", true),
 2252                    UserId = table.Column<Guid>(nullable: false),
 2253                    ItemId = table.Column<Guid>(nullable: false),
 2254                    Client = table.Column<string>(maxLength: 32, nullable: false),
 2255                    ViewType = table.Column<int>(nullable: false),
 2256                    RememberIndexing = table.Column<bool>(nullable: false),
 2257                    IndexBy = table.Column<int>(nullable: true),
 2258                    RememberSorting = table.Column<bool>(nullable: false),
 2259                    SortBy = table.Column<string>(maxLength: 64, nullable: false),
 2260                    SortOrder = table.Column<int>(nullable: false)
 2261                },
 2262                constraints: table =>
 2263                {
 2264                    table.PrimaryKey("PK_ItemDisplayPreferences", x => x.Id);
 2265                    table.ForeignKey(
 2266                        name: "FK_ItemDisplayPreferences_Users_UserId",
 2267                        column: x => x.UserId,
 2268                        principalSchema: "jellyfin",
 2269                        principalTable: "Users",
 2270                        principalColumn: "Id",
 2271                        onDelete: ReferentialAction.Cascade);
 2272                });
 73
 2274            migrationBuilder.CreateTable(
 2275                name: "HomeSection",
 2276                schema: "jellyfin",
 2277                columns: table => new
 2278                {
 2279                    Id = table.Column<int>(nullable: false)
 2280                        .Annotation("Sqlite:Autoincrement", true),
 2281                    DisplayPreferencesId = table.Column<int>(nullable: false),
 2282                    Order = table.Column<int>(nullable: false),
 2283                    Type = table.Column<int>(nullable: false)
 2284                },
 2285                constraints: table =>
 2286                {
 2287                    table.PrimaryKey("PK_HomeSection", x => x.Id);
 2288                    table.ForeignKey(
 2289                        name: "FK_HomeSection_DisplayPreferences_DisplayPreferencesId",
 2290                        column: x => x.DisplayPreferencesId,
 2291                        principalSchema: "jellyfin",
 2292                        principalTable: "DisplayPreferences",
 2293                        principalColumn: "Id",
 2294                        onDelete: ReferentialAction.Cascade);
 2295                });
 96
 2297            migrationBuilder.CreateIndex(
 2298                name: "IX_DisplayPreferences_UserId",
 2299                schema: "jellyfin",
 22100                table: "DisplayPreferences",
 22101                column: "UserId",
 22102                unique: true);
 103
 22104            migrationBuilder.CreateIndex(
 22105                name: "IX_HomeSection_DisplayPreferencesId",
 22106                schema: "jellyfin",
 22107                table: "HomeSection",
 22108                column: "DisplayPreferencesId");
 109
 22110            migrationBuilder.CreateIndex(
 22111                name: "IX_ItemDisplayPreferences_UserId",
 22112                schema: "jellyfin",
 22113                table: "ItemDisplayPreferences",
 22114                column: "UserId");
 22115        }
 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/Jellyfin.Server.Implementations/Migrations/20200728005145_AddDisplayPreferences.Designer.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2
 3// <auto-generated />
 4using System;
 5using Jellyfin.Server.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
 2220            modelBuilder
 2221                .HasDefaultSchema("jellyfin")
 2222                .HasAnnotation("ProductVersion", "3.1.6");
 23
 2224            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 2225                {
 2226                    b.Property<int>("Id")
 2227                        .ValueGeneratedOnAdd()
 2228                        .HasColumnType("INTEGER");
 2229
 2230                    b.Property<int>("DayOfWeek")
 2231                        .HasColumnType("INTEGER");
 2232
 2233                    b.Property<double>("EndHour")
 2234                        .HasColumnType("REAL");
 2235
 2236                    b.Property<double>("StartHour")
 2237                        .HasColumnType("REAL");
 2238
 2239                    b.Property<Guid>("UserId")
 2240                        .HasColumnType("TEXT");
 2241
 2242                    b.HasKey("Id");
 2243
 2244                    b.HasIndex("UserId");
 2245
 2246                    b.ToTable("AccessSchedules");
 2247                });
 48
 2249            modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b =>
 2250                {
 2251                    b.Property<int>("Id")
 2252                        .ValueGeneratedOnAdd()
 2253                        .HasColumnType("INTEGER");
 2254
 2255                    b.Property<DateTime>("DateCreated")
 2256                        .HasColumnType("TEXT");
 2257
 2258                    b.Property<string>("ItemId")
 2259                        .HasColumnType("TEXT")
 2260                        .HasMaxLength(256);
 2261
 2262                    b.Property<int>("LogSeverity")
 2263                        .HasColumnType("INTEGER");
 2264
 2265                    b.Property<string>("Name")
 2266                        .IsRequired()
 2267                        .HasColumnType("TEXT")
 2268                        .HasMaxLength(512);
 2269
 2270                    b.Property<string>("Overview")
 2271                        .HasColumnType("TEXT")
 2272                        .HasMaxLength(512);
 2273
 2274                    b.Property<uint>("RowVersion")
 2275                        .IsConcurrencyToken()
 2276                        .HasColumnType("INTEGER");
 2277
 2278                    b.Property<string>("ShortOverview")
 2279                        .HasColumnType("TEXT")
 2280                        .HasMaxLength(512);
 2281
 2282                    b.Property<string>("Type")
 2283                        .IsRequired()
 2284                        .HasColumnType("TEXT")
 2285                        .HasMaxLength(256);
 2286
 2287                    b.Property<Guid>("UserId")
 2288                        .HasColumnType("TEXT");
 2289
 2290                    b.HasKey("Id");
 2291
 2292                    b.ToTable("ActivityLogs");
 2293                });
 94
 2295            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 2296                {
 2297                    b.Property<int>("Id")
 2298                        .ValueGeneratedOnAdd()
 2299                        .HasColumnType("INTEGER");
 22100
 22101                    b.Property<int>("ChromecastVersion")
 22102                        .HasColumnType("INTEGER");
 22103
 22104                    b.Property<string>("Client")
 22105                        .IsRequired()
 22106                        .HasColumnType("TEXT")
 22107                        .HasMaxLength(32);
 22108
 22109                    b.Property<string>("DashboardTheme")
 22110                        .HasColumnType("TEXT")
 22111                        .HasMaxLength(32);
 22112
 22113                    b.Property<bool>("EnableNextVideoInfoOverlay")
 22114                        .HasColumnType("INTEGER");
 22115
 22116                    b.Property<int?>("IndexBy")
 22117                        .HasColumnType("INTEGER");
 22118
 22119                    b.Property<int>("ScrollDirection")
 22120                        .HasColumnType("INTEGER");
 22121
 22122                    b.Property<bool>("ShowBackdrop")
 22123                        .HasColumnType("INTEGER");
 22124
 22125                    b.Property<bool>("ShowSidebar")
 22126                        .HasColumnType("INTEGER");
 22127
 22128                    b.Property<int>("SkipBackwardLength")
 22129                        .HasColumnType("INTEGER");
 22130
 22131                    b.Property<int>("SkipForwardLength")
 22132                        .HasColumnType("INTEGER");
 22133
 22134                    b.Property<string>("TvHome")
 22135                        .HasColumnType("TEXT")
 22136                        .HasMaxLength(32);
 22137
 22138                    b.Property<Guid>("UserId")
 22139                        .HasColumnType("TEXT");
 22140
 22141                    b.HasKey("Id");
 22142
 22143                    b.HasIndex("UserId")
 22144                        .IsUnique();
 22145
 22146                    b.ToTable("DisplayPreferences");
 22147                });
 148
 22149            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 22150                {
 22151                    b.Property<int>("Id")
 22152                        .ValueGeneratedOnAdd()
 22153                        .HasColumnType("INTEGER");
 22154
 22155                    b.Property<int>("DisplayPreferencesId")
 22156                        .HasColumnType("INTEGER");
 22157
 22158                    b.Property<int>("Order")
 22159                        .HasColumnType("INTEGER");
 22160
 22161                    b.Property<int>("Type")
 22162                        .HasColumnType("INTEGER");
 22163
 22164                    b.HasKey("Id");
 22165
 22166                    b.HasIndex("DisplayPreferencesId");
 22167
 22168                    b.ToTable("HomeSection");
 22169                });
 170
 22171            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22172                {
 22173                    b.Property<int>("Id")
 22174                        .ValueGeneratedOnAdd()
 22175                        .HasColumnType("INTEGER");
 22176
 22177                    b.Property<DateTime>("LastModified")
 22178                        .HasColumnType("TEXT");
 22179
 22180                    b.Property<string>("Path")
 22181                        .IsRequired()
 22182                        .HasColumnType("TEXT")
 22183                        .HasMaxLength(512);
 22184
 22185                    b.Property<Guid?>("UserId")
 22186                        .HasColumnType("TEXT");
 22187
 22188                    b.HasKey("Id");
 22189
 22190                    b.HasIndex("UserId")
 22191                        .IsUnique();
 22192
 22193                    b.ToTable("ImageInfos");
 22194                });
 195
 22196            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 22197                {
 22198                    b.Property<int>("Id")
 22199                        .ValueGeneratedOnAdd()
 22200                        .HasColumnType("INTEGER");
 22201
 22202                    b.Property<string>("Client")
 22203                        .IsRequired()
 22204                        .HasColumnType("TEXT")
 22205                        .HasMaxLength(32);
 22206
 22207                    b.Property<int?>("IndexBy")
 22208                        .HasColumnType("INTEGER");
 22209
 22210                    b.Property<Guid>("ItemId")
 22211                        .HasColumnType("TEXT");
 22212
 22213                    b.Property<bool>("RememberIndexing")
 22214                        .HasColumnType("INTEGER");
 22215
 22216                    b.Property<bool>("RememberSorting")
 22217                        .HasColumnType("INTEGER");
 22218
 22219                    b.Property<string>("SortBy")
 22220                        .IsRequired()
 22221                        .HasColumnType("TEXT")
 22222                        .HasMaxLength(64);
 22223
 22224                    b.Property<int>("SortOrder")
 22225                        .HasColumnType("INTEGER");
 22226
 22227                    b.Property<Guid>("UserId")
 22228                        .HasColumnType("TEXT");
 22229
 22230                    b.Property<int>("ViewType")
 22231                        .HasColumnType("INTEGER");
 22232
 22233                    b.HasKey("Id");
 22234
 22235                    b.HasIndex("UserId");
 22236
 22237                    b.ToTable("ItemDisplayPreferences");
 22238                });
 239
 22240            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22241                {
 22242                    b.Property<int>("Id")
 22243                        .ValueGeneratedOnAdd()
 22244                        .HasColumnType("INTEGER");
 22245
 22246                    b.Property<int>("Kind")
 22247                        .HasColumnType("INTEGER");
 22248
 22249                    b.Property<Guid?>("Permission_Permissions_Guid")
 22250                        .HasColumnType("TEXT");
 22251
 22252                    b.Property<uint>("RowVersion")
 22253                        .IsConcurrencyToken()
 22254                        .HasColumnType("INTEGER");
 22255
 22256                    b.Property<bool>("Value")
 22257                        .HasColumnType("INTEGER");
 22258
 22259                    b.HasKey("Id");
 22260
 22261                    b.HasIndex("Permission_Permissions_Guid");
 22262
 22263                    b.ToTable("Permissions");
 22264                });
 265
 22266            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22267                {
 22268                    b.Property<int>("Id")
 22269                        .ValueGeneratedOnAdd()
 22270                        .HasColumnType("INTEGER");
 22271
 22272                    b.Property<int>("Kind")
 22273                        .HasColumnType("INTEGER");
 22274
 22275                    b.Property<Guid?>("Preference_Preferences_Guid")
 22276                        .HasColumnType("TEXT");
 22277
 22278                    b.Property<uint>("RowVersion")
 22279                        .IsConcurrencyToken()
 22280                        .HasColumnType("INTEGER");
 22281
 22282                    b.Property<string>("Value")
 22283                        .IsRequired()
 22284                        .HasColumnType("TEXT")
 22285                        .HasMaxLength(65535);
 22286
 22287                    b.HasKey("Id");
 22288
 22289                    b.HasIndex("Preference_Preferences_Guid");
 22290
 22291                    b.ToTable("Preferences");
 22292                });
 293
 22294            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 22295                {
 22296                    b.Property<Guid>("Id")
 22297                        .ValueGeneratedOnAdd()
 22298                        .HasColumnType("TEXT");
 22299
 22300                    b.Property<string>("AudioLanguagePreference")
 22301                        .HasColumnType("TEXT")
 22302                        .HasMaxLength(255);
 22303
 22304                    b.Property<string>("AuthenticationProviderId")
 22305                        .IsRequired()
 22306                        .HasColumnType("TEXT")
 22307                        .HasMaxLength(255);
 22308
 22309                    b.Property<bool>("DisplayCollectionsView")
 22310                        .HasColumnType("INTEGER");
 22311
 22312                    b.Property<bool>("DisplayMissingEpisodes")
 22313                        .HasColumnType("INTEGER");
 22314
 22315                    b.Property<string>("EasyPassword")
 22316                        .HasColumnType("TEXT")
 22317                        .HasMaxLength(65535);
 22318
 22319                    b.Property<bool>("EnableAutoLogin")
 22320                        .HasColumnType("INTEGER");
 22321
 22322                    b.Property<bool>("EnableLocalPassword")
 22323                        .HasColumnType("INTEGER");
 22324
 22325                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 22326                        .HasColumnType("INTEGER");
 22327
 22328                    b.Property<bool>("EnableUserPreferenceAccess")
 22329                        .HasColumnType("INTEGER");
 22330
 22331                    b.Property<bool>("HidePlayedInLatest")
 22332                        .HasColumnType("INTEGER");
 22333
 22334                    b.Property<long>("InternalId")
 22335                        .HasColumnType("INTEGER");
 22336
 22337                    b.Property<int>("InvalidLoginAttemptCount")
 22338                        .HasColumnType("INTEGER");
 22339
 22340                    b.Property<DateTime?>("LastActivityDate")
 22341                        .HasColumnType("TEXT");
 22342
 22343                    b.Property<DateTime?>("LastLoginDate")
 22344                        .HasColumnType("TEXT");
 22345
 22346                    b.Property<int?>("LoginAttemptsBeforeLockout")
 22347                        .HasColumnType("INTEGER");
 22348
 22349                    b.Property<int?>("MaxParentalAgeRating")
 22350                        .HasColumnType("INTEGER");
 22351
 22352                    b.Property<bool>("MustUpdatePassword")
 22353                        .HasColumnType("INTEGER");
 22354
 22355                    b.Property<string>("Password")
 22356                        .HasColumnType("TEXT")
 22357                        .HasMaxLength(65535);
 22358
 22359                    b.Property<string>("PasswordResetProviderId")
 22360                        .IsRequired()
 22361                        .HasColumnType("TEXT")
 22362                        .HasMaxLength(255);
 22363
 22364                    b.Property<bool>("PlayDefaultAudioTrack")
 22365                        .HasColumnType("INTEGER");
 22366
 22367                    b.Property<bool>("RememberAudioSelections")
 22368                        .HasColumnType("INTEGER");
 22369
 22370                    b.Property<bool>("RememberSubtitleSelections")
 22371                        .HasColumnType("INTEGER");
 22372
 22373                    b.Property<int?>("RemoteClientBitrateLimit")
 22374                        .HasColumnType("INTEGER");
 22375
 22376                    b.Property<uint>("RowVersion")
 22377                        .IsConcurrencyToken()
 22378                        .HasColumnType("INTEGER");
 22379
 22380                    b.Property<string>("SubtitleLanguagePreference")
 22381                        .HasColumnType("TEXT")
 22382                        .HasMaxLength(255);
 22383
 22384                    b.Property<int>("SubtitleMode")
 22385                        .HasColumnType("INTEGER");
 22386
 22387                    b.Property<int>("SyncPlayAccess")
 22388                        .HasColumnType("INTEGER");
 22389
 22390                    b.Property<string>("Username")
 22391                        .IsRequired()
 22392                        .HasColumnType("TEXT")
 22393                        .HasMaxLength(255);
 22394
 22395                    b.HasKey("Id");
 22396
 22397                    b.ToTable("Users");
 22398                });
 399
 22400            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 22401                {
 22402                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22403                        .WithMany("AccessSchedules")
 22404                        .HasForeignKey("UserId")
 22405                        .OnDelete(DeleteBehavior.Cascade)
 22406                        .IsRequired();
 22407                });
 408
 22409            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 22410                {
 22411                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22412                        .WithOne("DisplayPreferences")
 22413                        .HasForeignKey("Jellyfin.Data.Entities.DisplayPreferences", "UserId")
 22414                        .OnDelete(DeleteBehavior.Cascade)
 22415                        .IsRequired();
 22416                });
 417
 22418            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 22419                {
 22420                    b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null)
 22421                        .WithMany("HomeSections")
 22422                        .HasForeignKey("DisplayPreferencesId")
 22423                        .OnDelete(DeleteBehavior.Cascade)
 22424                        .IsRequired();
 22425                });
 426
 22427            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22428                {
 22429                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22430                        .WithOne("ProfileImage")
 22431                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId");
 22432                });
 433
 22434            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 22435                {
 22436                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22437                        .WithMany("ItemDisplayPreferences")
 22438                        .HasForeignKey("UserId")
 22439                        .OnDelete(DeleteBehavior.Cascade)
 22440                        .IsRequired();
 22441                });
 442
 22443            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22444                {
 22445                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22446                        .WithMany("Permissions")
 22447                        .HasForeignKey("Permission_Permissions_Guid");
 22448                });
 449
 22450            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22451                {
 22452                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22453                        .WithMany("Preferences")
 22454                        .HasForeignKey("Preference_Preferences_Guid");
 22455                });
 456#pragma warning restore 612, 618
 22457        }
 458    }
 459}