< Summary - Jellyfin

Line coverage
96%
Covered lines: 432
Uncovered lines: 16
Coverable lines: 448
Total lines: 509
Line coverage: 96.4%
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/20200613202153_AddUsers.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 AddUsers : Migration
 10    {
 11        protected override void Up(MigrationBuilder migrationBuilder)
 12        {
 2213            migrationBuilder.CreateTable(
 2214                name: "Users",
 2215                schema: "jellyfin",
 2216                columns: table => new
 2217                {
 2218                    Id = table.Column<Guid>(nullable: false),
 2219                    Username = table.Column<string>(maxLength: 255, nullable: false),
 2220                    Password = table.Column<string>(maxLength: 65535, nullable: true),
 2221                    EasyPassword = table.Column<string>(maxLength: 65535, nullable: true),
 2222                    MustUpdatePassword = table.Column<bool>(nullable: false),
 2223                    AudioLanguagePreference = table.Column<string>(maxLength: 255, nullable: true),
 2224                    AuthenticationProviderId = table.Column<string>(maxLength: 255, nullable: false),
 2225                    PasswordResetProviderId = table.Column<string>(maxLength: 255, nullable: false),
 2226                    InvalidLoginAttemptCount = table.Column<int>(nullable: false),
 2227                    LastActivityDate = table.Column<DateTime>(nullable: true),
 2228                    LastLoginDate = table.Column<DateTime>(nullable: true),
 2229                    LoginAttemptsBeforeLockout = table.Column<int>(nullable: true),
 2230                    SubtitleMode = table.Column<int>(nullable: false),
 2231                    PlayDefaultAudioTrack = table.Column<bool>(nullable: false),
 2232                    SubtitleLanguagePreference = table.Column<string>(maxLength: 255, nullable: true),
 2233                    DisplayMissingEpisodes = table.Column<bool>(nullable: false),
 2234                    DisplayCollectionsView = table.Column<bool>(nullable: false),
 2235                    EnableLocalPassword = table.Column<bool>(nullable: false),
 2236                    HidePlayedInLatest = table.Column<bool>(nullable: false),
 2237                    RememberAudioSelections = table.Column<bool>(nullable: false),
 2238                    RememberSubtitleSelections = table.Column<bool>(nullable: false),
 2239                    EnableNextEpisodeAutoPlay = table.Column<bool>(nullable: false),
 2240                    EnableAutoLogin = table.Column<bool>(nullable: false),
 2241                    EnableUserPreferenceAccess = table.Column<bool>(nullable: false),
 2242                    MaxParentalAgeRating = table.Column<int>(nullable: true),
 2243                    RemoteClientBitrateLimit = table.Column<int>(nullable: true),
 2244                    InternalId = table.Column<long>(nullable: false),
 2245                    SyncPlayAccess = table.Column<int>(nullable: false),
 2246                    RowVersion = table.Column<uint>(nullable: false)
 2247                },
 2248                constraints: table =>
 2249                {
 2250                    table.PrimaryKey("PK_Users", x => x.Id);
 2251                });
 52
 2253            migrationBuilder.CreateTable(
 2254                name: "AccessSchedules",
 2255                schema: "jellyfin",
 2256                columns: table => new
 2257                {
 2258                    Id = table.Column<int>(nullable: false)
 2259                        .Annotation("Sqlite:Autoincrement", true),
 2260                    UserId = table.Column<Guid>(nullable: false),
 2261                    DayOfWeek = table.Column<int>(nullable: false),
 2262                    StartHour = table.Column<double>(nullable: false),
 2263                    EndHour = table.Column<double>(nullable: false)
 2264                },
 2265                constraints: table =>
 2266                {
 2267                    table.PrimaryKey("PK_AccessSchedules", x => x.Id);
 2268                    table.ForeignKey(
 2269                        name: "FK_AccessSchedules_Users_UserId",
 2270                        column: x => x.UserId,
 2271                        principalSchema: "jellyfin",
 2272                        principalTable: "Users",
 2273                        principalColumn: "Id",
 2274                        onDelete: ReferentialAction.Cascade);
 2275                });
 76
 2277            migrationBuilder.CreateTable(
 2278                name: "ImageInfos",
 2279                schema: "jellyfin",
 2280                columns: table => new
 2281                {
 2282                    Id = table.Column<int>(nullable: false)
 2283                        .Annotation("Sqlite:Autoincrement", true),
 2284                    UserId = table.Column<Guid>(nullable: true),
 2285                    Path = table.Column<string>(maxLength: 512, nullable: false),
 2286                    LastModified = table.Column<DateTime>(nullable: false)
 2287                },
 2288                constraints: table =>
 2289                {
 2290                    table.PrimaryKey("PK_ImageInfos", x => x.Id);
 2291                    table.ForeignKey(
 2292                        name: "FK_ImageInfos_Users_UserId",
 2293                        column: x => x.UserId,
 2294                        principalSchema: "jellyfin",
 2295                        principalTable: "Users",
 2296                        principalColumn: "Id",
 2297                        onDelete: ReferentialAction.Restrict);
 2298                });
 99
 22100            migrationBuilder.CreateTable(
 22101                name: "Permissions",
 22102                schema: "jellyfin",
 22103                columns: table => new
 22104                {
 22105                    Id = table.Column<int>(nullable: false)
 22106                        .Annotation("Sqlite:Autoincrement", true),
 22107                    Kind = table.Column<int>(nullable: false),
 22108                    Value = table.Column<bool>(nullable: false),
 22109                    RowVersion = table.Column<uint>(nullable: false),
 22110                    Permission_Permissions_Guid = table.Column<Guid>(nullable: true)
 22111                },
 22112                constraints: table =>
 22113                {
 22114                    table.PrimaryKey("PK_Permissions", x => x.Id);
 22115                    table.ForeignKey(
 22116                        name: "FK_Permissions_Users_Permission_Permissions_Guid",
 22117                        column: x => x.Permission_Permissions_Guid,
 22118                        principalSchema: "jellyfin",
 22119                        principalTable: "Users",
 22120                        principalColumn: "Id",
 22121                        onDelete: ReferentialAction.Restrict);
 22122                });
 123
 22124            migrationBuilder.CreateTable(
 22125                name: "Preferences",
 22126                schema: "jellyfin",
 22127                columns: table => new
 22128                {
 22129                    Id = table.Column<int>(nullable: false)
 22130                        .Annotation("Sqlite:Autoincrement", true),
 22131                    Kind = table.Column<int>(nullable: false),
 22132                    Value = table.Column<string>(maxLength: 65535, nullable: false),
 22133                    RowVersion = table.Column<uint>(nullable: false),
 22134                    Preference_Preferences_Guid = table.Column<Guid>(nullable: true)
 22135                },
 22136                constraints: table =>
 22137                {
 22138                    table.PrimaryKey("PK_Preferences", x => x.Id);
 22139                    table.ForeignKey(
 22140                        name: "FK_Preferences_Users_Preference_Preferences_Guid",
 22141                        column: x => x.Preference_Preferences_Guid,
 22142                        principalSchema: "jellyfin",
 22143                        principalTable: "Users",
 22144                        principalColumn: "Id",
 22145                        onDelete: ReferentialAction.Restrict);
 22146                });
 147
 22148            migrationBuilder.CreateIndex(
 22149                name: "IX_AccessSchedules_UserId",
 22150                schema: "jellyfin",
 22151                table: "AccessSchedules",
 22152                column: "UserId");
 153
 22154            migrationBuilder.CreateIndex(
 22155                name: "IX_ImageInfos_UserId",
 22156                schema: "jellyfin",
 22157                table: "ImageInfos",
 22158                column: "UserId",
 22159                unique: true);
 160
 22161            migrationBuilder.CreateIndex(
 22162                name: "IX_Permissions_Permission_Permissions_Guid",
 22163                schema: "jellyfin",
 22164                table: "Permissions",
 22165                column: "Permission_Permissions_Guid");
 166
 22167            migrationBuilder.CreateIndex(
 22168                name: "IX_Preferences_Preference_Preferences_Guid",
 22169                schema: "jellyfin",
 22170                table: "Preferences",
 22171                column: "Preference_Preferences_Guid");
 22172        }
 173
 174        protected override void Down(MigrationBuilder migrationBuilder)
 175        {
 0176            migrationBuilder.DropTable(
 0177                name: "AccessSchedules",
 0178                schema: "jellyfin");
 179
 0180            migrationBuilder.DropTable(
 0181                name: "ImageInfos",
 0182                schema: "jellyfin");
 183
 0184            migrationBuilder.DropTable(
 0185                name: "Permissions",
 0186                schema: "jellyfin");
 187
 0188            migrationBuilder.DropTable(
 0189                name: "Preferences",
 0190                schema: "jellyfin");
 191
 0192            migrationBuilder.DropTable(
 0193                name: "Users",
 0194                schema: "jellyfin");
 0195        }
 196    }
 197}

