< Summary - Jellyfin

Line coverage
98%
Covered lines: 433
Uncovered lines: 5
Coverable lines: 438
Total lines: 492
Line coverage: 98.8%
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/20201004171403_AddMaxActiveSessions.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 AddMaxActiveSessions : Migration
 9    {
 10        protected override void Up(MigrationBuilder migrationBuilder)
 11        {
 2212            migrationBuilder.AddColumn<int>(
 2213                name: "MaxActiveSessions",
 2214                schema: "jellyfin",
 2215                table: "Users",
 2216                nullable: false,
 2217                defaultValue: 0);
 2218        }
 19
 20        protected override void Down(MigrationBuilder migrationBuilder)
 21        {
 022            migrationBuilder.DropColumn(
 023                name: "MaxActiveSessions",
 024                schema: "jellyfin",
 025                table: "Users");
 026        }
 27    }
 28}

/srv/git/jellyfin/Jellyfin.Server.Implementations/Migrations/20201004171403_AddMaxActiveSessions.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("20201004171403_AddMaxActiveSessions")]
 15    partial class AddMaxActiveSessions
 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.8");
 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?>("MaxActiveSessions")
 22352                        .HasColumnType("INTEGER");
 22353
 22354                    b.Property<int?>("MaxParentalAgeRating")
 22355                        .HasColumnType("INTEGER");
 22356
 22357                    b.Property<bool>("MustUpdatePassword")
 22358                        .HasColumnType("INTEGER");
 22359
 22360                    b.Property<string>("Password")
 22361                        .HasColumnType("TEXT")
 22362                        .HasMaxLength(65535);
 22363
 22364                    b.Property<string>("PasswordResetProviderId")
 22365                        .IsRequired()
 22366                        .HasColumnType("TEXT")
 22367                        .HasMaxLength(255);
 22368
 22369                    b.Property<bool>("PlayDefaultAudioTrack")
 22370                        .HasColumnType("INTEGER");
 22371
 22372                    b.Property<bool>("RememberAudioSelections")
 22373                        .HasColumnType("INTEGER");
 22374
 22375                    b.Property<bool>("RememberSubtitleSelections")
 22376                        .HasColumnType("INTEGER");
 22377
 22378                    b.Property<int?>("RemoteClientBitrateLimit")
 22379                        .HasColumnType("INTEGER");
 22380
 22381                    b.Property<uint>("RowVersion")
 22382                        .IsConcurrencyToken()
 22383                        .HasColumnType("INTEGER");
 22384
 22385                    b.Property<string>("SubtitleLanguagePreference")
 22386                        .HasColumnType("TEXT")
 22387                        .HasMaxLength(255);
 22388
 22389                    b.Property<int>("SubtitleMode")
 22390                        .HasColumnType("INTEGER");
 22391
 22392                    b.Property<int>("SyncPlayAccess")
 22393                        .HasColumnType("INTEGER");
 22394
 22395                    b.Property<string>("Username")
 22396                        .IsRequired()
 22397                        .HasColumnType("TEXT")
 22398                        .HasMaxLength(255);
 22399
 22400                    b.HasKey("Id");
 22401
 22402                    b.ToTable("Users");
 22403                });
 404
 22405            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 22406                {
 22407                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22408                        .WithMany("AccessSchedules")
 22409                        .HasForeignKey("UserId")
 22410                        .OnDelete(DeleteBehavior.Cascade)
 22411                        .IsRequired();
 22412                });
 413
 22414            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 22415                {
 22416                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22417                        .WithOne("DisplayPreferences")
 22418                        .HasForeignKey("Jellyfin.Data.Entities.DisplayPreferences", "UserId")
 22419                        .OnDelete(DeleteBehavior.Cascade)
 22420                        .IsRequired();
 22421                });
 422
 22423            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 22424                {
 22425                    b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null)
 22426                        .WithMany("HomeSections")
 22427                        .HasForeignKey("DisplayPreferencesId")
 22428                        .OnDelete(DeleteBehavior.Cascade)
 22429                        .IsRequired();
 22430                });
 431
 22432            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22433                {
 22434                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22435                        .WithOne("ProfileImage")
 22436                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId");
 22437                });
 438
 22439            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 22440                {
 22441                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22442                        .WithMany("ItemDisplayPreferences")
 22443                        .HasForeignKey("UserId")
 22444                        .OnDelete(DeleteBehavior.Cascade)
 22445                        .IsRequired();
 22446                });
 447
 22448            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22449                {
 22450                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22451                        .WithMany("Permissions")
 22452                        .HasForeignKey("Permission_Permissions_Guid");
 22453                });
 454
 22455            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22456                {
 22457                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22458                        .WithMany("Preferences")
 22459                        .HasForeignKey("Preference_Preferences_Guid");
 22460                });
 461#pragma warning restore 612, 618
 22462        }
 463    }
 464}