< 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

0255075100

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/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/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        {
 2112            migrationBuilder.DropIndex(
 2113                name: "IX_DisplayPreferences_UserId_Client",
 2114                schema: "jellyfin",
 2115                table: "DisplayPreferences");
 16
 2117            migrationBuilder.AlterColumn<int>(
 2118                name: "MaxActiveSessions",
 2119                schema: "jellyfin",
 2120                table: "Users",
 2121                type: "INTEGER",
 2122                nullable: false,
 2123                defaultValue: 0,
 2124                oldClrType: typeof(int),
 2125                oldType: "INTEGER",
 2126                oldNullable: true);
 27
 2128            migrationBuilder.AddColumn<Guid>(
 2129                name: "ItemId",
 2130                schema: "jellyfin",
 2131                table: "DisplayPreferences",
 2132                type: "TEXT",
 2133                nullable: false,
 2134                defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
 35
 2136            migrationBuilder.CreateTable(
 2137                name: "CustomItemDisplayPreferences",
 2138                schema: "jellyfin",
 2139                columns: table => new
 2140                {
 2141                    Id = table.Column<int>(type: "INTEGER", nullable: false)
 2142                        .Annotation("Sqlite:Autoincrement", true),
 2143                    UserId = table.Column<Guid>(type: "TEXT", nullable: false),
 2144                    ItemId = table.Column<Guid>(type: "TEXT", nullable: false),
 2145                    Client = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false),
 2146                    Key = table.Column<string>(type: "TEXT", nullable: false),
 2147                    Value = table.Column<string>(type: "TEXT", nullable: false)
 2148                },
 2149                constraints: table =>
 2150                {
 2151                    table.PrimaryKey("PK_CustomItemDisplayPreferences", x => x.Id);
 2152                });
 53
 2154            migrationBuilder.CreateIndex(
 2155                name: "IX_DisplayPreferences_UserId_ItemId_Client",
 2156                schema: "jellyfin",
 2157                table: "DisplayPreferences",
 2158                columns: new[] { "UserId", "ItemId", "Client" },
 2159                unique: true);
 60
 2161            migrationBuilder.CreateIndex(
 2162                name: "IX_CustomItemDisplayPreferences_UserId",
 2163                schema: "jellyfin",
 2164                table: "CustomItemDisplayPreferences",
 2165                column: "UserId");
 66
 2167            migrationBuilder.CreateIndex(
 2168                name: "IX_CustomItemDisplayPreferences_UserId_ItemId_Client_Key",
 2169                schema: "jellyfin",
 2170                table: "CustomItemDisplayPreferences",
 2171                columns: new[] { "UserId", "ItemId", "Client", "Key" },
 2172                unique: true);
 2173        }
 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/src/Jellyfin.Database/Jellyfin.Database.Providers.Sqlite/Migrations/20201204223655_AddCustomDisplayPreferences.Designer.cs