/srv/git/jellyfin/Jellyfin.Server.Implementations/Migrations/20200613202153_AddUsers.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("20200613202153_AddUsers")]
 15    partial class AddUsers
 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.4");
 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.ImageInfo", b =>
 2296                {
 2297                    b.Property<int>("Id")
 2298                        .ValueGeneratedOnAdd()
 2299                        .HasColumnType("INTEGER");
 22100
 22101                    b.Property<DateTime>("LastModified")
 22102                        .HasColumnType("TEXT");
 22103
 22104                    b.Property<string>("Path")
 22105                        .IsRequired()
 22106                        .HasColumnType("TEXT")
 22107                        .HasMaxLength(512);
 22108
 22109                    b.Property<Guid?>("UserId")
 22110                        .HasColumnType("TEXT");
 22111
 22112                    b.HasKey("Id");
 22113
 22114                    b.HasIndex("UserId")
 22115                        .IsUnique();
 22116
 22117                    b.ToTable("ImageInfos");
 22118                });
 119
 22120            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22121                {
 22122                    b.Property<int>("Id")
 22123                        .ValueGeneratedOnAdd()
 22124                        .HasColumnType("INTEGER");
 22125
 22126                    b.Property<int>("Kind")
 22127                        .HasColumnType("INTEGER");
 22128
 22129                    b.Property<Guid?>("Permission_Permissions_Guid")
 22130                        .HasColumnType("TEXT");
 22131
 22132                    b.Property<uint>("RowVersion")
 22133                        .IsConcurrencyToken()
 22134                        .HasColumnType("INTEGER");
 22135
 22136                    b.Property<bool>("Value")
 22137                        .HasColumnType("INTEGER");
 22138
 22139                    b.HasKey("Id");
 22140
 22141                    b.HasIndex("Permission_Permissions_Guid");
 22142
 22143                    b.ToTable("Permissions");
 22144                });
 145
 22146            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22147                {
 22148                    b.Property<int>("Id")
 22149                        .ValueGeneratedOnAdd()
 22150                        .HasColumnType("INTEGER");
 22151
 22152                    b.Property<int>("Kind")
 22153                        .HasColumnType("INTEGER");
 22154
 22155                    b.Property<Guid?>("Preference_Preferences_Guid")
 22156                        .HasColumnType("TEXT");
 22157
 22158                    b.Property<uint>("RowVersion")
 22159                        .IsConcurrencyToken()
 22160                        .HasColumnType("INTEGER");
 22161
 22162                    b.Property<string>("Value")
 22163                        .IsRequired()
 22164                        .HasColumnType("TEXT")
 22165                        .HasMaxLength(65535);
 22166
 22167                    b.HasKey("Id");
 22168
 22169                    b.HasIndex("Preference_Preferences_Guid");
 22170
 22171                    b.ToTable("Preferences");
 22172                });
 173
 22174            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 22175                {
 22176                    b.Property<Guid>("Id")
 22177                        .ValueGeneratedOnAdd()
 22178                        .HasColumnType("TEXT");
 22179
 22180                    b.Property<string>("AudioLanguagePreference")
 22181                        .HasColumnType("TEXT")
 22182                        .HasMaxLength(255);
 22183
 22184                    b.Property<string>("AuthenticationProviderId")
 22185                        .IsRequired()
 22186                        .HasColumnType("TEXT")
 22187                        .HasMaxLength(255);
 22188
 22189                    b.Property<bool>("DisplayCollectionsView")
 22190                        .HasColumnType("INTEGER");
 22191
 22192                    b.Property<bool>("DisplayMissingEpisodes")
 22193                        .HasColumnType("INTEGER");
 22194
 22195                    b.Property<string>("EasyPassword")
 22196                        .HasColumnType("TEXT")
 22197                        .HasMaxLength(65535);
 22198
 22199                    b.Property<bool>("EnableAutoLogin")
 22200                        .HasColumnType("INTEGER");
 22201
 22202                    b.Property<bool>("EnableLocalPassword")
 22203                        .HasColumnType("INTEGER");
 22204
 22205                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 22206                        .HasColumnType("INTEGER");
 22207
 22208                    b.Property<bool>("EnableUserPreferenceAccess")
 22209                        .HasColumnType("INTEGER");
 22210
 22211                    b.Property<bool>("HidePlayedInLatest")
 22212                        .HasColumnType("INTEGER");
 22213
 22214                    b.Property<long>("InternalId")
 22215                        .HasColumnType("INTEGER");
 22216
 22217                    b.Property<int>("InvalidLoginAttemptCount")
 22218                        .HasColumnType("INTEGER");
 22219
 22220                    b.Property<DateTime?>("LastActivityDate")
 22221                        .HasColumnType("TEXT");
 22222
 22223                    b.Property<DateTime?>("LastLoginDate")
 22224                        .HasColumnType("TEXT");
 22225
 22226                    b.Property<int?>("LoginAttemptsBeforeLockout")
 22227                        .HasColumnType("INTEGER");
 22228
 22229                    b.Property<int?>("MaxParentalAgeRating")
 22230                        .HasColumnType("INTEGER");
 22231
 22232                    b.Property<bool>("MustUpdatePassword")
 22233                        .HasColumnType("INTEGER");
 22234
 22235                    b.Property<string>("Password")
 22236                        .HasColumnType("TEXT")
 22237                        .HasMaxLength(65535);
 22238
 22239                    b.Property<string>("PasswordResetProviderId")
 22240                        .IsRequired()
 22241                        .HasColumnType("TEXT")
 22242                        .HasMaxLength(255);
 22243
 22244                    b.Property<bool>("PlayDefaultAudioTrack")
 22245                        .HasColumnType("INTEGER");
 22246
 22247                    b.Property<bool>("RememberAudioSelections")
 22248                        .HasColumnType("INTEGER");
 22249
 22250                    b.Property<bool>("RememberSubtitleSelections")
 22251                        .HasColumnType("INTEGER");
 22252
 22253                    b.Property<int?>("RemoteClientBitrateLimit")
 22254                        .HasColumnType("INTEGER");
 22255
 22256                    b.Property<uint>("RowVersion")
 22257                        .IsConcurrencyToken()
 22258                        .HasColumnType("INTEGER");
 22259
 22260                    b.Property<string>("SubtitleLanguagePreference")
 22261                        .HasColumnType("TEXT")
 22262                        .HasMaxLength(255);
 22263
 22264                    b.Property<int>("SubtitleMode")
 22265                        .HasColumnType("INTEGER");
 22266
 22267                    b.Property<int>("SyncPlayAccess")
 22268                        .HasColumnType("INTEGER");
 22269
 22270                    b.Property<string>("Username")
 22271                        .IsRequired()
 22272                        .HasColumnType("TEXT")
 22273                        .HasMaxLength(255);
 22274
 22275                    b.HasKey("Id");
 22276
 22277                    b.ToTable("Users");
 22278                });
 279
 22280            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 22281                {
 22282                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22283                        .WithMany("AccessSchedules")
 22284                        .HasForeignKey("UserId")
 22285                        .OnDelete(DeleteBehavior.Cascade)
 22286                        .IsRequired();
 22287                });
 288
 22289            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 22290                {
 22291                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22292                        .WithOne("ProfileImage")
 22293                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId");
 22294                });
 295
 22296            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 22297                {
 22298                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22299                        .WithMany("Permissions")
 22300                        .HasForeignKey("Permission_Permissions_Guid");
 22301                });
 302
 22303            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 22304                {
 22305                    b.HasOne("Jellyfin.Data.Entities.User", null)
 22306                        .WithMany("Preferences")
 22307                        .HasForeignKey("Preference_Preferences_Guid");
 22308                });
 309#pragma warning restore 612, 618
 22310        }
 311    }
 312}