diff options
| author | Cody Robibero <cody@robibe.ro> | 2025-03-25 21:34:26 -0600 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-03-25 21:34:26 -0600 |
| commit | d848faeb75f0109b5616f1f8405fa85cf734f860 (patch) | |
| tree | 59671ffe495d438cbb9ce095f1c3f26247095291 /Jellyfin.Server.Implementations | |
| parent | 035ecbdde33ce5b71cd580ebb0c3e1df320f80c7 (diff) | |
| parent | 1b388d729682435b92cb10eba67a1170ecbfcc6c (diff) | |
Merge pull request #13589 from JPVenson/feature/DatabaseRefactor
[Feature] Database code refactor
Diffstat (limited to 'Jellyfin.Server.Implementations')
115 files changed, 180 insertions, 28085 deletions
diff --git a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs index 54272aeaf..8d492f7cd 100644 --- a/Jellyfin.Server.Implementations/Activity/ActivityManager.cs +++ b/Jellyfin.Server.Implementations/Activity/ActivityManager.cs @@ -1,9 +1,10 @@ using System; using System.Linq; using System.Threading.Tasks; -using Jellyfin.Data.Entities; using Jellyfin.Data.Events; using Jellyfin.Data.Queries; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Model.Activity; using MediaBrowser.Model.Querying; using Microsoft.EntityFrameworkCore; diff --git a/Jellyfin.Server.Implementations/DbConfiguration/DatabaseConfigurationFactory.cs b/Jellyfin.Server.Implementations/DbConfiguration/DatabaseConfigurationFactory.cs new file mode 100644 index 000000000..26d32f417 --- /dev/null +++ b/Jellyfin.Server.Implementations/DbConfiguration/DatabaseConfigurationFactory.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using MediaBrowser.Common.Configuration; + +namespace Jellyfin.Server.Implementations.DatabaseConfiguration; + +/// <summary> +/// Factory for constructing a database configuration. +/// </summary> +public class DatabaseConfigurationFactory : IConfigurationFactory +{ + /// <inheritdoc/> + public IEnumerable<ConfigurationStore> GetConfigurations() + { + yield return new DatabaseConfigurationStore(); + } +} diff --git a/Jellyfin.Server.Implementations/DbConfiguration/DatabaseConfigurationStore.cs b/Jellyfin.Server.Implementations/DbConfiguration/DatabaseConfigurationStore.cs new file mode 100644 index 000000000..537630561 --- /dev/null +++ b/Jellyfin.Server.Implementations/DbConfiguration/DatabaseConfigurationStore.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using Jellyfin.Database.Implementations.DbConfiguration; +using MediaBrowser.Common.Configuration; + +namespace Jellyfin.Server.Implementations.DatabaseConfiguration; + +/// <summary> +/// A configuration that stores database related settings. +/// </summary> +public class DatabaseConfigurationStore : ConfigurationStore +{ + /// <summary> + /// The name of the configuration in the storage. + /// </summary> + public const string StoreKey = "database"; + + /// <summary> + /// Initializes a new instance of the <see cref="DatabaseConfigurationStore"/> class. + /// </summary> + public DatabaseConfigurationStore() + { + ConfigurationType = typeof(DatabaseConfigurationOptions); + Key = StoreKey; + } +} diff --git a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs index d3bff2936..51a118645 100644 --- a/Jellyfin.Server.Implementations/Devices/DeviceManager.cs +++ b/Jellyfin.Server.Implementations/Devices/DeviceManager.cs @@ -3,12 +3,14 @@ using System.Collections.Concurrent; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using Jellyfin.Data; using Jellyfin.Data.Dtos; -using Jellyfin.Data.Entities; -using Jellyfin.Data.Entities.Security; -using Jellyfin.Data.Enums; using Jellyfin.Data.Events; using Jellyfin.Data.Queries; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; +using Jellyfin.Database.Implementations.Entities.Security; +using Jellyfin.Database.Implementations.Enums; using Jellyfin.Extensions; using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Devices; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Library/LyricDownloadFailureLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Library/LyricDownloadFailureLogger.cs index 0d52bb985..5f4864e95 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Library/LyricDownloadFailureLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Library/LyricDownloadFailureLogger.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Events; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Library/SubtitleDownloadFailureLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Library/SubtitleDownloadFailureLogger.cs index 0a8c064a9..8fe380e4f 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Library/SubtitleDownloadFailureLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Library/SubtitleDownloadFailureLogger.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Entities.Audio; using MediaBrowser.Controller.Events; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Security/AuthenticationFailedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Security/AuthenticationFailedLogger.cs index a4424c739..1a8931a6d 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Security/AuthenticationFailedLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Security/AuthenticationFailedLogger.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Events.Authentication; using MediaBrowser.Model.Activity; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Security/AuthenticationSucceededLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Security/AuthenticationSucceededLogger.cs index e0ecef2a5..584d559e4 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Security/AuthenticationSucceededLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Security/AuthenticationSucceededLogger.cs @@ -1,6 +1,6 @@ using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Events.Authentication; using MediaBrowser.Model.Activity; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStartLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStartLogger.cs index 0ef929a99..73323acb3 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStartLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStartLogger.cs @@ -1,8 +1,8 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; using Jellyfin.Data.Enums; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Activity; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs index 7d452ea2f..b75567539 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Session/PlaybackStopLogger.cs @@ -1,8 +1,8 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; using Jellyfin.Data.Enums; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Library; using MediaBrowser.Model.Activity; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Session/SessionEndedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Session/SessionEndedLogger.cs index 77e7859c6..b90708a2f 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Session/SessionEndedLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Session/SessionEndedLogger.cs @@ -1,6 +1,6 @@ using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Events.Session; using MediaBrowser.Model.Activity; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Session/SessionStartedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Session/SessionStartedLogger.cs index 141dc20ea..139c2e2ac 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Session/SessionStartedLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Session/SessionStartedLogger.cs @@ -1,6 +1,6 @@ using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Events.Session; using MediaBrowser.Model.Activity; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/System/TaskCompletedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/System/TaskCompletedLogger.cs index b0a9393eb..da82a3b30 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/System/TaskCompletedLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/System/TaskCompletedLogger.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Globalization; using System.Text; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Model.Activity; using MediaBrowser.Model.Globalization; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedLogger.cs index 0ae9b7f66..632f30c7a 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstallationFailedLogger.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Common.Updates; using MediaBrowser.Controller.Events; using MediaBrowser.Model.Activity; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstalledLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstalledLogger.cs index 287ba578b..4b49b714c 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstalledLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginInstalledLogger.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Events.Updates; using MediaBrowser.Model.Activity; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUninstalledLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUninstalledLogger.cs index 2de207b15..2d24de7fc 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUninstalledLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUninstalledLogger.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Events.Updates; using MediaBrowser.Model.Activity; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUpdatedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUpdatedLogger.cs index 08d6bf9c2..e892d3dd9 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUpdatedLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Updates/PluginUpdatedLogger.cs @@ -1,7 +1,7 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Controller.Events.Updates; using MediaBrowser.Model.Activity; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Users/UserCreatedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Users/UserCreatedLogger.cs index a09c344f6..4f063f6a1 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Users/UserCreatedLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Users/UserCreatedLogger.cs @@ -1,7 +1,7 @@ using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; using Jellyfin.Data.Events.Users; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Model.Activity; using MediaBrowser.Model.Globalization; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Users/UserDeletedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Users/UserDeletedLogger.cs index 46da8044a..ba4a072e8 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Users/UserDeletedLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Users/UserDeletedLogger.cs @@ -1,8 +1,8 @@ using System; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; using Jellyfin.Data.Events.Users; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Model.Activity; using MediaBrowser.Model.Globalization; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Users/UserLockedOutLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Users/UserLockedOutLogger.cs index 1d0d016a7..bbc00567d 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Users/UserLockedOutLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Users/UserLockedOutLogger.cs @@ -1,7 +1,7 @@ using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; using Jellyfin.Data.Events.Users; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Model.Activity; using MediaBrowser.Model.Globalization; diff --git a/Jellyfin.Server.Implementations/Events/Consumers/Users/UserPasswordChangedLogger.cs b/Jellyfin.Server.Implementations/Events/Consumers/Users/UserPasswordChangedLogger.cs index 2b8f966a8..7219704ec 100644 --- a/Jellyfin.Server.Implementations/Events/Consumers/Users/UserPasswordChangedLogger.cs +++ b/Jellyfin.Server.Implementations/Events/Consumers/Users/UserPasswordChangedLogger.cs @@ -1,7 +1,7 @@ using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; using Jellyfin.Data.Events.Users; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Events; using MediaBrowser.Model.Activity; using MediaBrowser.Model.Globalization; diff --git a/Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs b/Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs index 7eee26059..fbbb5bca7 100644 --- a/Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs +++ b/Jellyfin.Server.Implementations/Extensions/ServiceCollectionExtensions.cs @@ -1,8 +1,15 @@ using System; -using System.IO; +using System.Collections.Generic; +using System.Reflection; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.DbConfiguration; +using Jellyfin.Database.Providers.Sqlite; using MediaBrowser.Common.Configuration; +using MediaBrowser.Controller.Configuration; using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; +using JellyfinDbProviderFactory = System.Func<System.IServiceProvider, Jellyfin.Database.Implementations.IJellyfinDatabaseProvider>; namespace Jellyfin.Server.Implementations.Extensions; @@ -11,17 +18,77 @@ namespace Jellyfin.Server.Implementations.Extensions; /// </summary> public static class ServiceCollectionExtensions { + private static IEnumerable<Type> DatabaseProviderTypes() + { + yield return typeof(SqliteDatabaseProvider); + } + + private static IDictionary<string, JellyfinDbProviderFactory> GetSupportedDbProviders() + { + var items = new Dictionary<string, JellyfinDbProviderFactory>(StringComparer.InvariantCultureIgnoreCase); + foreach (var providerType in DatabaseProviderTypes()) + { + var keyAttribute = providerType.GetCustomAttribute<JellyfinDatabaseProviderKeyAttribute>(); + if (keyAttribute is null || string.IsNullOrWhiteSpace(keyAttribute.DatabaseProviderKey)) + { + continue; + } + + var provider = providerType; + items[keyAttribute.DatabaseProviderKey] = (services) => (IJellyfinDatabaseProvider)ActivatorUtilities.CreateInstance(services, providerType); + } + + return items; + } + /// <summary> /// Adds the <see cref="IDbContextFactory{TContext}"/> interface to the service collection with second level caching enabled. /// </summary> /// <param name="serviceCollection">An instance of the <see cref="IServiceCollection"/> interface.</param> + /// <param name="configurationManager">The server configuration manager.</param> + /// <param name="configuration">The startup Configuration.</param> /// <returns>The updated service collection.</returns> - public static IServiceCollection AddJellyfinDbContext(this IServiceCollection serviceCollection) + public static IServiceCollection AddJellyfinDbContext( + this IServiceCollection serviceCollection, + IServerConfigurationManager configurationManager, + IConfiguration configuration) { + var efCoreConfiguration = configurationManager.GetConfiguration<DatabaseConfigurationOptions>("database"); + var providers = GetSupportedDbProviders(); + JellyfinDbProviderFactory? providerFactory = null; + + if (efCoreConfiguration?.DatabaseType is null) + { + var cmdMigrationArgument = configuration.GetValue<string>("migration-provider"); + if (!string.IsNullOrWhiteSpace(cmdMigrationArgument)) + { + efCoreConfiguration = new DatabaseConfigurationOptions() + { + DatabaseType = cmdMigrationArgument, + }; + } + else + { + // when nothing is setup via new Database configuration, fallback to SQLite with default settings. + efCoreConfiguration = new DatabaseConfigurationOptions() + { + DatabaseType = "Jellyfin-SQLite", + }; + configurationManager.SaveConfiguration("database", efCoreConfiguration); + } + } + + if (!providers.TryGetValue(efCoreConfiguration.DatabaseType.ToUpperInvariant(), out providerFactory!)) + { + throw new InvalidOperationException($"Jellyfin cannot find the database provider of type '{efCoreConfiguration.DatabaseType}'. Supported types are {string.Join(", ", providers.Keys)}"); + } + + serviceCollection.AddSingleton<IJellyfinDatabaseProvider>(providerFactory!); + serviceCollection.AddPooledDbContextFactory<JellyfinDbContext>((serviceProvider, opt) => { - var applicationPaths = serviceProvider.GetRequiredService<IApplicationPaths>(); - opt.UseSqlite($"Filename={Path.Combine(applicationPaths.DataPath, "jellyfin.db")};Pooling=false"); + var provider = serviceProvider.GetRequiredService<IJellyfinDatabaseProvider>(); + provider.Initialise(opt); }); return serviceCollection; diff --git a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs index bea69b282..4f6902244 100644 --- a/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs +++ b/Jellyfin.Server.Implementations/Item/BaseItemRepository.cs @@ -16,8 +16,10 @@ using System.Reflection; using System.Text; using System.Text.Json; using System.Threading; -using Jellyfin.Data.Entities; using Jellyfin.Data.Enums; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; +using Jellyfin.Database.Implementations.Enums; using Jellyfin.Extensions; using Jellyfin.Extensions.Json; using MediaBrowser.Common; @@ -36,7 +38,7 @@ using MediaBrowser.Model.Querying; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; using BaseItemDto = MediaBrowser.Controller.Entities.BaseItem; -using BaseItemEntity = Jellyfin.Data.Entities.BaseItemEntity; +using BaseItemEntity = Jellyfin.Database.Implementations.Entities.BaseItemEntity; namespace Jellyfin.Server.Implementations.Item; diff --git a/Jellyfin.Server.Implementations/Item/ChapterRepository.cs b/Jellyfin.Server.Implementations/Item/ChapterRepository.cs index fc6f04d56..93e15735c 100644 --- a/Jellyfin.Server.Implementations/Item/ChapterRepository.cs +++ b/Jellyfin.Server.Implementations/Item/ChapterRepository.cs @@ -2,7 +2,8 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Chapters; using MediaBrowser.Controller.Drawing; using MediaBrowser.Model.Dto; diff --git a/Jellyfin.Server.Implementations/Item/MediaAttachmentRepository.cs b/Jellyfin.Server.Implementations/Item/MediaAttachmentRepository.cs index 155798209..3ae6dbd70 100644 --- a/Jellyfin.Server.Implementations/Item/MediaAttachmentRepository.cs +++ b/Jellyfin.Server.Implementations/Item/MediaAttachmentRepository.cs @@ -3,7 +3,8 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Entities; using Microsoft.EntityFrameworkCore; diff --git a/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs b/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs index f47e3fdfd..36c3b9e56 100644 --- a/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs +++ b/Jellyfin.Server.Implementations/Item/MediaStreamRepository.cs @@ -3,7 +3,8 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; using System.Threading; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller; using MediaBrowser.Controller.Persistence; using MediaBrowser.Model.Entities; diff --git a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs index 1396f1c6f..77877835e 100644 --- a/Jellyfin.Server.Implementations/Item/PeopleRepository.cs +++ b/Jellyfin.Server.Implementations/Item/PeopleRepository.cs @@ -2,8 +2,9 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using Jellyfin.Data.Entities; using Jellyfin.Data.Enums; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; using Jellyfin.Extensions; using MediaBrowser.Controller.Entities; using MediaBrowser.Controller.Persistence; diff --git a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj index 31cf24fb2..6693ab8db 100644 --- a/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj +++ b/Jellyfin.Server.Implementations/Jellyfin.Server.Implementations.csproj @@ -28,22 +28,15 @@ <ItemGroup> <PackageReference Include="AsyncKeyedLock" /> <PackageReference Include="System.Linq.Async" /> - <PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Relational" /> - <PackageReference Include="Microsoft.EntityFrameworkCore.Design"> - <PrivateAssets>all</PrivateAssets> - <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> - </PackageReference> - <PackageReference Include="Microsoft.EntityFrameworkCore.Tools"> - <PrivateAssets>all</PrivateAssets> - <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> - </PackageReference> </ItemGroup> <ItemGroup> <ProjectReference Include="..\Jellyfin.Data\Jellyfin.Data.csproj" /> <ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" /> <ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" /> + <ProjectReference Include="..\src\Jellyfin.Database\Jellyfin.Database.Implementations\Jellyfin.Database.Implementations.csproj" /> + <ProjectReference Include="..\src\Jellyfin.Database\Jellyfin.Database.Providers.Sqlite\Jellyfin.Database.Providers.Sqlite.csproj" /> </ItemGroup> </Project> diff --git a/Jellyfin.Server.Implementations/JellyfinDbContext.cs b/Jellyfin.Server.Implementations/JellyfinDbContext.cs deleted file mode 100644 index 43ea2bd3c..000000000 --- a/Jellyfin.Server.Implementations/JellyfinDbContext.cs +++ /dev/null @@ -1,295 +0,0 @@ -using System; -using System.Linq; -using Jellyfin.Data.Entities; -using Jellyfin.Data.Entities.Security; -using Jellyfin.Data.Interfaces; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using Microsoft.EntityFrameworkCore.Metadata.Conventions; -using Microsoft.Extensions.Logging; - -namespace Jellyfin.Server.Implementations; - -/// <inheritdoc/> -/// <summary> -/// Initializes a new instance of the <see cref="JellyfinDbContext"/> class. -/// </summary> -/// <param name="options">The database context options.</param> -/// <param name="logger">Logger.</param> -public class JellyfinDbContext(DbContextOptions<JellyfinDbContext> options, ILogger<JellyfinDbContext> logger) : DbContext(options) -{ - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the access schedules. - /// </summary> - public DbSet<AccessSchedule> AccessSchedules => Set<AccessSchedule>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the activity logs. - /// </summary> - public DbSet<ActivityLog> ActivityLogs => Set<ActivityLog>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the API keys. - /// </summary> - public DbSet<ApiKey> ApiKeys => Set<ApiKey>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the devices. - /// </summary> - public DbSet<Device> Devices => Set<Device>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the device options. - /// </summary> - public DbSet<DeviceOptions> DeviceOptions => Set<DeviceOptions>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the display preferences. - /// </summary> - public DbSet<DisplayPreferences> DisplayPreferences => Set<DisplayPreferences>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the image infos. - /// </summary> - public DbSet<ImageInfo> ImageInfos => Set<ImageInfo>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the item display preferences. - /// </summary> - public DbSet<ItemDisplayPreferences> ItemDisplayPreferences => Set<ItemDisplayPreferences>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the custom item display preferences. - /// </summary> - public DbSet<CustomItemDisplayPreferences> CustomItemDisplayPreferences => Set<CustomItemDisplayPreferences>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the permissions. - /// </summary> - public DbSet<Permission> Permissions => Set<Permission>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the preferences. - /// </summary> - public DbSet<Preference> Preferences => Set<Preference>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the users. - /// </summary> - public DbSet<User> Users => Set<User>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the trickplay metadata. - /// </summary> - public DbSet<TrickplayInfo> TrickplayInfos => Set<TrickplayInfo>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the media segments. - /// </summary> - public DbSet<MediaSegment> MediaSegments => Set<MediaSegment>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the user data. - /// </summary> - public DbSet<UserData> UserData => Set<UserData>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the user data. - /// </summary> - public DbSet<AncestorId> AncestorIds => Set<AncestorId>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the user data. - /// </summary> - public DbSet<AttachmentStreamInfo> AttachmentStreamInfos => Set<AttachmentStreamInfo>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the user data. - /// </summary> - public DbSet<BaseItemEntity> BaseItems => Set<BaseItemEntity>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the user data. - /// </summary> - public DbSet<Chapter> Chapters => Set<Chapter>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/>. - /// </summary> - public DbSet<ItemValue> ItemValues => Set<ItemValue>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/>. - /// </summary> - public DbSet<ItemValueMap> ItemValuesMap => Set<ItemValueMap>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/>. - /// </summary> - public DbSet<MediaStreamInfo> MediaStreamInfos => Set<MediaStreamInfo>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/>. - /// </summary> - public DbSet<People> Peoples => Set<People>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/>. - /// </summary> - public DbSet<PeopleBaseItemMap> PeopleBaseItemMap => Set<PeopleBaseItemMap>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/> containing the referenced Providers with ids. - /// </summary> - public DbSet<BaseItemProvider> BaseItemProviders => Set<BaseItemProvider>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/>. - /// </summary> - public DbSet<BaseItemImageInfo> BaseItemImageInfos => Set<BaseItemImageInfo>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/>. - /// </summary> - public DbSet<BaseItemMetadataField> BaseItemMetadataFields => Set<BaseItemMetadataField>(); - - /// <summary> - /// Gets the <see cref="DbSet{TEntity}"/>. - /// </summary> - public DbSet<BaseItemTrailerType> BaseItemTrailerTypes => Set<BaseItemTrailerType>(); - - /*public DbSet<Artwork> Artwork => Set<Artwork>(); - - public DbSet<Book> Books => Set<Book>(); - - public DbSet<BookMetadata> BookMetadata => Set<BookMetadata>(); - - public DbSet<Chapter> Chapters => Set<Chapter>(); - - public DbSet<Collection> Collections => Set<Collection>(); - - public DbSet<CollectionItem> CollectionItems => Set<CollectionItem>(); - - public DbSet<Company> Companies => Set<Company>(); - - public DbSet<CompanyMetadata> CompanyMetadata => Set<CompanyMetadata>(); - - public DbSet<CustomItem> CustomItems => Set<CustomItem>(); - - public DbSet<CustomItemMetadata> CustomItemMetadata => Set<CustomItemMetadata>(); - - public DbSet<Episode> Episodes => Set<Episode>(); - - public DbSet<EpisodeMetadata> EpisodeMetadata => Set<EpisodeMetadata>(); - - public DbSet<Genre> Genres => Set<Genre>(); - - public DbSet<Group> Groups => Set<Groups>(); - - public DbSet<Library> Libraries => Set<Library>(); - - public DbSet<LibraryItem> LibraryItems => Set<LibraryItems>(); - - public DbSet<LibraryRoot> LibraryRoot => Set<LibraryRoot>(); - - public DbSet<MediaFile> MediaFiles => Set<MediaFiles>(); - - public DbSet<MediaFileStream> MediaFileStream => Set<MediaFileStream>(); - - public DbSet<Metadata> Metadata => Set<Metadata>(); - - public DbSet<MetadataProvider> MetadataProviders => Set<MetadataProvider>(); - - public DbSet<MetadataProviderId> MetadataProviderIds => Set<MetadataProviderId>(); - - public DbSet<Movie> Movies => Set<Movie>(); - - public DbSet<MovieMetadata> MovieMetadata => Set<MovieMetadata>(); - - public DbSet<MusicAlbum> MusicAlbums => Set<MusicAlbum>(); - - public DbSet<MusicAlbumMetadata> MusicAlbumMetadata => Set<MusicAlbumMetadata>(); - - public DbSet<Person> People => Set<Person>(); - - public DbSet<PersonRole> PersonRoles => Set<PersonRole>(); - - public DbSet<Photo> Photo => Set<Photo>(); - - public DbSet<PhotoMetadata> PhotoMetadata => Set<PhotoMetadata>(); - - public DbSet<ProviderMapping> ProviderMappings => Set<ProviderMapping>(); - - public DbSet<Rating> Ratings => Set<Rating>(); - - /// <summary> - /// Repository for global::Jellyfin.Data.Entities.RatingSource - This is the entity to - /// store review ratings, not age ratings. - /// </summary> - public DbSet<RatingSource> RatingSources => Set<RatingSource>(); - - public DbSet<Release> Releases => Set<Release>(); - - public DbSet<Season> Seasons => Set<Season>(); - - public DbSet<SeasonMetadata> SeasonMetadata => Set<SeasonMetadata>(); - - public DbSet<Series> Series => Set<Series>(); - - public DbSet<SeriesMetadata> SeriesMetadata => Set<SeriesMetadata(); - - public DbSet<Track> Tracks => Set<Track>(); - - public DbSet<TrackMetadata> TrackMetadata => Set<TrackMetadata>();*/ - - /// <inheritdoc/> - public override int SaveChanges() - { - foreach (var saveEntity in ChangeTracker.Entries() - .Where(e => e.State == EntityState.Modified) - .Select(entry => entry.Entity) - .OfType<IHasConcurrencyToken>()) - { - saveEntity.OnSavingChanges(); - } - - try - { - return base.SaveChanges(); - } - catch (Exception e) - { - logger.LogError(e, "Error trying to save changes."); - throw; - } - } - - /// <inheritdoc /> - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.SetDefaultDateTimeKind(DateTimeKind.Utc); - base.OnModelCreating(modelBuilder); - - // Configuration for each entity is in its own class inside 'ModelConfiguration'. - modelBuilder.ApplyConfigurationsFromAssembly(typeof(JellyfinDbContext).Assembly); - } - - /// <inheritdoc/> - protected override void ConfigureConventions(ModelConfigurationBuilder configurationBuilder) - { - configurationBuilder.Conventions.Add(_ => new DoNotUseReturningClauseConvention()); - } - - private class DoNotUseReturningClauseConvention : IModelFinalizingConvention - { - public void ProcessModelFinalizing( - IConventionModelBuilder modelBuilder, - IConventionContext<IConventionModelBuilder> context) - { - foreach (var entityType in modelBuilder.Metadata.GetEntityTypes()) - { - entityType.UseSqlReturningClause(false); - } - } - } -} diff --git a/Jellyfin.Server.Implementations/MediaSegments/MediaSegmentManager.cs b/Jellyfin.Server.Implementations/MediaSegments/MediaSegmentManager.cs index 59ec418ce..d6eeafacc 100644 --- a/Jellyfin.Server.Implementations/MediaSegments/MediaSegmentManager.cs +++ b/Jellyfin.Server.Implementations/MediaSegments/MediaSegmentManager.cs @@ -5,8 +5,9 @@ using System.Globalization; using System.Linq; using System.Threading; using System.Threading.Tasks; -using Jellyfin.Data.Entities; -using Jellyfin.Data.Enums; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; +using Jellyfin.Database.Implementations.Enums; using Jellyfin.Extensions; using MediaBrowser.Common.Extensions; using MediaBrowser.Controller; diff --git a/Jellyfin.Server.Implementations/Migrations/.gitattributes b/Jellyfin.Server.Implementations/Migrations/.gitattributes deleted file mode 100644 index da5c26f40..000000000 --- a/Jellyfin.Server.Implementations/Migrations/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -JellyfinDbModelSnapshot.cs binary diff --git a/Jellyfin.Server.Implementations/Migrations/20200514181226_AddActivityLog.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20200514181226_AddActivityLog.Designer.cs deleted file mode 100644 index 80fe784dd..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20200514181226_AddActivityLog.Designer.cs +++ /dev/null @@ -1,72 +0,0 @@ -#pragma warning disable CS1591 - -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20200514181226_AddActivityLog")] - partial class AddActivityLog - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("jellyfin") - .HasAnnotation("ProductVersion", "3.1.3"); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasColumnType("TEXT") - .HasMaxLength(256); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<string>("Overview") - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(256); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("ActivityLogs"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20200514181226_AddActivityLog.cs b/Jellyfin.Server.Implementations/Migrations/20200514181226_AddActivityLog.cs deleted file mode 100644 index 002e5296e..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20200514181226_AddActivityLog.cs +++ /dev/null @@ -1,46 +0,0 @@ -#pragma warning disable CS1591 -#pragma warning disable SA1601 - -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Jellyfin.Server.Implementations.Migrations -{ - public partial class AddActivityLog : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: "jellyfin"); - - migrationBuilder.CreateTable( - name: "ActivityLogs", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Name = table.Column<string>(maxLength: 512, nullable: false), - Overview = table.Column<string>(maxLength: 512, nullable: true), - ShortOverview = table.Column<string>(maxLength: 512, nullable: true), - Type = table.Column<string>(maxLength: 256, nullable: false), - UserId = table.Column<Guid>(nullable: false), - ItemId = table.Column<string>(maxLength: 256, nullable: true), - DateCreated = table.Column<DateTime>(nullable: false), - LogSeverity = table.Column<int>(nullable: false), - RowVersion = table.Column<uint>(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ActivityLogs", x => x.Id); - }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ActivityLogs", - schema: "jellyfin"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20200613202153_AddUsers.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20200613202153_AddUsers.Designer.cs deleted file mode 100644 index 7aa4479b3..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20200613202153_AddUsers.Designer.cs +++ /dev/null @@ -1,312 +0,0 @@ -#pragma warning disable CS1591 - -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20200613202153_AddUsers")] - partial class AddUsers - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("jellyfin") - .HasAnnotation("ProductVersion", "3.1.4"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasColumnType("TEXT") - .HasMaxLength(256); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<string>("Overview") - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(256); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Permission_Permissions_Guid"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.HasKey("Id"); - - b.HasIndex("Preference_Preferences_Guid"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<string>("EasyPassword") - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("Permission_Permissions_Guid"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("Preference_Preferences_Guid"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20200613202153_AddUsers.cs b/Jellyfin.Server.Implementations/Migrations/20200613202153_AddUsers.cs deleted file mode 100644 index 706a97ba2..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20200613202153_AddUsers.cs +++ /dev/null @@ -1,197 +0,0 @@ -#pragma warning disable CS1591 -#pragma warning disable SA1601 - -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Jellyfin.Server.Implementations.Migrations -{ - public partial class AddUsers : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "Users", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<Guid>(nullable: false), - Username = table.Column<string>(maxLength: 255, nullable: false), - Password = table.Column<string>(maxLength: 65535, nullable: true), - EasyPassword = table.Column<string>(maxLength: 65535, nullable: true), - MustUpdatePassword = table.Column<bool>(nullable: false), - AudioLanguagePreference = table.Column<string>(maxLength: 255, nullable: true), - AuthenticationProviderId = table.Column<string>(maxLength: 255, nullable: false), - PasswordResetProviderId = table.Column<string>(maxLength: 255, nullable: false), - InvalidLoginAttemptCount = table.Column<int>(nullable: false), - LastActivityDate = table.Column<DateTime>(nullable: true), - LastLoginDate = table.Column<DateTime>(nullable: true), - LoginAttemptsBeforeLockout = table.Column<int>(nullable: true), - SubtitleMode = table.Column<int>(nullable: false), - PlayDefaultAudioTrack = table.Column<bool>(nullable: false), - SubtitleLanguagePreference = table.Column<string>(maxLength: 255, nullable: true), - DisplayMissingEpisodes = table.Column<bool>(nullable: false), - DisplayCollectionsView = table.Column<bool>(nullable: false), - EnableLocalPassword = table.Column<bool>(nullable: false), - HidePlayedInLatest = table.Column<bool>(nullable: false), - RememberAudioSelections = table.Column<bool>(nullable: false), - RememberSubtitleSelections = table.Column<bool>(nullable: false), - EnableNextEpisodeAutoPlay = table.Column<bool>(nullable: false), - EnableAutoLogin = table.Column<bool>(nullable: false), - EnableUserPreferenceAccess = table.Column<bool>(nullable: false), - MaxParentalAgeRating = table.Column<int>(nullable: true), - RemoteClientBitrateLimit = table.Column<int>(nullable: true), - InternalId = table.Column<long>(nullable: false), - SyncPlayAccess = table.Column<int>(nullable: false), - RowVersion = table.Column<uint>(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Users", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AccessSchedules", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column<Guid>(nullable: false), - DayOfWeek = table.Column<int>(nullable: false), - StartHour = table.Column<double>(nullable: false), - EndHour = table.Column<double>(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_AccessSchedules", x => x.Id); - table.ForeignKey( - name: "FK_AccessSchedules_Users_UserId", - column: x => x.UserId, - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "ImageInfos", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column<Guid>(nullable: true), - Path = table.Column<string>(maxLength: 512, nullable: false), - LastModified = table.Column<DateTime>(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ImageInfos", x => x.Id); - table.ForeignKey( - name: "FK_ImageInfos_Users_UserId", - column: x => x.UserId, - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Permissions", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Kind = table.Column<int>(nullable: false), - Value = table.Column<bool>(nullable: false), - RowVersion = table.Column<uint>(nullable: false), - Permission_Permissions_Guid = table.Column<Guid>(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Permissions", x => x.Id); - table.ForeignKey( - name: "FK_Permissions_Users_Permission_Permissions_Guid", - column: x => x.Permission_Permissions_Guid, - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "Preferences", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - Kind = table.Column<int>(nullable: false), - Value = table.Column<string>(maxLength: 65535, nullable: false), - RowVersion = table.Column<uint>(nullable: false), - Preference_Preferences_Guid = table.Column<Guid>(nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Preferences", x => x.Id); - table.ForeignKey( - name: "FK_Preferences_Users_Preference_Preferences_Guid", - column: x => x.Preference_Preferences_Guid, - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateIndex( - name: "IX_AccessSchedules_UserId", - schema: "jellyfin", - table: "AccessSchedules", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_ImageInfos_UserId", - schema: "jellyfin", - table: "ImageInfos", - column: "UserId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Permissions_Permission_Permissions_Guid", - schema: "jellyfin", - table: "Permissions", - column: "Permission_Permissions_Guid"); - - migrationBuilder.CreateIndex( - name: "IX_Preferences_Preference_Preferences_Guid", - schema: "jellyfin", - table: "Preferences", - column: "Preference_Preferences_Guid"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AccessSchedules", - schema: "jellyfin"); - - migrationBuilder.DropTable( - name: "ImageInfos", - schema: "jellyfin"); - - migrationBuilder.DropTable( - name: "Permissions", - schema: "jellyfin"); - - migrationBuilder.DropTable( - name: "Preferences", - schema: "jellyfin"); - - migrationBuilder.DropTable( - name: "Users", - schema: "jellyfin"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20200728005145_AddDisplayPreferences.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20200728005145_AddDisplayPreferences.Designer.cs deleted file mode 100644 index 3860c851d..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20200728005145_AddDisplayPreferences.Designer.cs +++ /dev/null @@ -1,459 +0,0 @@ -#pragma warning disable CS1591 - -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20200728005145_AddDisplayPreferences")] - partial class AddDisplayPreferences - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("jellyfin") - .HasAnnotation("ProductVersion", "3.1.6"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasColumnType("TEXT") - .HasMaxLength(256); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<string>("Overview") - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(256); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<string>("DashboardTheme") - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(64); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Permission_Permissions_Guid"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.HasKey("Id"); - - b.HasIndex("Preference_Preferences_Guid"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<string>("EasyPassword") - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("DisplayPreferences") - .HasForeignKey("Jellyfin.Data.Entities.DisplayPreferences", "UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("Permission_Permissions_Guid"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("Preference_Preferences_Guid"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20200728005145_AddDisplayPreferences.cs b/Jellyfin.Server.Implementations/Migrations/20200728005145_AddDisplayPreferences.cs deleted file mode 100644 index 8cd551642..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20200728005145_AddDisplayPreferences.cs +++ /dev/null @@ -1,132 +0,0 @@ -#pragma warning disable CS1591 -#pragma warning disable SA1601 - -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Jellyfin.Server.Implementations.Migrations -{ - public partial class AddDisplayPreferences : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "DisplayPreferences", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column<Guid>(nullable: false), - Client = table.Column<string>(maxLength: 32, nullable: false), - ShowSidebar = table.Column<bool>(nullable: false), - ShowBackdrop = table.Column<bool>(nullable: false), - ScrollDirection = table.Column<int>(nullable: false), - IndexBy = table.Column<int>(nullable: true), - SkipForwardLength = table.Column<int>(nullable: false), - SkipBackwardLength = table.Column<int>(nullable: false), - ChromecastVersion = table.Column<int>(nullable: false), - EnableNextVideoInfoOverlay = table.Column<bool>(nullable: false), - DashboardTheme = table.Column<string>(maxLength: 32, nullable: true), - TvHome = table.Column<string>(maxLength: 32, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_DisplayPreferences", x => x.Id); - table.ForeignKey( - name: "FK_DisplayPreferences_Users_UserId", - column: x => x.UserId, - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "ItemDisplayPreferences", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column<Guid>(nullable: false), - ItemId = table.Column<Guid>(nullable: false), - Client = table.Column<string>(maxLength: 32, nullable: false), - ViewType = table.Column<int>(nullable: false), - RememberIndexing = table.Column<bool>(nullable: false), - IndexBy = table.Column<int>(nullable: true), - RememberSorting = table.Column<bool>(nullable: false), - SortBy = table.Column<string>(maxLength: 64, nullable: false), - SortOrder = table.Column<int>(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ItemDisplayPreferences", x => x.Id); - table.ForeignKey( - name: "FK_ItemDisplayPreferences_Users_UserId", - column: x => x.UserId, - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "HomeSection", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(nullable: false) - .Annotation("Sqlite:Autoincrement", true), - DisplayPreferencesId = table.Column<int>(nullable: false), - Order = table.Column<int>(nullable: false), - Type = table.Column<int>(nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_HomeSection", x => x.Id); - table.ForeignKey( - name: "FK_HomeSection_DisplayPreferences_DisplayPreferencesId", - column: x => x.DisplayPreferencesId, - principalSchema: "jellyfin", - principalTable: "DisplayPreferences", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_DisplayPreferences_UserId", - schema: "jellyfin", - table: "DisplayPreferences", - column: "UserId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_HomeSection_DisplayPreferencesId", - schema: "jellyfin", - table: "HomeSection", - column: "DisplayPreferencesId"); - - migrationBuilder.CreateIndex( - name: "IX_ItemDisplayPreferences_UserId", - schema: "jellyfin", - table: "ItemDisplayPreferences", - column: "UserId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "HomeSection", - schema: "jellyfin"); - - migrationBuilder.DropTable( - name: "ItemDisplayPreferences", - schema: "jellyfin"); - - migrationBuilder.DropTable( - name: "DisplayPreferences", - schema: "jellyfin"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20200905220533_FixDisplayPreferencesIndex.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20200905220533_FixDisplayPreferencesIndex.Designer.cs deleted file mode 100644 index 1134f7aa4..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20200905220533_FixDisplayPreferencesIndex.Designer.cs +++ /dev/null @@ -1,461 +0,0 @@ -#pragma warning disable CS1591 - -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20200905220533_FixDisplayPreferencesIndex")] - partial class FixDisplayPreferencesIndex - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("jellyfin") - .HasAnnotation("ProductVersion", "3.1.7"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasColumnType("TEXT") - .HasMaxLength(256); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<string>("Overview") - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(256); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<string>("DashboardTheme") - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(64); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Permission_Permissions_Guid"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.HasKey("Id"); - - b.HasIndex("Preference_Preferences_Guid"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<string>("EasyPassword") - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("DisplayPreferences") - .HasForeignKey("Jellyfin.Data.Entities.DisplayPreferences", "UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("Permission_Permissions_Guid"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("Preference_Preferences_Guid"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20200905220533_FixDisplayPreferencesIndex.cs b/Jellyfin.Server.Implementations/Migrations/20200905220533_FixDisplayPreferencesIndex.cs deleted file mode 100644 index 91d2b190d..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20200905220533_FixDisplayPreferencesIndex.cs +++ /dev/null @@ -1,51 +0,0 @@ -#pragma warning disable CS1591 -#pragma warning disable SA1601 - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Jellyfin.Server.Implementations.Migrations -{ - public partial class FixDisplayPreferencesIndex : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_DisplayPreferences_UserId", - schema: "jellyfin", - table: "DisplayPreferences"); - - migrationBuilder.CreateIndex( - name: "IX_DisplayPreferences_UserId", - schema: "jellyfin", - table: "DisplayPreferences", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_DisplayPreferences_UserId_Client", - schema: "jellyfin", - table: "DisplayPreferences", - columns: new[] { "UserId", "Client" }, - unique: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_DisplayPreferences_UserId", - schema: "jellyfin", - table: "DisplayPreferences"); - - migrationBuilder.DropIndex( - name: "IX_DisplayPreferences_UserId_Client", - schema: "jellyfin", - table: "DisplayPreferences"); - - migrationBuilder.CreateIndex( - name: "IX_DisplayPreferences_UserId", - schema: "jellyfin", - table: "DisplayPreferences", - column: "UserId", - unique: true); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20201004171403_AddMaxActiveSessions.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20201004171403_AddMaxActiveSessions.Designer.cs deleted file mode 100644 index 607310caa..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20201004171403_AddMaxActiveSessions.Designer.cs +++ /dev/null @@ -1,464 +0,0 @@ -#pragma warning disable CS1591 - -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20201004171403_AddMaxActiveSessions")] - partial class AddMaxActiveSessions - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("jellyfin") - .HasAnnotation("ProductVersion", "3.1.8"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasColumnType("TEXT") - .HasMaxLength(256); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<string>("Overview") - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(256); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<string>("DashboardTheme") - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(512); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(32); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(64); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Permission_Permissions_Guid"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.HasKey("Id"); - - b.HasIndex("Preference_Preferences_Guid"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<string>("EasyPassword") - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasColumnType("TEXT") - .HasMaxLength(65535); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasColumnType("TEXT") - .HasMaxLength(255); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("DisplayPreferences") - .HasForeignKey("Jellyfin.Data.Entities.DisplayPreferences", "UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("Permission_Permissions_Guid"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("Preference_Preferences_Guid"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20201004171403_AddMaxActiveSessions.cs b/Jellyfin.Server.Implementations/Migrations/20201004171403_AddMaxActiveSessions.cs deleted file mode 100644 index e37b4e696..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20201004171403_AddMaxActiveSessions.cs +++ /dev/null @@ -1,28 +0,0 @@ -#pragma warning disable CS1591 -#pragma warning disable SA1601 - -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Jellyfin.Server.Implementations.Migrations -{ - public partial class AddMaxActiveSessions : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn<int>( - name: "MaxActiveSessions", - schema: "jellyfin", - table: "Users", - nullable: false, - defaultValue: 0); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "MaxActiveSessions", - schema: "jellyfin", - table: "Users"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.Designer.cs deleted file mode 100644 index 02c3fc753..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.Designer.cs +++ /dev/null @@ -1,522 +0,0 @@ -#pragma warning disable CS1591 -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20201204223655_AddCustomDisplayPreferences")] - partial class AddCustomDisplayPreferences - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("jellyfin") - .HasAnnotation("ProductVersion", "5.0.0"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Permission_Permissions_Guid"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Preference_Preferences_Guid"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<string>("EasyPassword") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("DisplayPreferences") - .HasForeignKey("Jellyfin.Data.Entities.DisplayPreferences", "UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("Permission_Permissions_Guid"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("Preference_Preferences_Guid"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences") - .IsRequired(); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.cs b/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.cs deleted file mode 100644 index ce2b21d0c..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20201204223655_AddCustomDisplayPreferences.cs +++ /dev/null @@ -1,108 +0,0 @@ -#pragma warning disable CS1591 -// <auto-generated /> -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Jellyfin.Server.Implementations.Migrations -{ - public partial class AddCustomDisplayPreferences : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_DisplayPreferences_UserId_Client", - schema: "jellyfin", - table: "DisplayPreferences"); - - migrationBuilder.AlterColumn<int>( - name: "MaxActiveSessions", - schema: "jellyfin", - table: "Users", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AddColumn<Guid>( - name: "ItemId", - schema: "jellyfin", - table: "DisplayPreferences", - type: "TEXT", - nullable: false, - defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); - - migrationBuilder.CreateTable( - name: "CustomItemDisplayPreferences", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column<Guid>(type: "TEXT", nullable: false), - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - Client = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false), - Key = table.Column<string>(type: "TEXT", nullable: false), - Value = table.Column<string>(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_CustomItemDisplayPreferences", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_DisplayPreferences_UserId_ItemId_Client", - schema: "jellyfin", - table: "DisplayPreferences", - columns: new[] { "UserId", "ItemId", "Client" }, - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_CustomItemDisplayPreferences_UserId", - schema: "jellyfin", - table: "CustomItemDisplayPreferences", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_CustomItemDisplayPreferences_UserId_ItemId_Client_Key", - schema: "jellyfin", - table: "CustomItemDisplayPreferences", - columns: new[] { "UserId", "ItemId", "Client", "Key" }, - unique: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "CustomItemDisplayPreferences", - schema: "jellyfin"); - - migrationBuilder.DropIndex( - name: "IX_DisplayPreferences_UserId_ItemId_Client", - schema: "jellyfin", - table: "DisplayPreferences"); - - migrationBuilder.DropColumn( - name: "ItemId", - schema: "jellyfin", - table: "DisplayPreferences"); - - migrationBuilder.AlterColumn<int>( - name: "MaxActiveSessions", - schema: "jellyfin", - table: "Users", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.CreateIndex( - name: "IX_DisplayPreferences_UserId_Client", - schema: "jellyfin", - table: "DisplayPreferences", - columns: new[] { "UserId", "Client" }, - unique: true); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20210320181425_AddIndexesAndCollations.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20210320181425_AddIndexesAndCollations.Designer.cs deleted file mode 100644 index 1cfd7112c..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20210320181425_AddIndexesAndCollations.Designer.cs +++ /dev/null @@ -1,535 +0,0 @@ -#pragma warning disable CS1591 - -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20210320181425_AddIndexesAndCollations")] - partial class AddIndexesAndCollations - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("jellyfin") - .HasAnnotation("ProductVersion", "5.0.3"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<string>("EasyPassword") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20210320181425_AddIndexesAndCollations.cs b/Jellyfin.Server.Implementations/Migrations/20210320181425_AddIndexesAndCollations.cs deleted file mode 100644 index 3acd5e7b5..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20210320181425_AddIndexesAndCollations.cs +++ /dev/null @@ -1,240 +0,0 @@ -#pragma warning disable CS1591 -#pragma warning disable SA1601 - -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Jellyfin.Server.Implementations.Migrations -{ - public partial class AddIndexesAndCollations : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_ImageInfos_Users_UserId", - schema: "jellyfin", - table: "ImageInfos"); - - migrationBuilder.DropForeignKey( - name: "FK_Permissions_Users_Permission_Permissions_Guid", - schema: "jellyfin", - table: "Permissions"); - - migrationBuilder.DropForeignKey( - name: "FK_Preferences_Users_Preference_Preferences_Guid", - schema: "jellyfin", - table: "Preferences"); - - migrationBuilder.DropIndex( - name: "IX_Preferences_Preference_Preferences_Guid", - schema: "jellyfin", - table: "Preferences"); - - migrationBuilder.DropIndex( - name: "IX_Permissions_Permission_Permissions_Guid", - schema: "jellyfin", - table: "Permissions"); - - migrationBuilder.DropIndex( - name: "IX_DisplayPreferences_UserId", - schema: "jellyfin", - table: "DisplayPreferences"); - - migrationBuilder.DropIndex( - name: "IX_CustomItemDisplayPreferences_UserId", - schema: "jellyfin", - table: "CustomItemDisplayPreferences"); - - migrationBuilder.AlterColumn<string>( - name: "Username", - schema: "jellyfin", - table: "Users", - type: "TEXT", - maxLength: 255, - nullable: false, - collation: "NOCASE", - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 255); - - migrationBuilder.AddColumn<Guid>( - name: "UserId", - schema: "jellyfin", - table: "Preferences", - type: "TEXT", - nullable: true); - - migrationBuilder.AddColumn<Guid>( - name: "UserId", - schema: "jellyfin", - table: "Permissions", - type: "TEXT", - nullable: true); - - migrationBuilder.Sql("UPDATE Preferences SET UserId = Preference_Preferences_Guid"); - migrationBuilder.Sql("UPDATE Permissions SET UserId = Permission_Permissions_Guid"); - - migrationBuilder.CreateIndex( - name: "IX_Users_Username", - schema: "jellyfin", - table: "Users", - column: "Username", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Preferences_UserId_Kind", - schema: "jellyfin", - table: "Preferences", - columns: new[] { "UserId", "Kind" }, - unique: true, - filter: "[UserId] IS NOT NULL"); - - migrationBuilder.CreateIndex( - name: "IX_Permissions_UserId_Kind", - schema: "jellyfin", - table: "Permissions", - columns: new[] { "UserId", "Kind" }, - unique: true, - filter: "[UserId] IS NOT NULL"); - - migrationBuilder.AddForeignKey( - name: "FK_ImageInfos_Users_UserId", - schema: "jellyfin", - table: "ImageInfos", - column: "UserId", - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Permissions_Users_UserId", - schema: "jellyfin", - table: "Permissions", - column: "UserId", - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - - migrationBuilder.AddForeignKey( - name: "FK_Preferences_Users_UserId", - schema: "jellyfin", - table: "Preferences", - column: "UserId", - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_ImageInfos_Users_UserId", - schema: "jellyfin", - table: "ImageInfos"); - - migrationBuilder.DropForeignKey( - name: "FK_Permissions_Users_UserId", - schema: "jellyfin", - table: "Permissions"); - - migrationBuilder.DropForeignKey( - name: "FK_Preferences_Users_UserId", - schema: "jellyfin", - table: "Preferences"); - - migrationBuilder.DropIndex( - name: "IX_Users_Username", - schema: "jellyfin", - table: "Users"); - - migrationBuilder.DropIndex( - name: "IX_Preferences_UserId_Kind", - schema: "jellyfin", - table: "Preferences"); - - migrationBuilder.DropIndex( - name: "IX_Permissions_UserId_Kind", - schema: "jellyfin", - table: "Permissions"); - - migrationBuilder.DropColumn( - name: "UserId", - schema: "jellyfin", - table: "Preferences"); - - migrationBuilder.DropColumn( - name: "UserId", - schema: "jellyfin", - table: "Permissions"); - - migrationBuilder.AlterColumn<string>( - name: "Username", - schema: "jellyfin", - table: "Users", - type: "TEXT", - maxLength: 255, - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT", - oldMaxLength: 255, - oldCollation: "NOCASE"); - - migrationBuilder.CreateIndex( - name: "IX_Preferences_Preference_Preferences_Guid", - schema: "jellyfin", - table: "Preferences", - column: "Preference_Preferences_Guid"); - - migrationBuilder.CreateIndex( - name: "IX_Permissions_Permission_Permissions_Guid", - schema: "jellyfin", - table: "Permissions", - column: "Permission_Permissions_Guid"); - - migrationBuilder.CreateIndex( - name: "IX_DisplayPreferences_UserId", - schema: "jellyfin", - table: "DisplayPreferences", - column: "UserId"); - - migrationBuilder.CreateIndex( - name: "IX_CustomItemDisplayPreferences_UserId", - schema: "jellyfin", - table: "CustomItemDisplayPreferences", - column: "UserId"); - - migrationBuilder.AddForeignKey( - name: "FK_ImageInfos_Users_UserId", - schema: "jellyfin", - table: "ImageInfos", - column: "UserId", - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Permissions_Users_Permission_Permissions_Guid", - schema: "jellyfin", - table: "Permissions", - column: "Permission_Permissions_Guid", - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - - migrationBuilder.AddForeignKey( - name: "FK_Preferences_Users_Preference_Preferences_Guid", - schema: "jellyfin", - table: "Preferences", - column: "Preference_Preferences_Guid", - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20210407110544_NullableCustomPrefValue.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20210407110544_NullableCustomPrefValue.Designer.cs deleted file mode 100644 index ecf7af495..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20210407110544_NullableCustomPrefValue.Designer.cs +++ /dev/null @@ -1,520 +0,0 @@ -#pragma warning disable CS1591 -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20210407110544_NullableCustomPrefValue")] - partial class NullableCustomPrefValue - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("jellyfin") - .HasAnnotation("ProductVersion", "5.0.3"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("Permission_Permissions_Guid"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Preference_Preferences_Guid"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<string>("EasyPassword") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("Permission_Permissions_Guid"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("Preference_Preferences_Guid"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20210407110544_NullableCustomPrefValue.cs b/Jellyfin.Server.Implementations/Migrations/20210407110544_NullableCustomPrefValue.cs deleted file mode 100644 index a6b169a61..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20210407110544_NullableCustomPrefValue.cs +++ /dev/null @@ -1,35 +0,0 @@ -#pragma warning disable CS1591 -// <auto-generated /> -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Jellyfin.Server.Implementations.Migrations -{ - public partial class NullableCustomPrefValue : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn<string>( - name: "Value", - schema: "jellyfin", - table: "CustomItemDisplayPreferences", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn<string>( - name: "Value", - schema: "jellyfin", - table: "CustomItemDisplayPreferences", - type: "TEXT", - nullable: false, - defaultValue: "", - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20210814002109_AddDevices.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20210814002109_AddDevices.Designer.cs deleted file mode 100644 index dccba6f77..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20210814002109_AddDevices.Designer.cs +++ /dev/null @@ -1,653 +0,0 @@ -#pragma warning disable CS1591 - -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20210814002109_AddDevices")] - partial class AddDevices - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("jellyfin") - .HasAnnotation("ProductVersion", "5.0.7"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<string>("EasyPassword") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20210814002109_AddDevices.cs b/Jellyfin.Server.Implementations/Migrations/20210814002109_AddDevices.cs deleted file mode 100644 index bf90044cb..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20210814002109_AddDevices.cs +++ /dev/null @@ -1,128 +0,0 @@ -#pragma warning disable CS1591, SA1601 - -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -namespace Jellyfin.Server.Implementations.Migrations -{ - public partial class AddDevices : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "ApiKeys", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - DateCreated = table.Column<DateTime>(type: "TEXT", nullable: false), - DateLastActivity = table.Column<DateTime>(type: "TEXT", nullable: false), - Name = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false), - AccessToken = table.Column<string>(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ApiKeys", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "DeviceOptions", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - DeviceId = table.Column<string>(type: "TEXT", nullable: false), - CustomName = table.Column<string>(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_DeviceOptions", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "Devices", - schema: "jellyfin", - columns: table => new - { - Id = table.Column<int>(type: "INTEGER", nullable: false) - .Annotation("Sqlite:Autoincrement", true), - UserId = table.Column<Guid>(type: "TEXT", nullable: false), - AccessToken = table.Column<string>(type: "TEXT", nullable: false), - AppName = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false), - AppVersion = table.Column<string>(type: "TEXT", maxLength: 32, nullable: false), - DeviceName = table.Column<string>(type: "TEXT", maxLength: 64, nullable: false), - DeviceId = table.Column<string>(type: "TEXT", maxLength: 256, nullable: false), - IsActive = table.Column<bool>(type: "INTEGER", nullable: false), - DateCreated = table.Column<DateTime>(type: "TEXT", nullable: false), - DateModified = table.Column<DateTime>(type: "TEXT", nullable: false), - DateLastActivity = table.Column<DateTime>(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_Devices", x => x.Id); - table.ForeignKey( - name: "FK_Devices_Users_UserId", - column: x => x.UserId, - principalSchema: "jellyfin", - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_ApiKeys_AccessToken", - schema: "jellyfin", - table: "ApiKeys", - column: "AccessToken", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_DeviceOptions_DeviceId", - schema: "jellyfin", - table: "DeviceOptions", - column: "DeviceId", - unique: true); - - migrationBuilder.CreateIndex( - name: "IX_Devices_AccessToken_DateLastActivity", - schema: "jellyfin", - table: "Devices", - columns: new[] { "AccessToken", "DateLastActivity" }); - - migrationBuilder.CreateIndex( - name: "IX_Devices_DeviceId", - schema: "jellyfin", - table: "Devices", - column: "DeviceId"); - - migrationBuilder.CreateIndex( - name: "IX_Devices_DeviceId_DateLastActivity", - schema: "jellyfin", - table: "Devices", - columns: new[] { "DeviceId", "DateLastActivity" }); - - migrationBuilder.CreateIndex( - name: "IX_Devices_UserId_DeviceId", - schema: "jellyfin", - table: "Devices", - columns: new[] { "UserId", "DeviceId" }); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "ApiKeys", - schema: "jellyfin"); - - migrationBuilder.DropTable( - name: "DeviceOptions", - schema: "jellyfin"); - - migrationBuilder.DropTable( - name: "Devices", - schema: "jellyfin"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20221022080052_AddIndexActivityLogsDateCreated.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20221022080052_AddIndexActivityLogsDateCreated.Designer.cs deleted file mode 100644 index e821c106e..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20221022080052_AddIndexActivityLogsDateCreated.Designer.cs +++ /dev/null @@ -1,657 +0,0 @@ -#pragma warning disable CS1591 - -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20221022080052_AddIndexActivityLogsDateCreated")] - partial class AddIndexActivityLogsDateCreated - { - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder - .HasDefaultSchema("jellyfin") - .HasAnnotation("ProductVersion", "6.0.9"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<string>("EasyPassword") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users", "jellyfin"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20221022080052_AddIndexActivityLogsDateCreated.cs b/Jellyfin.Server.Implementations/Migrations/20221022080052_AddIndexActivityLogsDateCreated.cs deleted file mode 100644 index 9d5d7632b..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20221022080052_AddIndexActivityLogsDateCreated.cs +++ /dev/null @@ -1,28 +0,0 @@ -#pragma warning disable CS1591, SA1601 - -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - public partial class AddIndexActivityLogsDateCreated : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateIndex( - name: "IX_ActivityLogs_DateCreated", - schema: "jellyfin", - table: "ActivityLogs", - column: "DateCreated"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_ActivityLogs_DateCreated", - schema: "jellyfin", - table: "ActivityLogs"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20230526173516_RemoveEasyPassword.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20230526173516_RemoveEasyPassword.Designer.cs deleted file mode 100644 index 360fa0376..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20230526173516_RemoveEasyPassword.Designer.cs +++ /dev/null @@ -1,650 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20230526173516_RemoveEasyPassword")] - partial class RemoveEasyPassword - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.5"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20230526173516_RemoveEasyPassword.cs b/Jellyfin.Server.Implementations/Migrations/20230526173516_RemoveEasyPassword.cs deleted file mode 100644 index 354d91c38..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20230526173516_RemoveEasyPassword.cs +++ /dev/null @@ -1,164 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class RemoveEasyPassword : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "EasyPassword", - schema: "jellyfin", - table: "Users"); - - migrationBuilder.RenameTable( - name: "Users", - schema: "jellyfin", - newName: "Users"); - - migrationBuilder.RenameTable( - name: "Preferences", - schema: "jellyfin", - newName: "Preferences"); - - migrationBuilder.RenameTable( - name: "Permissions", - schema: "jellyfin", - newName: "Permissions"); - - migrationBuilder.RenameTable( - name: "ItemDisplayPreferences", - schema: "jellyfin", - newName: "ItemDisplayPreferences"); - - migrationBuilder.RenameTable( - name: "ImageInfos", - schema: "jellyfin", - newName: "ImageInfos"); - - migrationBuilder.RenameTable( - name: "HomeSection", - schema: "jellyfin", - newName: "HomeSection"); - - migrationBuilder.RenameTable( - name: "DisplayPreferences", - schema: "jellyfin", - newName: "DisplayPreferences"); - - migrationBuilder.RenameTable( - name: "Devices", - schema: "jellyfin", - newName: "Devices"); - - migrationBuilder.RenameTable( - name: "DeviceOptions", - schema: "jellyfin", - newName: "DeviceOptions"); - - migrationBuilder.RenameTable( - name: "CustomItemDisplayPreferences", - schema: "jellyfin", - newName: "CustomItemDisplayPreferences"); - - migrationBuilder.RenameTable( - name: "ApiKeys", - schema: "jellyfin", - newName: "ApiKeys"); - - migrationBuilder.RenameTable( - name: "ActivityLogs", - schema: "jellyfin", - newName: "ActivityLogs"); - - migrationBuilder.RenameTable( - name: "AccessSchedules", - schema: "jellyfin", - newName: "AccessSchedules"); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.EnsureSchema( - name: "jellyfin"); - - migrationBuilder.RenameTable( - name: "Users", - newName: "Users", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "Preferences", - newName: "Preferences", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "Permissions", - newName: "Permissions", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "ItemDisplayPreferences", - newName: "ItemDisplayPreferences", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "ImageInfos", - newName: "ImageInfos", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "HomeSection", - newName: "HomeSection", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "DisplayPreferences", - newName: "DisplayPreferences", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "Devices", - newName: "Devices", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "DeviceOptions", - newName: "DeviceOptions", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "CustomItemDisplayPreferences", - newName: "CustomItemDisplayPreferences", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "ApiKeys", - newName: "ApiKeys", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "ActivityLogs", - newName: "ActivityLogs", - newSchema: "jellyfin"); - - migrationBuilder.RenameTable( - name: "AccessSchedules", - newName: "AccessSchedules", - newSchema: "jellyfin"); - - migrationBuilder.AddColumn<string>( - name: "EasyPassword", - schema: "jellyfin", - table: "Users", - type: "TEXT", - maxLength: 65535, - nullable: true); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20230626233818_AddTrickplayInfos.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20230626233818_AddTrickplayInfos.Designer.cs deleted file mode 100644 index 17d33845f..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20230626233818_AddTrickplayInfos.Designer.cs +++ /dev/null @@ -1,681 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20230626233818_AddTrickplayInfos")] - partial class AddTrickplayInfos - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.7"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20230626233818_AddTrickplayInfos.cs b/Jellyfin.Server.Implementations/Migrations/20230626233818_AddTrickplayInfos.cs deleted file mode 100644 index 85f1b5b7d..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20230626233818_AddTrickplayInfos.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class AddTrickplayInfos : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "TrickplayInfos", - columns: table => new - { - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - Width = table.Column<int>(type: "INTEGER", nullable: false), - Height = table.Column<int>(type: "INTEGER", nullable: false), - TileWidth = table.Column<int>(type: "INTEGER", nullable: false), - TileHeight = table.Column<int>(type: "INTEGER", nullable: false), - ThumbnailCount = table.Column<int>(type: "INTEGER", nullable: false), - Interval = table.Column<int>(type: "INTEGER", nullable: false), - Bandwidth = table.Column<int>(type: "INTEGER", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_TrickplayInfos", x => new { x.ItemId, x.Width }); - }); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "TrickplayInfos"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20230923170422_UserCastReceiver.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20230923170422_UserCastReceiver.Designer.cs deleted file mode 100644 index 4c0917669..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20230923170422_UserCastReceiver.Designer.cs +++ /dev/null @@ -1,654 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20230923170422_UserCastReceiver")] - partial class UserCastReceiver - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "7.0.11"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20230923170422_UserCastReceiver.cs b/Jellyfin.Server.Implementations/Migrations/20230923170422_UserCastReceiver.cs deleted file mode 100644 index 5919e4665..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20230923170422_UserCastReceiver.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class UserCastReceiver : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn<string>( - name: "CastReceiverId", - table: "Users", - type: "TEXT", - maxLength: 32, - nullable: true); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "CastReceiverId", - table: "Users"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20240729140605_AddMediaSegments.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20240729140605_AddMediaSegments.Designer.cs deleted file mode 100644 index 35a3cdad2..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20240729140605_AddMediaSegments.Designer.cs +++ /dev/null @@ -1,708 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20240729140605_AddMediaSegments")] - partial class AddMediaSegments - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.7"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20240729140605_AddMediaSegments.cs b/Jellyfin.Server.Implementations/Migrations/20240729140605_AddMediaSegments.cs deleted file mode 100644 index 18164d999..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20240729140605_AddMediaSegments.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class AddMediaSegments : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "MediaSegments", - columns: table => new - { - Id = table.Column<Guid>(type: "TEXT", nullable: false), - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - Type = table.Column<int>(type: "INTEGER", nullable: false), - EndTicks = table.Column<long>(type: "INTEGER", nullable: false), - StartTicks = table.Column<long>(type: "INTEGER", nullable: false), - SegmentProviderId = table.Column<string>(type: "TEXT", nullable: false), - }, - constraints: table => - { - table.PrimaryKey("PK_MediaSegments", x => x.Id); - }); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "MediaSegments"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20240928082930_MarkSegmentProviderIdNonNullable.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20240928082930_MarkSegmentProviderIdNonNullable.Designer.cs deleted file mode 100644 index 8dba31a67..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20240928082930_MarkSegmentProviderIdNonNullable.Designer.cs +++ /dev/null @@ -1,712 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20240928082930_MarkSegmentProviderIdNonNullable")] - partial class MarkSegmentProviderIdNonNullable - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.8"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20240928082930_MarkSegmentProviderIdNonNullable.cs b/Jellyfin.Server.Implementations/Migrations/20240928082930_MarkSegmentProviderIdNonNullable.cs deleted file mode 100644 index 55b90a54d..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20240928082930_MarkSegmentProviderIdNonNullable.cs +++ /dev/null @@ -1,36 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class MarkSegmentProviderIdNonNullable : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn<string>( - name: "SegmentProviderId", - table: "MediaSegments", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn<string>( - name: "SegmentProviderId", - table: "MediaSegments", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241020103111_LibraryDbMigration.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20241020103111_LibraryDbMigration.Designer.cs deleted file mode 100644 index 27745f601..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241020103111_LibraryDbMigration.Designer.cs +++ /dev/null @@ -1,1607 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20241020103111_LibraryDbMigration")] - partial class LibraryDbMigration - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.10"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ParentItemId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("BaseItemEntityId") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ParentItemId"); - - b.HasIndex("BaseItemEntityId"); - - b.HasIndex("ParentItemId"); - - b.ToTable("AncestorIds"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Index") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<string>("Filename") - .HasColumnType("TEXT"); - - b.Property<string>("MimeType") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "Index"); - - b.ToTable("AttachmentStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Album") - .HasColumnType("TEXT"); - - b.Property<string>("AlbumArtists") - .HasColumnType("TEXT"); - - b.Property<string>("Artists") - .HasColumnType("TEXT"); - - b.Property<int?>("Audio") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelId") - .HasColumnType("TEXT"); - - b.Property<string>("CleanName") - .HasColumnType("TEXT"); - - b.Property<float?>("CommunityRating") - .HasColumnType("REAL"); - - b.Property<float?>("CriticRating") - .HasColumnType("REAL"); - - b.Property<string>("CustomRating") - .HasColumnType("TEXT"); - - b.Property<string>("Data") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastMediaAdded") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastRefreshed") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastSaved") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateModified") - .HasColumnType("TEXT"); - - b.Property<DateTime>("EndDate") - .HasColumnType("TEXT"); - - b.Property<string>("EpisodeTitle") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalSeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalServiceId") - .HasColumnType("TEXT"); - - b.Property<string>("ExtraIds") - .HasColumnType("TEXT"); - - b.Property<int?>("ExtraType") - .HasColumnType("INTEGER"); - - b.Property<string>("ForcedSortName") - .HasColumnType("TEXT"); - - b.Property<string>("Genres") - .HasColumnType("TEXT"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexNumber") - .HasColumnType("INTEGER"); - - b.Property<int?>("InheritedParentalRatingValue") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInMixedFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsLocked") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsMovie") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsRepeat") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsSeries") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsVirtualItem") - .HasColumnType("INTEGER"); - - b.Property<float?>("LUFS") - .HasColumnType("REAL"); - - b.Property<string>("MediaType") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<float?>("NormalizationGain") - .HasColumnType("REAL"); - - b.Property<string>("OfficialRating") - .HasColumnType("TEXT"); - - b.Property<string>("OriginalTitle") - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasColumnType("TEXT"); - - b.Property<string>("OwnerId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("ParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("ParentIndexNumber") - .HasColumnType("INTEGER"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataCountryCode") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataLanguage") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("PremiereDate") - .HasColumnType("TEXT"); - - b.Property<string>("PresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("PrimaryVersionId") - .HasColumnType("TEXT"); - - b.Property<string>("ProductionLocations") - .HasColumnType("TEXT"); - - b.Property<int?>("ProductionYear") - .HasColumnType("INTEGER"); - - b.Property<long?>("RunTimeTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("SeasonId") - .HasColumnType("TEXT"); - - b.Property<string>("SeasonName") - .HasColumnType("TEXT"); - - b.Property<Guid?>("SeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesName") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesPresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("ShowId") - .HasColumnType("TEXT"); - - b.Property<long?>("Size") - .HasColumnType("INTEGER"); - - b.Property<string>("SortName") - .HasColumnType("TEXT"); - - b.Property<DateTime>("StartDate") - .HasColumnType("TEXT"); - - b.Property<string>("Studios") - .HasColumnType("TEXT"); - - b.Property<string>("Tagline") - .HasColumnType("TEXT"); - - b.Property<string>("Tags") - .HasColumnType("TEXT"); - - b.Property<Guid?>("TopParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("TotalBitrate") - .HasColumnType("INTEGER"); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("UnratedType") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("Path"); - - b.HasIndex("PresentationUniqueKey"); - - b.HasIndex("TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); - - b.HasIndex("Type", "TopParentId", "StartDate"); - - b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem"); - - b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName"); - - b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.ToTable("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<byte[]>("Blurhash") - .HasColumnType("BLOB"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("ImageType") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemMetadataFields"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ProviderId"); - - b.HasIndex("ProviderId", "ProviderValue", "ItemId"); - - b.ToTable("BaseItemProviders"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemTrailerTypes"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ChapterIndex") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("ImageDateModified") - .HasColumnType("TEXT"); - - b.Property<string>("ImagePath") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<long>("StartPositionTicks") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "ChapterIndex"); - - b.ToTable("Chapters"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Property<Guid>("ItemValueId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("CleanValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId"); - - b.HasIndex("Type", "CleanValue"); - - b.ToTable("ItemValues"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.Property<Guid>("ItemValueId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("ItemValuesMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("StreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("AspectRatio") - .HasColumnType("TEXT"); - - b.Property<float>("AverageFrameRate") - .HasColumnType("REAL"); - - b.Property<int>("BitDepth") - .HasColumnType("INTEGER"); - - b.Property<int>("BitRate") - .HasColumnType("INTEGER"); - - b.Property<int>("BlPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelLayout") - .HasColumnType("TEXT"); - - b.Property<int>("Channels") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTimeBase") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorPrimaries") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorSpace") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorTransfer") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("DvBlSignalCompatibilityId") - .HasColumnType("INTEGER"); - - b.Property<int>("DvLevel") - .HasColumnType("INTEGER"); - - b.Property<int>("DvProfile") - .HasColumnType("INTEGER"); - - b.Property<int>("DvVersionMajor") - .HasColumnType("INTEGER"); - - b.Property<int>("DvVersionMinor") - .HasColumnType("INTEGER"); - - b.Property<int>("ElPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsAnamorphic") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsAvc") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsDefault") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsExternal") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsForced") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsHearingImpaired") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInterlaced") - .HasColumnType("INTEGER"); - - b.Property<string>("KeyFrames") - .HasColumnType("TEXT"); - - b.Property<string>("Language") - .HasColumnType("TEXT"); - - b.Property<float>("Level") - .HasColumnType("REAL"); - - b.Property<string>("NalLengthSize") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PixelFormat") - .HasColumnType("TEXT"); - - b.Property<string>("Profile") - .HasColumnType("TEXT"); - - b.Property<float>("RealFrameRate") - .HasColumnType("REAL"); - - b.Property<int>("RefFrames") - .HasColumnType("INTEGER"); - - b.Property<int>("Rotation") - .HasColumnType("INTEGER"); - - b.Property<int>("RpuPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int>("SampleRate") - .HasColumnType("INTEGER"); - - b.Property<int?>("StreamType") - .HasColumnType("INTEGER"); - - b.Property<string>("TimeBase") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Title") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "StreamIndex"); - - b.HasIndex("StreamIndex"); - - b.HasIndex("StreamType"); - - b.HasIndex("StreamIndex", "StreamType"); - - b.HasIndex("StreamIndex", "StreamType", "Language"); - - b.ToTable("MediaStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PersonType") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Peoples"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("PeopleId") - .HasColumnType("TEXT"); - - b.Property<int?>("ListOrder") - .HasColumnType("INTEGER"); - - b.Property<string>("Role") - .HasColumnType("TEXT"); - - b.Property<int?>("SortOrder") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "PeopleId"); - - b.HasIndex("PeopleId"); - - b.HasIndex("ItemId", "ListOrder"); - - b.HasIndex("ItemId", "SortOrder"); - - b.ToTable("PeopleBaseItemMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int?>("AudioStreamIndex") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFavorite") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastPlayedDate") - .HasColumnType("TEXT"); - - b.Property<bool?>("Likes") - .HasColumnType("INTEGER"); - - b.Property<int>("PlayCount") - .HasColumnType("INTEGER"); - - b.Property<long>("PlaybackPositionTicks") - .HasColumnType("INTEGER"); - - b.Property<bool>("Played") - .HasColumnType("INTEGER"); - - b.Property<double?>("Rating") - .HasColumnType("REAL"); - - b.Property<int?>("SubtitleStreamIndex") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "UserId"); - - b.HasIndex("UserId"); - - b.HasIndex("ItemId", "UserId", "IsFavorite"); - - b.HasIndex("ItemId", "UserId", "LastPlayedDate"); - - b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks"); - - b.HasIndex("ItemId", "UserId", "Played"); - - b.ToTable("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", null) - .WithMany("AncestorIds") - .HasForeignKey("BaseItemEntityId"); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem") - .WithMany() - .HasForeignKey("ParentItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ParentItem"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Images") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("LockedFields") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Provider") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("TrailerTypes") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Chapters") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("ItemValues") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue") - .WithMany("BaseItemsMap") - .HasForeignKey("ItemValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ItemValue"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("MediaStreams") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Peoples") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.People", "People") - .WithMany("BaseItems") - .HasForeignKey("PeopleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("People"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("UserData") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Navigation("AncestorIds"); - - b.Navigation("Chapters"); - - b.Navigation("Images"); - - b.Navigation("ItemValues"); - - b.Navigation("LockedFields"); - - b.Navigation("MediaStreams"); - - b.Navigation("Peoples"); - - b.Navigation("Provider"); - - b.Navigation("TrailerTypes"); - - b.Navigation("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Navigation("BaseItemsMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Navigation("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241020103111_LibraryDbMigration.cs b/Jellyfin.Server.Implementations/Migrations/20241020103111_LibraryDbMigration.cs deleted file mode 100644 index 8cc7fb452..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241020103111_LibraryDbMigration.cs +++ /dev/null @@ -1,639 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class LibraryDbMigration : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "BaseItems", - columns: table => new - { - Id = table.Column<Guid>(type: "TEXT", nullable: false), - Type = table.Column<string>(type: "TEXT", nullable: false), - Data = table.Column<string>(type: "TEXT", nullable: true), - Path = table.Column<string>(type: "TEXT", nullable: true), - StartDate = table.Column<DateTime>(type: "TEXT", nullable: false), - EndDate = table.Column<DateTime>(type: "TEXT", nullable: false), - ChannelId = table.Column<string>(type: "TEXT", nullable: true), - IsMovie = table.Column<bool>(type: "INTEGER", nullable: false), - CommunityRating = table.Column<float>(type: "REAL", nullable: true), - CustomRating = table.Column<string>(type: "TEXT", nullable: true), - IndexNumber = table.Column<int>(type: "INTEGER", nullable: true), - IsLocked = table.Column<bool>(type: "INTEGER", nullable: false), - Name = table.Column<string>(type: "TEXT", nullable: true), - OfficialRating = table.Column<string>(type: "TEXT", nullable: true), - MediaType = table.Column<string>(type: "TEXT", nullable: true), - Overview = table.Column<string>(type: "TEXT", nullable: true), - ParentIndexNumber = table.Column<int>(type: "INTEGER", nullable: true), - PremiereDate = table.Column<DateTime>(type: "TEXT", nullable: true), - ProductionYear = table.Column<int>(type: "INTEGER", nullable: true), - Genres = table.Column<string>(type: "TEXT", nullable: true), - SortName = table.Column<string>(type: "TEXT", nullable: true), - ForcedSortName = table.Column<string>(type: "TEXT", nullable: true), - RunTimeTicks = table.Column<long>(type: "INTEGER", nullable: true), - DateCreated = table.Column<DateTime>(type: "TEXT", nullable: true), - DateModified = table.Column<DateTime>(type: "TEXT", nullable: true), - IsSeries = table.Column<bool>(type: "INTEGER", nullable: false), - EpisodeTitle = table.Column<string>(type: "TEXT", nullable: true), - IsRepeat = table.Column<bool>(type: "INTEGER", nullable: false), - PreferredMetadataLanguage = table.Column<string>(type: "TEXT", nullable: true), - PreferredMetadataCountryCode = table.Column<string>(type: "TEXT", nullable: true), - DateLastRefreshed = table.Column<DateTime>(type: "TEXT", nullable: true), - DateLastSaved = table.Column<DateTime>(type: "TEXT", nullable: true), - IsInMixedFolder = table.Column<bool>(type: "INTEGER", nullable: false), - Studios = table.Column<string>(type: "TEXT", nullable: true), - ExternalServiceId = table.Column<string>(type: "TEXT", nullable: true), - Tags = table.Column<string>(type: "TEXT", nullable: true), - IsFolder = table.Column<bool>(type: "INTEGER", nullable: false), - InheritedParentalRatingValue = table.Column<int>(type: "INTEGER", nullable: true), - UnratedType = table.Column<string>(type: "TEXT", nullable: true), - CriticRating = table.Column<float>(type: "REAL", nullable: true), - CleanName = table.Column<string>(type: "TEXT", nullable: true), - PresentationUniqueKey = table.Column<string>(type: "TEXT", nullable: true), - OriginalTitle = table.Column<string>(type: "TEXT", nullable: true), - PrimaryVersionId = table.Column<string>(type: "TEXT", nullable: true), - DateLastMediaAdded = table.Column<DateTime>(type: "TEXT", nullable: true), - Album = table.Column<string>(type: "TEXT", nullable: true), - LUFS = table.Column<float>(type: "REAL", nullable: true), - NormalizationGain = table.Column<float>(type: "REAL", nullable: true), - IsVirtualItem = table.Column<bool>(type: "INTEGER", nullable: false), - SeriesName = table.Column<string>(type: "TEXT", nullable: true), - SeasonName = table.Column<string>(type: "TEXT", nullable: true), - ExternalSeriesId = table.Column<string>(type: "TEXT", nullable: true), - Tagline = table.Column<string>(type: "TEXT", nullable: true), - ProductionLocations = table.Column<string>(type: "TEXT", nullable: true), - ExtraIds = table.Column<string>(type: "TEXT", nullable: true), - TotalBitrate = table.Column<int>(type: "INTEGER", nullable: true), - ExtraType = table.Column<int>(type: "INTEGER", nullable: true), - Artists = table.Column<string>(type: "TEXT", nullable: true), - AlbumArtists = table.Column<string>(type: "TEXT", nullable: true), - ExternalId = table.Column<string>(type: "TEXT", nullable: true), - SeriesPresentationUniqueKey = table.Column<string>(type: "TEXT", nullable: true), - ShowId = table.Column<string>(type: "TEXT", nullable: true), - OwnerId = table.Column<string>(type: "TEXT", nullable: true), - Width = table.Column<int>(type: "INTEGER", nullable: true), - Height = table.Column<int>(type: "INTEGER", nullable: true), - Size = table.Column<long>(type: "INTEGER", nullable: true), - Audio = table.Column<int>(type: "INTEGER", nullable: true), - ParentId = table.Column<Guid>(type: "TEXT", nullable: true), - TopParentId = table.Column<Guid>(type: "TEXT", nullable: true), - SeasonId = table.Column<Guid>(type: "TEXT", nullable: true), - SeriesId = table.Column<Guid>(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_BaseItems", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "ItemValues", - columns: table => new - { - ItemValueId = table.Column<Guid>(type: "TEXT", nullable: false), - Type = table.Column<int>(type: "INTEGER", nullable: false), - Value = table.Column<string>(type: "TEXT", nullable: false), - CleanValue = table.Column<string>(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ItemValues", x => x.ItemValueId); - }); - - migrationBuilder.CreateTable( - name: "Peoples", - columns: table => new - { - Id = table.Column<Guid>(type: "TEXT", nullable: false), - Name = table.Column<string>(type: "TEXT", nullable: false), - PersonType = table.Column<string>(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Peoples", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "AncestorIds", - columns: table => new - { - ParentItemId = table.Column<Guid>(type: "TEXT", nullable: false), - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - BaseItemEntityId = table.Column<Guid>(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AncestorIds", x => new { x.ItemId, x.ParentItemId }); - table.ForeignKey( - name: "FK_AncestorIds_BaseItems_BaseItemEntityId", - column: x => x.BaseItemEntityId, - principalTable: "BaseItems", - principalColumn: "Id"); - table.ForeignKey( - name: "FK_AncestorIds_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_AncestorIds_BaseItems_ParentItemId", - column: x => x.ParentItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "AttachmentStreamInfos", - columns: table => new - { - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - Index = table.Column<int>(type: "INTEGER", nullable: false), - Codec = table.Column<string>(type: "TEXT", nullable: false), - CodecTag = table.Column<string>(type: "TEXT", nullable: true), - Comment = table.Column<string>(type: "TEXT", nullable: true), - Filename = table.Column<string>(type: "TEXT", nullable: true), - MimeType = table.Column<string>(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_AttachmentStreamInfos", x => new { x.ItemId, x.Index }); - table.ForeignKey( - name: "FK_AttachmentStreamInfos_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "BaseItemImageInfos", - columns: table => new - { - Id = table.Column<Guid>(type: "TEXT", nullable: false), - Path = table.Column<string>(type: "TEXT", nullable: false), - DateModified = table.Column<DateTime>(type: "TEXT", nullable: false), - ImageType = table.Column<int>(type: "INTEGER", nullable: false), - Width = table.Column<int>(type: "INTEGER", nullable: false), - Height = table.Column<int>(type: "INTEGER", nullable: false), - Blurhash = table.Column<byte[]>(type: "BLOB", nullable: true), - ItemId = table.Column<Guid>(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BaseItemImageInfos", x => x.Id); - table.ForeignKey( - name: "FK_BaseItemImageInfos_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "BaseItemMetadataFields", - columns: table => new - { - Id = table.Column<int>(type: "INTEGER", nullable: false), - ItemId = table.Column<Guid>(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BaseItemMetadataFields", x => new { x.Id, x.ItemId }); - table.ForeignKey( - name: "FK_BaseItemMetadataFields_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "BaseItemProviders", - columns: table => new - { - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - ProviderId = table.Column<string>(type: "TEXT", nullable: false), - ProviderValue = table.Column<string>(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BaseItemProviders", x => new { x.ItemId, x.ProviderId }); - table.ForeignKey( - name: "FK_BaseItemProviders_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "BaseItemTrailerTypes", - columns: table => new - { - Id = table.Column<int>(type: "INTEGER", nullable: false), - ItemId = table.Column<Guid>(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_BaseItemTrailerTypes", x => new { x.Id, x.ItemId }); - table.ForeignKey( - name: "FK_BaseItemTrailerTypes_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "Chapters", - columns: table => new - { - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - ChapterIndex = table.Column<int>(type: "INTEGER", nullable: false), - StartPositionTicks = table.Column<long>(type: "INTEGER", nullable: false), - Name = table.Column<string>(type: "TEXT", nullable: true), - ImagePath = table.Column<string>(type: "TEXT", nullable: true), - ImageDateModified = table.Column<DateTime>(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_Chapters", x => new { x.ItemId, x.ChapterIndex }); - table.ForeignKey( - name: "FK_Chapters_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "MediaStreamInfos", - columns: table => new - { - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - StreamIndex = table.Column<int>(type: "INTEGER", nullable: false), - StreamType = table.Column<int>(type: "INTEGER", nullable: true), - Codec = table.Column<string>(type: "TEXT", nullable: true), - Language = table.Column<string>(type: "TEXT", nullable: true), - ChannelLayout = table.Column<string>(type: "TEXT", nullable: true), - Profile = table.Column<string>(type: "TEXT", nullable: true), - AspectRatio = table.Column<string>(type: "TEXT", nullable: true), - Path = table.Column<string>(type: "TEXT", nullable: true), - IsInterlaced = table.Column<bool>(type: "INTEGER", nullable: false), - BitRate = table.Column<int>(type: "INTEGER", nullable: false), - Channels = table.Column<int>(type: "INTEGER", nullable: false), - SampleRate = table.Column<int>(type: "INTEGER", nullable: false), - IsDefault = table.Column<bool>(type: "INTEGER", nullable: false), - IsForced = table.Column<bool>(type: "INTEGER", nullable: false), - IsExternal = table.Column<bool>(type: "INTEGER", nullable: false), - Height = table.Column<int>(type: "INTEGER", nullable: false), - Width = table.Column<int>(type: "INTEGER", nullable: false), - AverageFrameRate = table.Column<float>(type: "REAL", nullable: false), - RealFrameRate = table.Column<float>(type: "REAL", nullable: false), - Level = table.Column<float>(type: "REAL", nullable: false), - PixelFormat = table.Column<string>(type: "TEXT", nullable: true), - BitDepth = table.Column<int>(type: "INTEGER", nullable: false), - IsAnamorphic = table.Column<bool>(type: "INTEGER", nullable: false), - RefFrames = table.Column<int>(type: "INTEGER", nullable: false), - CodecTag = table.Column<string>(type: "TEXT", nullable: false), - Comment = table.Column<string>(type: "TEXT", nullable: false), - NalLengthSize = table.Column<string>(type: "TEXT", nullable: false), - IsAvc = table.Column<bool>(type: "INTEGER", nullable: false), - Title = table.Column<string>(type: "TEXT", nullable: false), - TimeBase = table.Column<string>(type: "TEXT", nullable: false), - CodecTimeBase = table.Column<string>(type: "TEXT", nullable: false), - ColorPrimaries = table.Column<string>(type: "TEXT", nullable: false), - ColorSpace = table.Column<string>(type: "TEXT", nullable: false), - ColorTransfer = table.Column<string>(type: "TEXT", nullable: false), - DvVersionMajor = table.Column<int>(type: "INTEGER", nullable: false), - DvVersionMinor = table.Column<int>(type: "INTEGER", nullable: false), - DvProfile = table.Column<int>(type: "INTEGER", nullable: false), - DvLevel = table.Column<int>(type: "INTEGER", nullable: false), - RpuPresentFlag = table.Column<int>(type: "INTEGER", nullable: false), - ElPresentFlag = table.Column<int>(type: "INTEGER", nullable: false), - BlPresentFlag = table.Column<int>(type: "INTEGER", nullable: false), - DvBlSignalCompatibilityId = table.Column<int>(type: "INTEGER", nullable: false), - IsHearingImpaired = table.Column<bool>(type: "INTEGER", nullable: false), - Rotation = table.Column<int>(type: "INTEGER", nullable: false), - KeyFrames = table.Column<string>(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_MediaStreamInfos", x => new { x.ItemId, x.StreamIndex }); - table.ForeignKey( - name: "FK_MediaStreamInfos_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "UserData", - columns: table => new - { - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - UserId = table.Column<Guid>(type: "TEXT", nullable: false), - Rating = table.Column<double>(type: "REAL", nullable: true), - PlaybackPositionTicks = table.Column<long>(type: "INTEGER", nullable: false), - PlayCount = table.Column<int>(type: "INTEGER", nullable: false), - IsFavorite = table.Column<bool>(type: "INTEGER", nullable: false), - LastPlayedDate = table.Column<DateTime>(type: "TEXT", nullable: true), - Played = table.Column<bool>(type: "INTEGER", nullable: false), - AudioStreamIndex = table.Column<int>(type: "INTEGER", nullable: true), - SubtitleStreamIndex = table.Column<int>(type: "INTEGER", nullable: true), - Likes = table.Column<bool>(type: "INTEGER", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_UserData", x => new { x.ItemId, x.UserId }); - table.ForeignKey( - name: "FK_UserData_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_UserData_Users_UserId", - column: x => x.UserId, - principalTable: "Users", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "ItemValuesMap", - columns: table => new - { - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - ItemValueId = table.Column<Guid>(type: "TEXT", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_ItemValuesMap", x => new { x.ItemValueId, x.ItemId }); - table.ForeignKey( - name: "FK_ItemValuesMap_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_ItemValuesMap_ItemValues_ItemValueId", - column: x => x.ItemValueId, - principalTable: "ItemValues", - principalColumn: "ItemValueId", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "PeopleBaseItemMap", - columns: table => new - { - ItemId = table.Column<Guid>(type: "TEXT", nullable: false), - PeopleId = table.Column<Guid>(type: "TEXT", nullable: false), - SortOrder = table.Column<int>(type: "INTEGER", nullable: true), - ListOrder = table.Column<int>(type: "INTEGER", nullable: true), - Role = table.Column<string>(type: "TEXT", nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_PeopleBaseItemMap", x => new { x.ItemId, x.PeopleId }); - table.ForeignKey( - name: "FK_PeopleBaseItemMap_BaseItems_ItemId", - column: x => x.ItemId, - principalTable: "BaseItems", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_PeopleBaseItemMap_Peoples_PeopleId", - column: x => x.PeopleId, - principalTable: "Peoples", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_AncestorIds_BaseItemEntityId", - table: "AncestorIds", - column: "BaseItemEntityId"); - - migrationBuilder.CreateIndex( - name: "IX_AncestorIds_ParentItemId", - table: "AncestorIds", - column: "ParentItemId"); - - migrationBuilder.CreateIndex( - name: "IX_BaseItemImageInfos_ItemId", - table: "BaseItemImageInfos", - column: "ItemId"); - - migrationBuilder.CreateIndex( - name: "IX_BaseItemMetadataFields_ItemId", - table: "BaseItemMetadataFields", - column: "ItemId"); - - migrationBuilder.CreateIndex( - name: "IX_BaseItemProviders_ProviderId_ProviderValue_ItemId", - table: "BaseItemProviders", - columns: new[] { "ProviderId", "ProviderValue", "ItemId" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_Id_Type_IsFolder_IsVirtualItem", - table: "BaseItems", - columns: new[] { "Id", "Type", "IsFolder", "IsVirtualItem" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_IsFolder_TopParentId_IsVirtualItem_PresentationUniqueKey_DateCreated", - table: "BaseItems", - columns: new[] { "IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_MediaType_TopParentId_IsVirtualItem_PresentationUniqueKey", - table: "BaseItems", - columns: new[] { "MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_ParentId", - table: "BaseItems", - column: "ParentId"); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_Path", - table: "BaseItems", - column: "Path"); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_PresentationUniqueKey", - table: "BaseItems", - column: "PresentationUniqueKey"); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_TopParentId_Id", - table: "BaseItems", - columns: new[] { "TopParentId", "Id" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_Type_SeriesPresentationUniqueKey_IsFolder_IsVirtualItem", - table: "BaseItems", - columns: new[] { "Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_Type_SeriesPresentationUniqueKey_PresentationUniqueKey_SortName", - table: "BaseItems", - columns: new[] { "Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_Type_TopParentId_Id", - table: "BaseItems", - columns: new[] { "Type", "TopParentId", "Id" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_Type_TopParentId_IsVirtualItem_PresentationUniqueKey_DateCreated", - table: "BaseItems", - columns: new[] { "Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_Type_TopParentId_PresentationUniqueKey", - table: "BaseItems", - columns: new[] { "Type", "TopParentId", "PresentationUniqueKey" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItems_Type_TopParentId_StartDate", - table: "BaseItems", - columns: new[] { "Type", "TopParentId", "StartDate" }); - - migrationBuilder.CreateIndex( - name: "IX_BaseItemTrailerTypes_ItemId", - table: "BaseItemTrailerTypes", - column: "ItemId"); - - migrationBuilder.CreateIndex( - name: "IX_ItemValues_Type_CleanValue", - table: "ItemValues", - columns: new[] { "Type", "CleanValue" }); - - migrationBuilder.CreateIndex( - name: "IX_ItemValuesMap_ItemId", - table: "ItemValuesMap", - column: "ItemId"); - - migrationBuilder.CreateIndex( - name: "IX_MediaStreamInfos_StreamIndex", - table: "MediaStreamInfos", - column: "StreamIndex"); - - migrationBuilder.CreateIndex( - name: "IX_MediaStreamInfos_StreamIndex_StreamType", - table: "MediaStreamInfos", - columns: new[] { "StreamIndex", "StreamType" }); - - migrationBuilder.CreateIndex( - name: "IX_MediaStreamInfos_StreamIndex_StreamType_Language", - table: "MediaStreamInfos", - columns: new[] { "StreamIndex", "StreamType", "Language" }); - - migrationBuilder.CreateIndex( - name: "IX_MediaStreamInfos_StreamType", - table: "MediaStreamInfos", - column: "StreamType"); - - migrationBuilder.CreateIndex( - name: "IX_PeopleBaseItemMap_ItemId_ListOrder", - table: "PeopleBaseItemMap", - columns: new[] { "ItemId", "ListOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_PeopleBaseItemMap_ItemId_SortOrder", - table: "PeopleBaseItemMap", - columns: new[] { "ItemId", "SortOrder" }); - - migrationBuilder.CreateIndex( - name: "IX_PeopleBaseItemMap_PeopleId", - table: "PeopleBaseItemMap", - column: "PeopleId"); - - migrationBuilder.CreateIndex( - name: "IX_Peoples_Name", - table: "Peoples", - column: "Name"); - - migrationBuilder.CreateIndex( - name: "IX_UserData_ItemId_UserId_IsFavorite", - table: "UserData", - columns: new[] { "ItemId", "UserId", "IsFavorite" }); - - migrationBuilder.CreateIndex( - name: "IX_UserData_ItemId_UserId_LastPlayedDate", - table: "UserData", - columns: new[] { "ItemId", "UserId", "LastPlayedDate" }); - - migrationBuilder.CreateIndex( - name: "IX_UserData_ItemId_UserId_PlaybackPositionTicks", - table: "UserData", - columns: new[] { "ItemId", "UserId", "PlaybackPositionTicks" }); - - migrationBuilder.CreateIndex( - name: "IX_UserData_ItemId_UserId_Played", - table: "UserData", - columns: new[] { "ItemId", "UserId", "Played" }); - - migrationBuilder.CreateIndex( - name: "IX_UserData_UserId", - table: "UserData", - column: "UserId"); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "AncestorIds"); - - migrationBuilder.DropTable( - name: "AttachmentStreamInfos"); - - migrationBuilder.DropTable( - name: "BaseItemImageInfos"); - - migrationBuilder.DropTable( - name: "BaseItemMetadataFields"); - - migrationBuilder.DropTable( - name: "BaseItemProviders"); - - migrationBuilder.DropTable( - name: "BaseItemTrailerTypes"); - - migrationBuilder.DropTable( - name: "Chapters"); - - migrationBuilder.DropTable( - name: "ItemValuesMap"); - - migrationBuilder.DropTable( - name: "MediaStreamInfos"); - - migrationBuilder.DropTable( - name: "PeopleBaseItemMap"); - - migrationBuilder.DropTable( - name: "UserData"); - - migrationBuilder.DropTable( - name: "ItemValues"); - - migrationBuilder.DropTable( - name: "Peoples"); - - migrationBuilder.DropTable( - name: "BaseItems"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241111131257_AddedCustomDataKey.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20241111131257_AddedCustomDataKey.Designer.cs deleted file mode 100644 index 1fbf21492..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241111131257_AddedCustomDataKey.Designer.cs +++ /dev/null @@ -1,1610 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20241111131257_AddedCustomDataKey")] - partial class AddedCustomDataKey - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.10"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ParentItemId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("BaseItemEntityId") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ParentItemId"); - - b.HasIndex("BaseItemEntityId"); - - b.HasIndex("ParentItemId"); - - b.ToTable("AncestorIds"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Index") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<string>("Filename") - .HasColumnType("TEXT"); - - b.Property<string>("MimeType") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "Index"); - - b.ToTable("AttachmentStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Album") - .HasColumnType("TEXT"); - - b.Property<string>("AlbumArtists") - .HasColumnType("TEXT"); - - b.Property<string>("Artists") - .HasColumnType("TEXT"); - - b.Property<int?>("Audio") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelId") - .HasColumnType("TEXT"); - - b.Property<string>("CleanName") - .HasColumnType("TEXT"); - - b.Property<float?>("CommunityRating") - .HasColumnType("REAL"); - - b.Property<float?>("CriticRating") - .HasColumnType("REAL"); - - b.Property<string>("CustomRating") - .HasColumnType("TEXT"); - - b.Property<string>("Data") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastMediaAdded") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastRefreshed") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastSaved") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateModified") - .HasColumnType("TEXT"); - - b.Property<DateTime>("EndDate") - .HasColumnType("TEXT"); - - b.Property<string>("EpisodeTitle") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalSeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalServiceId") - .HasColumnType("TEXT"); - - b.Property<string>("ExtraIds") - .HasColumnType("TEXT"); - - b.Property<int?>("ExtraType") - .HasColumnType("INTEGER"); - - b.Property<string>("ForcedSortName") - .HasColumnType("TEXT"); - - b.Property<string>("Genres") - .HasColumnType("TEXT"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexNumber") - .HasColumnType("INTEGER"); - - b.Property<int?>("InheritedParentalRatingValue") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInMixedFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsLocked") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsMovie") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsRepeat") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsSeries") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsVirtualItem") - .HasColumnType("INTEGER"); - - b.Property<float?>("LUFS") - .HasColumnType("REAL"); - - b.Property<string>("MediaType") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<float?>("NormalizationGain") - .HasColumnType("REAL"); - - b.Property<string>("OfficialRating") - .HasColumnType("TEXT"); - - b.Property<string>("OriginalTitle") - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasColumnType("TEXT"); - - b.Property<string>("OwnerId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("ParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("ParentIndexNumber") - .HasColumnType("INTEGER"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataCountryCode") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataLanguage") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("PremiereDate") - .HasColumnType("TEXT"); - - b.Property<string>("PresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("PrimaryVersionId") - .HasColumnType("TEXT"); - - b.Property<string>("ProductionLocations") - .HasColumnType("TEXT"); - - b.Property<int?>("ProductionYear") - .HasColumnType("INTEGER"); - - b.Property<long?>("RunTimeTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("SeasonId") - .HasColumnType("TEXT"); - - b.Property<string>("SeasonName") - .HasColumnType("TEXT"); - - b.Property<Guid?>("SeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesName") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesPresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("ShowId") - .HasColumnType("TEXT"); - - b.Property<long?>("Size") - .HasColumnType("INTEGER"); - - b.Property<string>("SortName") - .HasColumnType("TEXT"); - - b.Property<DateTime>("StartDate") - .HasColumnType("TEXT"); - - b.Property<string>("Studios") - .HasColumnType("TEXT"); - - b.Property<string>("Tagline") - .HasColumnType("TEXT"); - - b.Property<string>("Tags") - .HasColumnType("TEXT"); - - b.Property<Guid?>("TopParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("TotalBitrate") - .HasColumnType("INTEGER"); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("UnratedType") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("Path"); - - b.HasIndex("PresentationUniqueKey"); - - b.HasIndex("TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); - - b.HasIndex("Type", "TopParentId", "StartDate"); - - b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem"); - - b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName"); - - b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.ToTable("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<byte[]>("Blurhash") - .HasColumnType("BLOB"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("ImageType") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemMetadataFields"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ProviderId"); - - b.HasIndex("ProviderId", "ProviderValue", "ItemId"); - - b.ToTable("BaseItemProviders"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemTrailerTypes"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ChapterIndex") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("ImageDateModified") - .HasColumnType("TEXT"); - - b.Property<string>("ImagePath") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<long>("StartPositionTicks") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "ChapterIndex"); - - b.ToTable("Chapters"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Property<Guid>("ItemValueId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("CleanValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId"); - - b.HasIndex("Type", "CleanValue"); - - b.ToTable("ItemValues"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.Property<Guid>("ItemValueId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("ItemValuesMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("StreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("AspectRatio") - .HasColumnType("TEXT"); - - b.Property<float>("AverageFrameRate") - .HasColumnType("REAL"); - - b.Property<int>("BitDepth") - .HasColumnType("INTEGER"); - - b.Property<int>("BitRate") - .HasColumnType("INTEGER"); - - b.Property<int>("BlPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelLayout") - .HasColumnType("TEXT"); - - b.Property<int>("Channels") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTimeBase") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorPrimaries") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorSpace") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorTransfer") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("DvBlSignalCompatibilityId") - .HasColumnType("INTEGER"); - - b.Property<int>("DvLevel") - .HasColumnType("INTEGER"); - - b.Property<int>("DvProfile") - .HasColumnType("INTEGER"); - - b.Property<int>("DvVersionMajor") - .HasColumnType("INTEGER"); - - b.Property<int>("DvVersionMinor") - .HasColumnType("INTEGER"); - - b.Property<int>("ElPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsAnamorphic") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsAvc") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsDefault") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsExternal") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsForced") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsHearingImpaired") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInterlaced") - .HasColumnType("INTEGER"); - - b.Property<string>("KeyFrames") - .HasColumnType("TEXT"); - - b.Property<string>("Language") - .HasColumnType("TEXT"); - - b.Property<float>("Level") - .HasColumnType("REAL"); - - b.Property<string>("NalLengthSize") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PixelFormat") - .HasColumnType("TEXT"); - - b.Property<string>("Profile") - .HasColumnType("TEXT"); - - b.Property<float>("RealFrameRate") - .HasColumnType("REAL"); - - b.Property<int>("RefFrames") - .HasColumnType("INTEGER"); - - b.Property<int>("Rotation") - .HasColumnType("INTEGER"); - - b.Property<int>("RpuPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int>("SampleRate") - .HasColumnType("INTEGER"); - - b.Property<int?>("StreamType") - .HasColumnType("INTEGER"); - - b.Property<string>("TimeBase") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Title") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "StreamIndex"); - - b.HasIndex("StreamIndex"); - - b.HasIndex("StreamType"); - - b.HasIndex("StreamIndex", "StreamType"); - - b.HasIndex("StreamIndex", "StreamType", "Language"); - - b.ToTable("MediaStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PersonType") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Peoples"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("PeopleId") - .HasColumnType("TEXT"); - - b.Property<int?>("ListOrder") - .HasColumnType("INTEGER"); - - b.Property<string>("Role") - .HasColumnType("TEXT"); - - b.Property<int?>("SortOrder") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "PeopleId"); - - b.HasIndex("PeopleId"); - - b.HasIndex("ItemId", "ListOrder"); - - b.HasIndex("ItemId", "SortOrder"); - - b.ToTable("PeopleBaseItemMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int?>("AudioStreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("CustomDataKey") - .HasColumnType("TEXT"); - - b.Property<bool>("IsFavorite") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastPlayedDate") - .HasColumnType("TEXT"); - - b.Property<bool?>("Likes") - .HasColumnType("INTEGER"); - - b.Property<int>("PlayCount") - .HasColumnType("INTEGER"); - - b.Property<long>("PlaybackPositionTicks") - .HasColumnType("INTEGER"); - - b.Property<bool>("Played") - .HasColumnType("INTEGER"); - - b.Property<double?>("Rating") - .HasColumnType("REAL"); - - b.Property<int?>("SubtitleStreamIndex") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "UserId"); - - b.HasIndex("UserId"); - - b.HasIndex("ItemId", "UserId", "IsFavorite"); - - b.HasIndex("ItemId", "UserId", "LastPlayedDate"); - - b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks"); - - b.HasIndex("ItemId", "UserId", "Played"); - - b.ToTable("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", null) - .WithMany("AncestorIds") - .HasForeignKey("BaseItemEntityId"); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem") - .WithMany() - .HasForeignKey("ParentItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ParentItem"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Images") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("LockedFields") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Provider") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("TrailerTypes") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Chapters") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("ItemValues") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue") - .WithMany("BaseItemsMap") - .HasForeignKey("ItemValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ItemValue"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("MediaStreams") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Peoples") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.People", "People") - .WithMany("BaseItems") - .HasForeignKey("PeopleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("People"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("UserData") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Navigation("AncestorIds"); - - b.Navigation("Chapters"); - - b.Navigation("Images"); - - b.Navigation("ItemValues"); - - b.Navigation("LockedFields"); - - b.Navigation("MediaStreams"); - - b.Navigation("Peoples"); - - b.Navigation("Provider"); - - b.Navigation("TrailerTypes"); - - b.Navigation("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Navigation("BaseItemsMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Navigation("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241111131257_AddedCustomDataKey.cs b/Jellyfin.Server.Implementations/Migrations/20241111131257_AddedCustomDataKey.cs deleted file mode 100644 index ac78019ed..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241111131257_AddedCustomDataKey.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class AddedCustomDataKey : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn<string>( - name: "CustomDataKey", - table: "UserData", - type: "TEXT", - nullable: true); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "CustomDataKey", - table: "UserData"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241111135439_AddedCustomDataKeyKey.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20241111135439_AddedCustomDataKeyKey.Designer.cs deleted file mode 100644 index bac6fd5b5..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241111135439_AddedCustomDataKeyKey.Designer.cs +++ /dev/null @@ -1,1610 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20241111135439_AddedCustomDataKeyKey")] - partial class AddedCustomDataKeyKey - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.10"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ParentItemId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("BaseItemEntityId") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ParentItemId"); - - b.HasIndex("BaseItemEntityId"); - - b.HasIndex("ParentItemId"); - - b.ToTable("AncestorIds"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Index") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<string>("Filename") - .HasColumnType("TEXT"); - - b.Property<string>("MimeType") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "Index"); - - b.ToTable("AttachmentStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Album") - .HasColumnType("TEXT"); - - b.Property<string>("AlbumArtists") - .HasColumnType("TEXT"); - - b.Property<string>("Artists") - .HasColumnType("TEXT"); - - b.Property<int?>("Audio") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelId") - .HasColumnType("TEXT"); - - b.Property<string>("CleanName") - .HasColumnType("TEXT"); - - b.Property<float?>("CommunityRating") - .HasColumnType("REAL"); - - b.Property<float?>("CriticRating") - .HasColumnType("REAL"); - - b.Property<string>("CustomRating") - .HasColumnType("TEXT"); - - b.Property<string>("Data") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastMediaAdded") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastRefreshed") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastSaved") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateModified") - .HasColumnType("TEXT"); - - b.Property<DateTime>("EndDate") - .HasColumnType("TEXT"); - - b.Property<string>("EpisodeTitle") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalSeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalServiceId") - .HasColumnType("TEXT"); - - b.Property<string>("ExtraIds") - .HasColumnType("TEXT"); - - b.Property<int?>("ExtraType") - .HasColumnType("INTEGER"); - - b.Property<string>("ForcedSortName") - .HasColumnType("TEXT"); - - b.Property<string>("Genres") - .HasColumnType("TEXT"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexNumber") - .HasColumnType("INTEGER"); - - b.Property<int?>("InheritedParentalRatingValue") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInMixedFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsLocked") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsMovie") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsRepeat") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsSeries") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsVirtualItem") - .HasColumnType("INTEGER"); - - b.Property<float?>("LUFS") - .HasColumnType("REAL"); - - b.Property<string>("MediaType") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<float?>("NormalizationGain") - .HasColumnType("REAL"); - - b.Property<string>("OfficialRating") - .HasColumnType("TEXT"); - - b.Property<string>("OriginalTitle") - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasColumnType("TEXT"); - - b.Property<string>("OwnerId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("ParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("ParentIndexNumber") - .HasColumnType("INTEGER"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataCountryCode") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataLanguage") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("PremiereDate") - .HasColumnType("TEXT"); - - b.Property<string>("PresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("PrimaryVersionId") - .HasColumnType("TEXT"); - - b.Property<string>("ProductionLocations") - .HasColumnType("TEXT"); - - b.Property<int?>("ProductionYear") - .HasColumnType("INTEGER"); - - b.Property<long?>("RunTimeTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("SeasonId") - .HasColumnType("TEXT"); - - b.Property<string>("SeasonName") - .HasColumnType("TEXT"); - - b.Property<Guid?>("SeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesName") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesPresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("ShowId") - .HasColumnType("TEXT"); - - b.Property<long?>("Size") - .HasColumnType("INTEGER"); - - b.Property<string>("SortName") - .HasColumnType("TEXT"); - - b.Property<DateTime>("StartDate") - .HasColumnType("TEXT"); - - b.Property<string>("Studios") - .HasColumnType("TEXT"); - - b.Property<string>("Tagline") - .HasColumnType("TEXT"); - - b.Property<string>("Tags") - .HasColumnType("TEXT"); - - b.Property<Guid?>("TopParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("TotalBitrate") - .HasColumnType("INTEGER"); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("UnratedType") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("Path"); - - b.HasIndex("PresentationUniqueKey"); - - b.HasIndex("TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); - - b.HasIndex("Type", "TopParentId", "StartDate"); - - b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem"); - - b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName"); - - b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.ToTable("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<byte[]>("Blurhash") - .HasColumnType("BLOB"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("ImageType") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemMetadataFields"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ProviderId"); - - b.HasIndex("ProviderId", "ProviderValue", "ItemId"); - - b.ToTable("BaseItemProviders"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemTrailerTypes"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ChapterIndex") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("ImageDateModified") - .HasColumnType("TEXT"); - - b.Property<string>("ImagePath") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<long>("StartPositionTicks") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "ChapterIndex"); - - b.ToTable("Chapters"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Property<Guid>("ItemValueId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("CleanValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId"); - - b.HasIndex("Type", "CleanValue"); - - b.ToTable("ItemValues"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.Property<Guid>("ItemValueId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("ItemValuesMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("StreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("AspectRatio") - .HasColumnType("TEXT"); - - b.Property<float>("AverageFrameRate") - .HasColumnType("REAL"); - - b.Property<int>("BitDepth") - .HasColumnType("INTEGER"); - - b.Property<int>("BitRate") - .HasColumnType("INTEGER"); - - b.Property<int>("BlPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelLayout") - .HasColumnType("TEXT"); - - b.Property<int>("Channels") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTimeBase") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorPrimaries") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorSpace") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorTransfer") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("DvBlSignalCompatibilityId") - .HasColumnType("INTEGER"); - - b.Property<int>("DvLevel") - .HasColumnType("INTEGER"); - - b.Property<int>("DvProfile") - .HasColumnType("INTEGER"); - - b.Property<int>("DvVersionMajor") - .HasColumnType("INTEGER"); - - b.Property<int>("DvVersionMinor") - .HasColumnType("INTEGER"); - - b.Property<int>("ElPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsAnamorphic") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsAvc") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsDefault") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsExternal") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsForced") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsHearingImpaired") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInterlaced") - .HasColumnType("INTEGER"); - - b.Property<string>("KeyFrames") - .HasColumnType("TEXT"); - - b.Property<string>("Language") - .HasColumnType("TEXT"); - - b.Property<float>("Level") - .HasColumnType("REAL"); - - b.Property<string>("NalLengthSize") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PixelFormat") - .HasColumnType("TEXT"); - - b.Property<string>("Profile") - .HasColumnType("TEXT"); - - b.Property<float>("RealFrameRate") - .HasColumnType("REAL"); - - b.Property<int>("RefFrames") - .HasColumnType("INTEGER"); - - b.Property<int>("Rotation") - .HasColumnType("INTEGER"); - - b.Property<int>("RpuPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int>("SampleRate") - .HasColumnType("INTEGER"); - - b.Property<int?>("StreamType") - .HasColumnType("INTEGER"); - - b.Property<string>("TimeBase") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Title") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "StreamIndex"); - - b.HasIndex("StreamIndex"); - - b.HasIndex("StreamType"); - - b.HasIndex("StreamIndex", "StreamType"); - - b.HasIndex("StreamIndex", "StreamType", "Language"); - - b.ToTable("MediaStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PersonType") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Peoples"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("PeopleId") - .HasColumnType("TEXT"); - - b.Property<int?>("ListOrder") - .HasColumnType("INTEGER"); - - b.Property<string>("Role") - .HasColumnType("TEXT"); - - b.Property<int?>("SortOrder") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "PeopleId"); - - b.HasIndex("PeopleId"); - - b.HasIndex("ItemId", "ListOrder"); - - b.HasIndex("ItemId", "SortOrder"); - - b.ToTable("PeopleBaseItemMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("CustomDataKey") - .HasColumnType("TEXT"); - - b.Property<int?>("AudioStreamIndex") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFavorite") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastPlayedDate") - .HasColumnType("TEXT"); - - b.Property<bool?>("Likes") - .HasColumnType("INTEGER"); - - b.Property<int>("PlayCount") - .HasColumnType("INTEGER"); - - b.Property<long>("PlaybackPositionTicks") - .HasColumnType("INTEGER"); - - b.Property<bool>("Played") - .HasColumnType("INTEGER"); - - b.Property<double?>("Rating") - .HasColumnType("REAL"); - - b.Property<int?>("SubtitleStreamIndex") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "UserId", "CustomDataKey"); - - b.HasIndex("UserId"); - - b.HasIndex("ItemId", "UserId", "IsFavorite"); - - b.HasIndex("ItemId", "UserId", "LastPlayedDate"); - - b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks"); - - b.HasIndex("ItemId", "UserId", "Played"); - - b.ToTable("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", null) - .WithMany("AncestorIds") - .HasForeignKey("BaseItemEntityId"); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem") - .WithMany() - .HasForeignKey("ParentItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ParentItem"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Images") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("LockedFields") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Provider") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("TrailerTypes") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Chapters") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("ItemValues") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue") - .WithMany("BaseItemsMap") - .HasForeignKey("ItemValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ItemValue"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("MediaStreams") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Peoples") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.People", "People") - .WithMany("BaseItems") - .HasForeignKey("PeopleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("People"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("UserData") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Navigation("AncestorIds"); - - b.Navigation("Chapters"); - - b.Navigation("Images"); - - b.Navigation("ItemValues"); - - b.Navigation("LockedFields"); - - b.Navigation("MediaStreams"); - - b.Navigation("Peoples"); - - b.Navigation("Provider"); - - b.Navigation("TrailerTypes"); - - b.Navigation("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Navigation("BaseItemsMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Navigation("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241111135439_AddedCustomDataKeyKey.cs b/Jellyfin.Server.Implementations/Migrations/20241111135439_AddedCustomDataKeyKey.cs deleted file mode 100644 index 4558d7c49..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241111135439_AddedCustomDataKeyKey.cs +++ /dev/null @@ -1,54 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class AddedCustomDataKeyKey : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_UserData", - table: "UserData"); - - migrationBuilder.AlterColumn<string>( - name: "CustomDataKey", - table: "UserData", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AddPrimaryKey( - name: "PK_UserData", - table: "UserData", - columns: new[] { "ItemId", "UserId", "CustomDataKey" }); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropPrimaryKey( - name: "PK_UserData", - table: "UserData"); - - migrationBuilder.AlterColumn<string>( - name: "CustomDataKey", - table: "UserData", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AddPrimaryKey( - name: "PK_UserData", - table: "UserData", - columns: new[] { "ItemId", "UserId" }); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241112152323_FixAncestorIdConfig.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20241112152323_FixAncestorIdConfig.Designer.cs deleted file mode 100644 index ad622d44c..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241112152323_FixAncestorIdConfig.Designer.cs +++ /dev/null @@ -1,1603 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20241112152323_FixAncestorIdConfig")] - partial class FixAncestorIdConfig - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.10"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ParentItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ParentItemId"); - - b.HasIndex("ParentItemId"); - - b.ToTable("AncestorIds"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Index") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<string>("Filename") - .HasColumnType("TEXT"); - - b.Property<string>("MimeType") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "Index"); - - b.ToTable("AttachmentStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Album") - .HasColumnType("TEXT"); - - b.Property<string>("AlbumArtists") - .HasColumnType("TEXT"); - - b.Property<string>("Artists") - .HasColumnType("TEXT"); - - b.Property<int?>("Audio") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelId") - .HasColumnType("TEXT"); - - b.Property<string>("CleanName") - .HasColumnType("TEXT"); - - b.Property<float?>("CommunityRating") - .HasColumnType("REAL"); - - b.Property<float?>("CriticRating") - .HasColumnType("REAL"); - - b.Property<string>("CustomRating") - .HasColumnType("TEXT"); - - b.Property<string>("Data") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastMediaAdded") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastRefreshed") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastSaved") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateModified") - .HasColumnType("TEXT"); - - b.Property<DateTime>("EndDate") - .HasColumnType("TEXT"); - - b.Property<string>("EpisodeTitle") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalSeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalServiceId") - .HasColumnType("TEXT"); - - b.Property<string>("ExtraIds") - .HasColumnType("TEXT"); - - b.Property<int?>("ExtraType") - .HasColumnType("INTEGER"); - - b.Property<string>("ForcedSortName") - .HasColumnType("TEXT"); - - b.Property<string>("Genres") - .HasColumnType("TEXT"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexNumber") - .HasColumnType("INTEGER"); - - b.Property<int?>("InheritedParentalRatingValue") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInMixedFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsLocked") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsMovie") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsRepeat") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsSeries") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsVirtualItem") - .HasColumnType("INTEGER"); - - b.Property<float?>("LUFS") - .HasColumnType("REAL"); - - b.Property<string>("MediaType") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<float?>("NormalizationGain") - .HasColumnType("REAL"); - - b.Property<string>("OfficialRating") - .HasColumnType("TEXT"); - - b.Property<string>("OriginalTitle") - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasColumnType("TEXT"); - - b.Property<string>("OwnerId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("ParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("ParentIndexNumber") - .HasColumnType("INTEGER"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataCountryCode") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataLanguage") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("PremiereDate") - .HasColumnType("TEXT"); - - b.Property<string>("PresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("PrimaryVersionId") - .HasColumnType("TEXT"); - - b.Property<string>("ProductionLocations") - .HasColumnType("TEXT"); - - b.Property<int?>("ProductionYear") - .HasColumnType("INTEGER"); - - b.Property<long?>("RunTimeTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("SeasonId") - .HasColumnType("TEXT"); - - b.Property<string>("SeasonName") - .HasColumnType("TEXT"); - - b.Property<Guid?>("SeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesName") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesPresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("ShowId") - .HasColumnType("TEXT"); - - b.Property<long?>("Size") - .HasColumnType("INTEGER"); - - b.Property<string>("SortName") - .HasColumnType("TEXT"); - - b.Property<DateTime>("StartDate") - .HasColumnType("TEXT"); - - b.Property<string>("Studios") - .HasColumnType("TEXT"); - - b.Property<string>("Tagline") - .HasColumnType("TEXT"); - - b.Property<string>("Tags") - .HasColumnType("TEXT"); - - b.Property<Guid?>("TopParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("TotalBitrate") - .HasColumnType("INTEGER"); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("UnratedType") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("Path"); - - b.HasIndex("PresentationUniqueKey"); - - b.HasIndex("TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); - - b.HasIndex("Type", "TopParentId", "StartDate"); - - b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem"); - - b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName"); - - b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.ToTable("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<byte[]>("Blurhash") - .HasColumnType("BLOB"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("ImageType") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemMetadataFields"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ProviderId"); - - b.HasIndex("ProviderId", "ProviderValue", "ItemId"); - - b.ToTable("BaseItemProviders"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemTrailerTypes"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ChapterIndex") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("ImageDateModified") - .HasColumnType("TEXT"); - - b.Property<string>("ImagePath") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<long>("StartPositionTicks") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "ChapterIndex"); - - b.ToTable("Chapters"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Property<Guid>("ItemValueId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("CleanValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId"); - - b.HasIndex("Type", "CleanValue"); - - b.ToTable("ItemValues"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.Property<Guid>("ItemValueId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("ItemValuesMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("StreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("AspectRatio") - .HasColumnType("TEXT"); - - b.Property<float>("AverageFrameRate") - .HasColumnType("REAL"); - - b.Property<int>("BitDepth") - .HasColumnType("INTEGER"); - - b.Property<int>("BitRate") - .HasColumnType("INTEGER"); - - b.Property<int>("BlPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelLayout") - .HasColumnType("TEXT"); - - b.Property<int>("Channels") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTimeBase") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorPrimaries") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorSpace") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("ColorTransfer") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("DvBlSignalCompatibilityId") - .HasColumnType("INTEGER"); - - b.Property<int>("DvLevel") - .HasColumnType("INTEGER"); - - b.Property<int>("DvProfile") - .HasColumnType("INTEGER"); - - b.Property<int>("DvVersionMajor") - .HasColumnType("INTEGER"); - - b.Property<int>("DvVersionMinor") - .HasColumnType("INTEGER"); - - b.Property<int>("ElPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsAnamorphic") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsAvc") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsDefault") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsExternal") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsForced") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsHearingImpaired") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInterlaced") - .HasColumnType("INTEGER"); - - b.Property<string>("KeyFrames") - .HasColumnType("TEXT"); - - b.Property<string>("Language") - .HasColumnType("TEXT"); - - b.Property<float>("Level") - .HasColumnType("REAL"); - - b.Property<string>("NalLengthSize") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PixelFormat") - .HasColumnType("TEXT"); - - b.Property<string>("Profile") - .HasColumnType("TEXT"); - - b.Property<float>("RealFrameRate") - .HasColumnType("REAL"); - - b.Property<int>("RefFrames") - .HasColumnType("INTEGER"); - - b.Property<int>("Rotation") - .HasColumnType("INTEGER"); - - b.Property<int>("RpuPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int>("SampleRate") - .HasColumnType("INTEGER"); - - b.Property<int?>("StreamType") - .HasColumnType("INTEGER"); - - b.Property<string>("TimeBase") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("Title") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "StreamIndex"); - - b.HasIndex("StreamIndex"); - - b.HasIndex("StreamType"); - - b.HasIndex("StreamIndex", "StreamType"); - - b.HasIndex("StreamIndex", "StreamType", "Language"); - - b.ToTable("MediaStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PersonType") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Peoples"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("PeopleId") - .HasColumnType("TEXT"); - - b.Property<int?>("ListOrder") - .HasColumnType("INTEGER"); - - b.Property<string>("Role") - .HasColumnType("TEXT"); - - b.Property<int?>("SortOrder") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "PeopleId"); - - b.HasIndex("PeopleId"); - - b.HasIndex("ItemId", "ListOrder"); - - b.HasIndex("ItemId", "SortOrder"); - - b.ToTable("PeopleBaseItemMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("CustomDataKey") - .HasColumnType("TEXT"); - - b.Property<int?>("AudioStreamIndex") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFavorite") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastPlayedDate") - .HasColumnType("TEXT"); - - b.Property<bool?>("Likes") - .HasColumnType("INTEGER"); - - b.Property<int>("PlayCount") - .HasColumnType("INTEGER"); - - b.Property<long>("PlaybackPositionTicks") - .HasColumnType("INTEGER"); - - b.Property<bool>("Played") - .HasColumnType("INTEGER"); - - b.Property<double?>("Rating") - .HasColumnType("REAL"); - - b.Property<int?>("SubtitleStreamIndex") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "UserId", "CustomDataKey"); - - b.HasIndex("UserId"); - - b.HasIndex("ItemId", "UserId", "IsFavorite"); - - b.HasIndex("ItemId", "UserId", "LastPlayedDate"); - - b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks"); - - b.HasIndex("ItemId", "UserId", "Played"); - - b.ToTable("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Children") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem") - .WithMany("ParentAncestors") - .HasForeignKey("ParentItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ParentItem"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Images") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("LockedFields") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Provider") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("TrailerTypes") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Chapters") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("ItemValues") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue") - .WithMany("BaseItemsMap") - .HasForeignKey("ItemValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ItemValue"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("MediaStreams") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Peoples") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.People", "People") - .WithMany("BaseItems") - .HasForeignKey("PeopleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("People"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("UserData") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Navigation("Chapters"); - - b.Navigation("Children"); - - b.Navigation("Images"); - - b.Navigation("ItemValues"); - - b.Navigation("LockedFields"); - - b.Navigation("MediaStreams"); - - b.Navigation("ParentAncestors"); - - b.Navigation("Peoples"); - - b.Navigation("Provider"); - - b.Navigation("TrailerTypes"); - - b.Navigation("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Navigation("BaseItemsMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Navigation("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241112152323_FixAncestorIdConfig.cs b/Jellyfin.Server.Implementations/Migrations/20241112152323_FixAncestorIdConfig.cs deleted file mode 100644 index 70e81f367..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241112152323_FixAncestorIdConfig.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class FixAncestorIdConfig : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_AncestorIds_BaseItems_BaseItemEntityId", - table: "AncestorIds"); - - migrationBuilder.DropIndex( - name: "IX_AncestorIds_BaseItemEntityId", - table: "AncestorIds"); - - migrationBuilder.DropColumn( - name: "BaseItemEntityId", - table: "AncestorIds"); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn<Guid>( - name: "BaseItemEntityId", - table: "AncestorIds", - type: "TEXT", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_AncestorIds_BaseItemEntityId", - table: "AncestorIds", - column: "BaseItemEntityId"); - - migrationBuilder.AddForeignKey( - name: "FK_AncestorIds_BaseItems_BaseItemEntityId", - table: "AncestorIds", - column: "BaseItemEntityId", - principalTable: "BaseItems", - principalColumn: "Id"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241112232041_fixMediaStreams.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20241112232041_fixMediaStreams.Designer.cs deleted file mode 100644 index dc4c8212b..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241112232041_fixMediaStreams.Designer.cs +++ /dev/null @@ -1,1600 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20241112232041_FixMediaStreams")] - partial class FixMediaStreams - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.10"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ParentItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ParentItemId"); - - b.HasIndex("ParentItemId"); - - b.ToTable("AncestorIds"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Index") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<string>("Filename") - .HasColumnType("TEXT"); - - b.Property<string>("MimeType") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "Index"); - - b.ToTable("AttachmentStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Album") - .HasColumnType("TEXT"); - - b.Property<string>("AlbumArtists") - .HasColumnType("TEXT"); - - b.Property<string>("Artists") - .HasColumnType("TEXT"); - - b.Property<int?>("Audio") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelId") - .HasColumnType("TEXT"); - - b.Property<string>("CleanName") - .HasColumnType("TEXT"); - - b.Property<float?>("CommunityRating") - .HasColumnType("REAL"); - - b.Property<float?>("CriticRating") - .HasColumnType("REAL"); - - b.Property<string>("CustomRating") - .HasColumnType("TEXT"); - - b.Property<string>("Data") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastMediaAdded") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastRefreshed") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastSaved") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateModified") - .HasColumnType("TEXT"); - - b.Property<DateTime>("EndDate") - .HasColumnType("TEXT"); - - b.Property<string>("EpisodeTitle") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalSeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalServiceId") - .HasColumnType("TEXT"); - - b.Property<string>("ExtraIds") - .HasColumnType("TEXT"); - - b.Property<int?>("ExtraType") - .HasColumnType("INTEGER"); - - b.Property<string>("ForcedSortName") - .HasColumnType("TEXT"); - - b.Property<string>("Genres") - .HasColumnType("TEXT"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexNumber") - .HasColumnType("INTEGER"); - - b.Property<int?>("InheritedParentalRatingValue") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInMixedFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsLocked") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsMovie") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsRepeat") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsSeries") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsVirtualItem") - .HasColumnType("INTEGER"); - - b.Property<float?>("LUFS") - .HasColumnType("REAL"); - - b.Property<string>("MediaType") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<float?>("NormalizationGain") - .HasColumnType("REAL"); - - b.Property<string>("OfficialRating") - .HasColumnType("TEXT"); - - b.Property<string>("OriginalTitle") - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasColumnType("TEXT"); - - b.Property<string>("OwnerId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("ParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("ParentIndexNumber") - .HasColumnType("INTEGER"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataCountryCode") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataLanguage") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("PremiereDate") - .HasColumnType("TEXT"); - - b.Property<string>("PresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("PrimaryVersionId") - .HasColumnType("TEXT"); - - b.Property<string>("ProductionLocations") - .HasColumnType("TEXT"); - - b.Property<int?>("ProductionYear") - .HasColumnType("INTEGER"); - - b.Property<long?>("RunTimeTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("SeasonId") - .HasColumnType("TEXT"); - - b.Property<string>("SeasonName") - .HasColumnType("TEXT"); - - b.Property<Guid?>("SeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesName") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesPresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("ShowId") - .HasColumnType("TEXT"); - - b.Property<long?>("Size") - .HasColumnType("INTEGER"); - - b.Property<string>("SortName") - .HasColumnType("TEXT"); - - b.Property<DateTime>("StartDate") - .HasColumnType("TEXT"); - - b.Property<string>("Studios") - .HasColumnType("TEXT"); - - b.Property<string>("Tagline") - .HasColumnType("TEXT"); - - b.Property<string>("Tags") - .HasColumnType("TEXT"); - - b.Property<Guid?>("TopParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("TotalBitrate") - .HasColumnType("INTEGER"); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("UnratedType") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("Path"); - - b.HasIndex("PresentationUniqueKey"); - - b.HasIndex("TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); - - b.HasIndex("Type", "TopParentId", "StartDate"); - - b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem"); - - b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName"); - - b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.ToTable("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<byte[]>("Blurhash") - .HasColumnType("BLOB"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("ImageType") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemMetadataFields"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ProviderId"); - - b.HasIndex("ProviderId", "ProviderValue", "ItemId"); - - b.ToTable("BaseItemProviders"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemTrailerTypes"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ChapterIndex") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("ImageDateModified") - .HasColumnType("TEXT"); - - b.Property<string>("ImagePath") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<long>("StartPositionTicks") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "ChapterIndex"); - - b.ToTable("Chapters"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Property<Guid>("ItemValueId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("CleanValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId"); - - b.HasIndex("Type", "CleanValue"); - - b.ToTable("ItemValues"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.Property<Guid>("ItemValueId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("ItemValuesMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("StreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("AspectRatio") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<float?>("AverageFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("BitDepth") - .HasColumnType("INTEGER"); - - b.Property<int?>("BitRate") - .HasColumnType("INTEGER"); - - b.Property<int?>("BlPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelLayout") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int?>("Channels") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("ColorPrimaries") - .HasColumnType("TEXT"); - - b.Property<string>("ColorSpace") - .HasColumnType("TEXT"); - - b.Property<string>("ColorTransfer") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<int?>("DvBlSignalCompatibilityId") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvLevel") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvProfile") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMajor") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMinor") - .HasColumnType("INTEGER"); - - b.Property<int?>("ElPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAnamorphic") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAvc") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsDefault") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsExternal") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsForced") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsHearingImpaired") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInterlaced") - .HasColumnType("INTEGER"); - - b.Property<string>("KeyFrames") - .HasColumnType("TEXT"); - - b.Property<string>("Language") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<float?>("Level") - .HasColumnType("REAL"); - - b.Property<string>("NalLengthSize") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PixelFormat") - .HasColumnType("TEXT"); - - b.Property<string>("Profile") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<float?>("RealFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("RefFrames") - .HasColumnType("INTEGER"); - - b.Property<int?>("Rotation") - .HasColumnType("INTEGER"); - - b.Property<int?>("RpuPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("SampleRate") - .HasColumnType("INTEGER"); - - b.Property<int>("StreamType") - .HasColumnType("INTEGER"); - - b.Property<string>("TimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("Title") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "StreamIndex"); - - b.HasIndex("StreamIndex"); - - b.HasIndex("StreamType"); - - b.HasIndex("StreamIndex", "StreamType"); - - b.HasIndex("StreamIndex", "StreamType", "Language"); - - b.ToTable("MediaStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PersonType") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Peoples"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("PeopleId") - .HasColumnType("TEXT"); - - b.Property<int?>("ListOrder") - .HasColumnType("INTEGER"); - - b.Property<string>("Role") - .HasColumnType("TEXT"); - - b.Property<int?>("SortOrder") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "PeopleId"); - - b.HasIndex("PeopleId"); - - b.HasIndex("ItemId", "ListOrder"); - - b.HasIndex("ItemId", "SortOrder"); - - b.ToTable("PeopleBaseItemMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("CustomDataKey") - .HasColumnType("TEXT"); - - b.Property<int?>("AudioStreamIndex") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFavorite") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastPlayedDate") - .HasColumnType("TEXT"); - - b.Property<bool?>("Likes") - .HasColumnType("INTEGER"); - - b.Property<int>("PlayCount") - .HasColumnType("INTEGER"); - - b.Property<long>("PlaybackPositionTicks") - .HasColumnType("INTEGER"); - - b.Property<bool>("Played") - .HasColumnType("INTEGER"); - - b.Property<double?>("Rating") - .HasColumnType("REAL"); - - b.Property<int?>("SubtitleStreamIndex") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "UserId", "CustomDataKey"); - - b.HasIndex("UserId"); - - b.HasIndex("ItemId", "UserId", "IsFavorite"); - - b.HasIndex("ItemId", "UserId", "LastPlayedDate"); - - b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks"); - - b.HasIndex("ItemId", "UserId", "Played"); - - b.ToTable("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Children") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem") - .WithMany("ParentAncestors") - .HasForeignKey("ParentItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ParentItem"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Images") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("LockedFields") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Provider") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("TrailerTypes") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Chapters") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("ItemValues") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue") - .WithMany("BaseItemsMap") - .HasForeignKey("ItemValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ItemValue"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("MediaStreams") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Peoples") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.People", "People") - .WithMany("BaseItems") - .HasForeignKey("PeopleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("People"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("UserData") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Navigation("Chapters"); - - b.Navigation("Children"); - - b.Navigation("Images"); - - b.Navigation("ItemValues"); - - b.Navigation("LockedFields"); - - b.Navigation("MediaStreams"); - - b.Navigation("ParentAncestors"); - - b.Navigation("Peoples"); - - b.Navigation("Provider"); - - b.Navigation("TrailerTypes"); - - b.Navigation("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Navigation("BaseItemsMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Navigation("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241112232041_fixMediaStreams.cs b/Jellyfin.Server.Implementations/Migrations/20241112232041_fixMediaStreams.cs deleted file mode 100644 index d57ea81b3..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241112232041_fixMediaStreams.cs +++ /dev/null @@ -1,702 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class FixMediaStreams : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn<int>( - name: "Width", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<string>( - name: "Title", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "TimeBase", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<int>( - name: "StreamType", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "SampleRate", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "RpuPresentFlag", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "Rotation", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "RefFrames", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<float>( - name: "RealFrameRate", - table: "MediaStreamInfos", - type: "REAL", - nullable: true, - oldClrType: typeof(float), - oldType: "REAL"); - - migrationBuilder.AlterColumn<string>( - name: "Profile", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "Path", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "NalLengthSize", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<float>( - name: "Level", - table: "MediaStreamInfos", - type: "REAL", - nullable: true, - oldClrType: typeof(float), - oldType: "REAL"); - - migrationBuilder.AlterColumn<string>( - name: "Language", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<bool>( - name: "IsHearingImpaired", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<bool>( - name: "IsAvc", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<bool>( - name: "IsAnamorphic", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "Height", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "ElPresentFlag", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "DvVersionMinor", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "DvVersionMajor", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "DvProfile", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "DvLevel", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "DvBlSignalCompatibilityId", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<string>( - name: "Comment", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "ColorTransfer", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "ColorSpace", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "ColorPrimaries", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "CodecTimeBase", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "CodecTag", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "Codec", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "Channels", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<string>( - name: "ChannelLayout", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "BlPresentFlag", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "BitRate", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "BitDepth", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<float>( - name: "AverageFrameRate", - table: "MediaStreamInfos", - type: "REAL", - nullable: true, - oldClrType: typeof(float), - oldType: "REAL"); - - migrationBuilder.AlterColumn<string>( - name: "AspectRatio", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn<int>( - name: "Width", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "Title", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "TimeBase", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "StreamType", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(int), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<int>( - name: "SampleRate", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "RpuPresentFlag", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "Rotation", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "RefFrames", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<float>( - name: "RealFrameRate", - table: "MediaStreamInfos", - type: "REAL", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "REAL", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "Profile", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "Path", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "NalLengthSize", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<float>( - name: "Level", - table: "MediaStreamInfos", - type: "REAL", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "REAL", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "Language", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<bool>( - name: "IsHearingImpaired", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: false, - oldClrType: typeof(bool), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<bool>( - name: "IsAvc", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: false, - oldClrType: typeof(bool), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<bool>( - name: "IsAnamorphic", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: false, - oldClrType: typeof(bool), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "Height", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "ElPresentFlag", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "DvVersionMinor", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "DvVersionMajor", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "DvProfile", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "DvLevel", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "DvBlSignalCompatibilityId", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "Comment", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "ColorTransfer", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "ColorSpace", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "ColorPrimaries", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "CodecTimeBase", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "CodecTag", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "Codec", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<int>( - name: "Channels", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "ChannelLayout", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<int>( - name: "BlPresentFlag", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "BitRate", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<int>( - name: "BitDepth", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: 0, - oldClrType: typeof(int), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<float>( - name: "AverageFrameRate", - table: "MediaStreamInfos", - type: "REAL", - nullable: false, - defaultValue: 0f, - oldClrType: typeof(float), - oldType: "REAL", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "AspectRatio", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241112234144_FixMediaStreams2.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20241112234144_FixMediaStreams2.Designer.cs deleted file mode 100644 index 5714120b5..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241112234144_FixMediaStreams2.Designer.cs +++ /dev/null @@ -1,1594 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20241112234144_FixMediaStreams2")] - partial class FixMediaStreams2 - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.10"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ParentItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ParentItemId"); - - b.HasIndex("ParentItemId"); - - b.ToTable("AncestorIds"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Index") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<string>("Filename") - .HasColumnType("TEXT"); - - b.Property<string>("MimeType") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "Index"); - - b.ToTable("AttachmentStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Album") - .HasColumnType("TEXT"); - - b.Property<string>("AlbumArtists") - .HasColumnType("TEXT"); - - b.Property<string>("Artists") - .HasColumnType("TEXT"); - - b.Property<int?>("Audio") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelId") - .HasColumnType("TEXT"); - - b.Property<string>("CleanName") - .HasColumnType("TEXT"); - - b.Property<float?>("CommunityRating") - .HasColumnType("REAL"); - - b.Property<float?>("CriticRating") - .HasColumnType("REAL"); - - b.Property<string>("CustomRating") - .HasColumnType("TEXT"); - - b.Property<string>("Data") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastMediaAdded") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastRefreshed") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastSaved") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateModified") - .HasColumnType("TEXT"); - - b.Property<DateTime>("EndDate") - .HasColumnType("TEXT"); - - b.Property<string>("EpisodeTitle") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalSeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalServiceId") - .HasColumnType("TEXT"); - - b.Property<string>("ExtraIds") - .HasColumnType("TEXT"); - - b.Property<int?>("ExtraType") - .HasColumnType("INTEGER"); - - b.Property<string>("ForcedSortName") - .HasColumnType("TEXT"); - - b.Property<string>("Genres") - .HasColumnType("TEXT"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexNumber") - .HasColumnType("INTEGER"); - - b.Property<int?>("InheritedParentalRatingValue") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInMixedFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsLocked") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsMovie") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsRepeat") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsSeries") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsVirtualItem") - .HasColumnType("INTEGER"); - - b.Property<float?>("LUFS") - .HasColumnType("REAL"); - - b.Property<string>("MediaType") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<float?>("NormalizationGain") - .HasColumnType("REAL"); - - b.Property<string>("OfficialRating") - .HasColumnType("TEXT"); - - b.Property<string>("OriginalTitle") - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasColumnType("TEXT"); - - b.Property<string>("OwnerId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("ParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("ParentIndexNumber") - .HasColumnType("INTEGER"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataCountryCode") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataLanguage") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("PremiereDate") - .HasColumnType("TEXT"); - - b.Property<string>("PresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("PrimaryVersionId") - .HasColumnType("TEXT"); - - b.Property<string>("ProductionLocations") - .HasColumnType("TEXT"); - - b.Property<int?>("ProductionYear") - .HasColumnType("INTEGER"); - - b.Property<long?>("RunTimeTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("SeasonId") - .HasColumnType("TEXT"); - - b.Property<string>("SeasonName") - .HasColumnType("TEXT"); - - b.Property<Guid?>("SeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesName") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesPresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("ShowId") - .HasColumnType("TEXT"); - - b.Property<long?>("Size") - .HasColumnType("INTEGER"); - - b.Property<string>("SortName") - .HasColumnType("TEXT"); - - b.Property<DateTime>("StartDate") - .HasColumnType("TEXT"); - - b.Property<string>("Studios") - .HasColumnType("TEXT"); - - b.Property<string>("Tagline") - .HasColumnType("TEXT"); - - b.Property<string>("Tags") - .HasColumnType("TEXT"); - - b.Property<Guid?>("TopParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("TotalBitrate") - .HasColumnType("INTEGER"); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("UnratedType") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("Path"); - - b.HasIndex("PresentationUniqueKey"); - - b.HasIndex("TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); - - b.HasIndex("Type", "TopParentId", "StartDate"); - - b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem"); - - b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName"); - - b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.ToTable("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<byte[]>("Blurhash") - .HasColumnType("BLOB"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("ImageType") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemMetadataFields"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ProviderId"); - - b.HasIndex("ProviderId", "ProviderValue", "ItemId"); - - b.ToTable("BaseItemProviders"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemTrailerTypes"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ChapterIndex") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("ImageDateModified") - .HasColumnType("TEXT"); - - b.Property<string>("ImagePath") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<long>("StartPositionTicks") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "ChapterIndex"); - - b.ToTable("Chapters"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Property<Guid>("ItemValueId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("CleanValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId"); - - b.HasIndex("Type", "CleanValue"); - - b.ToTable("ItemValues"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.Property<Guid>("ItemValueId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("ItemValuesMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("StreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("AspectRatio") - .HasColumnType("TEXT"); - - b.Property<float?>("AverageFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("BitDepth") - .HasColumnType("INTEGER"); - - b.Property<int?>("BitRate") - .HasColumnType("INTEGER"); - - b.Property<int?>("BlPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelLayout") - .HasColumnType("TEXT"); - - b.Property<int?>("Channels") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("ColorPrimaries") - .HasColumnType("TEXT"); - - b.Property<string>("ColorSpace") - .HasColumnType("TEXT"); - - b.Property<string>("ColorTransfer") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<int?>("DvBlSignalCompatibilityId") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvLevel") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvProfile") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMajor") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMinor") - .HasColumnType("INTEGER"); - - b.Property<int?>("ElPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAnamorphic") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAvc") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsDefault") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsExternal") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsForced") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsHearingImpaired") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsInterlaced") - .HasColumnType("INTEGER"); - - b.Property<string>("KeyFrames") - .HasColumnType("TEXT"); - - b.Property<string>("Language") - .HasColumnType("TEXT"); - - b.Property<float?>("Level") - .HasColumnType("REAL"); - - b.Property<string>("NalLengthSize") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PixelFormat") - .HasColumnType("TEXT"); - - b.Property<string>("Profile") - .HasColumnType("TEXT"); - - b.Property<float?>("RealFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("RefFrames") - .HasColumnType("INTEGER"); - - b.Property<int?>("Rotation") - .HasColumnType("INTEGER"); - - b.Property<int?>("RpuPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("SampleRate") - .HasColumnType("INTEGER"); - - b.Property<int>("StreamType") - .HasColumnType("INTEGER"); - - b.Property<string>("TimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("Title") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "StreamIndex"); - - b.HasIndex("StreamIndex"); - - b.HasIndex("StreamType"); - - b.HasIndex("StreamIndex", "StreamType"); - - b.HasIndex("StreamIndex", "StreamType", "Language"); - - b.ToTable("MediaStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PersonType") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Peoples"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("PeopleId") - .HasColumnType("TEXT"); - - b.Property<int?>("ListOrder") - .HasColumnType("INTEGER"); - - b.Property<string>("Role") - .HasColumnType("TEXT"); - - b.Property<int?>("SortOrder") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "PeopleId"); - - b.HasIndex("PeopleId"); - - b.HasIndex("ItemId", "ListOrder"); - - b.HasIndex("ItemId", "SortOrder"); - - b.ToTable("PeopleBaseItemMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("CustomDataKey") - .HasColumnType("TEXT"); - - b.Property<int?>("AudioStreamIndex") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFavorite") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastPlayedDate") - .HasColumnType("TEXT"); - - b.Property<bool?>("Likes") - .HasColumnType("INTEGER"); - - b.Property<int>("PlayCount") - .HasColumnType("INTEGER"); - - b.Property<long>("PlaybackPositionTicks") - .HasColumnType("INTEGER"); - - b.Property<bool>("Played") - .HasColumnType("INTEGER"); - - b.Property<double?>("Rating") - .HasColumnType("REAL"); - - b.Property<int?>("SubtitleStreamIndex") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "UserId", "CustomDataKey"); - - b.HasIndex("UserId"); - - b.HasIndex("ItemId", "UserId", "IsFavorite"); - - b.HasIndex("ItemId", "UserId", "LastPlayedDate"); - - b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks"); - - b.HasIndex("ItemId", "UserId", "Played"); - - b.ToTable("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Children") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem") - .WithMany("ParentAncestors") - .HasForeignKey("ParentItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ParentItem"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Images") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("LockedFields") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Provider") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("TrailerTypes") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Chapters") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("ItemValues") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue") - .WithMany("BaseItemsMap") - .HasForeignKey("ItemValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ItemValue"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("MediaStreams") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Peoples") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.People", "People") - .WithMany("BaseItems") - .HasForeignKey("PeopleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("People"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("UserData") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Navigation("Chapters"); - - b.Navigation("Children"); - - b.Navigation("Images"); - - b.Navigation("ItemValues"); - - b.Navigation("LockedFields"); - - b.Navigation("MediaStreams"); - - b.Navigation("ParentAncestors"); - - b.Navigation("Peoples"); - - b.Navigation("Provider"); - - b.Navigation("TrailerTypes"); - - b.Navigation("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Navigation("BaseItemsMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Navigation("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241112234144_FixMediaStreams2.cs b/Jellyfin.Server.Implementations/Migrations/20241112234144_FixMediaStreams2.cs deleted file mode 100644 index 78611b9e4..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241112234144_FixMediaStreams2.cs +++ /dev/null @@ -1,144 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class FixMediaStreams2 : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn<string>( - name: "Profile", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "Path", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "Language", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<bool>( - name: "IsInterlaced", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: true, - oldClrType: typeof(bool), - oldType: "INTEGER"); - - migrationBuilder.AlterColumn<string>( - name: "Codec", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "ChannelLayout", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<string>( - name: "AspectRatio", - table: "MediaStreamInfos", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn<string>( - name: "Profile", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "Path", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "Language", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<bool>( - name: "IsInterlaced", - table: "MediaStreamInfos", - type: "INTEGER", - nullable: false, - defaultValue: false, - oldClrType: typeof(bool), - oldType: "INTEGER", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "Codec", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "ChannelLayout", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<string>( - name: "AspectRatio", - table: "MediaStreamInfos", - type: "TEXT", - nullable: false, - defaultValue: string.Empty, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.Designer.cs deleted file mode 100644 index 855f02fd3..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.Designer.cs +++ /dev/null @@ -1,1595 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20241113133548_EnforceUniqueItemValue")] - partial class EnforceUniqueItemValue - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "8.0.10"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ParentItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ParentItemId"); - - b.HasIndex("ParentItemId"); - - b.ToTable("AncestorIds"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Index") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<string>("Filename") - .HasColumnType("TEXT"); - - b.Property<string>("MimeType") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "Index"); - - b.ToTable("AttachmentStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Album") - .HasColumnType("TEXT"); - - b.Property<string>("AlbumArtists") - .HasColumnType("TEXT"); - - b.Property<string>("Artists") - .HasColumnType("TEXT"); - - b.Property<int?>("Audio") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelId") - .HasColumnType("TEXT"); - - b.Property<string>("CleanName") - .HasColumnType("TEXT"); - - b.Property<float?>("CommunityRating") - .HasColumnType("REAL"); - - b.Property<float?>("CriticRating") - .HasColumnType("REAL"); - - b.Property<string>("CustomRating") - .HasColumnType("TEXT"); - - b.Property<string>("Data") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastMediaAdded") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastRefreshed") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastSaved") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateModified") - .HasColumnType("TEXT"); - - b.Property<DateTime>("EndDate") - .HasColumnType("TEXT"); - - b.Property<string>("EpisodeTitle") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalSeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalServiceId") - .HasColumnType("TEXT"); - - b.Property<string>("ExtraIds") - .HasColumnType("TEXT"); - - b.Property<int?>("ExtraType") - .HasColumnType("INTEGER"); - - b.Property<string>("ForcedSortName") - .HasColumnType("TEXT"); - - b.Property<string>("Genres") - .HasColumnType("TEXT"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexNumber") - .HasColumnType("INTEGER"); - - b.Property<int?>("InheritedParentalRatingValue") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInMixedFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsLocked") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsMovie") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsRepeat") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsSeries") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsVirtualItem") - .HasColumnType("INTEGER"); - - b.Property<float?>("LUFS") - .HasColumnType("REAL"); - - b.Property<string>("MediaType") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<float?>("NormalizationGain") - .HasColumnType("REAL"); - - b.Property<string>("OfficialRating") - .HasColumnType("TEXT"); - - b.Property<string>("OriginalTitle") - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasColumnType("TEXT"); - - b.Property<string>("OwnerId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("ParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("ParentIndexNumber") - .HasColumnType("INTEGER"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataCountryCode") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataLanguage") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("PremiereDate") - .HasColumnType("TEXT"); - - b.Property<string>("PresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("PrimaryVersionId") - .HasColumnType("TEXT"); - - b.Property<string>("ProductionLocations") - .HasColumnType("TEXT"); - - b.Property<int?>("ProductionYear") - .HasColumnType("INTEGER"); - - b.Property<long?>("RunTimeTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("SeasonId") - .HasColumnType("TEXT"); - - b.Property<string>("SeasonName") - .HasColumnType("TEXT"); - - b.Property<Guid?>("SeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesName") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesPresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("ShowId") - .HasColumnType("TEXT"); - - b.Property<long?>("Size") - .HasColumnType("INTEGER"); - - b.Property<string>("SortName") - .HasColumnType("TEXT"); - - b.Property<DateTime>("StartDate") - .HasColumnType("TEXT"); - - b.Property<string>("Studios") - .HasColumnType("TEXT"); - - b.Property<string>("Tagline") - .HasColumnType("TEXT"); - - b.Property<string>("Tags") - .HasColumnType("TEXT"); - - b.Property<Guid?>("TopParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("TotalBitrate") - .HasColumnType("INTEGER"); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("UnratedType") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("Path"); - - b.HasIndex("PresentationUniqueKey"); - - b.HasIndex("TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); - - b.HasIndex("Type", "TopParentId", "StartDate"); - - b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem"); - - b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName"); - - b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.ToTable("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<byte[]>("Blurhash") - .HasColumnType("BLOB"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("ImageType") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemMetadataFields"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ProviderId"); - - b.HasIndex("ProviderId", "ProviderValue", "ItemId"); - - b.ToTable("BaseItemProviders"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemTrailerTypes"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ChapterIndex") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("ImageDateModified") - .HasColumnType("TEXT"); - - b.Property<string>("ImagePath") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<long>("StartPositionTicks") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "ChapterIndex"); - - b.ToTable("Chapters"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Property<Guid>("ItemValueId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("CleanValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId"); - - b.HasIndex("Type", "CleanValue") - .IsUnique(); - - b.ToTable("ItemValues"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.Property<Guid>("ItemValueId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("ItemValuesMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("StreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("AspectRatio") - .HasColumnType("TEXT"); - - b.Property<float?>("AverageFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("BitDepth") - .HasColumnType("INTEGER"); - - b.Property<int?>("BitRate") - .HasColumnType("INTEGER"); - - b.Property<int?>("BlPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelLayout") - .HasColumnType("TEXT"); - - b.Property<int?>("Channels") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("ColorPrimaries") - .HasColumnType("TEXT"); - - b.Property<string>("ColorSpace") - .HasColumnType("TEXT"); - - b.Property<string>("ColorTransfer") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<int?>("DvBlSignalCompatibilityId") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvLevel") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvProfile") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMajor") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMinor") - .HasColumnType("INTEGER"); - - b.Property<int?>("ElPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAnamorphic") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAvc") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsDefault") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsExternal") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsForced") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsHearingImpaired") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsInterlaced") - .HasColumnType("INTEGER"); - - b.Property<string>("KeyFrames") - .HasColumnType("TEXT"); - - b.Property<string>("Language") - .HasColumnType("TEXT"); - - b.Property<float?>("Level") - .HasColumnType("REAL"); - - b.Property<string>("NalLengthSize") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PixelFormat") - .HasColumnType("TEXT"); - - b.Property<string>("Profile") - .HasColumnType("TEXT"); - - b.Property<float?>("RealFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("RefFrames") - .HasColumnType("INTEGER"); - - b.Property<int?>("Rotation") - .HasColumnType("INTEGER"); - - b.Property<int?>("RpuPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("SampleRate") - .HasColumnType("INTEGER"); - - b.Property<int>("StreamType") - .HasColumnType("INTEGER"); - - b.Property<string>("TimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("Title") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "StreamIndex"); - - b.HasIndex("StreamIndex"); - - b.HasIndex("StreamType"); - - b.HasIndex("StreamIndex", "StreamType"); - - b.HasIndex("StreamIndex", "StreamType", "Language"); - - b.ToTable("MediaStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PersonType") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Peoples"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("PeopleId") - .HasColumnType("TEXT"); - - b.Property<int?>("ListOrder") - .HasColumnType("INTEGER"); - - b.Property<string>("Role") - .HasColumnType("TEXT"); - - b.Property<int?>("SortOrder") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "PeopleId"); - - b.HasIndex("PeopleId"); - - b.HasIndex("ItemId", "ListOrder"); - - b.HasIndex("ItemId", "SortOrder"); - - b.ToTable("PeopleBaseItemMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("CustomDataKey") - .HasColumnType("TEXT"); - - b.Property<int?>("AudioStreamIndex") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFavorite") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastPlayedDate") - .HasColumnType("TEXT"); - - b.Property<bool?>("Likes") - .HasColumnType("INTEGER"); - - b.Property<int>("PlayCount") - .HasColumnType("INTEGER"); - - b.Property<long>("PlaybackPositionTicks") - .HasColumnType("INTEGER"); - - b.Property<bool>("Played") - .HasColumnType("INTEGER"); - - b.Property<double?>("Rating") - .HasColumnType("REAL"); - - b.Property<int?>("SubtitleStreamIndex") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "UserId", "CustomDataKey"); - - b.HasIndex("UserId"); - - b.HasIndex("ItemId", "UserId", "IsFavorite"); - - b.HasIndex("ItemId", "UserId", "LastPlayedDate"); - - b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks"); - - b.HasIndex("ItemId", "UserId", "Played"); - - b.ToTable("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Children") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem") - .WithMany("ParentAncestors") - .HasForeignKey("ParentItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ParentItem"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Images") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("LockedFields") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Provider") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("TrailerTypes") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Chapters") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("ItemValues") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue") - .WithMany("BaseItemsMap") - .HasForeignKey("ItemValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ItemValue"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("MediaStreams") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Peoples") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.People", "People") - .WithMany("BaseItems") - .HasForeignKey("PeopleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("People"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("UserData") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Navigation("Chapters"); - - b.Navigation("Children"); - - b.Navigation("Images"); - - b.Navigation("ItemValues"); - - b.Navigation("LockedFields"); - - b.Navigation("MediaStreams"); - - b.Navigation("ParentAncestors"); - - b.Navigation("Peoples"); - - b.Navigation("Provider"); - - b.Navigation("TrailerTypes"); - - b.Navigation("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Navigation("BaseItemsMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Navigation("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.cs b/Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.cs deleted file mode 100644 index d1b06ceae..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20241113133548_EnforceUniqueItemValue.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class EnforceUniqueItemValue : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_ItemValues_Type_CleanValue", - table: "ItemValues"); - - migrationBuilder.CreateIndex( - name: "IX_ItemValues_Type_CleanValue", - table: "ItemValues", - columns: new[] { "Type", "CleanValue" }, - unique: true); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropIndex( - name: "IX_ItemValues_Type_CleanValue", - table: "ItemValues"); - - migrationBuilder.CreateIndex( - name: "IX_ItemValues_Type_CleanValue", - table: "ItemValues", - columns: new[] { "Type", "CleanValue" }); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20250204092455_MakeStartEndDateNullable.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20250204092455_MakeStartEndDateNullable.Designer.cs deleted file mode 100644 index a329f1ef1..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20250204092455_MakeStartEndDateNullable.Designer.cs +++ /dev/null @@ -1,1595 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20250204092455_MakeStartEndDateNullable")] - partial class MakeStartEndDateNullable - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "9.0.1"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ParentItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ParentItemId"); - - b.HasIndex("ParentItemId"); - - b.ToTable("AncestorIds"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Index") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<string>("Filename") - .HasColumnType("TEXT"); - - b.Property<string>("MimeType") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "Index"); - - b.ToTable("AttachmentStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Album") - .HasColumnType("TEXT"); - - b.Property<string>("AlbumArtists") - .HasColumnType("TEXT"); - - b.Property<string>("Artists") - .HasColumnType("TEXT"); - - b.Property<int?>("Audio") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelId") - .HasColumnType("TEXT"); - - b.Property<string>("CleanName") - .HasColumnType("TEXT"); - - b.Property<float?>("CommunityRating") - .HasColumnType("REAL"); - - b.Property<float?>("CriticRating") - .HasColumnType("REAL"); - - b.Property<string>("CustomRating") - .HasColumnType("TEXT"); - - b.Property<string>("Data") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastMediaAdded") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastRefreshed") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastSaved") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateModified") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("EndDate") - .HasColumnType("TEXT"); - - b.Property<string>("EpisodeTitle") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalSeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalServiceId") - .HasColumnType("TEXT"); - - b.Property<string>("ExtraIds") - .HasColumnType("TEXT"); - - b.Property<int?>("ExtraType") - .HasColumnType("INTEGER"); - - b.Property<string>("ForcedSortName") - .HasColumnType("TEXT"); - - b.Property<string>("Genres") - .HasColumnType("TEXT"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexNumber") - .HasColumnType("INTEGER"); - - b.Property<int?>("InheritedParentalRatingValue") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInMixedFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsLocked") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsMovie") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsRepeat") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsSeries") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsVirtualItem") - .HasColumnType("INTEGER"); - - b.Property<float?>("LUFS") - .HasColumnType("REAL"); - - b.Property<string>("MediaType") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<float?>("NormalizationGain") - .HasColumnType("REAL"); - - b.Property<string>("OfficialRating") - .HasColumnType("TEXT"); - - b.Property<string>("OriginalTitle") - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasColumnType("TEXT"); - - b.Property<string>("OwnerId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("ParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("ParentIndexNumber") - .HasColumnType("INTEGER"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataCountryCode") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataLanguage") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("PremiereDate") - .HasColumnType("TEXT"); - - b.Property<string>("PresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("PrimaryVersionId") - .HasColumnType("TEXT"); - - b.Property<string>("ProductionLocations") - .HasColumnType("TEXT"); - - b.Property<int?>("ProductionYear") - .HasColumnType("INTEGER"); - - b.Property<long?>("RunTimeTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("SeasonId") - .HasColumnType("TEXT"); - - b.Property<string>("SeasonName") - .HasColumnType("TEXT"); - - b.Property<Guid?>("SeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesName") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesPresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("ShowId") - .HasColumnType("TEXT"); - - b.Property<long?>("Size") - .HasColumnType("INTEGER"); - - b.Property<string>("SortName") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("StartDate") - .HasColumnType("TEXT"); - - b.Property<string>("Studios") - .HasColumnType("TEXT"); - - b.Property<string>("Tagline") - .HasColumnType("TEXT"); - - b.Property<string>("Tags") - .HasColumnType("TEXT"); - - b.Property<Guid?>("TopParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("TotalBitrate") - .HasColumnType("INTEGER"); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("UnratedType") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("Path"); - - b.HasIndex("PresentationUniqueKey"); - - b.HasIndex("TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); - - b.HasIndex("Type", "TopParentId", "StartDate"); - - b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem"); - - b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName"); - - b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.ToTable("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<byte[]>("Blurhash") - .HasColumnType("BLOB"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("ImageType") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemMetadataFields"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ProviderId"); - - b.HasIndex("ProviderId", "ProviderValue", "ItemId"); - - b.ToTable("BaseItemProviders"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemTrailerTypes"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ChapterIndex") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("ImageDateModified") - .HasColumnType("TEXT"); - - b.Property<string>("ImagePath") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<long>("StartPositionTicks") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "ChapterIndex"); - - b.ToTable("Chapters"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Property<Guid>("ItemValueId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("CleanValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId"); - - b.HasIndex("Type", "CleanValue") - .IsUnique(); - - b.ToTable("ItemValues"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.Property<Guid>("ItemValueId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("ItemValuesMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("StreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("AspectRatio") - .HasColumnType("TEXT"); - - b.Property<float?>("AverageFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("BitDepth") - .HasColumnType("INTEGER"); - - b.Property<int?>("BitRate") - .HasColumnType("INTEGER"); - - b.Property<int?>("BlPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelLayout") - .HasColumnType("TEXT"); - - b.Property<int?>("Channels") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("ColorPrimaries") - .HasColumnType("TEXT"); - - b.Property<string>("ColorSpace") - .HasColumnType("TEXT"); - - b.Property<string>("ColorTransfer") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<int?>("DvBlSignalCompatibilityId") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvLevel") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvProfile") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMajor") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMinor") - .HasColumnType("INTEGER"); - - b.Property<int?>("ElPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAnamorphic") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAvc") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsDefault") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsExternal") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsForced") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsHearingImpaired") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsInterlaced") - .HasColumnType("INTEGER"); - - b.Property<string>("KeyFrames") - .HasColumnType("TEXT"); - - b.Property<string>("Language") - .HasColumnType("TEXT"); - - b.Property<float?>("Level") - .HasColumnType("REAL"); - - b.Property<string>("NalLengthSize") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PixelFormat") - .HasColumnType("TEXT"); - - b.Property<string>("Profile") - .HasColumnType("TEXT"); - - b.Property<float?>("RealFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("RefFrames") - .HasColumnType("INTEGER"); - - b.Property<int?>("Rotation") - .HasColumnType("INTEGER"); - - b.Property<int?>("RpuPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("SampleRate") - .HasColumnType("INTEGER"); - - b.Property<int>("StreamType") - .HasColumnType("INTEGER"); - - b.Property<string>("TimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("Title") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "StreamIndex"); - - b.HasIndex("StreamIndex"); - - b.HasIndex("StreamType"); - - b.HasIndex("StreamIndex", "StreamType"); - - b.HasIndex("StreamIndex", "StreamType", "Language"); - - b.ToTable("MediaStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PersonType") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Peoples"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("PeopleId") - .HasColumnType("TEXT"); - - b.Property<int?>("ListOrder") - .HasColumnType("INTEGER"); - - b.Property<string>("Role") - .HasColumnType("TEXT"); - - b.Property<int?>("SortOrder") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "PeopleId"); - - b.HasIndex("PeopleId"); - - b.HasIndex("ItemId", "ListOrder"); - - b.HasIndex("ItemId", "SortOrder"); - - b.ToTable("PeopleBaseItemMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("CustomDataKey") - .HasColumnType("TEXT"); - - b.Property<int?>("AudioStreamIndex") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFavorite") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastPlayedDate") - .HasColumnType("TEXT"); - - b.Property<bool?>("Likes") - .HasColumnType("INTEGER"); - - b.Property<int>("PlayCount") - .HasColumnType("INTEGER"); - - b.Property<long>("PlaybackPositionTicks") - .HasColumnType("INTEGER"); - - b.Property<bool>("Played") - .HasColumnType("INTEGER"); - - b.Property<double?>("Rating") - .HasColumnType("REAL"); - - b.Property<int?>("SubtitleStreamIndex") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "UserId", "CustomDataKey"); - - b.HasIndex("UserId"); - - b.HasIndex("ItemId", "UserId", "IsFavorite"); - - b.HasIndex("ItemId", "UserId", "LastPlayedDate"); - - b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks"); - - b.HasIndex("ItemId", "UserId", "Played"); - - b.ToTable("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Children") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem") - .WithMany("ParentAncestors") - .HasForeignKey("ParentItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ParentItem"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Images") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("LockedFields") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Provider") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("TrailerTypes") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Chapters") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("ItemValues") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue") - .WithMany("BaseItemsMap") - .HasForeignKey("ItemValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ItemValue"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("MediaStreams") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Peoples") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.People", "People") - .WithMany("BaseItems") - .HasForeignKey("PeopleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("People"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("UserData") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Navigation("Chapters"); - - b.Navigation("Children"); - - b.Navigation("Images"); - - b.Navigation("ItemValues"); - - b.Navigation("LockedFields"); - - b.Navigation("MediaStreams"); - - b.Navigation("ParentAncestors"); - - b.Navigation("Peoples"); - - b.Navigation("Provider"); - - b.Navigation("TrailerTypes"); - - b.Navigation("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Navigation("BaseItemsMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Navigation("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20250204092455_MakeStartEndDateNullable.cs b/Jellyfin.Server.Implementations/Migrations/20250204092455_MakeStartEndDateNullable.cs deleted file mode 100644 index 2c60dd7a6..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20250204092455_MakeStartEndDateNullable.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class MakeStartEndDateNullable : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn<DateTime>( - name: "StartDate", - table: "BaseItems", - type: "TEXT", - nullable: true, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - - migrationBuilder.AlterColumn<DateTime>( - name: "EndDate", - table: "BaseItems", - type: "TEXT", - nullable: true, - oldClrType: typeof(DateTime), - oldType: "TEXT"); - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AlterColumn<DateTime>( - name: "StartDate", - table: "BaseItems", - type: "TEXT", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - oldClrType: typeof(DateTime), - oldType: "TEXT", - oldNullable: true); - - migrationBuilder.AlterColumn<DateTime>( - name: "EndDate", - table: "BaseItems", - type: "TEXT", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), - oldClrType: typeof(DateTime), - oldType: "TEXT", - oldNullable: true); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20250214031148_ChannelIdGuid.Designer.cs b/Jellyfin.Server.Implementations/Migrations/20250214031148_ChannelIdGuid.Designer.cs deleted file mode 100644 index 48919c9b5..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20250214031148_ChannelIdGuid.Designer.cs +++ /dev/null @@ -1,1595 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Migrations; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - [Migration("20250214031148_ChannelIdGuid")] - partial class ChannelIdGuid - { - /// <inheritdoc /> - protected override void BuildTargetModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "9.0.2"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ParentItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ParentItemId"); - - b.HasIndex("ParentItemId"); - - b.ToTable("AncestorIds"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Index") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<string>("Filename") - .HasColumnType("TEXT"); - - b.Property<string>("MimeType") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "Index"); - - b.ToTable("AttachmentStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Album") - .HasColumnType("TEXT"); - - b.Property<string>("AlbumArtists") - .HasColumnType("TEXT"); - - b.Property<string>("Artists") - .HasColumnType("TEXT"); - - b.Property<int?>("Audio") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("ChannelId") - .HasColumnType("TEXT"); - - b.Property<string>("CleanName") - .HasColumnType("TEXT"); - - b.Property<float?>("CommunityRating") - .HasColumnType("REAL"); - - b.Property<float?>("CriticRating") - .HasColumnType("REAL"); - - b.Property<string>("CustomRating") - .HasColumnType("TEXT"); - - b.Property<string>("Data") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastMediaAdded") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastRefreshed") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastSaved") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateModified") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("EndDate") - .HasColumnType("TEXT"); - - b.Property<string>("EpisodeTitle") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalSeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalServiceId") - .HasColumnType("TEXT"); - - b.Property<string>("ExtraIds") - .HasColumnType("TEXT"); - - b.Property<int?>("ExtraType") - .HasColumnType("INTEGER"); - - b.Property<string>("ForcedSortName") - .HasColumnType("TEXT"); - - b.Property<string>("Genres") - .HasColumnType("TEXT"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexNumber") - .HasColumnType("INTEGER"); - - b.Property<int?>("InheritedParentalRatingValue") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInMixedFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsLocked") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsMovie") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsRepeat") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsSeries") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsVirtualItem") - .HasColumnType("INTEGER"); - - b.Property<float?>("LUFS") - .HasColumnType("REAL"); - - b.Property<string>("MediaType") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<float?>("NormalizationGain") - .HasColumnType("REAL"); - - b.Property<string>("OfficialRating") - .HasColumnType("TEXT"); - - b.Property<string>("OriginalTitle") - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasColumnType("TEXT"); - - b.Property<string>("OwnerId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("ParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("ParentIndexNumber") - .HasColumnType("INTEGER"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataCountryCode") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataLanguage") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("PremiereDate") - .HasColumnType("TEXT"); - - b.Property<string>("PresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("PrimaryVersionId") - .HasColumnType("TEXT"); - - b.Property<string>("ProductionLocations") - .HasColumnType("TEXT"); - - b.Property<int?>("ProductionYear") - .HasColumnType("INTEGER"); - - b.Property<long?>("RunTimeTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("SeasonId") - .HasColumnType("TEXT"); - - b.Property<string>("SeasonName") - .HasColumnType("TEXT"); - - b.Property<Guid?>("SeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesName") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesPresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("ShowId") - .HasColumnType("TEXT"); - - b.Property<long?>("Size") - .HasColumnType("INTEGER"); - - b.Property<string>("SortName") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("StartDate") - .HasColumnType("TEXT"); - - b.Property<string>("Studios") - .HasColumnType("TEXT"); - - b.Property<string>("Tagline") - .HasColumnType("TEXT"); - - b.Property<string>("Tags") - .HasColumnType("TEXT"); - - b.Property<Guid?>("TopParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("TotalBitrate") - .HasColumnType("INTEGER"); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("UnratedType") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("Path"); - - b.HasIndex("PresentationUniqueKey"); - - b.HasIndex("TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); - - b.HasIndex("Type", "TopParentId", "StartDate"); - - b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem"); - - b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName"); - - b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.ToTable("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<byte[]>("Blurhash") - .HasColumnType("BLOB"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("ImageType") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemMetadataFields"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ProviderId"); - - b.HasIndex("ProviderId", "ProviderValue", "ItemId"); - - b.ToTable("BaseItemProviders"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemTrailerTypes"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ChapterIndex") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("ImageDateModified") - .HasColumnType("TEXT"); - - b.Property<string>("ImagePath") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<long>("StartPositionTicks") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "ChapterIndex"); - - b.ToTable("Chapters"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Property<Guid>("ItemValueId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("CleanValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId"); - - b.HasIndex("Type", "CleanValue") - .IsUnique(); - - b.ToTable("ItemValues"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.Property<Guid>("ItemValueId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("ItemValuesMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("StreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("AspectRatio") - .HasColumnType("TEXT"); - - b.Property<float?>("AverageFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("BitDepth") - .HasColumnType("INTEGER"); - - b.Property<int?>("BitRate") - .HasColumnType("INTEGER"); - - b.Property<int?>("BlPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelLayout") - .HasColumnType("TEXT"); - - b.Property<int?>("Channels") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("ColorPrimaries") - .HasColumnType("TEXT"); - - b.Property<string>("ColorSpace") - .HasColumnType("TEXT"); - - b.Property<string>("ColorTransfer") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<int?>("DvBlSignalCompatibilityId") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvLevel") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvProfile") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMajor") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMinor") - .HasColumnType("INTEGER"); - - b.Property<int?>("ElPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAnamorphic") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAvc") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsDefault") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsExternal") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsForced") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsHearingImpaired") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsInterlaced") - .HasColumnType("INTEGER"); - - b.Property<string>("KeyFrames") - .HasColumnType("TEXT"); - - b.Property<string>("Language") - .HasColumnType("TEXT"); - - b.Property<float?>("Level") - .HasColumnType("REAL"); - - b.Property<string>("NalLengthSize") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PixelFormat") - .HasColumnType("TEXT"); - - b.Property<string>("Profile") - .HasColumnType("TEXT"); - - b.Property<float?>("RealFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("RefFrames") - .HasColumnType("INTEGER"); - - b.Property<int?>("Rotation") - .HasColumnType("INTEGER"); - - b.Property<int?>("RpuPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("SampleRate") - .HasColumnType("INTEGER"); - - b.Property<int>("StreamType") - .HasColumnType("INTEGER"); - - b.Property<string>("TimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("Title") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "StreamIndex"); - - b.HasIndex("StreamIndex"); - - b.HasIndex("StreamType"); - - b.HasIndex("StreamIndex", "StreamType"); - - b.HasIndex("StreamIndex", "StreamType", "Language"); - - b.ToTable("MediaStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PersonType") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Peoples"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("PeopleId") - .HasColumnType("TEXT"); - - b.Property<int?>("ListOrder") - .HasColumnType("INTEGER"); - - b.Property<string>("Role") - .HasColumnType("TEXT"); - - b.Property<int?>("SortOrder") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "PeopleId"); - - b.HasIndex("PeopleId"); - - b.HasIndex("ItemId", "ListOrder"); - - b.HasIndex("ItemId", "SortOrder"); - - b.ToTable("PeopleBaseItemMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("CustomDataKey") - .HasColumnType("TEXT"); - - b.Property<int?>("AudioStreamIndex") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFavorite") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastPlayedDate") - .HasColumnType("TEXT"); - - b.Property<bool?>("Likes") - .HasColumnType("INTEGER"); - - b.Property<int>("PlayCount") - .HasColumnType("INTEGER"); - - b.Property<long>("PlaybackPositionTicks") - .HasColumnType("INTEGER"); - - b.Property<bool>("Played") - .HasColumnType("INTEGER"); - - b.Property<double?>("Rating") - .HasColumnType("REAL"); - - b.Property<int?>("SubtitleStreamIndex") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "UserId", "CustomDataKey"); - - b.HasIndex("UserId"); - - b.HasIndex("ItemId", "UserId", "IsFavorite"); - - b.HasIndex("ItemId", "UserId", "LastPlayedDate"); - - b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks"); - - b.HasIndex("ItemId", "UserId", "Played"); - - b.ToTable("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Children") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem") - .WithMany("ParentAncestors") - .HasForeignKey("ParentItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ParentItem"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Images") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("LockedFields") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Provider") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("TrailerTypes") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Chapters") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("ItemValues") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue") - .WithMany("BaseItemsMap") - .HasForeignKey("ItemValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ItemValue"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("MediaStreams") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Peoples") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.People", "People") - .WithMany("BaseItems") - .HasForeignKey("PeopleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("People"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("UserData") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Navigation("Chapters"); - - b.Navigation("Children"); - - b.Navigation("Images"); - - b.Navigation("ItemValues"); - - b.Navigation("LockedFields"); - - b.Navigation("MediaStreams"); - - b.Navigation("ParentAncestors"); - - b.Navigation("Peoples"); - - b.Navigation("Provider"); - - b.Navigation("TrailerTypes"); - - b.Navigation("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Navigation("BaseItemsMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Navigation("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/20250214031148_ChannelIdGuid.cs b/Jellyfin.Server.Implementations/Migrations/20250214031148_ChannelIdGuid.cs deleted file mode 100644 index 1e904e833..000000000 --- a/Jellyfin.Server.Implementations/Migrations/20250214031148_ChannelIdGuid.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <inheritdoc /> - public partial class ChannelIdGuid : Migration - { - /// <inheritdoc /> - protected override void Up(MigrationBuilder migrationBuilder) - { - // NOOP, Guids and strings are stored the same in SQLite. - } - - /// <inheritdoc /> - protected override void Down(MigrationBuilder migrationBuilder) - { - // NOOP, Guids and strings are stored the same in SQLite. - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/DesignTimeJellyfinDbFactory.cs b/Jellyfin.Server.Implementations/Migrations/DesignTimeJellyfinDbFactory.cs deleted file mode 100644 index 500c4a1c7..000000000 --- a/Jellyfin.Server.Implementations/Migrations/DesignTimeJellyfinDbFactory.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Design; -using Microsoft.Extensions.Logging.Abstractions; - -namespace Jellyfin.Server.Implementations.Migrations -{ - /// <summary> - /// The design time factory for <see cref="JellyfinDbContext"/>. - /// This is only used for the creation of migrations and not during runtime. - /// </summary> - internal class DesignTimeJellyfinDbFactory : IDesignTimeDbContextFactory<JellyfinDbContext> - { - public JellyfinDbContext CreateDbContext(string[] args) - { - var optionsBuilder = new DbContextOptionsBuilder<JellyfinDbContext>(); - optionsBuilder.UseSqlite("Data Source=jellyfin.db"); - - return new JellyfinDbContext(optionsBuilder.Options, NullLogger<JellyfinDbContext>.Instance); - } - } -} diff --git a/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs b/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs deleted file mode 100644 index fef122886..000000000 --- a/Jellyfin.Server.Implementations/Migrations/JellyfinDbModelSnapshot.cs +++ /dev/null @@ -1,1592 +0,0 @@ -// <auto-generated /> -using System; -using Jellyfin.Server.Implementations; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -#nullable disable - -namespace Jellyfin.Server.Implementations.Migrations -{ - [DbContext(typeof(JellyfinDbContext))] - partial class JellyfinDbModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { -#pragma warning disable 612, 618 - modelBuilder.HasAnnotation("ProductVersion", "9.0.2"); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DayOfWeek") - .HasColumnType("INTEGER"); - - b.Property<double>("EndHour") - .HasColumnType("REAL"); - - b.Property<double>("StartHour") - .HasColumnType("REAL"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("AccessSchedules"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ActivityLog", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<string>("ItemId") - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<int>("LogSeverity") - .HasColumnType("INTEGER"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("ShortOverview") - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<string>("Type") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DateCreated"); - - b.ToTable("ActivityLogs"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ParentItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ParentItemId"); - - b.HasIndex("ParentItemId"); - - b.ToTable("AncestorIds"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Index") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<string>("Filename") - .HasColumnType("TEXT"); - - b.Property<string>("MimeType") - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "Index"); - - b.ToTable("AttachmentStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Album") - .HasColumnType("TEXT"); - - b.Property<string>("AlbumArtists") - .HasColumnType("TEXT"); - - b.Property<string>("Artists") - .HasColumnType("TEXT"); - - b.Property<int?>("Audio") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("ChannelId") - .HasColumnType("TEXT"); - - b.Property<string>("CleanName") - .HasColumnType("TEXT"); - - b.Property<float?>("CommunityRating") - .HasColumnType("REAL"); - - b.Property<float?>("CriticRating") - .HasColumnType("REAL"); - - b.Property<string>("CustomRating") - .HasColumnType("TEXT"); - - b.Property<string>("Data") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastMediaAdded") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastRefreshed") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateLastSaved") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("DateModified") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("EndDate") - .HasColumnType("TEXT"); - - b.Property<string>("EpisodeTitle") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalSeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("ExternalServiceId") - .HasColumnType("TEXT"); - - b.Property<string>("ExtraIds") - .HasColumnType("TEXT"); - - b.Property<int?>("ExtraType") - .HasColumnType("INTEGER"); - - b.Property<string>("ForcedSortName") - .HasColumnType("TEXT"); - - b.Property<string>("Genres") - .HasColumnType("TEXT"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexNumber") - .HasColumnType("INTEGER"); - - b.Property<int?>("InheritedParentalRatingValue") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsInMixedFolder") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsLocked") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsMovie") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsRepeat") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsSeries") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsVirtualItem") - .HasColumnType("INTEGER"); - - b.Property<float?>("LUFS") - .HasColumnType("REAL"); - - b.Property<string>("MediaType") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<float?>("NormalizationGain") - .HasColumnType("REAL"); - - b.Property<string>("OfficialRating") - .HasColumnType("TEXT"); - - b.Property<string>("OriginalTitle") - .HasColumnType("TEXT"); - - b.Property<string>("Overview") - .HasColumnType("TEXT"); - - b.Property<string>("OwnerId") - .HasColumnType("TEXT"); - - b.Property<Guid?>("ParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("ParentIndexNumber") - .HasColumnType("INTEGER"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataCountryCode") - .HasColumnType("TEXT"); - - b.Property<string>("PreferredMetadataLanguage") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("PremiereDate") - .HasColumnType("TEXT"); - - b.Property<string>("PresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("PrimaryVersionId") - .HasColumnType("TEXT"); - - b.Property<string>("ProductionLocations") - .HasColumnType("TEXT"); - - b.Property<int?>("ProductionYear") - .HasColumnType("INTEGER"); - - b.Property<long?>("RunTimeTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("SeasonId") - .HasColumnType("TEXT"); - - b.Property<string>("SeasonName") - .HasColumnType("TEXT"); - - b.Property<Guid?>("SeriesId") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesName") - .HasColumnType("TEXT"); - - b.Property<string>("SeriesPresentationUniqueKey") - .HasColumnType("TEXT"); - - b.Property<string>("ShowId") - .HasColumnType("TEXT"); - - b.Property<long?>("Size") - .HasColumnType("INTEGER"); - - b.Property<string>("SortName") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("StartDate") - .HasColumnType("TEXT"); - - b.Property<string>("Studios") - .HasColumnType("TEXT"); - - b.Property<string>("Tagline") - .HasColumnType("TEXT"); - - b.Property<string>("Tags") - .HasColumnType("TEXT"); - - b.Property<Guid?>("TopParentId") - .HasColumnType("TEXT"); - - b.Property<int?>("TotalBitrate") - .HasColumnType("INTEGER"); - - b.Property<string>("Type") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("UnratedType") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ParentId"); - - b.HasIndex("Path"); - - b.HasIndex("PresentationUniqueKey"); - - b.HasIndex("TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "Id"); - - b.HasIndex("Type", "TopParentId", "PresentationUniqueKey"); - - b.HasIndex("Type", "TopParentId", "StartDate"); - - b.HasIndex("Id", "Type", "IsFolder", "IsVirtualItem"); - - b.HasIndex("MediaType", "TopParentId", "IsVirtualItem", "PresentationUniqueKey"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "IsFolder", "IsVirtualItem"); - - b.HasIndex("Type", "SeriesPresentationUniqueKey", "PresentationUniqueKey", "SortName"); - - b.HasIndex("IsFolder", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.HasIndex("Type", "TopParentId", "IsVirtualItem", "PresentationUniqueKey", "DateCreated"); - - b.ToTable("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<byte[]>("Blurhash") - .HasColumnType("BLOB"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("ImageType") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemMetadataFields"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderId") - .HasColumnType("TEXT"); - - b.Property<string>("ProviderValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemId", "ProviderId"); - - b.HasIndex("ProviderId", "ProviderValue", "ItemId"); - - b.ToTable("BaseItemProviders"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.Property<int>("Id") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("Id", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("BaseItemTrailerTypes"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ChapterIndex") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("ImageDateModified") - .HasColumnType("TEXT"); - - b.Property<string>("ImagePath") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .HasColumnType("TEXT"); - - b.Property<long>("StartPositionTicks") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "ChapterIndex"); - - b.ToTable("Chapters"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.CustomItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("Key") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client", "Key") - .IsUnique(); - - b.ToTable("CustomItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("ChromecastVersion") - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<string>("DashboardTheme") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("EnableNextVideoInfoOverlay") - .HasColumnType("INTEGER"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("ScrollDirection") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowBackdrop") - .HasColumnType("INTEGER"); - - b.Property<bool>("ShowSidebar") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipBackwardLength") - .HasColumnType("INTEGER"); - - b.Property<int>("SkipForwardLength") - .HasColumnType("INTEGER"); - - b.Property<string>("TvHome") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "ItemId", "Client") - .IsUnique(); - - b.ToTable("DisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("DisplayPreferencesId") - .HasColumnType("INTEGER"); - - b.Property<int>("Order") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("DisplayPreferencesId"); - - b.ToTable("HomeSection"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<DateTime>("LastModified") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .IsRequired() - .HasMaxLength(512) - .HasColumnType("TEXT"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId") - .IsUnique(); - - b.ToTable("ImageInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("Client") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<int?>("IndexBy") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<bool>("RememberIndexing") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSorting") - .HasColumnType("INTEGER"); - - b.Property<string>("SortBy") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<int>("SortOrder") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<int>("ViewType") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId"); - - b.ToTable("ItemDisplayPreferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Property<Guid>("ItemValueId") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("CleanValue") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.Property<string>("Value") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId"); - - b.HasIndex("Type", "CleanValue") - .IsUnique(); - - b.ToTable("ItemValues"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.Property<Guid>("ItemValueId") - .HasColumnType("TEXT"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.HasKey("ItemValueId", "ItemId"); - - b.HasIndex("ItemId"); - - b.ToTable("ItemValuesMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaSegment", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<long>("EndTicks") - .HasColumnType("INTEGER"); - - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<string>("SegmentProviderId") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<long>("StartTicks") - .HasColumnType("INTEGER"); - - b.Property<int>("Type") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.ToTable("MediaSegments"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("StreamIndex") - .HasColumnType("INTEGER"); - - b.Property<string>("AspectRatio") - .HasColumnType("TEXT"); - - b.Property<float?>("AverageFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("BitDepth") - .HasColumnType("INTEGER"); - - b.Property<int?>("BitRate") - .HasColumnType("INTEGER"); - - b.Property<int?>("BlPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<string>("ChannelLayout") - .HasColumnType("TEXT"); - - b.Property<int?>("Channels") - .HasColumnType("INTEGER"); - - b.Property<string>("Codec") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTag") - .HasColumnType("TEXT"); - - b.Property<string>("CodecTimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("ColorPrimaries") - .HasColumnType("TEXT"); - - b.Property<string>("ColorSpace") - .HasColumnType("TEXT"); - - b.Property<string>("ColorTransfer") - .HasColumnType("TEXT"); - - b.Property<string>("Comment") - .HasColumnType("TEXT"); - - b.Property<int?>("DvBlSignalCompatibilityId") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvLevel") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvProfile") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMajor") - .HasColumnType("INTEGER"); - - b.Property<int?>("DvVersionMinor") - .HasColumnType("INTEGER"); - - b.Property<int?>("ElPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("Height") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAnamorphic") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsAvc") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsDefault") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsExternal") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsForced") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsHearingImpaired") - .HasColumnType("INTEGER"); - - b.Property<bool?>("IsInterlaced") - .HasColumnType("INTEGER"); - - b.Property<string>("KeyFrames") - .HasColumnType("TEXT"); - - b.Property<string>("Language") - .HasColumnType("TEXT"); - - b.Property<float?>("Level") - .HasColumnType("REAL"); - - b.Property<string>("NalLengthSize") - .HasColumnType("TEXT"); - - b.Property<string>("Path") - .HasColumnType("TEXT"); - - b.Property<string>("PixelFormat") - .HasColumnType("TEXT"); - - b.Property<string>("Profile") - .HasColumnType("TEXT"); - - b.Property<float?>("RealFrameRate") - .HasColumnType("REAL"); - - b.Property<int?>("RefFrames") - .HasColumnType("INTEGER"); - - b.Property<int?>("Rotation") - .HasColumnType("INTEGER"); - - b.Property<int?>("RpuPresentFlag") - .HasColumnType("INTEGER"); - - b.Property<int?>("SampleRate") - .HasColumnType("INTEGER"); - - b.Property<int>("StreamType") - .HasColumnType("INTEGER"); - - b.Property<string>("TimeBase") - .HasColumnType("TEXT"); - - b.Property<string>("Title") - .HasColumnType("TEXT"); - - b.Property<int?>("Width") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "StreamIndex"); - - b.HasIndex("StreamIndex"); - - b.HasIndex("StreamType"); - - b.HasIndex("StreamIndex", "StreamType"); - - b.HasIndex("StreamIndex", "StreamType", "Language"); - - b.ToTable("MediaStreamInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("PersonType") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("Name"); - - b.ToTable("Peoples"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("PeopleId") - .HasColumnType("TEXT"); - - b.Property<int?>("ListOrder") - .HasColumnType("INTEGER"); - - b.Property<string>("Role") - .HasColumnType("TEXT"); - - b.Property<int?>("SortOrder") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "PeopleId"); - - b.HasIndex("PeopleId"); - - b.HasIndex("ItemId", "ListOrder"); - - b.HasIndex("ItemId", "SortOrder"); - - b.ToTable("PeopleBaseItemMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Permission_Permissions_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<bool>("Value") - .HasColumnType("INTEGER"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Permissions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<int>("Kind") - .HasColumnType("INTEGER"); - - b.Property<Guid?>("Preference_Preferences_Guid") - .HasColumnType("TEXT"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<Guid?>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("Value") - .IsRequired() - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("UserId", "Kind") - .IsUnique() - .HasFilter("[UserId] IS NOT NULL"); - - b.ToTable("Preferences"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.ApiKey", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<string>("Name") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("AccessToken") - .IsUnique(); - - b.ToTable("ApiKeys"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("AccessToken") - .IsRequired() - .HasColumnType("TEXT"); - - b.Property<string>("AppName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<string>("AppVersion") - .IsRequired() - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateCreated") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateLastActivity") - .HasColumnType("TEXT"); - - b.Property<DateTime>("DateModified") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasMaxLength(256) - .HasColumnType("TEXT"); - - b.Property<string>("DeviceName") - .IsRequired() - .HasMaxLength(64) - .HasColumnType("TEXT"); - - b.Property<bool>("IsActive") - .HasColumnType("INTEGER"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId"); - - b.HasIndex("AccessToken", "DateLastActivity"); - - b.HasIndex("DeviceId", "DateLastActivity"); - - b.HasIndex("UserId", "DeviceId"); - - b.ToTable("Devices"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.DeviceOptions", b => - { - b.Property<int>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("INTEGER"); - - b.Property<string>("CustomName") - .HasColumnType("TEXT"); - - b.Property<string>("DeviceId") - .IsRequired() - .HasColumnType("TEXT"); - - b.HasKey("Id"); - - b.HasIndex("DeviceId") - .IsUnique(); - - b.ToTable("DeviceOptions"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.TrickplayInfo", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<int>("Width") - .HasColumnType("INTEGER"); - - b.Property<int>("Bandwidth") - .HasColumnType("INTEGER"); - - b.Property<int>("Height") - .HasColumnType("INTEGER"); - - b.Property<int>("Interval") - .HasColumnType("INTEGER"); - - b.Property<int>("ThumbnailCount") - .HasColumnType("INTEGER"); - - b.Property<int>("TileHeight") - .HasColumnType("INTEGER"); - - b.Property<int>("TileWidth") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "Width"); - - b.ToTable("TrickplayInfos"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Property<Guid>("Id") - .ValueGeneratedOnAdd() - .HasColumnType("TEXT"); - - b.Property<string>("AudioLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("AuthenticationProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<string>("CastReceiverId") - .HasMaxLength(32) - .HasColumnType("TEXT"); - - b.Property<bool>("DisplayCollectionsView") - .HasColumnType("INTEGER"); - - b.Property<bool>("DisplayMissingEpisodes") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableAutoLogin") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableLocalPassword") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableNextEpisodeAutoPlay") - .HasColumnType("INTEGER"); - - b.Property<bool>("EnableUserPreferenceAccess") - .HasColumnType("INTEGER"); - - b.Property<bool>("HidePlayedInLatest") - .HasColumnType("INTEGER"); - - b.Property<long>("InternalId") - .HasColumnType("INTEGER"); - - b.Property<int>("InvalidLoginAttemptCount") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastActivityDate") - .HasColumnType("TEXT"); - - b.Property<DateTime?>("LastLoginDate") - .HasColumnType("TEXT"); - - b.Property<int?>("LoginAttemptsBeforeLockout") - .HasColumnType("INTEGER"); - - b.Property<int>("MaxActiveSessions") - .HasColumnType("INTEGER"); - - b.Property<int?>("MaxParentalAgeRating") - .HasColumnType("INTEGER"); - - b.Property<bool>("MustUpdatePassword") - .HasColumnType("INTEGER"); - - b.Property<string>("Password") - .HasMaxLength(65535) - .HasColumnType("TEXT"); - - b.Property<string>("PasswordResetProviderId") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<bool>("PlayDefaultAudioTrack") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberAudioSelections") - .HasColumnType("INTEGER"); - - b.Property<bool>("RememberSubtitleSelections") - .HasColumnType("INTEGER"); - - b.Property<int?>("RemoteClientBitrateLimit") - .HasColumnType("INTEGER"); - - b.Property<uint>("RowVersion") - .IsConcurrencyToken() - .HasColumnType("INTEGER"); - - b.Property<string>("SubtitleLanguagePreference") - .HasMaxLength(255) - .HasColumnType("TEXT"); - - b.Property<int>("SubtitleMode") - .HasColumnType("INTEGER"); - - b.Property<int>("SyncPlayAccess") - .HasColumnType("INTEGER"); - - b.Property<string>("Username") - .IsRequired() - .HasMaxLength(255) - .HasColumnType("TEXT") - .UseCollation("NOCASE"); - - b.HasKey("Id"); - - b.HasIndex("Username") - .IsUnique(); - - b.ToTable("Users"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.Property<Guid>("ItemId") - .HasColumnType("TEXT"); - - b.Property<Guid>("UserId") - .HasColumnType("TEXT"); - - b.Property<string>("CustomDataKey") - .HasColumnType("TEXT"); - - b.Property<int?>("AudioStreamIndex") - .HasColumnType("INTEGER"); - - b.Property<bool>("IsFavorite") - .HasColumnType("INTEGER"); - - b.Property<DateTime?>("LastPlayedDate") - .HasColumnType("TEXT"); - - b.Property<bool?>("Likes") - .HasColumnType("INTEGER"); - - b.Property<int>("PlayCount") - .HasColumnType("INTEGER"); - - b.Property<long>("PlaybackPositionTicks") - .HasColumnType("INTEGER"); - - b.Property<bool>("Played") - .HasColumnType("INTEGER"); - - b.Property<double?>("Rating") - .HasColumnType("REAL"); - - b.Property<int?>("SubtitleStreamIndex") - .HasColumnType("INTEGER"); - - b.HasKey("ItemId", "UserId", "CustomDataKey"); - - b.HasIndex("UserId"); - - b.HasIndex("ItemId", "UserId", "IsFavorite"); - - b.HasIndex("ItemId", "UserId", "LastPlayedDate"); - - b.HasIndex("ItemId", "UserId", "PlaybackPositionTicks"); - - b.HasIndex("ItemId", "UserId", "Played"); - - b.ToTable("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AccessSchedule", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("AccessSchedules") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AncestorId", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Children") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "ParentItem") - .WithMany("ParentAncestors") - .HasForeignKey("ParentItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ParentItem"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.AttachmentStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany() - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Images") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemMetadataField", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("LockedFields") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemProvider", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Provider") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemTrailerType", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("TrailerTypes") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Chapter", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Chapters") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("DisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.HomeSection", b => - { - b.HasOne("Jellyfin.Data.Entities.DisplayPreferences", null) - .WithMany("HomeSections") - .HasForeignKey("DisplayPreferencesId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ImageInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithOne("ProfileImage") - .HasForeignKey("Jellyfin.Data.Entities.ImageInfo", "UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemDisplayPreferences", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("ItemDisplayPreferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValueMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("ItemValues") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.ItemValue", "ItemValue") - .WithMany("BaseItemsMap") - .HasForeignKey("ItemValueId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("ItemValue"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.MediaStreamInfo", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("MediaStreams") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.PeopleBaseItemMap", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("Peoples") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.People", "People") - .WithMany("BaseItems") - .HasForeignKey("PeopleId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("People"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Permission", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Permissions") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Preference", b => - { - b.HasOne("Jellyfin.Data.Entities.User", null) - .WithMany("Preferences") - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.Security.Device", b => - { - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.UserData", b => - { - b.HasOne("Jellyfin.Data.Entities.BaseItemEntity", "Item") - .WithMany("UserData") - .HasForeignKey("ItemId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.HasOne("Jellyfin.Data.Entities.User", "User") - .WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.Cascade) - .IsRequired(); - - b.Navigation("Item"); - - b.Navigation("User"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.BaseItemEntity", b => - { - b.Navigation("Chapters"); - - b.Navigation("Children"); - - b.Navigation("Images"); - - b.Navigation("ItemValues"); - - b.Navigation("LockedFields"); - - b.Navigation("MediaStreams"); - - b.Navigation("ParentAncestors"); - - b.Navigation("Peoples"); - - b.Navigation("Provider"); - - b.Navigation("TrailerTypes"); - - b.Navigation("UserData"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.DisplayPreferences", b => - { - b.Navigation("HomeSections"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.ItemValue", b => - { - b.Navigation("BaseItemsMap"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.People", b => - { - b.Navigation("BaseItems"); - }); - - modelBuilder.Entity("Jellyfin.Data.Entities.User", b => - { - b.Navigation("AccessSchedules"); - - b.Navigation("DisplayPreferences"); - - b.Navigation("ItemDisplayPreferences"); - - b.Navigation("Permissions"); - - b.Navigation("Preferences"); - - b.Navigation("ProfileImage"); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelBuilderExtensions.cs b/Jellyfin.Server.Implementations/ModelBuilderExtensions.cs deleted file mode 100644 index 79ae1661a..000000000 --- a/Jellyfin.Server.Implementations/ModelBuilderExtensions.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System; -using Jellyfin.Server.Implementations.ValueConverters; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations -{ - /// <summary> - /// Model builder extensions. - /// </summary> - public static class ModelBuilderExtensions - { - /// <summary> - /// Specify value converter for the object type. - /// </summary> - /// <param name="modelBuilder">The model builder.</param> - /// <param name="converter">The <see cref="ValueConverter{TModel,TProvider}"/>.</param> - /// <typeparam name="T">The type to convert.</typeparam> - /// <returns>The modified <see cref="ModelBuilder"/>.</returns> - public static ModelBuilder UseValueConverterForType<T>(this ModelBuilder modelBuilder, ValueConverter converter) - { - var type = typeof(T); - foreach (var entityType in modelBuilder.Model.GetEntityTypes()) - { - foreach (var property in entityType.GetProperties()) - { - if (property.ClrType == type) - { - property.SetValueConverter(converter); - } - } - } - - return modelBuilder; - } - - /// <summary> - /// Specify the default <see cref="DateTimeKind"/>. - /// </summary> - /// <param name="modelBuilder">The model builder to extend.</param> - /// <param name="kind">The <see cref="DateTimeKind"/> to specify.</param> - public static void SetDefaultDateTimeKind(this ModelBuilder modelBuilder, DateTimeKind kind) - { - modelBuilder.UseValueConverterForType<DateTime>(new DateTimeKindValueConverter(kind)); - modelBuilder.UseValueConverterForType<DateTime?>(new DateTimeKindValueConverter(kind)); - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/ActivityLogConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/ActivityLogConfiguration.cs deleted file mode 100644 index 9a63ed9f2..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/ActivityLogConfiguration.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// FluentAPI configuration for the ActivityLog entity. -/// </summary> -public class ActivityLogConfiguration : IEntityTypeConfiguration<ActivityLog> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<ActivityLog> builder) - { - builder.HasIndex(entity => entity.DateCreated); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/AncestorIdConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/AncestorIdConfiguration.cs deleted file mode 100644 index 8cc817fb8..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/AncestorIdConfiguration.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// AncestorId configuration. -/// </summary> -public class AncestorIdConfiguration : IEntityTypeConfiguration<AncestorId> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<AncestorId> builder) - { - builder.HasKey(e => new { e.ItemId, e.ParentItemId }); - builder.HasIndex(e => e.ParentItemId); - builder.HasOne(e => e.ParentItem).WithMany(e => e.ParentAncestors).HasForeignKey(f => f.ParentItemId); - builder.HasOne(e => e.Item).WithMany(e => e.Children).HasForeignKey(f => f.ItemId); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs deleted file mode 100644 index 3f19b6986..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/ApiKeyConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Jellyfin.Data.Entities.Security; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration -{ - /// <summary> - /// FluentAPI configuration for the ApiKey entity. - /// </summary> - public class ApiKeyConfiguration : IEntityTypeConfiguration<ApiKey> - { - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<ApiKey> builder) - { - builder - .HasIndex(entity => entity.AccessToken) - .IsUnique(); - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/AttachmentStreamInfoConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/AttachmentStreamInfoConfiguration.cs deleted file mode 100644 index 057b6689a..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/AttachmentStreamInfoConfiguration.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// FluentAPI configuration for the AttachmentStreamInfo entity. -/// </summary> -public class AttachmentStreamInfoConfiguration : IEntityTypeConfiguration<AttachmentStreamInfo> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<AttachmentStreamInfo> builder) - { - builder.HasKey(e => new { e.ItemId, e.Index }); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemConfiguration.cs deleted file mode 100644 index eaf48981c..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemConfiguration.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using SQLitePCL; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// Configuration for BaseItem. -/// </summary> -public class BaseItemConfiguration : IEntityTypeConfiguration<BaseItemEntity> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<BaseItemEntity> builder) - { - builder.HasKey(e => e.Id); - // TODO: See rant in entity file. - // builder.HasOne(e => e.Parent).WithMany(e => e.DirectChildren).HasForeignKey(e => e.ParentId); - // builder.HasOne(e => e.TopParent).WithMany(e => e.AllChildren).HasForeignKey(e => e.TopParentId); - // builder.HasOne(e => e.Season).WithMany(e => e.SeasonEpisodes).HasForeignKey(e => e.SeasonId); - // builder.HasOne(e => e.Series).WithMany(e => e.SeriesEpisodes).HasForeignKey(e => e.SeriesId); - builder.HasMany(e => e.Peoples); - builder.HasMany(e => e.UserData); - builder.HasMany(e => e.ItemValues); - builder.HasMany(e => e.MediaStreams); - builder.HasMany(e => e.Chapters); - builder.HasMany(e => e.Provider); - builder.HasMany(e => e.ParentAncestors); - builder.HasMany(e => e.Children); - builder.HasMany(e => e.LockedFields); - builder.HasMany(e => e.TrailerTypes); - builder.HasMany(e => e.Images); - - builder.HasIndex(e => e.Path); - builder.HasIndex(e => e.ParentId); - builder.HasIndex(e => e.PresentationUniqueKey); - builder.HasIndex(e => new { e.Id, e.Type, e.IsFolder, e.IsVirtualItem }); - - // covering index - builder.HasIndex(e => new { e.TopParentId, e.Id }); - // series - builder.HasIndex(e => new { e.Type, e.SeriesPresentationUniqueKey, e.PresentationUniqueKey, e.SortName }); - // series counts - // seriesdateplayed sort order - builder.HasIndex(e => new { e.Type, e.SeriesPresentationUniqueKey, e.IsFolder, e.IsVirtualItem }); - // live tv programs - builder.HasIndex(e => new { e.Type, e.TopParentId, e.StartDate }); - // covering index for getitemvalues - builder.HasIndex(e => new { e.Type, e.TopParentId, e.Id }); - // used by movie suggestions - builder.HasIndex(e => new { e.Type, e.TopParentId, e.PresentationUniqueKey }); - // latest items - builder.HasIndex(e => new { e.Type, e.TopParentId, e.IsVirtualItem, e.PresentationUniqueKey, e.DateCreated }); - builder.HasIndex(e => new { e.IsFolder, e.TopParentId, e.IsVirtualItem, e.PresentationUniqueKey, e.DateCreated }); - // resume - builder.HasIndex(e => new { e.MediaType, e.TopParentId, e.IsVirtualItem, e.PresentationUniqueKey }); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemMetadataFieldConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemMetadataFieldConfiguration.cs deleted file mode 100644 index 137f4a883..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemMetadataFieldConfiguration.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Linq; -using Jellyfin.Data.Entities; -using MediaBrowser.Model.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using SQLitePCL; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// Provides configuration for the BaseItemMetadataField entity. -/// </summary> -public class BaseItemMetadataFieldConfiguration : IEntityTypeConfiguration<BaseItemMetadataField> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<BaseItemMetadataField> builder) - { - builder.HasKey(e => new { e.Id, e.ItemId }); - builder.HasOne(e => e.Item); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemProviderConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemProviderConfiguration.cs deleted file mode 100644 index d15049a1f..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemProviderConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// BaseItemProvider configuration. -/// </summary> -public class BaseItemProviderConfiguration : IEntityTypeConfiguration<BaseItemProvider> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<BaseItemProvider> builder) - { - builder.HasKey(e => new { e.ItemId, e.ProviderId }); - builder.HasOne(e => e.Item); - builder.HasIndex(e => new { e.ProviderId, e.ProviderValue, e.ItemId }); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemTrailerTypeConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemTrailerTypeConfiguration.cs deleted file mode 100644 index f03d99c29..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/BaseItemTrailerTypeConfiguration.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Linq; -using Jellyfin.Data.Entities; -using MediaBrowser.Model.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; -using SQLitePCL; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// Provides configuration for the BaseItemMetadataField entity. -/// </summary> -public class BaseItemTrailerTypeConfiguration : IEntityTypeConfiguration<BaseItemTrailerType> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<BaseItemTrailerType> builder) - { - builder.HasKey(e => new { e.Id, e.ItemId }); - builder.HasOne(e => e.Item); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/ChapterConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/ChapterConfiguration.cs deleted file mode 100644 index 5a84f7750..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/ChapterConfiguration.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// Chapter configuration. -/// </summary> -public class ChapterConfiguration : IEntityTypeConfiguration<Chapter> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<Chapter> builder) - { - builder.HasKey(e => new { e.ItemId, e.ChapterIndex }); - builder.HasOne(e => e.Item); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/CustomItemDisplayPreferencesConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/CustomItemDisplayPreferencesConfiguration.cs deleted file mode 100644 index 779aec986..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/CustomItemDisplayPreferencesConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration -{ - /// <summary> - /// FluentAPI configuration for the CustomItemDisplayPreferences entity. - /// </summary> - public class CustomItemDisplayPreferencesConfiguration : IEntityTypeConfiguration<CustomItemDisplayPreferences> - { - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<CustomItemDisplayPreferences> builder) - { - builder - .HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client, entity.Key }) - .IsUnique(); - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/DeviceConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/DeviceConfiguration.cs deleted file mode 100644 index a750b65c0..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/DeviceConfiguration.cs +++ /dev/null @@ -1,28 +0,0 @@ -using Jellyfin.Data.Entities.Security; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration -{ - /// <summary> - /// FluentAPI configuration for the Device entity. - /// </summary> - public class DeviceConfiguration : IEntityTypeConfiguration<Device> - { - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<Device> builder) - { - builder - .HasIndex(entity => new { entity.DeviceId, entity.DateLastActivity }); - - builder - .HasIndex(entity => new { entity.AccessToken, entity.DateLastActivity }); - - builder - .HasIndex(entity => new { entity.UserId, entity.DeviceId }); - - builder - .HasIndex(entity => entity.DeviceId); - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs deleted file mode 100644 index 038afd752..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/DeviceOptionsConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using Jellyfin.Data.Entities.Security; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration -{ - /// <summary> - /// FluentAPI configuration for the DeviceOptions entity. - /// </summary> - public class DeviceOptionsConfiguration : IEntityTypeConfiguration<DeviceOptions> - { - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<DeviceOptions> builder) - { - builder - .HasIndex(entity => entity.DeviceId) - .IsUnique(); - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/DisplayPreferencesConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/DisplayPreferencesConfiguration.cs deleted file mode 100644 index 9b437861b..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/DisplayPreferencesConfiguration.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration -{ - /// <summary> - /// FluentAPI configuration for the DisplayPreferencesConfiguration entity. - /// </summary> - public class DisplayPreferencesConfiguration : IEntityTypeConfiguration<DisplayPreferences> - { - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<DisplayPreferences> builder) - { - builder - .HasMany(d => d.HomeSections) - .WithOne() - .OnDelete(DeleteBehavior.Cascade); - - builder - .HasIndex(entity => new { entity.UserId, entity.ItemId, entity.Client }) - .IsUnique(); - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs deleted file mode 100644 index abeeb09c9..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesConfiguration.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// itemvalues Configuration. -/// </summary> -public class ItemValuesConfiguration : IEntityTypeConfiguration<ItemValue> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<ItemValue> builder) - { - builder.HasKey(e => e.ItemValueId); - builder.HasIndex(e => new { e.Type, e.CleanValue }).IsUnique(); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesMapConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesMapConfiguration.cs deleted file mode 100644 index 9c22b114c..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/ItemValuesMapConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// itemvalues Configuration. -/// </summary> -public class ItemValuesMapConfiguration : IEntityTypeConfiguration<ItemValueMap> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<ItemValueMap> builder) - { - builder.HasKey(e => new { e.ItemValueId, e.ItemId }); - builder.HasOne(e => e.Item); - builder.HasOne(e => e.ItemValue); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/MediaStreamInfoConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/MediaStreamInfoConfiguration.cs deleted file mode 100644 index 7e572f9a3..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/MediaStreamInfoConfiguration.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// People configuration. -/// </summary> -public class MediaStreamInfoConfiguration : IEntityTypeConfiguration<MediaStreamInfo> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<MediaStreamInfo> builder) - { - builder.HasKey(e => new { e.ItemId, e.StreamIndex }); - builder.HasIndex(e => e.StreamIndex); - builder.HasIndex(e => e.StreamType); - builder.HasIndex(e => new { e.StreamIndex, e.StreamType }); - builder.HasIndex(e => new { e.StreamIndex, e.StreamType, e.Language }); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/PeopleBaseItemMapConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/PeopleBaseItemMapConfiguration.cs deleted file mode 100644 index cdaee9161..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/PeopleBaseItemMapConfiguration.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// People configuration. -/// </summary> -public class PeopleBaseItemMapConfiguration : IEntityTypeConfiguration<PeopleBaseItemMap> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<PeopleBaseItemMap> builder) - { - builder.HasKey(e => new { e.ItemId, e.PeopleId }); - builder.HasIndex(e => new { e.ItemId, e.SortOrder }); - builder.HasIndex(e => new { e.ItemId, e.ListOrder }); - builder.HasOne(e => e.Item); - builder.HasOne(e => e.People); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/PeopleConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/PeopleConfiguration.cs deleted file mode 100644 index f3cccb13f..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/PeopleConfiguration.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// People configuration. -/// </summary> -public class PeopleConfiguration : IEntityTypeConfiguration<People> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<People> builder) - { - builder.HasKey(e => e.Id); - builder.HasIndex(e => e.Name); - builder.HasMany(e => e.BaseItems); - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/PermissionConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/PermissionConfiguration.cs deleted file mode 100644 index 240e284c0..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/PermissionConfiguration.cs +++ /dev/null @@ -1,24 +0,0 @@ -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration -{ - /// <summary> - /// FluentAPI configuration for the Permission entity. - /// </summary> - public class PermissionConfiguration : IEntityTypeConfiguration<Permission> - { - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<Permission> builder) - { - // Used to get a user's permissions or a specific permission for a user. - // Also prevents multiple values being created for a user. - // Filtered over non-null user ids for when other entities (groups, API keys) get permissions - builder - .HasIndex(p => new { p.UserId, p.Kind }) - .HasFilter("[UserId] IS NOT NULL") - .IsUnique(); - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/PreferenceConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/PreferenceConfiguration.cs deleted file mode 100644 index 49c869c6a..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/PreferenceConfiguration.cs +++ /dev/null @@ -1,21 +0,0 @@ -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration -{ - /// <summary> - /// FluentAPI configuration for the Permission entity. - /// </summary> - public class PreferenceConfiguration : IEntityTypeConfiguration<Preference> - { - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<Preference> builder) - { - builder - .HasIndex(p => new { p.UserId, p.Kind }) - .HasFilter("[UserId] IS NOT NULL") - .IsUnique(); - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/TrickplayInfoConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/TrickplayInfoConfiguration.cs deleted file mode 100644 index dc1c17e5e..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/TrickplayInfoConfiguration.cs +++ /dev/null @@ -1,18 +0,0 @@ -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration -{ - /// <summary> - /// FluentAPI configuration for the TrickplayInfo entity. - /// </summary> - public class TrickplayInfoConfiguration : IEntityTypeConfiguration<TrickplayInfo> - { - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<TrickplayInfo> builder) - { - builder.HasKey(info => new { info.ItemId, info.Width }); - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/UserConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/UserConfiguration.cs deleted file mode 100644 index a369cf656..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/UserConfiguration.cs +++ /dev/null @@ -1,56 +0,0 @@ -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration -{ - /// <summary> - /// FluentAPI configuration for the User entity. - /// </summary> - public class UserConfiguration : IEntityTypeConfiguration<User> - { - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<User> builder) - { - builder - .Property(user => user.Username) - .UseCollation("NOCASE"); - - builder - .HasOne(u => u.ProfileImage) - .WithOne() - .OnDelete(DeleteBehavior.Cascade); - - builder - .HasMany(u => u.Permissions) - .WithOne() - .HasForeignKey(p => p.UserId) - .OnDelete(DeleteBehavior.Cascade); - - builder - .HasMany(u => u.Preferences) - .WithOne() - .HasForeignKey(p => p.UserId) - .OnDelete(DeleteBehavior.Cascade); - - builder - .HasMany(u => u.AccessSchedules) - .WithOne() - .OnDelete(DeleteBehavior.Cascade); - - builder - .HasMany(u => u.DisplayPreferences) - .WithOne() - .OnDelete(DeleteBehavior.Cascade); - - builder - .HasMany(u => u.ItemDisplayPreferences) - .WithOne() - .OnDelete(DeleteBehavior.Cascade); - - builder - .HasIndex(entity => entity.Username) - .IsUnique(); - } - } -} diff --git a/Jellyfin.Server.Implementations/ModelConfiguration/UserDataConfiguration.cs b/Jellyfin.Server.Implementations/ModelConfiguration/UserDataConfiguration.cs deleted file mode 100644 index 7bbb28d43..000000000 --- a/Jellyfin.Server.Implementations/ModelConfiguration/UserDataConfiguration.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using Jellyfin.Data.Entities; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Metadata.Builders; - -namespace Jellyfin.Server.Implementations.ModelConfiguration; - -/// <summary> -/// FluentAPI configuration for the UserData entity. -/// </summary> -public class UserDataConfiguration : IEntityTypeConfiguration<UserData> -{ - /// <inheritdoc/> - public void Configure(EntityTypeBuilder<UserData> builder) - { - builder.HasKey(d => new { d.ItemId, d.UserId, d.CustomDataKey }); - builder.HasIndex(d => new { d.ItemId, d.UserId, d.Played }); - builder.HasIndex(d => new { d.ItemId, d.UserId, d.PlaybackPositionTicks }); - builder.HasIndex(d => new { d.ItemId, d.UserId, d.IsFavorite }); - builder.HasIndex(d => new { d.ItemId, d.UserId, d.LastPlayedDate }); - builder.HasOne(e => e.Item); - } -} diff --git a/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs b/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs index 1c9f54ab0..cf0293463 100644 --- a/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs +++ b/Jellyfin.Server.Implementations/Security/AuthenticationManager.cs @@ -1,7 +1,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Jellyfin.Data.Entities.Security; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities.Security; using MediaBrowser.Controller.Security; using Microsoft.EntityFrameworkCore; diff --git a/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs b/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs index 9e225393c..e3fe517c4 100644 --- a/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs +++ b/Jellyfin.Server.Implementations/Security/AuthorizationContext.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Net; using System.Threading.Tasks; using Jellyfin.Data.Queries; +using Jellyfin.Database.Implementations; using Jellyfin.Extensions; using MediaBrowser.Controller; using MediaBrowser.Controller.Configuration; diff --git a/Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs b/Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs index 6949ec1a8..bf39f13a7 100644 --- a/Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs +++ b/Jellyfin.Server.Implementations/Trickplay/TrickplayManager.cs @@ -7,7 +7,8 @@ using System.Text; using System.Threading; using System.Threading.Tasks; using AsyncKeyedLock; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Common.Configuration; using MediaBrowser.Controller.Configuration; using MediaBrowser.Controller.Drawing; diff --git a/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs b/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs index acada7aa4..35c43b176 100644 --- a/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs +++ b/Jellyfin.Server.Implementations/Users/DefaultAuthenticationProvider.cs @@ -2,7 +2,7 @@ using System; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Authentication; using MediaBrowser.Model.Cryptography; using Microsoft.Extensions.Logging; diff --git a/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs b/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs index cefbd0624..6296881a9 100644 --- a/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs +++ b/Jellyfin.Server.Implementations/Users/DefaultPasswordResetProvider.cs @@ -4,7 +4,7 @@ using System.IO; using System.Security.Cryptography; using System.Text.Json; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Common; using MediaBrowser.Common.Extensions; using MediaBrowser.Controller.Authentication; diff --git a/Jellyfin.Server.Implementations/Users/DeviceAccessHost.cs b/Jellyfin.Server.Implementations/Users/DeviceAccessHost.cs index 45b0a0853..92e2bb4fa 100644 --- a/Jellyfin.Server.Implementations/Users/DeviceAccessHost.cs +++ b/Jellyfin.Server.Implementations/Users/DeviceAccessHost.cs @@ -1,9 +1,10 @@ using System.Threading; using System.Threading.Tasks; -using Jellyfin.Data.Entities; -using Jellyfin.Data.Enums; +using Jellyfin.Data; using Jellyfin.Data.Events; using Jellyfin.Data.Queries; +using Jellyfin.Database.Implementations.Entities; +using Jellyfin.Database.Implementations.Enums; using MediaBrowser.Controller.Devices; using MediaBrowser.Controller.Library; using MediaBrowser.Controller.Session; diff --git a/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs b/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs index e204a16a6..0f21e11a3 100644 --- a/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs +++ b/Jellyfin.Server.Implementations/Users/DisplayPreferencesManager.cs @@ -5,7 +5,8 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller; using Microsoft.EntityFrameworkCore; diff --git a/Jellyfin.Server.Implementations/Users/InvalidAuthProvider.cs b/Jellyfin.Server.Implementations/Users/InvalidAuthProvider.cs index c4e4c460a..caf9d5bd9 100644 --- a/Jellyfin.Server.Implementations/Users/InvalidAuthProvider.cs +++ b/Jellyfin.Server.Implementations/Users/InvalidAuthProvider.cs @@ -1,5 +1,5 @@ using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Database.Implementations.Entities; using MediaBrowser.Controller.Authentication; namespace Jellyfin.Server.Implementations.Users diff --git a/Jellyfin.Server.Implementations/Users/UserManager.cs b/Jellyfin.Server.Implementations/Users/UserManager.cs index fba8923f8..3c39e5503 100644 --- a/Jellyfin.Server.Implementations/Users/UserManager.cs +++ b/Jellyfin.Server.Implementations/Users/UserManager.cs @@ -7,10 +7,13 @@ using System.Globalization; using System.Linq; using System.Text.RegularExpressions; using System.Threading.Tasks; -using Jellyfin.Data.Entities; +using Jellyfin.Data; using Jellyfin.Data.Enums; using Jellyfin.Data.Events; using Jellyfin.Data.Events.Users; +using Jellyfin.Database.Implementations; +using Jellyfin.Database.Implementations.Entities; +using Jellyfin.Database.Implementations.Enums; using Jellyfin.Extensions; using MediaBrowser.Common; using MediaBrowser.Common.Extensions; @@ -146,7 +149,7 @@ namespace Jellyfin.Server.Implementations.Users ThrowIfInvalidUsername(newName); - if (user.Username.Equals(newName, StringComparison.Ordinal)) + if (user.Username.Equals(newName, StringComparison.OrdinalIgnoreCase)) { throw new ArgumentException("The new and old names must be different."); } @@ -154,8 +157,11 @@ namespace Jellyfin.Server.Implementations.Users var dbContext = await _dbProvider.CreateDbContextAsync().ConfigureAwait(false); await using (dbContext.ConfigureAwait(false)) { +#pragma warning disable CA1862 // Use the 'StringComparison' method overloads to perform case-insensitive string comparisons +#pragma warning disable CA1311 // Specify a culture or use an invariant version to avoid implicit dependency on current culture +#pragma warning disable CA1304 // The behavior of 'string.ToUpper()' could vary based on the current user's locale settings if (await dbContext.Users - .AnyAsync(u => u.Username == newName && !u.Id.Equals(user.Id)) + .AnyAsync(u => u.Username.ToUpper() == newName.ToUpper() && !u.Id.Equals(user.Id)) .ConfigureAwait(false)) { throw new ArgumentException(string.Format( @@ -163,6 +169,9 @@ namespace Jellyfin.Server.Implementations.Users "A user with the name '{0}' already exists.", newName)); } +#pragma warning restore CA1304 // The behavior of 'string.ToUpper()' could vary based on the current user's locale settings +#pragma warning restore CA1311 // Specify a culture or use an invariant version to avoid implicit dependency on current culture +#pragma warning restore CA1862 // Use the 'StringComparison' method overloads to perform case-insensitive string comparisons user.Username = newName; await UpdateUserInternalAsync(dbContext, user).ConfigureAwait(false); diff --git a/Jellyfin.Server.Implementations/ValueConverters/DateTimeKindValueConverter.cs b/Jellyfin.Server.Implementations/ValueConverters/DateTimeKindValueConverter.cs deleted file mode 100644 index 2e585c92d..000000000 --- a/Jellyfin.Server.Implementations/ValueConverters/DateTimeKindValueConverter.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; - -namespace Jellyfin.Server.Implementations.ValueConverters -{ - /// <summary> - /// ValueConverter to specify kind. - /// </summary> - public class DateTimeKindValueConverter : ValueConverter<DateTime, DateTime> - { - /// <summary> - /// Initializes a new instance of the <see cref="DateTimeKindValueConverter"/> class. - /// </summary> - /// <param name="kind">The kind to specify.</param> - /// <param name="mappingHints">The mapping hints.</param> - public DateTimeKindValueConverter(DateTimeKind kind, ConverterMappingHints? mappingHints = null) - : base(v => v.ToUniversalTime(), v => DateTime.SpecifyKind(v, kind), mappingHints) - { - } - } -} |
