< Summary - Jellyfin

Line coverage
96%
Covered lines: 439
Uncovered lines: 15
Coverable lines: 454
Total lines: 512
Line coverage: 96.6%
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/20200905220533_FixDisplayPreferencesIndex.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2#pragma warning disable SA1601
 3
 4using Microsoft.EntityFrameworkCore.Migrations;
 5
 6namespace Jellyfin.Server.Implementations.Migrations
 7{
 8    public partial class FixDisplayPreferencesIndex : Migration
 9    {
 10        protected override void Up(MigrationBuilder migrationBuilder)
 11        {
 2212            migrationBuilder.DropIndex(
 2213                name: "IX_DisplayPreferences_UserId",
 2214                schema: "jellyfin",
 2215                table: "DisplayPreferences");
 16
 2217            migrationBuilder.CreateIndex(
 2218                name: "IX_DisplayPreferences_UserId",
 2219                schema: "jellyfin",
 2220                table: "DisplayPreferences",
 2221                column: "UserId");
 22
 2223            migrationBuilder.CreateIndex(
 2224                name: "IX_DisplayPreferences_UserId_Client",
 2225                schema: "jellyfin",
 2226                table: "DisplayPreferences",
 2227                columns: new[] { "UserId", "Client" },
 2228                unique: true);
 2229        }
 30
 31        protected override void Down(MigrationBuilder migrationBuilder)
 32        {
 033            migrationBuilder.DropIndex(
 034                name: "IX_DisplayPreferences_UserId",
 035                schema: "jellyfin",
 036                table: "DisplayPreferences");
 37
 038            migrationBuilder.DropIndex(
 039                name: "IX_DisplayPreferences_UserId_Client",
 040                schema: "jellyfin",
 041                table: "DisplayPreferences");
 42
 043            migrationBuilder.CreateIndex(
 044                name: "IX_DisplayPreferences_UserId",
 045                schema: "jellyfin",
 046                table: "DisplayPreferences",
 047                column: "UserId",
 048                unique: true);
 049        }
 50    }
 51}

