< Summary - Jellyfin

Line coverage
95%
Covered lines: 538
Uncovered lines: 26
Coverable lines: 564
Total lines: 630
Line coverage: 95.3%
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/20201204223655_AddCustomDisplayPreferences.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2// <auto-generated />
 3using System;
 4using Microsoft.EntityFrameworkCore.Migrations;
 5
 6namespace Jellyfin.Server.Implementations.Migrations
 7{
 8    public partial class AddCustomDisplayPreferences : Migration
 9    {
 10        protected override void Up(MigrationBuilder migrationBuilder)
 11        {
 2212            migrationBuilder.DropIndex(
 2213                name: "IX_DisplayPreferences_UserId_Client",
 2214                schema: "jellyfin",
 2215                table: "DisplayPreferences");
 16
 2217            migrationBuilder.AlterColumn<int>(
 2218                name: "MaxActiveSessions",
 2219                schema: "jellyfin",
 2220                table: "Users",
 2221                type: "INTEGER",
 2222                nullable: false,
 2223                defaultValue: 0,
 2224                oldClrType: typeof(int),
 2225                oldType: "INTEGER",
 2226                oldNullable: true);
 27
 2228            migrationBuilder.AddColumn<Guid>(
 2229                name: "ItemId",
 2230                schema: "jellyfin",
 2231                table: "DisplayPreferences",
 2232                type: "TEXT",
 2233                nullable: false,
 2234                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
 35
 2236            migrationBuilder.CreateTable(
 2237                name: "CustomItemDisplayPreferences",
 2238                schema: "jellyfin",
 2239                columns: table => new
 2240                {
 2241                    Id = table.Column<int>(type: "INTEGER", nullable: false)
 2242                        .Annotation("Sqlite:Autoincrement", true),
 2243                    UserId = table.Column<Guid>(type: "TEXT", nullable: false),
 2244                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 2245                    Client = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false),
 2246                    Key = table.Column<string>(type: "TEXT", nullable: false),
 2247                    Value = table.Column<string>(type: "TEXT", nullable: false)
 2248                },
 2249                constraints: table =>
 2250                {
 2251                    table.PrimaryKey("PK_CustomItemDisplayPreferences", x => x.Id);
 2252                });
 53
 2254            migrationBuilder.CreateIndex(
 2255                name: "IX_DisplayPreferences_UserId_ItemId_Client",
 2256                schema: "jellyfin",
 2257                table: "DisplayPreferences",
 2258                columns: new[] { "UserId", "ItemId", "Client" },
 2259                unique: true);
 60
 2261            migrationBuilder.CreateIndex(
 2262                name: "IX_CustomItemDisplayPreferences_UserId",
 2263                schema: "jellyfin",
 2264                table: "CustomItemDisplayPreferences",
 2265                column: "UserId");
 66
 2267            migrationBuilder.CreateIndex(
 2268                name: "IX_CustomItemDisplayPreferences_UserId_ItemId_Client_Key",
 2269                schema: "jellyfin",
 2270                table: "CustomItemDisplayPreferences",
 2271                columns: new[] { "UserId", "ItemId", "Client", "Key" },
 2272                unique: true);
 2273        }
 74
 75        protected override void Down(MigrationBuilder migrationBuilder)
 76        {
 077            migrationBuilder.DropTable(
 078                name: "CustomItemDisplayPreferences",
 079                schema: "jellyfin");
 80
 081            migrationBuilder.DropIndex(
 082                name: "IX_DisplayPreferences_UserId_ItemId_Client",
 083                schema: "jellyfin",
 084                table: "DisplayPreferences");
 85
 086            migrationBuilder.DropColumn(
 087                name: "ItemId",
 088                schema: "jellyfin",
 089                table: "DisplayPreferences");
 90
 091            migrationBuilder.AlterColumn<int>(
 092                name: "MaxActiveSessions",
 093                schema: "jellyfin",
 094                table: "Users",
 095                type: "INTEGER",
 096                nullable: true,
 097                oldClrType: typeof(int),
 098                oldType: "INTEGER");
 99
 0100            migrationBuilder.CreateIndex(
 0101                name: "IX_DisplayPreferences_UserId_Client",
 0102                schema: "jellyfin",
 0103                table: "DisplayPreferences",
 0104                columns: new[] { "UserId", "Client" },
 0105                unique: true);
 0106        }
 107    }
 108}