#LineLine coverage
 1#pragma warning disable CS1591
 2// <auto-generated />
 3using System;
 4using Jellyfin.Database.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
 2119            modelBuilder
 2120                .HasDefaultSchema("jellyfin")
 2121                .HasAnnotation("ProductVersion", "5.0.0");
 22
 2123            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 2124                {
 2125                    b.Property<int>("Id")
 2126                        .ValueGeneratedOnAdd()
 2127                        .HasColumnType("INTEGER");
 2128
 2129                    b.Property<int>("DayOfWeek")
 2130                        .HasColumnType("INTEGER");
 2131
 2132                    b.Property<double>("EndHour")
 2133                        .HasColumnType("REAL");
 2134
 2135                    b.Property<double>("StartHour")
 2136                        .HasColumnType("REAL");
 2137
 2138                    b.Property<Guid>("UserId")
 2139                        .HasColumnType("TEXT");
 2140
 2141                    b.HasKey("Id");
 2142
 2143                    b.HasIndex("UserId");
 2144
 2145                    b.ToTable("AccessSchedules");
 2146                });
 47
 2148            modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b =>
 2149                {
 2150                    b.Property<int>("Id")
 2151                        .ValueGeneratedOnAdd()
 2152                        .HasColumnType("INTEGER");
 2153
 2154                    b.Property<DateTime>("DateCreated")
 2155                        .HasColumnType("TEXT");
 2156
 2157                    b.Property<string>("ItemId")
 2158                        .HasMaxLength(256)
 2159                        .HasColumnType("TEXT");
 2160
 2161                    b.Property<int>("LogSeverity")
 2162                        .HasColumnType("INTEGER");
 2163
 2164                    b.Property<string>("Name")
 2165                        .IsRequired()
 2166                        .HasMaxLength(512)
 2167                        .HasColumnType("TEXT");
 2168
 2169                    b.Property<string>("Overview")
 2170                        .HasMaxLength(512)
 2171                        .HasColumnType("TEXT");
 2172
 2173                    b.Property<uint>("RowVersion")
 2174                        .IsConcurrencyToken()
 2175                        .HasColumnType("INTEGER");
 2176
 2177                    b.Property<string>("ShortOverview")
 2178                        .HasMaxLength(512)
 2179                        .HasColumnType("TEXT");
 2180
 2181                    b.Property<string>("Type")
 2182                        .IsRequired()
 2183                        .HasMaxLength(256)
 2184                        .HasColumnType("TEXT");
 2185
 2186                    b.Property<Guid>("UserId")
 2187                        .HasColumnType("TEXT");
 2188
 2189                    b.HasKey("Id");
 2190
 2191                    b.ToTable("ActivityLogs");
 2192                });
 93
 2194            modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b =>
 2195                {
 2196                    b.Property<int>("Id")
 2197                        .ValueGeneratedOnAdd()
 2198                        .HasColumnType("INTEGER");
 2199
 21100                    b.Property<string>("Client")
 21101                        .IsRequired()
 21102                        .HasMaxLength(32)
 21103                        .HasColumnType("TEXT");
 21104
 21105                    b.Property<Guid>("ItemId")
 21106                        .HasColumnType("TEXT");
 21107
 21108                    b.Property<string>("Key")
 21109                        .IsRequired()
 21110                        .HasColumnType("TEXT");
 21111
 21112                    b.Property<Guid>("UserId")
 21113                        .HasColumnType("TEXT");
 21114
 21115                    b.Property<string>("Value")
 21116                        .IsRequired()
 21117                        .HasColumnType("TEXT");
 21118
 21119                    b.HasKey("Id");
 21120
 21121                    b.HasIndex("UserId");
 21122
 21123                    b.HasIndex("UserId", "ItemId", "Client", "Key")
 21124                        .IsUnique();
 21125
 21126                    b.ToTable("CustomItemDisplayPreferences");
 21127                });
 128
 21129            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 21130                {
 21131                    b.Property<int>("Id")
 21132                        .ValueGeneratedOnAdd()
 21133                        .HasColumnType("INTEGER");
 21134
 21135                    b.Property<int>("ChromecastVersion")
 21136                        .HasColumnType("INTEGER");
 21137
 21138                    b.Property<string>("Client")
 21139                        .IsRequired()
 21140                        .HasMaxLength(32)
 21141                        .HasColumnType("TEXT");
 21142
 21143                    b.Property<string>("DashboardTheme")
 21144                        .HasMaxLength(32)
 21145                        .HasColumnType("TEXT");
 21146
 21147                    b.Property<bool>("EnableNextVideoInfoOverlay")
 21148                        .HasColumnType("INTEGER");
 21149
 21150                    b.Property<int?>("IndexBy")
 21151                        .HasColumnType("INTEGER");
 21152
 21153                    b.Property<Guid>("ItemId")
 21154                        .HasColumnType("TEXT");
 21155
 21156                    b.Property<int>("ScrollDirection")
 21157                        .HasColumnType("INTEGER");
 21158
 21159                    b.Property<bool>("ShowBackdrop")
 21160                        .HasColumnType("INTEGER");
 21161
 21162                    b.Property<bool>("ShowSidebar")
 21163                        .HasColumnType("INTEGER");
 21164
 21165                    b.Property<int>("SkipBackwardLength")
 21166                        .HasColumnType("INTEGER");
 21167
 21168                    b.Property<int>("SkipForwardLength")
 21169                        .HasColumnType("INTEGER");
 21170
 21171                    b.Property<string>("TvHome")
 21172                        .HasMaxLength(32)
 21173                        .HasColumnType("TEXT");
 21174
 21175                    b.Property<Guid>("UserId")
 21176                        .HasColumnType("TEXT");
 21177
 21178                    b.HasKey("Id");
 21179
 21180                    b.HasIndex("UserId");
 21181
 21182                    b.HasIndex("UserId", "ItemId", "Client")
 21183                        .IsUnique();
 21184
 21185                    b.ToTable("DisplayPreferences");
 21186                });
 187
 21188            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 21189                {
 21190                    b.Property<int>("Id")
 21191                        .ValueGeneratedOnAdd()
 21192                        .HasColumnType("INTEGER");
 21193
 21194                    b.Property<int>("DisplayPreferencesId")
 21195                        .HasColumnType("INTEGER");
 21196
 21197                    b.Property<int>("Order")
 21198                        .HasColumnType("INTEGER");
 21199
 21200                    b.Property<int>("Type")
 21201                        .HasColumnType("INTEGER");
 21202
 21203                    b.HasKey("Id");
 21204
 21205                    b.HasIndex("DisplayPreferencesId");
 21206
 21207                    b.ToTable("HomeSection");
 21208                });
 209
 21210            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 21211                {
 21212                    b.Property<int>("Id")
 21213                        .ValueGeneratedOnAdd()
 21214                        .HasColumnType("INTEGER");
 21215
 21216                    b.Property<DateTime>("LastModified")
 21217                        .HasColumnType("TEXT");
 21218
 21219                    b.Property<string>("Path")
 21220                        .IsRequired()
 21221                        .HasMaxLength(512)
 21222                        .HasColumnType("TEXT");
 21223
 21224                    b.Property<Guid?>("UserId")
 21225                        .HasColumnType("TEXT");
 21226
 21227                    b.HasKey("Id");
 21228
 21229                    b.HasIndex("UserId")
 21230                        .IsUnique();
 21231
 21232                    b.ToTable("ImageInfos");
 21233                });
 234
 21235            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 21236                {
 21237                    b.Property<int>("Id")
 21238                        .ValueGeneratedOnAdd()
 21239                        .HasColumnType("INTEGER");
 21240
 21241                    b.Property<string>("Client")
 21242                        .IsRequired()
 21243                        .HasMaxLength(32)
 21244                        .HasColumnType("TEXT");
 21245
 21246                    b.Property<int?>("IndexBy")
 21247                        .HasColumnType("INTEGER");
 21248
 21249                    b.Property<Guid>("ItemId")
 21250                        .HasColumnType("TEXT");
 21251
 21252                    b.Property<bool>("RememberIndexing")
 21253                        .HasColumnType("INTEGER");
 21254
 21255                    b.Property<bool>("RememberSorting")
 21256                        .HasColumnType("INTEGER");
 21257
 21258                    b.Property<string>("SortBy")
 21259                        .IsRequired()
 21260                        .HasMaxLength(64)
 21261                        .HasColumnType("TEXT");
 21262
 21263                    b.Property<int>("SortOrder")
 21264                        .HasColumnType("INTEGER");
 21265
 21266                    b.Property<Guid>("UserId")
 21267                        .HasColumnType("TEXT");
 21268
 21269                    b.Property<int>("ViewType")
 21270                        .HasColumnType("INTEGER");
 21271
 21272                    b.HasKey("Id");
 21273
 21274                    b.HasIndex("UserId");
 21275
 21276                    b.ToTable("ItemDisplayPreferences");
 21277                });
 278
 21279            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 21280                {
 21281                    b.Property<int>("Id")
 21282                        .ValueGeneratedOnAdd()
 21283                        .HasColumnType("INTEGER");
 21284
 21285                    b.Property<int>("Kind")
 21286                        .HasColumnType("INTEGER");
 21287
 21288                    b.Property<Guid?>("Permission_Permissions_Guid")
 21289                        .HasColumnType("TEXT");
 21290
 21291                    b.Property<uint>("RowVersion")
 21292                        .IsConcurrencyToken()
 21293                        .HasColumnType("INTEGER");
 21294
 21295                    b.Property<bool>("Value")
 21296                        .HasColumnType("INTEGER");
 21297
 21298                    b.HasKey("Id");
 21299
 21300                    b.HasIndex("Permission_Permissions_Guid");
 21301
 21302                    b.ToTable("Permissions");
 21303                });
 304
 21305            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 21306                {
 21307                    b.Property<int>("Id")
 21308                        .ValueGeneratedOnAdd()
 21309                        .HasColumnType("INTEGER");
 21310
 21311                    b.Property<int>("Kind")
 21312                        .HasColumnType("INTEGER");
 21313
 21314                    b.Property<Guid?>("Preference_Preferences_Guid")
 21315                        .HasColumnType("TEXT");
 21316
 21317                    b.Property<uint>("RowVersion")
 21318                        .IsConcurrencyToken()
 21319                        .HasColumnType("INTEGER");
 21320
 21321                    b.Property<string>("Value")
 21322                        .IsRequired()
 21323                        .HasMaxLength(65535)
 21324                        .HasColumnType("TEXT");
 21325
 21326                    b.HasKey("Id");
 21327
 21328                    b.HasIndex("Preference_Preferences_Guid");
 21329
 21330                    b.ToTable("Preferences");
 21331                });
 332
 21333            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 21334                {
 21335                    b.Property<Guid>("Id")
 21336                        .ValueGeneratedOnAdd()
 21337                        .HasColumnType("TEXT");
 21338
 21339                    b.Property<string>("AudioLanguagePreference")
 21340                        .HasMaxLength(255)
 21341                        .HasColumnType("TEXT");
 21342
 21343                    b.Property<string>("AuthenticationProviderId")
 21344                        .IsRequired()
 21345                        .HasMaxLength(255)
 21346                        .HasColumnType("TEXT");
 21347
 21348                    b.Property<bool>("DisplayCollectionsView")
 21349                        .HasColumnType("INTEGER");
 21350
 21351                    b.Property<bool>("DisplayMissingEpisodes")
 21352                        .HasColumnType("INTEGER");
 21353
 21354                    b.Property<string>("EasyPassword")
 21355                        .HasMaxLength(65535)
 21356                        .HasColumnType("TEXT");
 21357
 21358                    b.Property<bool>("EnableAutoLogin")
 21359                        .HasColumnType("INTEGER");
 21360
 21361                    b.Property<bool>("EnableLocalPassword")
 21362                        .HasColumnType("INTEGER");
 21363
 21364                    b.Property<bool>("EnableNextEpisodeAutoPlay")
 21365                        .HasColumnType("INTEGER");
 21366
 21367                    b.Property<bool>("EnableUserPreferenceAccess")
 21368                        .HasColumnType("INTEGER");
 21369
 21370                    b.Property<bool>("HidePlayedInLatest")
 21371                        .HasColumnType("INTEGER");
 21372
 21373                    b.Property<long>("InternalId")
 21374                        .HasColumnType("INTEGER");
 21375
 21376                    b.Property<int>("InvalidLoginAttemptCount")
 21377                        .HasColumnType("INTEGER");
 21378
 21379                    b.Property<DateTime?>("LastActivityDate")
 21380                        .HasColumnType("TEXT");
 21381
 21382                    b.Property<DateTime?>("LastLoginDate")
 21383                        .HasColumnType("TEXT");
 21384
 21385                    b.Property<int?>("LoginAttemptsBeforeLockout")
 21386                        .HasColumnType("INTEGER");
 21387
 21388                    b.Property<int>("MaxActiveSessions")
 21389                        .HasColumnType("INTEGER");
 21390
 21391                    b.Property<int?>("MaxParentalAgeRating")
 21392                        .HasColumnType("INTEGER");
 21393
 21394                    b.Property<bool>("MustUpdatePassword")
 21395                        .HasColumnType("INTEGER");
 21396
 21397                    b.Property<string>("Password")
 21398                        .HasMaxLength(65535)
 21399                        .HasColumnType("TEXT");
 21400
 21401                    b.Property<string>("PasswordResetProviderId")
 21402                        .IsRequired()
 21403                        .HasMaxLength(255)
 21404                        .HasColumnType("TEXT");
 21405
 21406                    b.Property<bool>("PlayDefaultAudioTrack")
 21407                        .HasColumnType("INTEGER");
 21408
 21409                    b.Property<bool>("RememberAudioSelections")
 21410                        .HasColumnType("INTEGER");
 21411
 21412                    b.Property<bool>("RememberSubtitleSelections")
 21413                        .HasColumnType("INTEGER");
 21414
 21415                    b.Property<int?>("RemoteClientBitrateLimit")
 21416                        .HasColumnType("INTEGER");
 21417
 21418                    b.Property<uint>("RowVersion")
 21419                        .IsConcurrencyToken()
 21420                        .HasColumnType("INTEGER");
 21421
 21422                    b.Property<string>("SubtitleLanguagePreference")
 21423                        .HasMaxLength(255)
 21424                        .HasColumnType("TEXT");
 21425
 21426                    b.Property<int>("SubtitleMode")
 21427                        .HasColumnType("INTEGER");
 21428
 21429                    b.Property<int>("SyncPlayAccess")
 21430                        .HasColumnType("INTEGER");
 21431
 21432                    b.Property<string>("Username")
 21433                        .IsRequired()
 21434                        .HasMaxLength(255)
 21435                        .HasColumnType("TEXT");
 21436
 21437                    b.HasKey("Id");
 21438
 21439                    b.ToTable("Users");
 21440                });
 441
 21442            modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b =>
 21443                {
 21444                    b.HasOne("Jellyfin.Data.Entities.User", null)
 21445                        .WithMany("AccessSchedules")
 21446                        .HasForeignKey("UserId")
 21447                        .OnDelete(DeleteBehavior.Cascade)
 21448                        .IsRequired();
 21449                });
 450
 21451            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 21452                {
 21453                    b.HasOne("Jellyfin.Data.Entities.User", null)
 21454                        .WithOne("DisplayPreferences")
 21455                        .HasForeignKey("Jellyfin.Data.Entities.DisplayPreferences", "UserId")
 21456                        .OnDelete(DeleteBehavior.Cascade)
 21457                        .IsRequired();
 21458                });
 459
 21460            modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b =>
 21461                {
 21462                    b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null)
 21463                        .WithMany("HomeSections")
 21464                        .HasForeignKey("DisplayPreferencesId")
 21465                        .OnDelete(DeleteBehavior.Cascade)
 21466                        .IsRequired();
 21467                });
 468
 21469            modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b =>
 21470                {
 21471                    b.HasOne("Jellyfin.Data.Entities.User", null)
 21472                        .WithOne("ProfileImage")
 21473                        .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId");
 21474                });
 475
 21476            modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b =>
 21477                {
 21478                    b.HasOne("Jellyfin.Data.Entities.User", null)
 21479                        .WithMany("ItemDisplayPreferences")
 21480                        .HasForeignKey("UserId")
 21481                        .OnDelete(DeleteBehavior.Cascade)
 21482                        .IsRequired();
 21483                });
 484
 21485            modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b =>
 21486                {
 21487                    b.HasOne("Jellyfin.Data.Entities.User", null)
 21488                        .WithMany("Permissions")
 21489                        .HasForeignKey("Permission_Permissions_Guid");
 21490                });
 491
 21492            modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b =>
 21493                {
 21494                    b.HasOne("Jellyfin.Data.Entities.User", null)
 21495                        .WithMany("Preferences")
 21496                        .HasForeignKey("Preference_Preferences_Guid");
 21497                });
 498
 21499            modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b =>
 21500                {
 21501                    b.Navigation("HomeSections");
 21502                });
 503
 21504            modelBuilder.Entity("Jellyfin.Data.Entities.User", b =>
 21505                {
 21506                    b.Navigation("AccessSchedules");
 21507
 21508                    b.Navigation("DisplayPreferences")
 21509                        .IsRequired();
 21510
 21511                    b.Navigation("ItemDisplayPreferences");
 21512
 21513                    b.Navigation("Permissions");
 21514
 21515                    b.Navigation("Preferences");
 21516
 21517                    b.Navigation("ProfileImage");
 21518                });
 519#pragma warning restore 612, 618
 21520        }
 521    }
 522}