/srv/git/jellyfin/Jellyfin.Server.Implementations/Migrations/20200905220533_FixDisplayPreferencesIndex.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("20200905220533_FixDisplayPreferencesIndex")]
 15    partial class FixDisplayPreferencesIndex
 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.7");
 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
 22145                    b.HasIndex("UserId", "Client")
 22146                        .IsUnique();
 22147
 22148                    b.ToTable("DisplayPreferences");
 22149                });
 150
 22151            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 22152                {
 22153                    b.Property<int>("Id")
 22154                        .ValueGeneratedOnAdd()
 22155                        .HasColumnType("INTEGER");
 22156
 22157                    b.Property<int>("DisplayPreferencesId")
 22158                        .HasColumnType("INTEGER");
 22159
 22160                    b.Property<int>("Order")
 22161                        .HasColumnType("INTEGER");
 22162
 22163                    b.Property<int>("Type")
 22164                        .HasColumnType("INTEGER");
 22165
 22166                    b.HasKey("Id");
 22167
 22168                    b.HasIndex("DisplayPreferencesId");
 22169
 22170                    b.ToTable("HomeSection");
 22171                });
 172
 22173            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22174                {
 22175                    b.Property<int>("Id")
 22176                        .ValueGeneratedOnAdd()
 22177                        .HasColumnType("INTEGER");
 22178
 22179                    b.Property<DateTime>("LastModified")
 22180                        .HasColumnType("TEXT");
 22181
 22182                    b.Property<string>("Path")
 22183                        .IsRequired()
 22184                        .HasColumnType("TEXT")
 22185                        .HasMaxLength(512);
 22186
 22187                    b.Property<Guid?>("UserId")
 22188                        .HasColumnType("TEXT");
 22189
 22190                    b.HasKey("Id");
 22191
 22192                    b.HasIndex("UserId")
 22193                        .IsUnique();
 22194
 22195                    b.ToTable("ImageInfos");
 22196                });
 197
 22198            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 22199                {
 22200                    b.Property<int>("Id")
 22201                        .ValueGeneratedOnAdd()
 22202                        .HasColumnType("INTEGER");
 22203
 22204                    b.Property<string>("Client")
 22205                        .IsRequired()
 22206                        .HasColumnType("TEXT")
 22207                        .HasMaxLength(32);
 22208
 22209                    b.Property<int?>("IndexBy")
 22210                        .HasColumnType("INTEGER");
 22211
 22212                    b.Property<Guid>("ItemId")
 22213                        .HasColumnType("TEXT");
 22214
 22215                    b.Property<bool>("RememberIndexing")
 22216                        .HasColumnType("INTEGER");
 22217
 22218                    b.Property<bool>("RememberSorting")
 22219                        .HasColumnType("INTEGER");
 22220
 22221                    b.Property<string>("SortBy")
 22222                        .IsRequired()
 22223                        .HasColumnType("TEXT")
 22224                        .HasMaxLength(64);
 22225
 22226                    b.Property<int>("SortOrder")
 22227                        .HasColumnType("INTEGER");
 22228
 22229                    b.Property<Guid>("UserId")
 22230                        .HasColumnType("TEXT");
 22231
 22232                    b.Property<int>("ViewType")
 22233                        .HasColumnType("INTEGER");
 22234
 22235                    b.HasKey("Id");
 22236
 22237                    b.HasIndex("UserId");
 22238
 22239                    b.ToTable("ItemDisplayPreferences");
 22240                });
 241
 22242            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22243                {
 22244                    b.Property<int>("Id")
 22245                        .ValueGeneratedOnAdd()
 22246                        .HasColumnType("INTEGER");
 22247
 22248                    b.Property<int>("Kind")
 22249                        .HasColumnType("INTEGER");
 22250
 22251                    b.Property<Guid?>("Permission_Permissions_Guid")
 22252                        .HasColumnType("TEXT");
 22253
 22254                    b.Property<uint>("RowVersion")
 22255                        .IsConcurrencyToken()
 22256                        .HasColumnType("INTEGER");
 22257
 22258                    b.Property<bool>("Value")
 22259                        .HasColumnType("INTEGER");
 22260
 22261                    b.HasKey("Id");
 22262
 22263                    b.HasIndex("Permission_Permissions_Guid");
 22264
 22265                    b.ToTable("Permissions");
 22266                });
 267
 22268            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22269                {
 22270                    b.Property<int>("Id")
 22271                        .ValueGeneratedOnAdd()
 22272                        .HasColumnType("INTEGER");
 22273
 22274                    b.Property<int>("Kind")
 22275                        .HasColumnType("INTEGER");
 22276
 22277                    b.Property<Guid?>("Preference_Preferences_Guid")
 22278                        .HasColumnType("TEXT");
 22279
 22280                    b.Property<uint>("RowVersion")
 22281                        .IsConcurrencyToken()
 22282                        .HasColumnType("INTEGER");
 22283
 22284                    b.Property<string>("Value")
 22285                        .IsRequired()
 22286                        .HasColumnType("TEXT")
 22287                        .HasMaxLength(65535);
 22288
 22289                    b.HasKey("Id");
 22290
 22291                    b.HasIndex("Preference_Preferences_Guid");
 22292
 22293                    b.ToTable("Preferences");
 22294                });
 295
 22296            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 22297                {
 22298                    b.Property<Guid>("Id")
 22299                        .ValueGeneratedOnAdd()
 22300                        .HasColumnType("TEXT");
 22301
 22302                    b.Property<string>("AudioLanguagePreference")
 22303                        .HasColumnType("TEXT")
 22304                        .HasMaxLength(255);
 22305
 22306                    b.Property<string>("AuthenticationProviderId")
 22307                        .IsRequired()
 22308                        .HasColumnType("TEXT")
 22309                        .HasMaxLength(255);
 22310
 22311                    b.Property<bool>("DisplayCollectionsView")
 22312                        .HasColumnType("INTEGER");
 22313
 22314                    b.Property<bool>("DisplayMissingEpisodes")
 22315                        .HasColumnType("INTEGER");
 22316
 22317                    b.Property<string>("EasyPassword")
 22318                        .HasColumnType("TEXT")
 22319                        .HasMaxLength(65535);
 22320
 22321                    b.Property<bool>("EnableAutoLogin")
 22322                        .HasColumnType("INTEGER");
 22323
 22324                    b.Property<bool>("EnableLocalPassword")
 22325                        .HasColumnType("INTEGER");
 22326
 22327                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 22328                        .HasColumnType("INTEGER");
 22329
 22330                    b.Property<bool>("EnableUserPreferenceAccess")
 22331                        .HasColumnType("INTEGER");
 22332
 22333                    b.Property<bool>("HidePlayedInLatest")
 22334                        .HasColumnType("INTEGER");
 22335
 22336                    b.Property<long>("InternalId")
 22337                        .HasColumnType("INTEGER");
 22338
 22339                    b.Property<int>("InvalidLoginAttemptCount")
 22340                        .HasColumnType("INTEGER");
 22341
 22342                    b.Property<DateTime?>("LastActivityDate")
 22343                        .HasColumnType("TEXT");
 22344
 22345                    b.Property<DateTime?>("LastLoginDate")
 22346                        .HasColumnType("TEXT");
 22347
 22348                    b.Property<int?>("LoginAttemptsBeforeLockout")
 22349                        .HasColumnType("INTEGER");
 22350
 22351                    b.Property<int?>("MaxParentalAgeRating")
 22352                        .HasColumnType("INTEGER");
 22353
 22354                    b.Property<bool>("MustUpdatePassword")
 22355                        .HasColumnType("INTEGER");
 22356
 22357                    b.Property<string>("Password")
 22358                        .HasColumnType("TEXT")
 22359                        .HasMaxLength(65535);
 22360
 22361                    b.Property<string>("PasswordResetProviderId")
 22362                        .IsRequired()
 22363                        .HasColumnType("TEXT")
 22364                        .HasMaxLength(255);
 22365
 22366                    b.Property<bool>("PlayDefaultAudioTrack")
 22367                        .HasColumnType("INTEGER");
 22368
 22369                    b.Property<bool>("RememberAudioSelections")
 22370                        .HasColumnType("INTEGER");
 22371
 22372                    b.Property<bool>("RememberSubtitleSelections")
 22373                        .HasColumnType("INTEGER");
 22374
 22375                    b.Property<int?>("RemoteClientBitrateLimit")
 22376                        .HasColumnType("INTEGER");
 22377
 22378                    b.Property<uint>("RowVersion")
 22379                        .IsConcurrencyToken()
 22380                        .HasColumnType("INTEGER");
 22381
 22382                    b.Property<string>("SubtitleLanguagePreference")
 22383                        .HasColumnType("TEXT")
 22384                        .HasMaxLength(255);
 22385
 22386                    b.Property<int>("SubtitleMode")
 22387                        .HasColumnType("INTEGER");
 22388
 22389                    b.Property<int>("SyncPlayAccess")
 22390                        .HasColumnType("INTEGER");
 22391
 22392                    b.Property<string>("Username")
 22393                        .IsRequired()
 22394                        .HasColumnType("TEXT")
 22395                        .HasMaxLength(255);
 22396
 22397                    b.HasKey("Id");
 22398
 22399                    b.ToTable("Users");
 22400                });
 401
 22402            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 22403                {
 22404                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22405                        .WithMany("AccessSchedules")
 22406                        .HasForeignKey("UserId")
 22407                        .OnDelete(DeleteBehavior.Cascade)
 22408                        .IsRequired();
 22409                });
 410
 22411            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 22412                {
 22413                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22414                        .WithOne("DisplayPreferences")
 22415                        .HasForeignKey("Jellyfin.Data.Entities.DisplayPreferences", "UserId")
 22416                        .OnDelete(DeleteBehavior.Cascade)
 22417                        .IsRequired();
 22418                });
 419
 22420            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 22421                {
 22422                    b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null)
 22423                        .WithMany("HomeSections")
 22424                        .HasForeignKey("DisplayPreferencesId")
 22425                        .OnDelete(DeleteBehavior.Cascade)
 22426                        .IsRequired();
 22427                });
 428
 22429            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22430                {
 22431                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22432                        .WithOne("ProfileImage")
 22433                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId");
 22434                });
 435
 22436            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 22437                {
 22438                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22439                        .WithMany("ItemDisplayPreferences")
 22440                        .HasForeignKey("UserId")
 22441                        .OnDelete(DeleteBehavior.Cascade)
 22442                        .IsRequired();
 22443                });
 444
 22445            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22446                {
 22447                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22448                        .WithMany("Permissions")
 22449                        .HasForeignKey("Permission_Permissions_Guid");
 22450                });
 451
 22452            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22453                {
 22454                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22455                        .WithMany("Preferences")
 22456                        .HasForeignKey("Preference_Preferences_Guid");
 22457                });
 458#pragma warning restore 612, 618
 22459        }
 460    }
 461}