/srv/git/jellyfin/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.Designer.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2// <auto-generated />
 3using System;
 4using Jellyfin.Server.Implementations;
 5using Microsoft.EntityFrameworkCore;
 6using Microsoft.EntityFrameworkCore.Infrastructure;
 7using Microsoft.EntityFrameworkCore.Migrations;
 8using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
 9
 10namespace Jellyfin.Server.Implementations.Migrations
 11{
 12    [DbContext(typeof(JellyfinDbContext))]
 13    [Migration("20201204223655_AddCustomDisplayPreferences")]
 14    partial class AddCustomDisplayPreferences
 15    {
 16        protected override void BuildTargetModel(ModelBuilder modelBuilder)
 17        {
 18#pragma warning disable 612, 618
 2219            modelBuilder
 2220                .HasDefaultSchema("jellyfin")
 2221                .HasAnnotation("ProductVersion", "5.0.0");
 22
 2223            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 2224                {
 2225                    b.Property<int>("Id")
 2226                        .ValueGeneratedOnAdd()
 2227                        .HasColumnType("INTEGER");
 2228
 2229                    b.Property<int>("DayOfWeek")
 2230                        .HasColumnType("INTEGER");
 2231
 2232                    b.Property<double>("EndHour")
 2233                        .HasColumnType("REAL");
 2234
 2235                    b.Property<double>("StartHour")
 2236                        .HasColumnType("REAL");
 2237
 2238                    b.Property<Guid>("UserId")
 2239                        .HasColumnType("TEXT");
 2240
 2241                    b.HasKey("Id");
 2242
 2243                    b.HasIndex("UserId");
 2244
 2245                    b.ToTable("AccessSchedules");
 2246                });
 47
 2248            modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b =>
 2249                {
 2250                    b.Property<int>("Id")
 2251                        .ValueGeneratedOnAdd()
 2252                        .HasColumnType("INTEGER");
 2253
 2254                    b.Property<DateTime>("DateCreated")
 2255                        .HasColumnType("TEXT");
 2256
 2257                    b.Property<string>("ItemId")
 2258                        .HasMaxLength(256)
 2259                        .HasColumnType("TEXT");
 2260
 2261                    b.Property<int>("LogSeverity")
 2262                        .HasColumnType("INTEGER");
 2263
 2264                    b.Property<string>("Name")
 2265                        .IsRequired()
 2266                        .HasMaxLength(512)
 2267                        .HasColumnType("TEXT");
 2268
 2269                    b.Property<string>("Overview")
 2270                        .HasMaxLength(512)
 2271                        .HasColumnType("TEXT");
 2272
 2273                    b.Property<uint>("RowVersion")
 2274                        .IsConcurrencyToken()
 2275                        .HasColumnType("INTEGER");
 2276
 2277                    b.Property<string>("ShortOverview")
 2278                        .HasMaxLength(512)
 2279                        .HasColumnType("TEXT");
 2280
 2281                    b.Property<string>("Type")
 2282                        .IsRequired()
 2283                        .HasMaxLength(256)
 2284                        .HasColumnType("TEXT");
 2285
 2286                    b.Property<Guid>("UserId")
 2287                        .HasColumnType("TEXT");
 2288
 2289                    b.HasKey("Id");
 2290
 2291                    b.ToTable("ActivityLogs");
 2292                });
 93
 2294            modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b =>
 2295                {
 2296                    b.Property<int>("Id")
 2297                        .ValueGeneratedOnAdd()
 2298                        .HasColumnType("INTEGER");
 2299
 22100                    b.Property<string>("Client")
 22101                        .IsRequired()
 22102                        .HasMaxLength(32)
 22103                        .HasColumnType("TEXT");
 22104
 22105                    b.Property<Guid>("ItemId")
 22106                        .HasColumnType("TEXT");
 22107
 22108                    b.Property<string>("Key")
 22109                        .IsRequired()
 22110                        .HasColumnType("TEXT");
 22111
 22112                    b.Property<Guid>("UserId")
 22113                        .HasColumnType("TEXT");
 22114
 22115                    b.Property<string>("Value")
 22116                        .IsRequired()
 22117                        .HasColumnType("TEXT");
 22118
 22119                    b.HasKey("Id");
 22120
 22121                    b.HasIndex("UserId");
 22122
 22123                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 22124                        .IsUnique();
 22125
 22126                    b.ToTable("CustomItemDisplayPreferences");
 22127                });
 128
 22129            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 22130                {
 22131                    b.Property<int>("Id")
 22132                        .ValueGeneratedOnAdd()
 22133                        .HasColumnType("INTEGER");
 22134
 22135                    b.Property<int>("ChromecastVersion")
 22136                        .HasColumnType("INTEGER");
 22137
 22138                    b.Property<string>("Client")
 22139                        .IsRequired()
 22140                        .HasMaxLength(32)
 22141                        .HasColumnType("TEXT");
 22142
 22143                    b.Property<string>("DashboardTheme")
 22144                        .HasMaxLength(32)
 22145                        .HasColumnType("TEXT");
 22146
 22147                    b.Property<bool>("EnableNextVideoInfoOverlay")
 22148                        .HasColumnType("INTEGER");
 22149
 22150                    b.Property<int?>("IndexBy")
 22151                        .HasColumnType("INTEGER");
 22152
 22153                    b.Property<Guid>("ItemId")
 22154                        .HasColumnType("TEXT");
 22155
 22156                    b.Property<int>("ScrollDirection")
 22157                        .HasColumnType("INTEGER");
 22158
 22159                    b.Property<bool>("ShowBackdrop")
 22160                        .HasColumnType("INTEGER");
 22161
 22162                    b.Property<bool>("ShowSidebar")
 22163                        .HasColumnType("INTEGER");
 22164
 22165                    b.Property<int>("SkipBackwardLength")
 22166                        .HasColumnType("INTEGER");
 22167
 22168                    b.Property<int>("SkipForwardLength")
 22169                        .HasColumnType("INTEGER");
 22170
 22171                    b.Property<string>("TvHome")
 22172                        .HasMaxLength(32)
 22173                        .HasColumnType("TEXT");
 22174
 22175                    b.Property<Guid>("UserId")
 22176                        .HasColumnType("TEXT");
 22177
 22178                    b.HasKey("Id");
 22179
 22180                    b.HasIndex("UserId");
 22181
 22182                    b.HasIndex("UserId", "ItemId", "Client")
 22183                        .IsUnique();
 22184
 22185                    b.ToTable("DisplayPreferences");
 22186                });
 187
 22188            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 22189                {
 22190                    b.Property<int>("Id")
 22191                        .ValueGeneratedOnAdd()
 22192                        .HasColumnType("INTEGER");
 22193
 22194                    b.Property<int>("DisplayPreferencesId")
 22195                        .HasColumnType("INTEGER");
 22196
 22197                    b.Property<int>("Order")
 22198                        .HasColumnType("INTEGER");
 22199
 22200                    b.Property<int>("Type")
 22201                        .HasColumnType("INTEGER");
 22202
 22203                    b.HasKey("Id");
 22204
 22205                    b.HasIndex("DisplayPreferencesId");
 22206
 22207                    b.ToTable("HomeSection");
 22208                });
 209
 22210            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22211                {
 22212                    b.Property<int>("Id")
 22213                        .ValueGeneratedOnAdd()
 22214                        .HasColumnType("INTEGER");
 22215
 22216                    b.Property<DateTime>("LastModified")
 22217                        .HasColumnType("TEXT");
 22218
 22219                    b.Property<string>("Path")
 22220                        .IsRequired()
 22221                        .HasMaxLength(512)
 22222                        .HasColumnType("TEXT");
 22223
 22224                    b.Property<Guid?>("UserId")
 22225                        .HasColumnType("TEXT");
 22226
 22227                    b.HasKey("Id");
 22228
 22229                    b.HasIndex("UserId")
 22230                        .IsUnique();
 22231
 22232                    b.ToTable("ImageInfos");
 22233                });
 234
 22235            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 22236                {
 22237                    b.Property<int>("Id")
 22238                        .ValueGeneratedOnAdd()
 22239                        .HasColumnType("INTEGER");
 22240
 22241                    b.Property<string>("Client")
 22242                        .IsRequired()
 22243                        .HasMaxLength(32)
 22244                        .HasColumnType("TEXT");
 22245
 22246                    b.Property<int?>("IndexBy")
 22247                        .HasColumnType("INTEGER");
 22248
 22249                    b.Property<Guid>("ItemId")
 22250                        .HasColumnType("TEXT");
 22251
 22252                    b.Property<bool>("RememberIndexing")
 22253                        .HasColumnType("INTEGER");
 22254
 22255                    b.Property<bool>("RememberSorting")
 22256                        .HasColumnType("INTEGER");
 22257
 22258                    b.Property<string>("SortBy")
 22259                        .IsRequired()
 22260                        .HasMaxLength(64)
 22261                        .HasColumnType("TEXT");
 22262
 22263                    b.Property<int>("SortOrder")
 22264                        .HasColumnType("INTEGER");
 22265
 22266                    b.Property<Guid>("UserId")
 22267                        .HasColumnType("TEXT");
 22268
 22269                    b.Property<int>("ViewType")
 22270                        .HasColumnType("INTEGER");
 22271
 22272                    b.HasKey("Id");
 22273
 22274                    b.HasIndex("UserId");
 22275
 22276                    b.ToTable("ItemDisplayPreferences");
 22277                });
 278
 22279            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22280                {
 22281                    b.Property<int>("Id")
 22282                        .ValueGeneratedOnAdd()
 22283                        .HasColumnType("INTEGER");
 22284
 22285                    b.Property<int>("Kind")
 22286                        .HasColumnType("INTEGER");
 22287
 22288                    b.Property<Guid?>("Permission_Permissions_Guid")
 22289                        .HasColumnType("TEXT");
 22290
 22291                    b.Property<uint>("RowVersion")
 22292                        .IsConcurrencyToken()
 22293                        .HasColumnType("INTEGER");
 22294
 22295                    b.Property<bool>("Value")
 22296                        .HasColumnType("INTEGER");
 22297
 22298                    b.HasKey("Id");
 22299
 22300                    b.HasIndex("Permission_Permissions_Guid");
 22301
 22302                    b.ToTable("Permissions");
 22303                });
 304
 22305            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22306                {
 22307                    b.Property<int>("Id")
 22308                        .ValueGeneratedOnAdd()
 22309                        .HasColumnType("INTEGER");
 22310
 22311                    b.Property<int>("Kind")
 22312                        .HasColumnType("INTEGER");
 22313
 22314                    b.Property<Guid?>("Preference_Preferences_Guid")
 22315                        .HasColumnType("TEXT");
 22316
 22317                    b.Property<uint>("RowVersion")
 22318                        .IsConcurrencyToken()
 22319                        .HasColumnType("INTEGER");
 22320
 22321                    b.Property<string>("Value")
 22322                        .IsRequired()
 22323                        .HasMaxLength(65535)
 22324                        .HasColumnType("TEXT");
 22325
 22326                    b.HasKey("Id");
 22327
 22328                    b.HasIndex("Preference_Preferences_Guid");
 22329
 22330                    b.ToTable("Preferences");
 22331                });
 332
 22333            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 22334                {
 22335                    b.Property<Guid>("Id")
 22336                        .ValueGeneratedOnAdd()
 22337                        .HasColumnType("TEXT");
 22338
 22339                    b.Property<string>("AudioLanguagePreference")
 22340                        .HasMaxLength(255)
 22341                        .HasColumnType("TEXT");
 22342
 22343                    b.Property<string>("AuthenticationProviderId")
 22344                        .IsRequired()
 22345                        .HasMaxLength(255)
 22346                        .HasColumnType("TEXT");
 22347
 22348                    b.Property<bool>("DisplayCollectionsView")
 22349                        .HasColumnType("INTEGER");
 22350
 22351                    b.Property<bool>("DisplayMissingEpisodes")
 22352                        .HasColumnType("INTEGER");
 22353
 22354                    b.Property<string>("EasyPassword")
 22355                        .HasMaxLength(65535)
 22356                        .HasColumnType("TEXT");
 22357
 22358                    b.Property<bool>("EnableAutoLogin")
 22359                        .HasColumnType("INTEGER");
 22360
 22361                    b.Property<bool>("EnableLocalPassword")
 22362                        .HasColumnType("INTEGER");
 22363
 22364                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 22365                        .HasColumnType("INTEGER");
 22366
 22367                    b.Property<bool>("EnableUserPreferenceAccess")
 22368                        .HasColumnType("INTEGER");
 22369
 22370                    b.Property<bool>("HidePlayedInLatest")
 22371                        .HasColumnType("INTEGER");
 22372
 22373                    b.Property<long>("InternalId")
 22374                        .HasColumnType("INTEGER");
 22375
 22376                    b.Property<int>("InvalidLoginAttemptCount")
 22377                        .HasColumnType("INTEGER");
 22378
 22379                    b.Property<DateTime?>("LastActivityDate")
 22380                        .HasColumnType("TEXT");
 22381
 22382                    b.Property<DateTime?>("LastLoginDate")
 22383                        .HasColumnType("TEXT");
 22384
 22385                    b.Property<int?>("LoginAttemptsBeforeLockout")
 22386                        .HasColumnType("INTEGER");
 22387
 22388                    b.Property<int>("MaxActiveSessions")
 22389                        .HasColumnType("INTEGER");
 22390
 22391                    b.Property<int?>("MaxParentalAgeRating")
 22392                        .HasColumnType("INTEGER");
 22393
 22394                    b.Property<bool>("MustUpdatePassword")
 22395                        .HasColumnType("INTEGER");
 22396
 22397                    b.Property<string>("Password")
 22398                        .HasMaxLength(65535)
 22399                        .HasColumnType("TEXT");
 22400
 22401                    b.Property<string>("PasswordResetProviderId")
 22402                        .IsRequired()
 22403                        .HasMaxLength(255)
 22404                        .HasColumnType("TEXT");
 22405
 22406                    b.Property<bool>("PlayDefaultAudioTrack")
 22407                        .HasColumnType("INTEGER");
 22408
 22409                    b.Property<bool>("RememberAudioSelections")
 22410                        .HasColumnType("INTEGER");
 22411
 22412                    b.Property<bool>("RememberSubtitleSelections")
 22413                        .HasColumnType("INTEGER");
 22414
 22415                    b.Property<int?>("RemoteClientBitrateLimit")
 22416                        .HasColumnType("INTEGER");
 22417
 22418                    b.Property<uint>("RowVersion")
 22419                        .IsConcurrencyToken()
 22420                        .HasColumnType("INTEGER");
 22421
 22422                    b.Property<string>("SubtitleLanguagePreference")
 22423                        .HasMaxLength(255)
 22424                        .HasColumnType("TEXT");
 22425
 22426                    b.Property<int>("SubtitleMode")
 22427                        .HasColumnType("INTEGER");
 22428
 22429                    b.Property<int>("SyncPlayAccess")
 22430                        .HasColumnType("INTEGER");
 22431
 22432                    b.Property<string>("Username")
 22433                        .IsRequired()
 22434                        .HasMaxLength(255)
 22435                        .HasColumnType("TEXT");
 22436
 22437                    b.HasKey("Id");
 22438
 22439                    b.ToTable("Users");
 22440                });
 441
 22442            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 22443                {
 22444                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22445                        .WithMany("AccessSchedules")
 22446                        .HasForeignKey("UserId")
 22447                        .OnDelete(DeleteBehavior.Cascade)
 22448                        .IsRequired();
 22449                });
 450
 22451            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 22452                {
 22453                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22454                        .WithOne("DisplayPreferences")
 22455                        .HasForeignKey("Jellyfin.Data.Entities.DisplayPreferences", "UserId")
 22456                        .OnDelete(DeleteBehavior.Cascade)
 22457                        .IsRequired();
 22458                });
 459
 22460            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 22461                {
 22462                    b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null)
 22463                        .WithMany("HomeSections")
 22464                        .HasForeignKey("DisplayPreferencesId")
 22465                        .OnDelete(DeleteBehavior.Cascade)
 22466                        .IsRequired();
 22467                });
 468
 22469            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22470                {
 22471                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22472                        .WithOne("ProfileImage")
 22473                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId");
 22474                });
 475
 22476            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 22477                {
 22478                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22479                        .WithMany("ItemDisplayPreferences")
 22480                        .HasForeignKey("UserId")
 22481                        .OnDelete(DeleteBehavior.Cascade)
 22482                        .IsRequired();
 22483                });
 484
 22485            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22486                {
 22487                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22488                        .WithMany("Permissions")
 22489                        .HasForeignKey("Permission_Permissions_Guid");
 22490                });
 491
 22492            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22493                {
 22494                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22495                        .WithMany("Preferences")
 22496                        .HasForeignKey("Preference_Preferences_Guid");
 22497                });
 498
 22499            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 22500                {
 22501                    b.Navigation("HomeSections");
 22502                });
 503
 22504            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 22505                {
 22506                    b.Navigation("AccessSchedules");
 22507
 22508                    b.Navigation("DisplayPreferences")
 22509                        .IsRequired();
 22510
 22511                    b.Navigation("ItemDisplayPreferences");
 22512
 22513                    b.Navigation("Permissions");
 22514
 22515                    b.Navigation("Preferences");
 22516
 22517                    b.Navigation("ProfileImage");
 22518                });
 519#pragma warning restore 612, 618
 22520        }
 521    }
 522}