aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Barron <18354464+barronpm@users.noreply.github.com>2020-05-12 16:08:28 +0000
committerGitHub <noreply@github.com>2020-05-12 16:08:28 +0000
commit6379391f871424177c6048a54ccd061d6e44bc4a (patch)
treecf268efbe2d8aaeee964ef8e893ae382abf88ad4
parent37dcbfbc3980ed962c28fe7f1ee9d8a78f65ec19 (diff)
parent32c118222647f121c0b17055c0ef158763c0b5d2 (diff)
Merge branch 'master' into activitydb-efcore
-rw-r--r--.editorconfig17
-rw-r--r--DvdLib/BigEndianBinaryReader.cs2
-rw-r--r--DvdLib/DvdLib.csproj1
-rw-r--r--DvdLib/Ifo/Cell.cs2
-rw-r--r--DvdLib/Ifo/CellPlaybackInfo.cs2
-rw-r--r--DvdLib/Ifo/CellPositionInfo.cs2
-rw-r--r--DvdLib/Ifo/Chapter.cs2
-rw-r--r--DvdLib/Ifo/Dvd.cs2
-rw-r--r--DvdLib/Ifo/DvdTime.cs2
-rw-r--r--DvdLib/Ifo/Program.cs2
-rw-r--r--DvdLib/Ifo/ProgramChain.cs2
-rw-r--r--DvdLib/Ifo/Title.cs2
-rw-r--r--DvdLib/Ifo/UserOperation.cs2
-rw-r--r--Emby.Naming/Video/VideoResolver.cs6
-rw-r--r--Emby.Server.Implementations/ConfigurationOptions.cs1
-rw-r--r--Emby.Server.Implementations/Data/SqliteUserDataRepository.cs10
-rw-r--r--Emby.Server.Implementations/Library/UserManager.cs25
-rw-r--r--Emby.Server.Implementations/Localization/Core/af.json2
-rw-r--r--Emby.Server.Implementations/Localization/Core/es-MX.json2
-rw-r--r--Emby.Server.Implementations/Localization/Core/es.json2
-rw-r--r--Emby.Server.Implementations/Localization/Core/fi.json26
-rw-r--r--Emby.Server.Implementations/Localization/Core/fr-CA.json20
-rw-r--r--Emby.Server.Implementations/Localization/Core/gsw.json92
-rw-r--r--Emby.Server.Implementations/Localization/Core/he.json2
-rw-r--r--Emby.Server.Implementations/Localization/Core/hr.json12
-rw-r--r--Emby.Server.Implementations/Localization/Core/it.json2
-rw-r--r--Emby.Server.Implementations/Localization/Core/mk.json9
-rw-r--r--Emby.Server.Implementations/Localization/Core/nl.json6
-rw-r--r--Emby.Server.Implementations/Localization/Core/sl-SI.json23
-rw-r--r--Emby.Server.Implementations/Localization/Core/sv.json7
-rw-r--r--Emby.Server.Implementations/Localization/Core/uk.json36
-rw-r--r--Emby.Server.Implementations/Localization/Core/zh-HK.json7
-rw-r--r--Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs8
-rw-r--r--Jellyfin.Data/Entities/Artwork.cs371
-rw-r--r--Jellyfin.Data/Entities/Book.cs113
-rw-r--r--Jellyfin.Data/Entities/BookMetadata.cs204
-rw-r--r--Jellyfin.Data/Entities/Chapter.cs457
-rw-r--r--Jellyfin.Data/Entities/Collection.cs205
-rw-r--r--Jellyfin.Data/Entities/CollectionItem.cs274
-rw-r--r--Jellyfin.Data/Entities/Company.cs262
-rw-r--r--Jellyfin.Data/Entities/CompanyMetadata.cs416
-rw-r--r--Jellyfin.Data/Entities/CustomItem.cs114
-rw-r--r--Jellyfin.Data/Entities/CustomItemMetadata.cs119
-rw-r--r--Jellyfin.Data/Entities/Episode.cs213
-rw-r--r--Jellyfin.Data/Entities/EpisodeMetadata.cs346
-rw-r--r--Jellyfin.Data/Entities/Genre.cs285
-rw-r--r--Jellyfin.Data/Entities/Group.cs206
-rw-r--r--Jellyfin.Data/Entities/Library.cs275
-rw-r--r--Jellyfin.Data/Entities/LibraryItem.cs322
-rw-r--r--Jellyfin.Data/Entities/LibraryRoot.cs366
-rw-r--r--Jellyfin.Data/Entities/MediaFile.cs371
-rw-r--r--Jellyfin.Data/Entities/MediaFileStream.cs279
-rw-r--r--Jellyfin.Data/Entities/Metadata.cs699
-rw-r--r--Jellyfin.Data/Entities/MetadataProvider.cs275
-rw-r--r--Jellyfin.Data/Entities/MetadataProviderId.cs344
-rw-r--r--Jellyfin.Data/Entities/Movie.cs113
-rw-r--r--Jellyfin.Data/Entities/MovieMetadata.cs424
-rw-r--r--Jellyfin.Data/Entities/MusicAlbum.cs114
-rw-r--r--Jellyfin.Data/Entities/MusicAlbumMetadata.cs353
-rw-r--r--Jellyfin.Data/Entities/Permission.cs272
-rw-r--r--Jellyfin.Data/Entities/PermissionKind.cs40
-rw-r--r--Jellyfin.Data/Entities/Person.cs522
-rw-r--r--Jellyfin.Data/Entities/PersonRole.cs382
-rw-r--r--Jellyfin.Data/Entities/Photo.cs114
-rw-r--r--Jellyfin.Data/Entities/PhotoMetadata.cs118
-rw-r--r--Jellyfin.Data/Entities/Preference.cs208
-rw-r--r--Jellyfin.Data/Entities/PreferenceKind.cs27
-rw-r--r--Jellyfin.Data/Entities/ProviderMapping.cs240
-rw-r--r--Jellyfin.Data/Entities/Rating.cs356
-rw-r--r--Jellyfin.Data/Entities/RatingSource.cs441
-rw-r--r--Jellyfin.Data/Entities/Release.cs359
-rw-r--r--Jellyfin.Data/Entities/Season.cs212
-rw-r--r--Jellyfin.Data/Entities/SeasonMetadata.cs205
-rw-r--r--Jellyfin.Data/Entities/Series.cs316
-rw-r--r--Jellyfin.Data/Entities/SeriesMetadata.cs424
-rw-r--r--Jellyfin.Data/Entities/Track.cs211
-rw-r--r--Jellyfin.Data/Entities/TrackMetadata.cs118
-rw-r--r--Jellyfin.Data/Entities/User.cs459
-rw-r--r--Jellyfin.Data/Enums/ArtKind.cs30
-rw-r--r--Jellyfin.Data/Enums/MediaFileKind.cs30
-rw-r--r--Jellyfin.Data/Enums/PermissionKind.cs26
-rw-r--r--Jellyfin.Data/Enums/PersonRoleType.cs44
-rw-r--r--Jellyfin.Data/Enums/PreferenceKind.cs13
-rw-r--r--Jellyfin.Data/Enums/Weekday.cs34
-rw-r--r--Jellyfin.Data/ISavingChanges.cs2
-rw-r--r--Jellyfin.Data/Structs/.gitkeep0
-rw-r--r--Jellyfin.Server/Migrations/IMigrationRoutine.cs4
-rw-r--r--Jellyfin.Server/Migrations/MigrationRunner.cs21
-rw-r--r--Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs11
-rw-r--r--Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs17
-rw-r--r--Jellyfin.Server/Program.cs102
-rw-r--r--MediaBrowser.Api/Images/RemoteImageService.cs13
-rw-r--r--MediaBrowser.Api/ItemLookupService.cs14
-rw-r--r--MediaBrowser.Api/Playback/Hls/BaseHlsService.cs26
-rw-r--r--MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs197
-rw-r--r--MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs126
-rw-r--r--MediaBrowser.Api/UserService.cs38
-rw-r--r--MediaBrowser.Controller/Library/IUserManager.cs8
-rw-r--r--MediaBrowser.Model/Dlna/CodecProfile.cs4
-rw-r--r--MediaBrowser.Model/Dlna/ConditionProcessor.cs6
-rw-r--r--MediaBrowser.Model/Dlna/ContainerProfile.cs8
-rw-r--r--MediaBrowser.Model/Dlna/DeviceProfile.cs25
-rw-r--r--MediaBrowser.Model/Dlna/SubtitleProfile.cs5
-rw-r--r--MediaBrowser.Model/Dto/PublicUserDto.cs48
-rw-r--r--MediaBrowser.Model/Extensions/ListHelper.cs27
-rw-r--r--MediaBrowser.Model/Net/MimeTypes.cs117
-rw-r--r--MediaBrowser.Model/Notifications/NotificationOptions.cs14
-rw-r--r--MediaBrowser.sln31
-rw-r--r--tests/Jellyfin.Naming.Tests/Video/BaseVideoTest.cs13
-rw-r--r--tests/Jellyfin.Naming.Tests/Video/CleanDateTimeTests.cs1
-rw-r--r--tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs2
-rw-r--r--tests/Jellyfin.Naming.Tests/Video/Format3DTests.cs59
-rw-r--r--tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs5
-rw-r--r--tests/Jellyfin.Naming.Tests/Video/StackTests.cs6
-rw-r--r--tests/Jellyfin.Naming.Tests/Video/StubTests.cs10
-rw-r--r--tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs4
-rw-r--r--tests/Jellyfin.Naming.Tests/Video/VideoResolverTests.cs459
-rw-r--r--tests/MediaBrowser.Api.Tests/BrandingServiceTests.cs49
-rw-r--r--tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs120
-rw-r--r--tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.csproj33
-rw-r--r--tests/jellyfin-tests.ruleset22
121 files changed, 7425 insertions, 7281 deletions
diff --git a/.editorconfig b/.editorconfig
index dc9aaa3ed..b84e563ef 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -13,7 +13,7 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
-max_line_length = null
+max_line_length = off
# YAML indentation
[*.{yml,yaml}]
@@ -22,6 +22,7 @@ indent_size = 2
# XML indentation
[*.{csproj,xml}]
indent_size = 2
+
###############################
# .NET Coding Conventions #
###############################
@@ -51,11 +52,12 @@ dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:silent
-dotnet_prefer_inferred_tuple_names = true:suggestion
-dotnet_prefer_inferred_anonymous_type_member_names = true:suggestion
+dotnet_style_prefer_inferred_tuple_names = true:suggestion
+dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
+
###############################
# Naming Conventions #
###############################
@@ -67,7 +69,7 @@ dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.symbols = non
dotnet_naming_rule.non_private_static_fields_should_be_pascal_case.style = non_private_static_field_style
dotnet_naming_symbols.non_private_static_fields.applicable_kinds = field
-dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected internal, private protected
+dotnet_naming_symbols.non_private_static_fields.applicable_accessibilities = public, protected, internal, protected_internal, private_protected
dotnet_naming_symbols.non_private_static_fields.required_modifiers = static
dotnet_naming_style.non_private_static_field_style.capitalization = pascal_case
@@ -159,6 +161,7 @@ csharp_style_deconstructed_variable_declaration = true:suggestion
csharp_prefer_simple_default_expression = true:suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
+
###############################
# C# Formatting Rules #
###############################
@@ -189,9 +192,3 @@ csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
-###############################
-# VB Coding Conventions #
-###############################
-[*.vb]
-# Modifier preferences
-visual_basic_preferred_modifier_order = Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:suggestion
diff --git a/DvdLib/BigEndianBinaryReader.cs b/DvdLib/BigEndianBinaryReader.cs
index 473005b55..b3aad85ce 100644
--- a/DvdLib/BigEndianBinaryReader.cs
+++ b/DvdLib/BigEndianBinaryReader.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.Buffers.Binary;
using System.IO;
diff --git a/DvdLib/DvdLib.csproj b/DvdLib/DvdLib.csproj
index fd0cb5e25..64d041cb0 100644
--- a/DvdLib/DvdLib.csproj
+++ b/DvdLib/DvdLib.csproj
@@ -13,6 +13,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
</Project>
diff --git a/DvdLib/Ifo/Cell.cs b/DvdLib/Ifo/Cell.cs
index 268ab897e..2eab400f7 100644
--- a/DvdLib/Ifo/Cell.cs
+++ b/DvdLib/Ifo/Cell.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.IO;
namespace DvdLib.Ifo
diff --git a/DvdLib/Ifo/CellPlaybackInfo.cs b/DvdLib/Ifo/CellPlaybackInfo.cs
index e588e51ac..6e33a0ec5 100644
--- a/DvdLib/Ifo/CellPlaybackInfo.cs
+++ b/DvdLib/Ifo/CellPlaybackInfo.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.IO;
namespace DvdLib.Ifo
diff --git a/DvdLib/Ifo/CellPositionInfo.cs b/DvdLib/Ifo/CellPositionInfo.cs
index 2b973e083..216aa0f77 100644
--- a/DvdLib/Ifo/CellPositionInfo.cs
+++ b/DvdLib/Ifo/CellPositionInfo.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.IO;
namespace DvdLib.Ifo
diff --git a/DvdLib/Ifo/Chapter.cs b/DvdLib/Ifo/Chapter.cs
index bd3bd9704..1e69429f8 100644
--- a/DvdLib/Ifo/Chapter.cs
+++ b/DvdLib/Ifo/Chapter.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
namespace DvdLib.Ifo
{
public class Chapter
diff --git a/DvdLib/Ifo/Dvd.cs b/DvdLib/Ifo/Dvd.cs
index 5af58a2dc..ca20baa73 100644
--- a/DvdLib/Ifo/Dvd.cs
+++ b/DvdLib/Ifo/Dvd.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
using System.Collections.Generic;
using System.IO;
diff --git a/DvdLib/Ifo/DvdTime.cs b/DvdLib/Ifo/DvdTime.cs
index 3688089ec..978af90c2 100644
--- a/DvdLib/Ifo/DvdTime.cs
+++ b/DvdLib/Ifo/DvdTime.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
namespace DvdLib.Ifo
diff --git a/DvdLib/Ifo/Program.cs b/DvdLib/Ifo/Program.cs
index af08afa35..9f6251270 100644
--- a/DvdLib/Ifo/Program.cs
+++ b/DvdLib/Ifo/Program.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.Collections.Generic;
namespace DvdLib.Ifo
diff --git a/DvdLib/Ifo/ProgramChain.cs b/DvdLib/Ifo/ProgramChain.cs
index 7b003005b..4860360af 100644
--- a/DvdLib/Ifo/ProgramChain.cs
+++ b/DvdLib/Ifo/ProgramChain.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.Collections.Generic;
using System.IO;
using System.Linq;
diff --git a/DvdLib/Ifo/Title.cs b/DvdLib/Ifo/Title.cs
index 335e92992..abf806d2c 100644
--- a/DvdLib/Ifo/Title.cs
+++ b/DvdLib/Ifo/Title.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System.Collections.Generic;
using System.IO;
diff --git a/DvdLib/Ifo/UserOperation.cs b/DvdLib/Ifo/UserOperation.cs
index 757a5a05d..5d111ebc0 100644
--- a/DvdLib/Ifo/UserOperation.cs
+++ b/DvdLib/Ifo/UserOperation.cs
@@ -1,3 +1,5 @@
+#pragma warning disable CS1591
+
using System;
namespace DvdLib.Ifo
diff --git a/Emby.Naming/Video/VideoResolver.cs b/Emby.Naming/Video/VideoResolver.cs
index 0b75a8cce..b4aee614b 100644
--- a/Emby.Naming/Video/VideoResolver.cs
+++ b/Emby.Naming/Video/VideoResolver.cs
@@ -89,14 +89,14 @@ namespace Emby.Naming.Video
if (parseName)
{
var cleanDateTimeResult = CleanDateTime(name);
+ name = cleanDateTimeResult.Name;
+ year = cleanDateTimeResult.Year;
if (extraResult.ExtraType == null
- && TryCleanString(cleanDateTimeResult.Name, out ReadOnlySpan<char> newName))
+ && TryCleanString(name, out ReadOnlySpan<char> newName))
{
name = newName.ToString();
}
-
- year = cleanDateTimeResult.Year;
}
return new VideoFileInfo
diff --git a/Emby.Server.Implementations/ConfigurationOptions.cs b/Emby.Server.Implementations/ConfigurationOptions.cs
index db7c35a7c..dea9b6682 100644
--- a/Emby.Server.Implementations/ConfigurationOptions.cs
+++ b/Emby.Server.Implementations/ConfigurationOptions.cs
@@ -1,7 +1,6 @@
using System.Collections.Generic;
using Emby.Server.Implementations.HttpServer;
using Emby.Server.Implementations.Updates;
-using MediaBrowser.Providers.Music;
using static MediaBrowser.Controller.Extensions.ConfigurationExtensions;
namespace Emby.Server.Implementations
diff --git a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
index 22955850a..6ee6230fc 100644
--- a/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
+++ b/Emby.Server.Implementations/Data/SqliteUserDataRepository.cs
@@ -375,5 +375,15 @@ namespace Emby.Server.Implementations.Data
return userData;
}
+
+ /// <inheritdoc/>
+ /// <remarks>
+ /// There is nothing to dispose here since <see cref="BaseSqliteRepository.WriteLock"/> and
+ /// <see cref="BaseSqliteRepository.WriteConnection"/> are managed by <see cref="SqliteItemRepository"/>.
+ /// See <see cref="Initialize(IUserManager, SemaphoreSlim, SQLiteDatabaseConnection)"/>.
+ /// </remarks>
+ protected override void Dispose(bool dispose)
+ {
+ }
}
}
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs
index d63bc6bda..b8feb5535 100644
--- a/Emby.Server.Implementations/Library/UserManager.cs
+++ b/Emby.Server.Implementations/Library/UserManager.cs
@@ -608,6 +608,31 @@ namespace Emby.Server.Implementations.Library
return dto;
}
+ public PublicUserDto GetPublicUserDto(User user, string remoteEndPoint = null)
+ {
+ if (user == null)
+ {
+ throw new ArgumentNullException(nameof(user));
+ }
+
+ IAuthenticationProvider authenticationProvider = GetAuthenticationProvider(user);
+ bool hasConfiguredPassword = authenticationProvider.HasPassword(user);
+ bool hasConfiguredEasyPassword = !string.IsNullOrEmpty(authenticationProvider.GetEasyPasswordHash(user));
+
+ bool hasPassword = user.Configuration.EnableLocalPassword &&
+ !string.IsNullOrEmpty(remoteEndPoint) &&
+ _networkManager.IsInLocalNetwork(remoteEndPoint) ? hasConfiguredEasyPassword : hasConfiguredPassword;
+
+ PublicUserDto dto = new PublicUserDto
+ {
+ Name = user.Name,
+ HasPassword = hasPassword,
+ HasConfiguredPassword = hasConfiguredPassword,
+ };
+
+ return dto;
+ }
+
public UserDto GetOfflineUserDto(User user)
{
var dto = GetUserDto(user);
diff --git a/Emby.Server.Implementations/Localization/Core/af.json b/Emby.Server.Implementations/Localization/Core/af.json
index 1363eaf85..20447347b 100644
--- a/Emby.Server.Implementations/Localization/Core/af.json
+++ b/Emby.Server.Implementations/Localization/Core/af.json
@@ -4,7 +4,7 @@
"Folders": "Fouers",
"Favorites": "Gunstelinge",
"HeaderFavoriteShows": "Gunsteling Vertonings",
- "ValueSpecialEpisodeName": "Spesiaal - {0}",
+ "ValueSpecialEpisodeName": "Spesiale - {0}",
"HeaderAlbumArtists": "Album Kunstenaars",
"Books": "Boeke",
"HeaderNextUp": "Volgende",
diff --git a/Emby.Server.Implementations/Localization/Core/es-MX.json b/Emby.Server.Implementations/Localization/Core/es-MX.json
index e0bbe90b3..d93920f43 100644
--- a/Emby.Server.Implementations/Localization/Core/es-MX.json
+++ b/Emby.Server.Implementations/Localization/Core/es-MX.json
@@ -11,7 +11,7 @@
"Collections": "Colecciones",
"DeviceOfflineWithName": "{0} se ha desconectado",
"DeviceOnlineWithName": "{0} está conectado",
- "FailedLoginAttemptWithUserName": "Intento fallido de inicio de sesión de {0}",
+ "FailedLoginAttemptWithUserName": "Intento fallido de inicio de sesión desde {0}",
"Favorites": "Favoritos",
"Folders": "Carpetas",
"Genres": "Géneros",
diff --git a/Emby.Server.Implementations/Localization/Core/es.json b/Emby.Server.Implementations/Localization/Core/es.json
index de1baada8..e7bd3959b 100644
--- a/Emby.Server.Implementations/Localization/Core/es.json
+++ b/Emby.Server.Implementations/Localization/Core/es.json
@@ -71,7 +71,7 @@
"ScheduledTaskFailedWithName": "{0} falló",
"ScheduledTaskStartedWithName": "{0} iniciada",
"ServerNameNeedsToBeRestarted": "{0} necesita ser reiniciado",
- "Shows": "Series",
+ "Shows": "Mostrar",
"Songs": "Canciones",
"StartupEmbyServerIsLoading": "Jellyfin Server se está cargando. Vuelve a intentarlo en breve.",
"SubtitleDownloadFailureForItem": "Error al descargar subtítulos para {0}",
diff --git a/Emby.Server.Implementations/Localization/Core/fi.json b/Emby.Server.Implementations/Localization/Core/fi.json
index b39adefe7..f8d6e0e09 100644
--- a/Emby.Server.Implementations/Localization/Core/fi.json
+++ b/Emby.Server.Implementations/Localization/Core/fi.json
@@ -1,5 +1,5 @@
{
- "HeaderLiveTV": "Suorat lähetykset",
+ "HeaderLiveTV": "Live-TV",
"NewVersionIsAvailable": "Uusi versio Jellyfin palvelimesta on ladattavissa.",
"NameSeasonUnknown": "Tuntematon Kausi",
"NameSeasonNumber": "Kausi {0}",
@@ -12,7 +12,7 @@
"MessageNamedServerConfigurationUpdatedWithValue": "Palvelimen asetusryhmä {0} on päivitetty",
"MessageApplicationUpdatedTo": "Jellyfin palvelin on päivitetty versioon {0}",
"MessageApplicationUpdated": "Jellyfin palvelin on päivitetty",
- "Latest": "Viimeisin",
+ "Latest": "Uusimmat",
"LabelRunningTimeValue": "Toiston kesto: {0}",
"LabelIpAddressValue": "IP-osoite: {0}",
"ItemRemovedWithName": "{0} poistettiin kirjastosta",
@@ -41,7 +41,7 @@
"CameraImageUploadedFrom": "Uusi kamerakuva on ladattu {0}",
"Books": "Kirjat",
"AuthenticationSucceededWithUserName": "{0} todennus onnistui",
- "Artists": "Esiintyjät",
+ "Artists": "Artistit",
"Application": "Sovellus",
"AppDeviceValues": "Sovellus: {0}, Laite: {1}",
"Albums": "Albumit",
@@ -67,21 +67,21 @@
"UserDownloadingItemWithValues": "{0} lataa {1}",
"UserDeletedWithName": "Käyttäjä {0} poistettu",
"UserCreatedWithName": "Käyttäjä {0} luotu",
- "TvShows": "TV-Ohjelmat",
+ "TvShows": "TV-sarjat",
"Sync": "Synkronoi",
- "SubtitleDownloadFailureFromForItem": "Tekstityksen lataaminen epäonnistui {0} - {1}",
+ "SubtitleDownloadFailureFromForItem": "Tekstitysten lataus ({0} -> {1}) epäonnistui //this string would have to be generated for each provider and movie because of finnish cases, sorry",
"StartupEmbyServerIsLoading": "Jellyfin palvelin latautuu. Kokeile hetken kuluttua uudelleen.",
"Songs": "Kappaleet",
- "Shows": "Ohjelmat",
- "ServerNameNeedsToBeRestarted": "{0} vaatii uudelleenkäynnistyksen",
+ "Shows": "Sarjat",
+ "ServerNameNeedsToBeRestarted": "{0} täytyy käynnistää uudelleen",
"ProviderValue": "Tarjoaja: {0}",
"Plugin": "Liitännäinen",
"NotificationOptionVideoPlaybackStopped": "Videon toisto pysäytetty",
- "NotificationOptionVideoPlayback": "Videon toisto aloitettu",
- "NotificationOptionUserLockedOut": "Käyttäjä lukittu",
+ "NotificationOptionVideoPlayback": "Videota toistetaan",
+ "NotificationOptionUserLockedOut": "Käyttäjä kirjautui ulos",
"NotificationOptionTaskFailed": "Ajastettu tehtävä epäonnistui",
- "NotificationOptionServerRestartRequired": "Palvelimen uudelleenkäynnistys vaaditaan",
- "NotificationOptionPluginUpdateInstalled": "Lisäosan päivitys asennettu",
+ "NotificationOptionServerRestartRequired": "Palvelin pitää käynnistää uudelleen",
+ "NotificationOptionPluginUpdateInstalled": "Liitännäinen päivitetty",
"NotificationOptionPluginUninstalled": "Liitännäinen poistettu",
"NotificationOptionPluginInstalled": "Liitännäinen asennettu",
"NotificationOptionPluginError": "Ongelma liitännäisessä",
@@ -90,8 +90,8 @@
"NotificationOptionCameraImageUploaded": "Kameran kuva ladattu",
"NotificationOptionAudioPlaybackStopped": "Äänen toisto lopetettu",
"NotificationOptionAudioPlayback": "Toistetaan ääntä",
- "NotificationOptionApplicationUpdateInstalled": "Uusi sovellusversio asennettu",
- "NotificationOptionApplicationUpdateAvailable": "Sovelluksesta on uusi versio saatavilla",
+ "NotificationOptionApplicationUpdateInstalled": "Sovelluspäivitys asennettu",
+ "NotificationOptionApplicationUpdateAvailable": "Ohjelmistopäivitys saatavilla",
"TasksMaintenanceCategory": "Ylläpito",
"TaskDownloadMissingSubtitlesDescription": "Etsii puuttuvia tekstityksiä videon metadatatietojen pohjalta.",
"TaskDownloadMissingSubtitles": "Lataa puuttuvat tekstitykset",
diff --git a/Emby.Server.Implementations/Localization/Core/fr-CA.json b/Emby.Server.Implementations/Localization/Core/fr-CA.json
index 2c9dae6a1..c2349ba5b 100644
--- a/Emby.Server.Implementations/Localization/Core/fr-CA.json
+++ b/Emby.Server.Implementations/Localization/Core/fr-CA.json
@@ -94,5 +94,23 @@
"ValueSpecialEpisodeName": "Spécial - {0}",
"VersionNumber": "Version {0}",
"TasksLibraryCategory": "Bibliothèque",
- "TasksMaintenanceCategory": "Entretien"
+ "TasksMaintenanceCategory": "Entretien",
+ "TaskDownloadMissingSubtitlesDescription": "Recherche l'internet pour des sous-titres manquants à base de métadonnées configurées.",
+ "TaskDownloadMissingSubtitles": "Télécharger des sous-titres manquants",
+ "TaskRefreshChannelsDescription": "Rafraîchit des informations des chaines d'internet.",
+ "TaskRefreshChannels": "Rafraîchir des chaines",
+ "TaskCleanTranscodeDescription": "Retirer des fichiers de transcodage de plus qu'un jour.",
+ "TaskCleanTranscode": "Nettoyer le directoire de transcodage",
+ "TaskUpdatePluginsDescription": "Télécharger et installer des mises à jours des plugins qui sont configurés m.à.j. automisés.",
+ "TaskUpdatePlugins": "Mise à jour des plugins",
+ "TaskRefreshPeopleDescription": "Met à jour les métadonnées pour les acteurs et réalisateurs dans votre bibliothèque.",
+ "TaskRefreshPeople": "Rafraîchir les acteurs",
+ "TaskCleanLogsDescription": "Retire les données qui ont plus que {0} jours.",
+ "TaskCleanLogs": "Nettoyer les données de directoire",
+ "TaskRefreshLibraryDescription": "Analyse votre bibliothèque média pour des nouveaux fichiers et rafraîchit les métadonnées.",
+ "TaskRefreshChapterImages": "Extraire des images du chapitre",
+ "TaskRefreshChapterImagesDescription": "Créer des vignettes pour des vidéos qui ont des chapitres",
+ "TaskRefreshLibrary": "Analyser la bibliothèque de média",
+ "TaskCleanCache": "Nettoyer le cache de directoire",
+ "TasksApplicationCategory": "Application"
}
diff --git a/Emby.Server.Implementations/Localization/Core/gsw.json b/Emby.Server.Implementations/Localization/Core/gsw.json
index 9611e33f5..8780a884b 100644
--- a/Emby.Server.Implementations/Localization/Core/gsw.json
+++ b/Emby.Server.Implementations/Localization/Core/gsw.json
@@ -1,41 +1,41 @@
{
- "Albums": "Albom",
- "AppDeviceValues": "App: {0}, Grät: {1}",
- "Application": "Aawändig",
- "Artists": "Könstler",
- "AuthenticationSucceededWithUserName": "{0} het sech aagmäudet",
- "Books": "Büecher",
- "CameraImageUploadedFrom": "Es nöis Foti esch ufeglade worde vo {0}",
- "Channels": "Kanäu",
- "ChapterNameValue": "Kapitu {0}",
- "Collections": "Sammlige",
- "DeviceOfflineWithName": "{0} esch offline gange",
- "DeviceOnlineWithName": "{0} esch online cho",
- "FailedLoginAttemptWithUserName": "Fäugschlagne Aamäudeversuech vo {0}",
- "Favorites": "Favorite",
+ "Albums": "Alben",
+ "AppDeviceValues": "App: {0}, Gerät: {1}",
+ "Application": "Anwendung",
+ "Artists": "Künstler",
+ "AuthenticationSucceededWithUserName": "{0} hat sich angemeldet",
+ "Books": "Bücher",
+ "CameraImageUploadedFrom": "Ein neues Foto wurde von {0} hochgeladen",
+ "Channels": "Kanäle",
+ "ChapterNameValue": "Kapitel {0}",
+ "Collections": "Sammlungen",
+ "DeviceOfflineWithName": "{0} wurde getrennt",
+ "DeviceOnlineWithName": "{0} ist verbunden",
+ "FailedLoginAttemptWithUserName": "Fehlgeschlagener Anmeldeversuch von {0}",
+ "Favorites": "Favoriten",
"Folders": "Ordner",
"Genres": "Genres",
- "HeaderAlbumArtists": "Albom-Könstler",
+ "HeaderAlbumArtists": "Album-Künstler",
"HeaderCameraUploads": "Kamera-Uploads",
- "HeaderContinueWatching": "Wiiterluege",
- "HeaderFavoriteAlbums": "Lieblingsalbe",
- "HeaderFavoriteArtists": "Lieblings-Interprete",
- "HeaderFavoriteEpisodes": "Lieblingsepisode",
- "HeaderFavoriteShows": "Lieblingsserie",
+ "HeaderContinueWatching": "weiter schauen",
+ "HeaderFavoriteAlbums": "Lieblingsalben",
+ "HeaderFavoriteArtists": "Lieblings-Künstler",
+ "HeaderFavoriteEpisodes": "Lieblingsepisoden",
+ "HeaderFavoriteShows": "Lieblingsserien",
"HeaderFavoriteSongs": "Lieblingslieder",
- "HeaderLiveTV": "Live-Färnseh",
- "HeaderNextUp": "Als nächts",
- "HeaderRecordingGroups": "Ufnahmegruppe",
- "HomeVideos": "Heimfilmli",
- "Inherit": "Hinzuefüege",
- "ItemAddedWithName": "{0} esch de Bibliothek dezuegfüegt worde",
- "ItemRemovedWithName": "{0} esch vo de Bibliothek entfärnt worde",
- "LabelIpAddressValue": "IP-Adrässe: {0}",
- "LabelRunningTimeValue": "Loufziit: {0}",
- "Latest": "Nöischti",
- "MessageApplicationUpdated": "Jellyfin Server esch aktualisiert worde",
- "MessageApplicationUpdatedTo": "Jellyfin Server esch of Version {0} aktualisiert worde",
- "MessageNamedServerConfigurationUpdatedWithValue": "De Serveriistöuigsberiich {0} esch aktualisiert worde",
+ "HeaderLiveTV": "Live-Fernseh",
+ "HeaderNextUp": "Als Nächstes",
+ "HeaderRecordingGroups": "Aufnahme-Gruppen",
+ "HomeVideos": "Heimvideos",
+ "Inherit": "Vererben",
+ "ItemAddedWithName": "{0} wurde der Bibliothek hinzugefügt",
+ "ItemRemovedWithName": "{0} wurde aus der Bibliothek entfernt",
+ "LabelIpAddressValue": "IP-Adresse: {0}",
+ "LabelRunningTimeValue": "Laufzeit: {0}",
+ "Latest": "Neueste",
+ "MessageApplicationUpdated": "Jellyfin-Server wurde aktualisiert",
+ "MessageApplicationUpdatedTo": "Jellyfin-Server wurde auf Version {0} aktualisiert",
+ "MessageNamedServerConfigurationUpdatedWithValue": "Der Server-Einstellungsbereich {0} wurde aktualisiert",
"MessageServerConfigurationUpdated": "Serveriistöuige send aktualisiert worde",
"MixedContent": "Gmeschti Inhäut",
"Movies": "Film",
@@ -50,7 +50,7 @@
"NotificationOptionAudioPlayback": "Audiowedergab gstartet",
"NotificationOptionAudioPlaybackStopped": "Audiwedergab gstoppt",
"NotificationOptionCameraImageUploaded": "Foti ueglade",
- "NotificationOptionInstallationFailed": "Installationsfäuer",
+ "NotificationOptionInstallationFailed": "Installationsfehler",
"NotificationOptionNewLibraryContent": "Nöie Inhaut hinzuegfüegt",
"NotificationOptionPluginError": "Plugin-Fäuer",
"NotificationOptionPluginInstalled": "Plugin installiert",
@@ -92,5 +92,27 @@
"UserStoppedPlayingItemWithValues": "{0} het d'Wedergab vo {1} of {2} gstoppt",
"ValueHasBeenAddedToLibrary": "{0} esch dinnere Biblithek hinzuegfüegt worde",
"ValueSpecialEpisodeName": "Extra - {0}",
- "VersionNumber": "Version {0}"
+ "VersionNumber": "Version {0}",
+ "TaskCleanLogs": "Lösche Log Pfad",
+ "TaskRefreshLibraryDescription": "Scanne alle Bibliotheken für hinzugefügte Datein und erneuere Metadaten.",
+ "TaskRefreshLibrary": "Scanne alle Bibliotheken",
+ "TaskRefreshChapterImagesDescription": "Kreiert Vorschaubilder für Videos welche Kapitel haben.",
+ "TaskRefreshChapterImages": "Extrahiere Kapitel-Bilder",
+ "TaskCleanCacheDescription": "Löscht Zwischenspeicherdatein die nicht länger von System gebraucht werden.",
+ "TaskCleanCache": "Leere Cache Pfad",
+ "TasksChannelsCategory": "Internet Kanäle",
+ "TasksApplicationCategory": "Applikation",
+ "TasksLibraryCategory": "Bibliothek",
+ "TasksMaintenanceCategory": "Verwaltung",
+ "TaskDownloadMissingSubtitlesDescription": "Durchsucht das Internet nach fehlenden Untertiteln, basierend auf den Metadaten Einstellungen.",
+ "TaskDownloadMissingSubtitles": "Lade fehlende Untertitel herunter",
+ "TaskRefreshChannelsDescription": "Aktualisiert Internet Kanal Informationen.",
+ "TaskRefreshChannels": "Aktualisiere Kanäle",
+ "TaskCleanTranscodeDescription": "Löscht Transkodierdateien welche älter als ein Tag sind.",
+ "TaskCleanTranscode": "Räume Transcodier Verzeichnis auf",
+ "TaskUpdatePluginsDescription": "Lädt Aktualisierungen für Erweiterungen herunter und installiert diese, für welche automatische Aktualisierungen konfiguriert sind.",
+ "TaskUpdatePlugins": "Aktualisiere Erweiterungen",
+ "TaskRefreshPeopleDescription": "Aktualisiert Metadaten für Schausteller und Regisseure in deiner Bibliothek.",
+ "TaskRefreshPeople": "Aktualisiere Schauspieler",
+ "TaskCleanLogsDescription": "Löscht Log Dateien die älter als {0} Tage sind."
}
diff --git a/Emby.Server.Implementations/Localization/Core/he.json b/Emby.Server.Implementations/Localization/Core/he.json
index 266291362..8abe31d2a 100644
--- a/Emby.Server.Implementations/Localization/Core/he.json
+++ b/Emby.Server.Implementations/Localization/Core/he.json
@@ -62,7 +62,7 @@
"NotificationOptionVideoPlayback": "Video playback started",
"NotificationOptionVideoPlaybackStopped": "Video playback stopped",
"Photos": "תמונות",
- "Playlists": "רשימות ניגון",
+ "Playlists": "רשימות הפעלה",
"Plugin": "Plugin",
"PluginInstalledWithName": "{0} was installed",
"PluginUninstalledWithName": "{0} was uninstalled",
diff --git a/Emby.Server.Implementations/Localization/Core/hr.json b/Emby.Server.Implementations/Localization/Core/hr.json
index 6947178d7..c169a35e7 100644
--- a/Emby.Server.Implementations/Localization/Core/hr.json
+++ b/Emby.Server.Implementations/Localization/Core/hr.json
@@ -30,7 +30,7 @@
"Inherit": "Naslijedi",
"ItemAddedWithName": "{0} je dodano u biblioteku",
"ItemRemovedWithName": "{0} je uklonjen iz biblioteke",
- "LabelIpAddressValue": "Ip adresa: {0}",
+ "LabelIpAddressValue": "IP adresa: {0}",
"LabelRunningTimeValue": "Vrijeme rada: {0}",
"Latest": "Najnovije",
"MessageApplicationUpdated": "Jellyfin Server je ažuriran",
@@ -92,5 +92,13 @@
"UserStoppedPlayingItemWithValues": "{0} je zaustavio {1}",
"ValueHasBeenAddedToLibrary": "{0} has been added to your media library",
"ValueSpecialEpisodeName": "Specijal - {0}",
- "VersionNumber": "Verzija {0}"
+ "VersionNumber": "Verzija {0}",
+ "TaskRefreshLibraryDescription": "Skenira vašu medijsku knjižnicu sa novim datotekama i osvježuje metapodatke.",
+ "TaskRefreshLibrary": "Skeniraj medijsku knjižnicu",
+ "TaskRefreshChapterImagesDescription": "Stvara sličice za videozapise koji imaju poglavlja.",
+ "TaskRefreshChapterImages": "Raspakiraj slike poglavlja",
+ "TaskCleanCacheDescription": "Briše priručne datoteke nepotrebne za sistem.",
+ "TaskCleanCache": "Očisti priručnu memoriju",
+ "TasksApplicationCategory": "Aplikacija",
+ "TasksMaintenanceCategory": "Održavanje"
}
diff --git a/Emby.Server.Implementations/Localization/Core/it.json b/Emby.Server.Implementations/Localization/Core/it.json
index 0758bbe9c..7f5a56e86 100644
--- a/Emby.Server.Implementations/Localization/Core/it.json
+++ b/Emby.Server.Implementations/Localization/Core/it.json
@@ -5,7 +5,7 @@
"Artists": "Artisti",
"AuthenticationSucceededWithUserName": "{0} autenticato con successo",
"Books": "Libri",
- "CameraImageUploadedFrom": "È stata caricata una nuova immagine della fotocamera dal device {0}",
+ "CameraImageUploadedFrom": "È stata caricata una nuova fotografia da {0}",
"Channels": "Canali",
"ChapterNameValue": "Capitolo {0}",
"Collections": "Collezioni",
diff --git a/Emby.Server.Implementations/Localization/Core/mk.json b/Emby.Server.Implementations/Localization/Core/mk.json
index 8df137302..bbdf99aba 100644
--- a/Emby.Server.Implementations/Localization/Core/mk.json
+++ b/Emby.Server.Implementations/Localization/Core/mk.json
@@ -91,5 +91,12 @@
"Songs": "Песни",
"Shows": "Серии",
"ServerNameNeedsToBeRestarted": "{0} треба да се рестартира",
- "ScheduledTaskStartedWithName": "{0} започна"
+ "ScheduledTaskStartedWithName": "{0} започна",
+ "TaskRefreshChapterImages": "Извези Слики од Поглавје",
+ "TaskCleanCacheDescription": "Ги брише кешираните фајлови што не се повеќе потребни од системот.",
+ "TaskCleanCache": "Исчисти Го Кешот",
+ "TasksChannelsCategory": "Интернет Канали",
+ "TasksApplicationCategory": "Апликација",
+ "TasksLibraryCategory": "Библиотека",
+ "TasksMaintenanceCategory": "Одржување"
}
diff --git a/Emby.Server.Implementations/Localization/Core/nl.json b/Emby.Server.Implementations/Localization/Core/nl.json
index baa12e98e..41c74d54d 100644
--- a/Emby.Server.Implementations/Localization/Core/nl.json
+++ b/Emby.Server.Implementations/Localization/Core/nl.json
@@ -5,7 +5,7 @@
"Artists": "Artiesten",
"AuthenticationSucceededWithUserName": "{0} is succesvol geverifieerd",
"Books": "Boeken",
- "CameraImageUploadedFrom": "Er is een nieuwe afbeelding toegevoegd via {0}",
+ "CameraImageUploadedFrom": "Er is een nieuwe camera afbeelding toegevoegd via {0}",
"Channels": "Kanalen",
"ChapterNameValue": "Hoofdstuk {0}",
"Collections": "Verzamelingen",
@@ -26,7 +26,7 @@
"HeaderLiveTV": "Live TV",
"HeaderNextUp": "Volgende",
"HeaderRecordingGroups": "Opnamegroepen",
- "HomeVideos": "Start video's",
+ "HomeVideos": "Home video's",
"Inherit": "Overerven",
"ItemAddedWithName": "{0} is toegevoegd aan de bibliotheek",
"ItemRemovedWithName": "{0} is verwijderd uit de bibliotheek",
@@ -50,7 +50,7 @@
"NotificationOptionAudioPlayback": "Muziek gestart",
"NotificationOptionAudioPlaybackStopped": "Muziek gestopt",
"NotificationOptionCameraImageUploaded": "Camera-afbeelding geüpload",
- "NotificationOptionInstallationFailed": "Installatie mislukking",
+ "NotificationOptionInstallationFailed": "Installatie mislukt",
"NotificationOptionNewLibraryContent": "Nieuwe content toegevoegd",
"NotificationOptionPluginError": "Plug-in fout",
"NotificationOptionPluginInstalled": "Plug-in geïnstalleerd",
diff --git a/Emby.Server.Implementations/Localization/Core/sl-SI.json b/Emby.Server.Implementations/Localization/Core/sl-SI.json
index b60dd33bd..60c58d472 100644
--- a/Emby.Server.Implementations/Localization/Core/sl-SI.json
+++ b/Emby.Server.Implementations/Localization/Core/sl-SI.json
@@ -92,5 +92,26 @@
"UserStoppedPlayingItemWithValues": "{0} je nehal predvajati {1} na {2}",
"ValueHasBeenAddedToLibrary": "{0} je bil dodan vaši knjižnici",
"ValueSpecialEpisodeName": "Poseben - {0}",
- "VersionNumber": "Različica {0}"
+ "VersionNumber": "Različica {0}",
+ "TaskDownloadMissingSubtitles": "Prenesi manjkajoče podnapise",
+ "TaskRefreshChannelsDescription": "Osveži podatke spletnih kanalov.",
+ "TaskRefreshChannels": "Osveži kanale",
+ "TaskCleanTranscodeDescription": "Izbriše več kot dan stare datoteke prekodiranja.",
+ "TaskCleanTranscode": "Počisti mapo prekodiranja",
+ "TaskUpdatePluginsDescription": "Prenese in namesti posodobitve za dodatke, ki imajo omogočene samodejne posodobitve.",
+ "TaskUpdatePlugins": "Posodobi dodatke",
+ "TaskRefreshPeopleDescription": "Osveži metapodatke za igralce in režiserje v vaši knjižnici.",
+ "TaskRefreshPeople": "Osveži osebe",
+ "TaskCleanLogsDescription": "Izbriše dnevniške datoteke starejše od {0} dni.",
+ "TaskCleanLogs": "Počisti mapo dnevnika",
+ "TaskRefreshLibraryDescription": "Preišče vašo knjižnico za nove datoteke in osveži metapodatke.",
+ "TaskRefreshLibrary": "Preišči knjižnico predstavnosti",
+ "TaskRefreshChapterImagesDescription": "Ustvari sličice za poglavja videoposnetkov.",
+ "TaskRefreshChapterImages": "Izvleči slike poglavij",
+ "TaskCleanCacheDescription": "Izbriše predpomnjene datoteke, ki niso več potrebne.",
+ "TaskCleanCache": "Počisti mapo predpomnilnika",
+ "TasksChannelsCategory": "Spletni kanali",
+ "TasksApplicationCategory": "Aplikacija",
+ "TasksLibraryCategory": "Knjižnica",
+ "TasksMaintenanceCategory": "Vzdrževanje"
}
diff --git a/Emby.Server.Implementations/Localization/Core/sv.json b/Emby.Server.Implementations/Localization/Core/sv.json
index b7c50394a..c8662b2ca 100644
--- a/Emby.Server.Implementations/Localization/Core/sv.json
+++ b/Emby.Server.Implementations/Localization/Core/sv.json
@@ -9,7 +9,7 @@
"Channels": "Kanaler",
"ChapterNameValue": "Kapitel {0}",
"Collections": "Samlingar",
- "DeviceOfflineWithName": "{0} har tappat anslutningen",
+ "DeviceOfflineWithName": "{0} har kopplat från",
"DeviceOnlineWithName": "{0} är ansluten",
"FailedLoginAttemptWithUserName": "Misslyckat inloggningsförsök från {0}",
"Favorites": "Favoriter",
@@ -50,7 +50,7 @@
"NotificationOptionAudioPlayback": "Ljuduppspelning har påbörjats",
"NotificationOptionAudioPlaybackStopped": "Ljuduppspelning stoppades",
"NotificationOptionCameraImageUploaded": "Kamerabild har laddats upp",
- "NotificationOptionInstallationFailed": "Fel vid installation",
+ "NotificationOptionInstallationFailed": "Installationen misslyckades",
"NotificationOptionNewLibraryContent": "Nytt innehåll har lagts till",
"NotificationOptionPluginError": "Fel uppstod med tillägget",
"NotificationOptionPluginInstalled": "Tillägg har installerats",
@@ -113,5 +113,6 @@
"TasksChannelsCategory": "Internetkanaler",
"TasksApplicationCategory": "Applikation",
"TasksLibraryCategory": "Bibliotek",
- "TasksMaintenanceCategory": "Underhåll"
+ "TasksMaintenanceCategory": "Underhåll",
+ "TaskRefreshPeople": "Uppdatera Personer"
}
diff --git a/Emby.Server.Implementations/Localization/Core/uk.json b/Emby.Server.Implementations/Localization/Core/uk.json
new file mode 100644
index 000000000..b2e0b66fe
--- /dev/null
+++ b/Emby.Server.Implementations/Localization/Core/uk.json
@@ -0,0 +1,36 @@
+{
+ "MusicVideos": "Музичні відео",
+ "Music": "Музика",
+ "Movies": "Фільми",
+ "MessageApplicationUpdatedTo": "Jellyfin Server був оновлений до версії {0}",
+ "MessageApplicationUpdated": "Jellyfin Server був оновлений",
+ "Latest": "Останні",
+ "LabelIpAddressValue": "IP-адреси: {0}",
+ "ItemRemovedWithName": "{0} видалено з бібліотеки",
+ "ItemAddedWithName": "{0} додано до бібліотеки",
+ "HeaderNextUp": "Наступний",
+ "HeaderLiveTV": "Ефірне ТБ",
+ "HeaderFavoriteSongs": "Улюблені пісні",
+ "HeaderFavoriteShows": "Улюблені шоу",
+ "HeaderFavoriteEpisodes": "Улюблені серії",
+ "HeaderFavoriteArtists": "Улюблені виконавці",
+ "HeaderFavoriteAlbums": "Улюблені альбоми",
+ "HeaderContinueWatching": "Продовжити перегляд",
+ "HeaderCameraUploads": "Завантажено з камери",
+ "HeaderAlbumArtists": "Виконавці альбомів",
+ "Genres": "Жанри",
+ "Folders": "Директорії",
+ "Favorites": "Улюблені",
+ "DeviceOnlineWithName": "{0} під'єднано",
+ "DeviceOfflineWithName": "{0} від'єднано",
+ "Collections": "Колекції",
+ "ChapterNameValue": "Глава {0}",
+ "Channels": "Канали",
+ "CameraImageUploadedFrom": "Нова фотографія завантажена з {0}",
+ "Books": "Книги",
+ "AuthenticationSucceededWithUserName": "{0} успішно авторизовані",
+ "Artists": "Виконавці",
+ "Application": "Додаток",
+ "AppDeviceValues": "Додаток: {0}, Пристрій: {1}",
+ "Albums": "Альбоми"
+}
diff --git a/Emby.Server.Implementations/Localization/Core/zh-HK.json b/Emby.Server.Implementations/Localization/Core/zh-HK.json
index 224748e61..a67a67582 100644
--- a/Emby.Server.Implementations/Localization/Core/zh-HK.json
+++ b/Emby.Server.Implementations/Localization/Core/zh-HK.json
@@ -1,6 +1,6 @@
{
"Albums": "專輯",
- "AppDeviceValues": "軟體: {0}, 設備: {1}",
+ "AppDeviceValues": "軟件: {0}, 設備: {1}",
"Application": "應用程式",
"Artists": "藝人",
"AuthenticationSucceededWithUserName": "{0} 授權成功",
@@ -92,5 +92,8 @@
"UserStoppedPlayingItemWithValues": "{0} 已在 {2} 上停止播放 {1}",
"ValueHasBeenAddedToLibrary": "{0} 已添加到你的媒體庫",
"ValueSpecialEpisodeName": "特典 - {0}",
- "VersionNumber": "版本{0}"
+ "VersionNumber": "版本{0}",
+ "TaskDownloadMissingSubtitles": "下載遺失的字幕",
+ "TaskUpdatePlugins": "更新插件",
+ "TasksApplicationCategory": "應用程式"
}
diff --git a/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs b/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs
index 9c638f439..ee5131c1f 100644
--- a/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs
+++ b/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs
@@ -63,6 +63,9 @@ namespace Emby.Server.Implementations.SocketSharp
if (!IPAddress.TryParse(GetHeader(CustomHeaderNames.XRealIP), out ip))
{
ip = Request.HttpContext.Connection.RemoteIpAddress;
+
+ // Default to the loopback address if no RemoteIpAddress is specified (i.e. during integration tests)
+ ip ??= IPAddress.Loopback;
}
}
@@ -90,7 +93,10 @@ namespace Emby.Server.Implementations.SocketSharp
public IQueryCollection QueryString => Request.Query;
- public bool IsLocal => Request.HttpContext.Connection.LocalIpAddress.Equals(Request.HttpContext.Connection.RemoteIpAddress);
+ public bool IsLocal =>
+ (Request.HttpContext.Connection.LocalIpAddress == null
+ && Request.HttpContext.Connection.RemoteIpAddress == null)
+ || Request.HttpContext.Connection.LocalIpAddress.Equals(Request.HttpContext.Connection.RemoteIpAddress);
public string HttpMethod => Request.Method;
diff --git a/Jellyfin.Data/Entities/Artwork.cs b/Jellyfin.Data/Entities/Artwork.cs
index be13686dc..bf3029368 100644
--- a/Jellyfin.Data/Entities/Artwork.cs
+++ b/Jellyfin.Data/Entities/Artwork.cs
@@ -1,208 +1,195 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Artwork
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Artwork()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Artwork CreateArtworkUnsafe()
- {
- return new Artwork();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="path"></param>
- /// <param name="kind"></param>
- /// <param name="_metadata0"></param>
- /// <param name="_personrole1"></param>
- public Artwork(string path, global::Jellyfin.Data.Enums.ArtKind kind, global::Jellyfin.Data.Entities.Metadata _metadata0, global::Jellyfin.Data.Entities.PersonRole _personrole1)
- {
- if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path));
- this.Path = path;
-
- this.Kind = kind;
-
- if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
- _metadata0.Artwork.Add(this);
-
- if (_personrole1 == null) throw new ArgumentNullException(nameof(_personrole1));
- _personrole1.Artwork = this;
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="path"></param>
- /// <param name="kind"></param>
- /// <param name="_metadata0"></param>
- /// <param name="_personrole1"></param>
- public static Artwork Create(string path, global::Jellyfin.Data.Enums.ArtKind kind, global::Jellyfin.Data.Entities.Metadata _metadata0, global::Jellyfin.Data.Entities.PersonRole _personrole1)
- {
- return new Artwork(path, kind, _metadata0, _personrole1);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class Artwork
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Artwork()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Artwork CreateArtworkUnsafe()
+ {
+ return new Artwork();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="path"></param>
+ /// <param name="kind"></param>
+ /// <param name="_metadata0"></param>
+ /// <param name="_personrole1"></param>
+ public Artwork(string path, Enums.ArtKind kind, Metadata _metadata0, PersonRole _personrole1)
+ {
+ if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path));
+ this.Path = path;
+
+ this.Kind = kind;
+
+ if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
+ _metadata0.Artwork.Add(this);
+
+ if (_personrole1 == null) throw new ArgumentNullException(nameof(_personrole1));
+ _personrole1.Artwork = this;
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="path"></param>
+ /// <param name="kind"></param>
+ /// <param name="_metadata0"></param>
+ /// <param name="_personrole1"></param>
+ public static Artwork Create(string path, Enums.ArtKind kind, Metadata _metadata0, PersonRole _personrole1)
+ {
+ return new Artwork(path, kind, _metadata0, _personrole1);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
+ {
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Path
+ /// </summary>
+ protected string _Path;
+ /// <summary>
+ /// When provided in a partial class, allows value of Path to be changed before setting.
+ /// </summary>
+ partial void SetPath(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Path to be changed before returning.
+ /// </summary>
+ partial void GetPath(ref string result);
+
+ /// <summary>
+ /// Required, Max length = 65535
+ /// </summary>
+ [Required]
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string Path
+ {
+ get
+ {
+ string value = _Path;
+ GetPath(ref value);
+ return (_Path = value);
+ }
+ set
{
- _Id = value;
+ string oldValue = _Path;
+ SetPath(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Path = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Path
- /// </summary>
- protected string _Path;
- /// <summary>
- /// When provided in a partial class, allows value of Path to be changed before setting.
- /// </summary>
- partial void SetPath(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Path to be changed before returning.
- /// </summary>
- partial void GetPath(ref string result);
-
- /// <summary>
- /// Required, Max length = 65535
- /// </summary>
- [Required]
- [MaxLength(65535)]
- [StringLength(65535)]
- public string Path
- {
- get
- {
- string value = _Path;
- GetPath(ref value);
- return (_Path = value);
- }
- set
- {
- string oldValue = _Path;
- SetPath(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Kind
+ /// </summary>
+ internal Enums.ArtKind _Kind;
+ /// <summary>
+ /// When provided in a partial class, allows value of Kind to be changed before setting.
+ /// </summary>
+ partial void SetKind(Enums.ArtKind oldValue, ref Enums.ArtKind newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Kind to be changed before returning.
+ /// </summary>
+ partial void GetKind(ref Enums.ArtKind result);
+
+ /// <summary>
+ /// Indexed, Required
+ /// </summary>
+ [Required]
+ public Enums.ArtKind Kind
+ {
+ get
{
- _Path = value;
+ Enums.ArtKind value = _Kind;
+ GetKind(ref value);
+ return (_Kind = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Kind
- /// </summary>
- internal global::Jellyfin.Data.Enums.ArtKind _Kind;
- /// <summary>
- /// When provided in a partial class, allows value of Kind to be changed before setting.
- /// </summary>
- partial void SetKind(global::Jellyfin.Data.Enums.ArtKind oldValue, ref global::Jellyfin.Data.Enums.ArtKind newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Kind to be changed before returning.
- /// </summary>
- partial void GetKind(ref global::Jellyfin.Data.Enums.ArtKind result);
-
- /// <summary>
- /// Indexed, Required
- /// </summary>
- [Required]
- public global::Jellyfin.Data.Enums.ArtKind Kind
- {
- get
- {
- global::Jellyfin.Data.Enums.ArtKind value = _Kind;
- GetKind(ref value);
- return (_Kind = value);
- }
- set
- {
- global::Jellyfin.Data.Enums.ArtKind oldValue = _Kind;
- SetKind(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Kind = value;
+ Enums.ArtKind oldValue = _Kind;
+ SetKind(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Kind = value;
+ }
}
- }
- }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Book.cs b/Jellyfin.Data/Entities/Book.cs
index 30c89ae5c..42d24e31d 100644
--- a/Jellyfin.Data/Entities/Book.cs
+++ b/Jellyfin.Data/Entities/Book.cs
@@ -1,84 +1,69 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Book: global::Jellyfin.Data.Entities.LibraryItem
- {
- partial void Init();
+ public partial class Book : LibraryItem
+ {
+ partial void Init();
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Book(): base()
- {
- BookMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.BookMetadata>();
- Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Book()
+ {
+ BookMetadata = new HashSet<BookMetadata>();
+ Releases = new HashSet<Release>();
- Init();
- }
+ Init();
+ }
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Book CreateBookUnsafe()
- {
- return new Book();
- }
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Book CreateBookUnsafe()
+ {
+ return new Book();
+ }
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public Book(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public Book(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
- this.BookMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.BookMetadata>();
- this.Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
+ this.BookMetadata = new HashSet<BookMetadata>();
+ this.Releases = new HashSet<Release>();
- Init();
- }
+ Init();
+ }
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public static Book Create(Guid urlid, DateTime dateadded)
- {
- return new Book(urlid, dateadded);
- }
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public static Book Create(Guid urlid, DateTime dateadded)
+ {
+ return new Book(urlid, dateadded);
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection<global::Jellyfin.Data.Entities.BookMetadata> BookMetadata { get; protected set; }
+ [ForeignKey("BookMetadata_BookMetadata_Id")]
+ public virtual ICollection<BookMetadata> BookMetadata { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.Release> Releases { get; protected set; }
+ [ForeignKey("Release_Releases_Id")]
+ public virtual ICollection<Release> Releases { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/BookMetadata.cs b/Jellyfin.Data/Entities/BookMetadata.cs
index 3a28244d6..d52fe7605 100644
--- a/Jellyfin.Data/Entities/BookMetadata.cs
+++ b/Jellyfin.Data/Entities/BookMetadata.cs
@@ -1,123 +1,107 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class BookMetadata: global::Jellyfin.Data.Entities.Metadata
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected BookMetadata(): base()
- {
- Publishers = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Company>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static BookMetadata CreateBookMetadataUnsafe()
- {
- return new BookMetadata();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_book0"></param>
- public BookMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Book _book0)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
-
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
-
- if (_book0 == null) throw new ArgumentNullException(nameof(_book0));
- _book0.BookMetadata.Add(this);
-
- this.Publishers = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Company>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_book0"></param>
- public static BookMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Book _book0)
- {
- return new BookMetadata(title, language, dateadded, datemodified, _book0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for ISBN
- /// </summary>
- protected long? _ISBN;
- /// <summary>
- /// When provided in a partial class, allows value of ISBN to be changed before setting.
- /// </summary>
- partial void SetISBN(long? oldValue, ref long? newValue);
- /// <summary>
- /// When provided in a partial class, allows value of ISBN to be changed before returning.
- /// </summary>
- partial void GetISBN(ref long? result);
-
- public long? ISBN
- {
- get
- {
- long? value = _ISBN;
- GetISBN(ref value);
- return (_ISBN = value);
- }
- set
- {
- long? oldValue = _ISBN;
- SetISBN(oldValue, ref value);
- if (oldValue != value)
+ public partial class BookMetadata : Metadata
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected BookMetadata()
+ {
+ Publishers = new HashSet<Company>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static BookMetadata CreateBookMetadataUnsafe()
+ {
+ return new BookMetadata();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_book0"></param>
+ public BookMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Book _book0)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
+
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
+
+ if (_book0 == null) throw new ArgumentNullException(nameof(_book0));
+ _book0.BookMetadata.Add(this);
+
+ this.Publishers = new HashSet<Company>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_book0"></param>
+ public static BookMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Book _book0)
+ {
+ return new BookMetadata(title, language, dateadded, datemodified, _book0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for ISBN
+ /// </summary>
+ protected long? _ISBN;
+ /// <summary>
+ /// When provided in a partial class, allows value of ISBN to be changed before setting.
+ /// </summary>
+ partial void SetISBN(long? oldValue, ref long? newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of ISBN to be changed before returning.
+ /// </summary>
+ partial void GetISBN(ref long? result);
+
+ public long? ISBN
+ {
+ get
+ {
+ long? value = _ISBN;
+ GetISBN(ref value);
+ return (_ISBN = value);
+ }
+ set
{
- _ISBN = value;
+ long? oldValue = _ISBN;
+ SetISBN(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _ISBN = value;
+ }
}
- }
- }
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection<global::Jellyfin.Data.Entities.Company> Publishers { get; protected set; }
+ [ForeignKey("Company_Publishers_Id")]
+ public virtual ICollection<Company> Publishers { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Chapter.cs b/Jellyfin.Data/Entities/Chapter.cs
index 21a5dd73e..d48cb9b62 100644
--- a/Jellyfin.Data/Entities/Chapter.cs
+++ b/Jellyfin.Data/Entities/Chapter.cs
@@ -1,274 +1,263 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Chapter
- {
- partial void Init();
+ public partial class Chapter
+ {
+ partial void Init();
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Chapter()
- {
- Init();
- }
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Chapter()
+ {
+ Init();
+ }
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Chapter CreateChapterUnsafe()
- {
- return new Chapter();
- }
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Chapter CreateChapterUnsafe()
+ {
+ return new Chapter();
+ }
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="timestart"></param>
- /// <param name="_release0"></param>
- public Chapter(string language, long timestart, global::Jellyfin.Data.Entities.Release _release0)
- {
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="timestart"></param>
+ /// <param name="_release0"></param>
+ public Chapter(string language, long timestart, Release _release0)
+ {
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
- this.TimeStart = timestart;
+ this.TimeStart = timestart;
- if (_release0 == null) throw new ArgumentNullException(nameof(_release0));
- _release0.Chapters.Add(this);
+ if (_release0 == null) throw new ArgumentNullException(nameof(_release0));
+ _release0.Chapters.Add(this);
- Init();
- }
+ Init();
+ }
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="timestart"></param>
- /// <param name="_release0"></param>
- public static Chapter Create(string language, long timestart, global::Jellyfin.Data.Entities.Release _release0)
- {
- return new Chapter(language, timestart, _release0);
- }
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="timestart"></param>
+ /// <param name="_release0"></param>
+ public static Chapter Create(string language, long timestart, Release _release0)
+ {
+ return new Chapter(language, timestart, _release0);
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
{
- _Id = value;
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
}
- }
- }
+ }
- /// <summary>
- /// Backing field for Name
- /// </summary>
- protected string _Name;
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before setting.
- /// </summary>
- partial void SetName(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before returning.
- /// </summary>
- partial void GetName(ref string result);
+ /// <summary>
+ /// Backing field for Name
+ /// </summary>
+ protected string _Name;
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ /// </summary>
+ partial void SetName(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ /// </summary>
+ partial void GetName(ref string result);
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Name
- {
- get
- {
- string value = _Name;
- GetName(ref value);
- return (_Name = value);
- }
- set
- {
- string oldValue = _Name;
- SetName(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Name
+ {
+ get
{
- _Name = value;
+ string value = _Name;
+ GetName(ref value);
+ return (_Name = value);
}
- }
- }
+ set
+ {
+ string oldValue = _Name;
+ SetName(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Name = value;
+ }
+ }
+ }
- /// <summary>
- /// Backing field for Language
- /// </summary>
- protected string _Language;
- /// <summary>
- /// When provided in a partial class, allows value of Language to be changed before setting.
- /// </summary>
- partial void SetLanguage(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Language to be changed before returning.
- /// </summary>
- partial void GetLanguage(ref string result);
+ /// <summary>
+ /// Backing field for Language
+ /// </summary>
+ protected string _Language;
+ /// <summary>
+ /// When provided in a partial class, allows value of Language to be changed before setting.
+ /// </summary>
+ partial void SetLanguage(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Language to be changed before returning.
+ /// </summary>
+ partial void GetLanguage(ref string result);
- /// <summary>
- /// Required, Min length = 3, Max length = 3
- /// ISO-639-3 3-character language codes
- /// </summary>
- [Required]
- [MinLength(3)]
- [MaxLength(3)]
- [StringLength(3)]
- public string Language
- {
- get
- {
- string value = _Language;
- GetLanguage(ref value);
- return (_Language = value);
- }
- set
- {
- string oldValue = _Language;
- SetLanguage(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Required, Min length = 3, Max length = 3
+ /// ISO-639-3 3-character language codes
+ /// </summary>
+ [Required]
+ [MinLength(3)]
+ [MaxLength(3)]
+ [StringLength(3)]
+ public string Language
+ {
+ get
+ {
+ string value = _Language;
+ GetLanguage(ref value);
+ return (_Language = value);
+ }
+ set
{
- _Language = value;
+ string oldValue = _Language;
+ SetLanguage(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Language = value;
+ }
}
- }
- }
+ }
- /// <summary>
- /// Backing field for TimeStart
- /// </summary>
- protected long _TimeStart;
- /// <summary>
- /// When provided in a partial class, allows value of TimeStart to be changed before setting.
- /// </summary>
- partial void SetTimeStart(long oldValue, ref long newValue);
- /// <summary>
- /// When provided in a partial class, allows value of TimeStart to be changed before returning.
- /// </summary>
- partial void GetTimeStart(ref long result);
+ /// <summary>
+ /// Backing field for TimeStart
+ /// </summary>
+ protected long _TimeStart;
+ /// <summary>
+ /// When provided in a partial class, allows value of TimeStart to be changed before setting.
+ /// </summary>
+ partial void SetTimeStart(long oldValue, ref long newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of TimeStart to be changed before returning.
+ /// </summary>
+ partial void GetTimeStart(ref long result);
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public long TimeStart
- {
- get
- {
- long value = _TimeStart;
- GetTimeStart(ref value);
- return (_TimeStart = value);
- }
- set
- {
- long oldValue = _TimeStart;
- SetTimeStart(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public long TimeStart
+ {
+ get
+ {
+ long value = _TimeStart;
+ GetTimeStart(ref value);
+ return (_TimeStart = value);
+ }
+ set
{
- _TimeStart = value;
+ long oldValue = _TimeStart;
+ SetTimeStart(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _TimeStart = value;
+ }
}
- }
- }
+ }
- /// <summary>
- /// Backing field for TimeEnd
- /// </summary>
- protected long? _TimeEnd;
- /// <summary>
- /// When provided in a partial class, allows value of TimeEnd to be changed before setting.
- /// </summary>
- partial void SetTimeEnd(long? oldValue, ref long? newValue);
- /// <summary>
- /// When provided in a partial class, allows value of TimeEnd to be changed before returning.
- /// </summary>
- partial void GetTimeEnd(ref long? result);
+ /// <summary>
+ /// Backing field for TimeEnd
+ /// </summary>
+ protected long? _TimeEnd;
+ /// <summary>
+ /// When provided in a partial class, allows value of TimeEnd to be changed before setting.
+ /// </summary>
+ partial void SetTimeEnd(long? oldValue, ref long? newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of TimeEnd to be changed before returning.
+ /// </summary>
+ partial void GetTimeEnd(ref long? result);
- public long? TimeEnd
- {
- get
- {
- long? value = _TimeEnd;
- GetTimeEnd(ref value);
- return (_TimeEnd = value);
- }
- set
- {
- long? oldValue = _TimeEnd;
- SetTimeEnd(oldValue, ref value);
- if (oldValue != value)
+ public long? TimeEnd
+ {
+ get
{
- _TimeEnd = value;
+ long? value = _TimeEnd;
+ GetTimeEnd(ref value);
+ return (_TimeEnd = value);
}
- }
- }
+ set
+ {
+ long? oldValue = _TimeEnd;
+ SetTimeEnd(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _TimeEnd = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Collection.cs b/Jellyfin.Data/Entities/Collection.cs
index 68979eb2f..e2fa3a5bd 100644
--- a/Jellyfin.Data/Entities/Collection.cs
+++ b/Jellyfin.Data/Entities/Collection.cs
@@ -1,131 +1,120 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Collection
- {
- partial void Init();
+ public partial class Collection
+ {
+ partial void Init();
- /// <summary>
- /// Default constructor
- /// </summary>
- public Collection()
- {
- CollectionItem = new System.Collections.Generic.LinkedList<global::Jellyfin.Data.Entities.CollectionItem>();
+ /// <summary>
+ /// Default constructor
+ /// </summary>
+ public Collection()
+ {
+ CollectionItem = new LinkedList<CollectionItem>();
- Init();
- }
+ Init();
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
{
- _Id = value;
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
}
- }
- }
+ }
- /// <summary>
- /// Backing field for Name
- /// </summary>
- protected string _Name;
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before setting.
- /// </summary>
- partial void SetName(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before returning.
- /// </summary>
- partial void GetName(ref string result);
+ /// <summary>
+ /// Backing field for Name
+ /// </summary>
+ protected string _Name;
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ /// </summary>
+ partial void SetName(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ /// </summary>
+ partial void GetName(ref string result);
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Name
- {
- get
- {
- string value = _Name;
- GetName(ref value);
- return (_Name = value);
- }
- set
- {
- string oldValue = _Name;
- SetName(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Name
+ {
+ get
+ {
+ string value = _Name;
+ GetName(ref value);
+ return (_Name = value);
+ }
+ set
{
- _Name = value;
+ string oldValue = _Name;
+ SetName(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Name = value;
+ }
}
- }
- }
+ }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- public virtual ICollection<global::Jellyfin.Data.Entities.CollectionItem> CollectionItem { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("CollectionItem_CollectionItem_Id")]
+ public virtual ICollection<CollectionItem> CollectionItem { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/CollectionItem.cs b/Jellyfin.Data/Entities/CollectionItem.cs
index 8e575e0a2..4a3d06639 100644
--- a/Jellyfin.Data/Entities/CollectionItem.cs
+++ b/Jellyfin.Data/Entities/CollectionItem.cs
@@ -1,151 +1,143 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class CollectionItem
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected CollectionItem()
- {
- // NOTE: This class has one-to-one associations with CollectionItem.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static CollectionItem CreateCollectionItemUnsafe()
- {
- return new CollectionItem();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="_collection0"></param>
- /// <param name="_collectionitem1"></param>
- /// <param name="_collectionitem2"></param>
- public CollectionItem(global::Jellyfin.Data.Entities.Collection _collection0, global::Jellyfin.Data.Entities.CollectionItem _collectionitem1, global::Jellyfin.Data.Entities.CollectionItem _collectionitem2)
- {
- // NOTE: This class has one-to-one associations with CollectionItem.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- if (_collection0 == null) throw new ArgumentNullException(nameof(_collection0));
- _collection0.CollectionItem.Add(this);
-
- if (_collectionitem1 == null) throw new ArgumentNullException(nameof(_collectionitem1));
- _collectionitem1.Next = this;
-
- if (_collectionitem2 == null) throw new ArgumentNullException(nameof(_collectionitem2));
- _collectionitem2.Previous = this;
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="_collection0"></param>
- /// <param name="_collectionitem1"></param>
- /// <param name="_collectionitem2"></param>
- public static CollectionItem Create(global::Jellyfin.Data.Entities.Collection _collection0, global::Jellyfin.Data.Entities.CollectionItem _collectionitem1, global::Jellyfin.Data.Entities.CollectionItem _collectionitem2)
- {
- return new CollectionItem(_collection0, _collectionitem1, _collectionitem2);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class CollectionItem
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected CollectionItem()
+ {
+ // NOTE: This class has one-to-one associations with CollectionItem.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static CollectionItem CreateCollectionItemUnsafe()
+ {
+ return new CollectionItem();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="_collection0"></param>
+ /// <param name="_collectionitem1"></param>
+ /// <param name="_collectionitem2"></param>
+ public CollectionItem(Collection _collection0, CollectionItem _collectionitem1, CollectionItem _collectionitem2)
+ {
+ // NOTE: This class has one-to-one associations with CollectionItem.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ if (_collection0 == null) throw new ArgumentNullException(nameof(_collection0));
+ _collection0.CollectionItem.Add(this);
+
+ if (_collectionitem1 == null) throw new ArgumentNullException(nameof(_collectionitem1));
+ _collectionitem1.Next = this;
+
+ if (_collectionitem2 == null) throw new ArgumentNullException(nameof(_collectionitem2));
+ _collectionitem2.Previous = this;
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="_collection0"></param>
+ /// <param name="_collectionitem1"></param>
+ /// <param name="_collectionitem2"></param>
+ public static CollectionItem Create(Collection _collection0, CollectionItem _collectionitem1, CollectionItem _collectionitem2)
+ {
+ return new CollectionItem(_collection0, _collectionitem1, _collectionitem2);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
{
- _Id = value;
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- /// <summary>
- /// Required
- /// </summary>
- public virtual global::Jellyfin.Data.Entities.LibraryItem LibraryItem { get; set; }
-
- /// <remarks>
- /// TODO check if this properly updated dependant and has the proper principal relationship
- /// </remarks>
- public virtual global::Jellyfin.Data.Entities.CollectionItem Next { get; set; }
-
- /// <remarks>
- /// TODO check if this properly updated dependant and has the proper principal relationship
- /// </remarks>
- public virtual global::Jellyfin.Data.Entities.CollectionItem Previous { get; set; }
-
- }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [ForeignKey("LibraryItem_Id")]
+ public virtual LibraryItem LibraryItem { get; set; }
+
+ /// <remarks>
+ /// TODO check if this properly updated dependant and has the proper principal relationship
+ /// </remarks>
+ [ForeignKey("CollectionItem_Next_Id")]
+ public virtual CollectionItem Next { get; set; }
+
+ /// <remarks>
+ /// TODO check if this properly updated dependant and has the proper principal relationship
+ /// </remarks>
+ [ForeignKey("CollectionItem_Previous_Id")]
+ public virtual CollectionItem Previous { get; set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/Company.cs b/Jellyfin.Data/Entities/Company.cs
index 444ae9c56..0650271c6 100644
--- a/Jellyfin.Data/Entities/Company.cs
+++ b/Jellyfin.Data/Entities/Company.cs
@@ -1,147 +1,137 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Company
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Company()
- {
- CompanyMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.CompanyMetadata>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Company CreateCompanyUnsafe()
- {
- return new Company();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="_moviemetadata0"></param>
- /// <param name="_seriesmetadata1"></param>
- /// <param name="_musicalbummetadata2"></param>
- /// <param name="_bookmetadata3"></param>
- /// <param name="_company4"></param>
- public Company(global::Jellyfin.Data.Entities.MovieMetadata _moviemetadata0, global::Jellyfin.Data.Entities.SeriesMetadata _seriesmetadata1, global::Jellyfin.Data.Entities.MusicAlbumMetadata _musicalbummetadata2, global::Jellyfin.Data.Entities.BookMetadata _bookmetadata3, global::Jellyfin.Data.Entities.Company _company4)
- {
- if (_moviemetadata0 == null) throw new ArgumentNullException(nameof(_moviemetadata0));
- _moviemetadata0.Studios.Add(this);
-
- if (_seriesmetadata1 == null) throw new ArgumentNullException(nameof(_seriesmetadata1));
- _seriesmetadata1.Networks.Add(this);
-
- if (_musicalbummetadata2 == null) throw new ArgumentNullException(nameof(_musicalbummetadata2));
- _musicalbummetadata2.Labels.Add(this);
-
- if (_bookmetadata3 == null) throw new ArgumentNullException(nameof(_bookmetadata3));
- _bookmetadata3.Publishers.Add(this);
-
- if (_company4 == null) throw new ArgumentNullException(nameof(_company4));
- _company4.Parent = this;
-
- this.CompanyMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.CompanyMetadata>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="_moviemetadata0"></param>
- /// <param name="_seriesmetadata1"></param>
- /// <param name="_musicalbummetadata2"></param>
- /// <param name="_bookmetadata3"></param>
- /// <param name="_company4"></param>
- public static Company Create(global::Jellyfin.Data.Entities.MovieMetadata _moviemetadata0, global::Jellyfin.Data.Entities.SeriesMetadata _seriesmetadata1, global::Jellyfin.Data.Entities.MusicAlbumMetadata _musicalbummetadata2, global::Jellyfin.Data.Entities.BookMetadata _bookmetadata3, global::Jellyfin.Data.Entities.Company _company4)
- {
- return new Company(_moviemetadata0, _seriesmetadata1, _musicalbummetadata2, _bookmetadata3, _company4);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class Company
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Company()
+ {
+ CompanyMetadata = new HashSet<CompanyMetadata>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Company CreateCompanyUnsafe()
+ {
+ return new Company();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="_moviemetadata0"></param>
+ /// <param name="_seriesmetadata1"></param>
+ /// <param name="_musicalbummetadata2"></param>
+ /// <param name="_bookmetadata3"></param>
+ /// <param name="_company4"></param>
+ public Company(MovieMetadata _moviemetadata0, SeriesMetadata _seriesmetadata1, MusicAlbumMetadata _musicalbummetadata2, BookMetadata _bookmetadata3, Company _company4)
+ {
+ if (_moviemetadata0 == null) throw new ArgumentNullException(nameof(_moviemetadata0));
+ _moviemetadata0.Studios.Add(this);
+
+ if (_seriesmetadata1 == null) throw new ArgumentNullException(nameof(_seriesmetadata1));
+ _seriesmetadata1.Networks.Add(this);
+
+ if (_musicalbummetadata2 == null) throw new ArgumentNullException(nameof(_musicalbummetadata2));
+ _musicalbummetadata2.Labels.Add(this);
+
+ if (_bookmetadata3 == null) throw new ArgumentNullException(nameof(_bookmetadata3));
+ _bookmetadata3.Publishers.Add(this);
+
+ if (_company4 == null) throw new ArgumentNullException(nameof(_company4));
+ _company4.Parent = this;
+
+ this.CompanyMetadata = new HashSet<CompanyMetadata>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="_moviemetadata0"></param>
+ /// <param name="_seriesmetadata1"></param>
+ /// <param name="_musicalbummetadata2"></param>
+ /// <param name="_bookmetadata3"></param>
+ /// <param name="_company4"></param>
+ public static Company Create(MovieMetadata _moviemetadata0, SeriesMetadata _seriesmetadata1, MusicAlbumMetadata _musicalbummetadata2, BookMetadata _bookmetadata3, Company _company4)
+ {
+ return new Company(_moviemetadata0, _seriesmetadata1, _musicalbummetadata2, _bookmetadata3, _company4);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
{
- _Id = value;
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
}
- }
- }
-
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- public virtual ICollection<global::Jellyfin.Data.Entities.CompanyMetadata> CompanyMetadata { get; protected set; }
-
- public virtual global::Jellyfin.Data.Entities.Company Parent { get; set; }
-
- }
+ protected set
+ {
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("CompanyMetadata_CompanyMetadata_Id")]
+ public virtual ICollection<CompanyMetadata> CompanyMetadata { get; protected set; }
+ [ForeignKey("Company_Parent_Id")]
+ public virtual Company Parent { get; set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/CompanyMetadata.cs b/Jellyfin.Data/Entities/CompanyMetadata.cs
index 6d636e884..b3ec9c1a7 100644
--- a/Jellyfin.Data/Entities/CompanyMetadata.cs
+++ b/Jellyfin.Data/Entities/CompanyMetadata.cs
@@ -1,234 +1,216 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class CompanyMetadata: global::Jellyfin.Data.Entities.Metadata
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected CompanyMetadata(): base()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static CompanyMetadata CreateCompanyMetadataUnsafe()
- {
- return new CompanyMetadata();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_company0"></param>
- public CompanyMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Company _company0)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
-
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
-
- if (_company0 == null) throw new ArgumentNullException(nameof(_company0));
- _company0.CompanyMetadata.Add(this);
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_company0"></param>
- public static CompanyMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Company _company0)
- {
- return new CompanyMetadata(title, language, dateadded, datemodified, _company0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Description
- /// </summary>
- protected string _Description;
- /// <summary>
- /// When provided in a partial class, allows value of Description to be changed before setting.
- /// </summary>
- partial void SetDescription(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Description to be changed before returning.
- /// </summary>
- partial void GetDescription(ref string result);
-
- /// <summary>
- /// Max length = 65535
- /// </summary>
- [MaxLength(65535)]
- [StringLength(65535)]
- public string Description
- {
- get
- {
- string value = _Description;
- GetDescription(ref value);
- return (_Description = value);
- }
- set
- {
- string oldValue = _Description;
- SetDescription(oldValue, ref value);
- if (oldValue != value)
+ public partial class CompanyMetadata : Metadata
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected CompanyMetadata()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static CompanyMetadata CreateCompanyMetadataUnsafe()
+ {
+ return new CompanyMetadata();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_company0"></param>
+ public CompanyMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Company _company0)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
+
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
+
+ if (_company0 == null) throw new ArgumentNullException(nameof(_company0));
+ _company0.CompanyMetadata.Add(this);
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_company0"></param>
+ public static CompanyMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Company _company0)
+ {
+ return new CompanyMetadata(title, language, dateadded, datemodified, _company0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Description
+ /// </summary>
+ protected string _Description;
+ /// <summary>
+ /// When provided in a partial class, allows value of Description to be changed before setting.
+ /// </summary>
+ partial void SetDescription(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Description to be changed before returning.
+ /// </summary>
+ partial void GetDescription(ref string result);
+
+ /// <summary>
+ /// Max length = 65535
+ /// </summary>
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string Description
+ {
+ get
+ {
+ string value = _Description;
+ GetDescription(ref value);
+ return (_Description = value);
+ }
+ set
+ {
+ string oldValue = _Description;
+ SetDescription(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Description = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Headquarters
+ /// </summary>
+ protected string _Headquarters;
+ /// <summary>
+ /// When provided in a partial class, allows value of Headquarters to be changed before setting.
+ /// </summary>
+ partial void SetHeadquarters(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Headquarters to be changed before returning.
+ /// </summary>
+ partial void GetHeadquarters(ref string result);
+
+ /// <summary>
+ /// Max length = 255
+ /// </summary>
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string Headquarters
+ {
+ get
+ {
+ string value = _Headquarters;
+ GetHeadquarters(ref value);
+ return (_Headquarters = value);
+ }
+ set
+ {
+ string oldValue = _Headquarters;
+ SetHeadquarters(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Headquarters = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Country
+ /// </summary>
+ protected string _Country;
+ /// <summary>
+ /// When provided in a partial class, allows value of Country to be changed before setting.
+ /// </summary>
+ partial void SetCountry(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Country to be changed before returning.
+ /// </summary>
+ partial void GetCountry(ref string result);
+
+ /// <summary>
+ /// Max length = 2
+ /// </summary>
+ [MaxLength(2)]
+ [StringLength(2)]
+ public string Country
+ {
+ get
{
- _Description = value;
+ string value = _Country;
+ GetCountry(ref value);
+ return (_Country = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Headquarters
- /// </summary>
- protected string _Headquarters;
- /// <summary>
- /// When provided in a partial class, allows value of Headquarters to be changed before setting.
- /// </summary>
- partial void SetHeadquarters(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Headquarters to be changed before returning.
- /// </summary>
- partial void GetHeadquarters(ref string result);
-
- /// <summary>
- /// Max length = 255
- /// </summary>
- [MaxLength(255)]
- [StringLength(255)]
- public string Headquarters
- {
- get
- {
- string value = _Headquarters;
- GetHeadquarters(ref value);
- return (_Headquarters = value);
- }
- set
- {
- string oldValue = _Headquarters;
- SetHeadquarters(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Headquarters = value;
+ string oldValue = _Country;
+ SetCountry(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Country = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Country
- /// </summary>
- protected string _Country;
- /// <summary>
- /// When provided in a partial class, allows value of Country to be changed before setting.
- /// </summary>
- partial void SetCountry(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Country to be changed before returning.
- /// </summary>
- partial void GetCountry(ref string result);
-
- /// <summary>
- /// Max length = 2
- /// </summary>
- [MaxLength(2)]
- [StringLength(2)]
- public string Country
- {
- get
- {
- string value = _Country;
- GetCountry(ref value);
- return (_Country = value);
- }
- set
- {
- string oldValue = _Country;
- SetCountry(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Homepage
+ /// </summary>
+ protected string _Homepage;
+ /// <summary>
+ /// When provided in a partial class, allows value of Homepage to be changed before setting.
+ /// </summary>
+ partial void SetHomepage(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Homepage to be changed before returning.
+ /// </summary>
+ partial void GetHomepage(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Homepage
+ {
+ get
{
- _Country = value;
+ string value = _Homepage;
+ GetHomepage(ref value);
+ return (_Homepage = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Homepage
- /// </summary>
- protected string _Homepage;
- /// <summary>
- /// When provided in a partial class, allows value of Homepage to be changed before setting.
- /// </summary>
- partial void SetHomepage(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Homepage to be changed before returning.
- /// </summary>
- partial void GetHomepage(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Homepage
- {
- get
- {
- string value = _Homepage;
- GetHomepage(ref value);
- return (_Homepage = value);
- }
- set
- {
- string oldValue = _Homepage;
- SetHomepage(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Homepage = value;
+ string oldValue = _Homepage;
+ SetHomepage(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Homepage = value;
+ }
}
- }
- }
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/CustomItem.cs b/Jellyfin.Data/Entities/CustomItem.cs
index eb6d2752d..2006717bf 100644
--- a/Jellyfin.Data/Entities/CustomItem.cs
+++ b/Jellyfin.Data/Entities/CustomItem.cs
@@ -1,84 +1,68 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class CustomItem: global::Jellyfin.Data.Entities.LibraryItem
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected CustomItem(): base()
- {
- CustomItemMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.CustomItemMetadata>();
- Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
+ public partial class CustomItem : LibraryItem
+ {
+ partial void Init();
- Init();
- }
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected CustomItem()
+ {
+ CustomItemMetadata = new HashSet<CustomItemMetadata>();
+ Releases = new HashSet<Release>();
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static CustomItem CreateCustomItemUnsafe()
- {
- return new CustomItem();
- }
+ Init();
+ }
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public CustomItem(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static CustomItem CreateCustomItemUnsafe()
+ {
+ return new CustomItem();
+ }
- this.CustomItemMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.CustomItemMetadata>();
- this.Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public CustomItem(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
- Init();
- }
+ this.CustomItemMetadata = new HashSet<CustomItemMetadata>();
+ this.Releases = new HashSet<Release>();
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public static CustomItem Create(Guid urlid, DateTime dateadded)
- {
- return new CustomItem(urlid, dateadded);
- }
+ Init();
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public static CustomItem Create(Guid urlid, DateTime dateadded)
+ {
+ return new CustomItem(urlid, dateadded);
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- public virtual ICollection<global::Jellyfin.Data.Entities.CustomItemMetadata> CustomItemMetadata { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("CustomItemMetadata_CustomItemMetadata_Id")]
+ public virtual ICollection<CustomItemMetadata> CustomItemMetadata { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.Release> Releases { get; protected set; }
+ [ForeignKey("Release_Releases_Id")]
+ public virtual ICollection<Release> Releases { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/CustomItemMetadata.cs b/Jellyfin.Data/Entities/CustomItemMetadata.cs
index f2c15d3fe..e09e4467a 100644
--- a/Jellyfin.Data/Entities/CustomItemMetadata.cs
+++ b/Jellyfin.Data/Entities/CustomItemMetadata.cs
@@ -1,86 +1,67 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class CustomItemMetadata: global::Jellyfin.Data.Entities.Metadata
- {
- partial void Init();
+ public partial class CustomItemMetadata : Metadata
+ {
+ partial void Init();
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected CustomItemMetadata(): base()
- {
- Init();
- }
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected CustomItemMetadata()
+ {
+ Init();
+ }
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static CustomItemMetadata CreateCustomItemMetadataUnsafe()
- {
- return new CustomItemMetadata();
- }
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static CustomItemMetadata CreateCustomItemMetadataUnsafe()
+ {
+ return new CustomItemMetadata();
+ }
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_customitem0"></param>
- public CustomItemMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.CustomItem _customitem0)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_customitem0"></param>
+ public CustomItemMetadata(string title, string language, DateTime dateadded, DateTime datemodified, CustomItem _customitem0)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
- if (_customitem0 == null) throw new ArgumentNullException(nameof(_customitem0));
- _customitem0.CustomItemMetadata.Add(this);
+ if (_customitem0 == null) throw new ArgumentNullException(nameof(_customitem0));
+ _customitem0.CustomItemMetadata.Add(this);
- Init();
- }
+ Init();
+ }
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_customitem0"></param>
- public static CustomItemMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.CustomItem _customitem0)
- {
- return new CustomItemMetadata(title, language, dateadded, datemodified, _customitem0);
- }
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_customitem0"></param>
+ public static CustomItemMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, CustomItem _customitem0)
+ {
+ return new CustomItemMetadata(title, language, dateadded, datemodified, _customitem0);
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Episode.cs b/Jellyfin.Data/Entities/Episode.cs
index 3a23f0976..6f6baa14d 100644
--- a/Jellyfin.Data/Entities/Episode.cs
+++ b/Jellyfin.Data/Entities/Episode.cs
@@ -1,127 +1,110 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Episode: global::Jellyfin.Data.Entities.LibraryItem
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Episode(): base()
- {
- // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
- EpisodeMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.EpisodeMetadata>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Episode CreateEpisodeUnsafe()
- {
- return new Episode();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- /// <param name="_season0"></param>
- public Episode(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.Season _season0)
- {
- // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- this.UrlId = urlid;
-
- if (_season0 == null) throw new ArgumentNullException(nameof(_season0));
- _season0.Episodes.Add(this);
-
- this.Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
- this.EpisodeMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.EpisodeMetadata>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- /// <param name="_season0"></param>
- public static Episode Create(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.Season _season0)
- {
- return new Episode(urlid, dateadded, _season0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for EpisodeNumber
- /// </summary>
- protected int? _EpisodeNumber;
- /// <summary>
- /// When provided in a partial class, allows value of EpisodeNumber to be changed before setting.
- /// </summary>
- partial void SetEpisodeNumber(int? oldValue, ref int? newValue);
- /// <summary>
- /// When provided in a partial class, allows value of EpisodeNumber to be changed before returning.
- /// </summary>
- partial void GetEpisodeNumber(ref int? result);
-
- public int? EpisodeNumber
- {
- get
- {
- int? value = _EpisodeNumber;
- GetEpisodeNumber(ref value);
- return (_EpisodeNumber = value);
- }
- set
- {
- int? oldValue = _EpisodeNumber;
- SetEpisodeNumber(oldValue, ref value);
- if (oldValue != value)
+ public partial class Episode : LibraryItem
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Episode()
+ {
+ // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ Releases = new HashSet<Release>();
+ EpisodeMetadata = new HashSet<EpisodeMetadata>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Episode CreateEpisodeUnsafe()
+ {
+ return new Episode();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ /// <param name="_season0"></param>
+ public Episode(Guid urlid, DateTime dateadded, Season _season0)
+ {
+ // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ this.UrlId = urlid;
+
+ if (_season0 == null) throw new ArgumentNullException(nameof(_season0));
+ _season0.Episodes.Add(this);
+
+ this.Releases = new HashSet<Release>();
+ this.EpisodeMetadata = new HashSet<EpisodeMetadata>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ /// <param name="_season0"></param>
+ public static Episode Create(Guid urlid, DateTime dateadded, Season _season0)
+ {
+ return new Episode(urlid, dateadded, _season0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for EpisodeNumber
+ /// </summary>
+ protected int? _EpisodeNumber;
+ /// <summary>
+ /// When provided in a partial class, allows value of EpisodeNumber to be changed before setting.
+ /// </summary>
+ partial void SetEpisodeNumber(int? oldValue, ref int? newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of EpisodeNumber to be changed before returning.
+ /// </summary>
+ partial void GetEpisodeNumber(ref int? result);
+
+ public int? EpisodeNumber
+ {
+ get
{
- _EpisodeNumber = value;
+ int? value = _EpisodeNumber;
+ GetEpisodeNumber(ref value);
+ return (_EpisodeNumber = value);
}
- }
- }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- public virtual ICollection<global::Jellyfin.Data.Entities.Release> Releases { get; protected set; }
+ set
+ {
+ int? oldValue = _EpisodeNumber;
+ SetEpisodeNumber(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _EpisodeNumber = value;
+ }
+ }
+ }
- public virtual ICollection<global::Jellyfin.Data.Entities.EpisodeMetadata> EpisodeMetadata { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("Release_Releases_Id")]
+ public virtual ICollection<Release> Releases { get; protected set; }
+ [ForeignKey("EpisodeMetadata_EpisodeMetadata_Id")]
+ public virtual ICollection<EpisodeMetadata> EpisodeMetadata { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/EpisodeMetadata.cs b/Jellyfin.Data/Entities/EpisodeMetadata.cs
index 963219140..e5431bf22 100644
--- a/Jellyfin.Data/Entities/EpisodeMetadata.cs
+++ b/Jellyfin.Data/Entities/EpisodeMetadata.cs
@@ -1,197 +1,179 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
-using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class EpisodeMetadata: global::Jellyfin.Data.Entities.Metadata
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected EpisodeMetadata(): base()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static EpisodeMetadata CreateEpisodeMetadataUnsafe()
- {
- return new EpisodeMetadata();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_episode0"></param>
- public EpisodeMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Episode _episode0)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
-
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
-
- if (_episode0 == null) throw new ArgumentNullException(nameof(_episode0));
- _episode0.EpisodeMetadata.Add(this);
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_episode0"></param>
- public static EpisodeMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Episode _episode0)
- {
- return new EpisodeMetadata(title, language, dateadded, datemodified, _episode0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Outline
- /// </summary>
- protected string _Outline;
- /// <summary>
- /// When provided in a partial class, allows value of Outline to be changed before setting.
- /// </summary>
- partial void SetOutline(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Outline to be changed before returning.
- /// </summary>
- partial void GetOutline(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Outline
- {
- get
- {
- string value = _Outline;
- GetOutline(ref value);
- return (_Outline = value);
- }
- set
- {
- string oldValue = _Outline;
- SetOutline(oldValue, ref value);
- if (oldValue != value)
+ public partial class EpisodeMetadata : Metadata
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected EpisodeMetadata()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static EpisodeMetadata CreateEpisodeMetadataUnsafe()
+ {
+ return new EpisodeMetadata();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_episode0"></param>
+ public EpisodeMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Episode _episode0)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
+
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
+
+ if (_episode0 == null) throw new ArgumentNullException(nameof(_episode0));
+ _episode0.EpisodeMetadata.Add(this);
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_episode0"></param>
+ public static EpisodeMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Episode _episode0)
+ {
+ return new EpisodeMetadata(title, language, dateadded, datemodified, _episode0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Outline
+ /// </summary>
+ protected string _Outline;
+ /// <summary>
+ /// When provided in a partial class, allows value of Outline to be changed before setting.
+ /// </summary>
+ partial void SetOutline(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Outline to be changed before returning.
+ /// </summary>
+ partial void GetOutline(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Outline
+ {
+ get
+ {
+ string value = _Outline;
+ GetOutline(ref value);
+ return (_Outline = value);
+ }
+ set
+ {
+ string oldValue = _Outline;
+ SetOutline(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Outline = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Plot
+ /// </summary>
+ protected string _Plot;
+ /// <summary>
+ /// When provided in a partial class, allows value of Plot to be changed before setting.
+ /// </summary>
+ partial void SetPlot(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Plot to be changed before returning.
+ /// </summary>
+ partial void GetPlot(ref string result);
+
+ /// <summary>
+ /// Max length = 65535
+ /// </summary>
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string Plot
+ {
+ get
+ {
+ string value = _Plot;
+ GetPlot(ref value);
+ return (_Plot = value);
+ }
+ set
{
- _Outline = value;
+ string oldValue = _Plot;
+ SetPlot(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Plot = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Plot
- /// </summary>
- protected string _Plot;
- /// <summary>
- /// When provided in a partial class, allows value of Plot to be changed before setting.
- /// </summary>
- partial void SetPlot(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Plot to be changed before returning.
- /// </summary>
- partial void GetPlot(ref string result);
-
- /// <summary>
- /// Max length = 65535
- /// </summary>
- [MaxLength(65535)]
- [StringLength(65535)]
- public string Plot
- {
- get
- {
- string value = _Plot;
- GetPlot(ref value);
- return (_Plot = value);
- }
- set
- {
- string oldValue = _Plot;
- SetPlot(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Tagline
+ /// </summary>
+ protected string _Tagline;
+ /// <summary>
+ /// When provided in a partial class, allows value of Tagline to be changed before setting.
+ /// </summary>
+ partial void SetTagline(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Tagline to be changed before returning.
+ /// </summary>
+ partial void GetTagline(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Tagline
+ {
+ get
{
- _Plot = value;
+ string value = _Tagline;
+ GetTagline(ref value);
+ return (_Tagline = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Tagline
- /// </summary>
- protected string _Tagline;
- /// <summary>
- /// When provided in a partial class, allows value of Tagline to be changed before setting.
- /// </summary>
- partial void SetTagline(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Tagline to be changed before returning.
- /// </summary>
- partial void GetTagline(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Tagline
- {
- get
- {
- string value = _Tagline;
- GetTagline(ref value);
- return (_Tagline = value);
- }
- set
- {
- string oldValue = _Tagline;
- SetTagline(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Tagline = value;
+ string oldValue = _Tagline;
+ SetTagline(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Tagline = value;
+ }
}
- }
- }
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Genre.cs b/Jellyfin.Data/Entities/Genre.cs
index 982600553..38f289a8e 100644
--- a/Jellyfin.Data/Entities/Genre.cs
+++ b/Jellyfin.Data/Entities/Genre.cs
@@ -1,163 +1,152 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Genre
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Genre()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Genre CreateGenreUnsafe()
- {
- return new Genre();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="name"></param>
- /// <param name="_metadata0"></param>
- public Genre(string name, global::Jellyfin.Data.Entities.Metadata _metadata0)
- {
- if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
- this.Name = name;
-
- if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
- _metadata0.Genres.Add(this);
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="name"></param>
- /// <param name="_metadata0"></param>
- public static Genre Create(string name, global::Jellyfin.Data.Entities.Metadata _metadata0)
- {
- return new Genre(name, _metadata0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class Genre
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Genre()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Genre CreateGenreUnsafe()
+ {
+ return new Genre();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="name"></param>
+ /// <param name="_metadata0"></param>
+ public Genre(string name, Metadata _metadata0)
+ {
+ if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
+ this.Name = name;
+
+ if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
+ _metadata0.Genres.Add(this);
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="name"></param>
+ /// <param name="_metadata0"></param>
+ public static Genre Create(string name, Metadata _metadata0)
+ {
+ return new Genre(name, _metadata0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
{
- _Id = value;
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Name
- /// </summary>
- internal string _Name;
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before setting.
- /// </summary>
- partial void SetName(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before returning.
- /// </summary>
- partial void GetName(ref string result);
-
- /// <summary>
- /// Indexed, Required, Max length = 255
- /// </summary>
- [Required]
- [MaxLength(255)]
- [StringLength(255)]
- public string Name
- {
- get
- {
- string value = _Name;
- GetName(ref value);
- return (_Name = value);
- }
- set
- {
- string oldValue = _Name;
- SetName(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Name
+ /// </summary>
+ internal string _Name;
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ /// </summary>
+ partial void SetName(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ /// </summary>
+ partial void GetName(ref string result);
+
+ /// <summary>
+ /// Indexed, Required, Max length = 255
+ /// </summary>
+ [Required]
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string Name
+ {
+ get
{
- _Name = value;
+ string value = _Name;
+ GetName(ref value);
+ return (_Name = value);
}
- }
- }
+ set
+ {
+ string oldValue = _Name;
+ SetName(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Name = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Group.cs b/Jellyfin.Data/Entities/Group.cs
index ff19e9b01..54f9f4905 100644
--- a/Jellyfin.Data/Entities/Group.cs
+++ b/Jellyfin.Data/Entities/Group.cs
@@ -1,115 +1,109 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Group
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Group()
- {
- GroupPermissions = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Permission>();
- ProviderMappings = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.ProviderMapping>();
- Preferences = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Preference>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Group CreateGroupUnsafe()
- {
- return new Group();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="name"></param>
- /// <param name="_user0"></param>
- public Group(string name, global::Jellyfin.Data.Entities.User _user0)
- {
- if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
- this.Name = name;
-
- if (_user0 == null) throw new ArgumentNullException(nameof(_user0));
- _user0.Groups.Add(this);
-
- this.GroupPermissions = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Permission>();
- this.ProviderMappings = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.ProviderMapping>();
- this.Preferences = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Preference>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="name"></param>
- /// <param name="_user0"></param>
- public static Group Create(string name, global::Jellyfin.Data.Entities.User _user0)
- {
- return new Group(name, _user0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id { get; protected set; }
-
- /// <summary>
- /// Required, Max length = 255
- /// </summary>
- [Required]
- [MaxLength(255)]
- [StringLength(255)]
- public string Name { get; set; }
-
- /// <summary>
- /// Concurrency token
- /// </summary>
- [Timestamp]
- public Byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- public virtual ICollection<global::Jellyfin.Data.Entities.Permission> GroupPermissions { get; protected set; }
-
- public virtual ICollection<global::Jellyfin.Data.Entities.ProviderMapping> ProviderMappings { get; protected set; }
-
- public virtual ICollection<global::Jellyfin.Data.Entities.Preference> Preferences { get; protected set; }
-
- }
+ public partial class Group
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Group()
+ {
+ GroupPermissions = new HashSet<Permission>();
+ ProviderMappings = new HashSet<ProviderMapping>();
+ Preferences = new HashSet<Preference>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Group CreateGroupUnsafe()
+ {
+ return new Group();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="name"></param>
+ /// <param name="_user0"></param>
+ public Group(string name, User _user0)
+ {
+ if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
+ this.Name = name;
+
+ if (_user0 == null) throw new ArgumentNullException(nameof(_user0));
+ _user0.Groups.Add(this);
+
+ this.GroupPermissions = new HashSet<Permission>();
+ this.ProviderMappings = new HashSet<ProviderMapping>();
+ this.Preferences = new HashSet<Preference>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="name"></param>
+ /// <param name="_user0"></param>
+ public static Group Create(string name, User _user0)
+ {
+ return new Group(name, _user0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id { get; protected set; }
+
+ /// <summary>
+ /// Required, Max length = 255
+ /// </summary>
+ [Required]
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ [ForeignKey("Permission_GroupPermissions_Id")]
+ public virtual ICollection<Permission> GroupPermissions { get; protected set; }
+
+ [ForeignKey("ProviderMapping_ProviderMappings_Id")]
+ public virtual ICollection<ProviderMapping> ProviderMappings { get; protected set; }
+
+ [ForeignKey("Preference_Preferences_Id")]
+ public virtual ICollection<Preference> Preferences { get; protected set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/Library.cs b/Jellyfin.Data/Entities/Library.cs
index 19ca14294..c11c09e91 100644
--- a/Jellyfin.Data/Entities/Library.cs
+++ b/Jellyfin.Data/Entities/Library.cs
@@ -1,158 +1,147 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Library
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Library()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Library CreateLibraryUnsafe()
- {
- return new Library();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="name"></param>
- public Library(string name)
- {
- if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
- this.Name = name;
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="name"></param>
- public static Library Create(string name)
- {
- return new Library(name);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class Library
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Library()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Library CreateLibraryUnsafe()
+ {
+ return new Library();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="name"></param>
+ public Library(string name)
+ {
+ if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
+ this.Name = name;
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="name"></param>
+ public static Library Create(string name)
+ {
+ return new Library(name);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
{
- _Id = value;
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Name
- /// </summary>
- protected string _Name;
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before setting.
- /// </summary>
- partial void SetName(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before returning.
- /// </summary>
- partial void GetName(ref string result);
-
- /// <summary>
- /// Required, Max length = 1024
- /// </summary>
- [Required]
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Name
- {
- get
- {
- string value = _Name;
- GetName(ref value);
- return (_Name = value);
- }
- set
- {
- string oldValue = _Name;
- SetName(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Name
+ /// </summary>
+ protected string _Name;
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ /// </summary>
+ partial void SetName(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ /// </summary>
+ partial void GetName(ref string result);
+
+ /// <summary>
+ /// Required, Max length = 1024
+ /// </summary>
+ [Required]
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Name
+ {
+ get
{
- _Name = value;
+ string value = _Name;
+ GetName(ref value);
+ return (_Name = value);
}
- }
- }
+ set
+ {
+ string oldValue = _Name;
+ SetName(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Name = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/LibraryItem.cs b/Jellyfin.Data/Entities/LibraryItem.cs
index 1987196d6..af6c640b9 100644
--- a/Jellyfin.Data/Entities/LibraryItem.cs
+++ b/Jellyfin.Data/Entities/LibraryItem.cs
@@ -1,180 +1,170 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public abstract partial class LibraryItem
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to being abstract.
- /// </summary>
- protected LibraryItem()
- {
- Init();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- protected LibraryItem(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
-
-
- Init();
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public abstract partial class LibraryItem
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to being abstract.
+ /// </summary>
+ protected LibraryItem()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ protected LibraryItem(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
+
+
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
+ {
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for UrlId
+ /// </summary>
+ internal Guid _UrlId;
+ /// <summary>
+ /// When provided in a partial class, allows value of UrlId to be changed before setting.
+ /// </summary>
+ partial void SetUrlId(Guid oldValue, ref Guid newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of UrlId to be changed before returning.
+ /// </summary>
+ partial void GetUrlId(ref Guid result);
+
+ /// <summary>
+ /// Indexed, Required
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ /// </summary>
+ [Required]
+ public Guid UrlId
+ {
+ get
+ {
+ Guid value = _UrlId;
+ GetUrlId(ref value);
+ return (_UrlId = value);
+ }
+ set
{
- _Id = value;
+ Guid oldValue = _UrlId;
+ SetUrlId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _UrlId = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for UrlId
- /// </summary>
- internal Guid _UrlId;
- /// <summary>
- /// When provided in a partial class, allows value of UrlId to be changed before setting.
- /// </summary>
- partial void SetUrlId(Guid oldValue, ref Guid newValue);
- /// <summary>
- /// When provided in a partial class, allows value of UrlId to be changed before returning.
- /// </summary>
- partial void GetUrlId(ref Guid result);
-
- /// <summary>
- /// Indexed, Required
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- /// </summary>
- [Required]
- public Guid UrlId
- {
- get
- {
- Guid value = _UrlId;
- GetUrlId(ref value);
- return (_UrlId = value);
- }
- set
- {
- Guid oldValue = _UrlId;
- SetUrlId(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for DateAdded
+ /// </summary>
+ protected DateTime _DateAdded;
+ /// <summary>
+ /// When provided in a partial class, allows value of DateAdded to be changed before setting.
+ /// </summary>
+ partial void SetDateAdded(DateTime oldValue, ref DateTime newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of DateAdded to be changed before returning.
+ /// </summary>
+ partial void GetDateAdded(ref DateTime result);
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public DateTime DateAdded
+ {
+ get
{
- _UrlId = value;
+ DateTime value = _DateAdded;
+ GetDateAdded(ref value);
+ return (_DateAdded = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for DateAdded
- /// </summary>
- protected DateTime _DateAdded;
- /// <summary>
- /// When provided in a partial class, allows value of DateAdded to be changed before setting.
- /// </summary>
- partial void SetDateAdded(DateTime oldValue, ref DateTime newValue);
- /// <summary>
- /// When provided in a partial class, allows value of DateAdded to be changed before returning.
- /// </summary>
- partial void GetDateAdded(ref DateTime result);
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public DateTime DateAdded
- {
- get
- {
- DateTime value = _DateAdded;
- GetDateAdded(ref value);
- return (_DateAdded = value);
- }
- internal set
- {
- DateTime oldValue = _DateAdded;
- SetDateAdded(oldValue, ref value);
- if (oldValue != value)
+ internal set
{
- _DateAdded = value;
+ DateTime oldValue = _DateAdded;
+ SetDateAdded(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _DateAdded = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- /// <summary>
- /// Required
- /// </summary>
- public virtual global::Jellyfin.Data.Entities.LibraryRoot LibraryRoot { get; set; }
-
- }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [ForeignKey("LibraryRoot_Id")]
+ public virtual LibraryRoot LibraryRoot { get; set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/LibraryRoot.cs b/Jellyfin.Data/Entities/LibraryRoot.cs
index 015fc4ea9..bbc23e1c9 100644
--- a/Jellyfin.Data/Entities/LibraryRoot.cs
+++ b/Jellyfin.Data/Entities/LibraryRoot.cs
@@ -1,202 +1,192 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class LibraryRoot
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected LibraryRoot()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static LibraryRoot CreateLibraryRootUnsafe()
- {
- return new LibraryRoot();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="path">Absolute Path</param>
- public LibraryRoot(string path)
- {
- if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path));
- this.Path = path;
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="path">Absolute Path</param>
- public static LibraryRoot Create(string path)
- {
- return new LibraryRoot(path);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class LibraryRoot
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected LibraryRoot()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static LibraryRoot CreateLibraryRootUnsafe()
+ {
+ return new LibraryRoot();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="path">Absolute Path</param>
+ public LibraryRoot(string path)
+ {
+ if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path));
+ this.Path = path;
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="path">Absolute Path</param>
+ public static LibraryRoot Create(string path)
+ {
+ return new LibraryRoot(path);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
+ {
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Path
+ /// </summary>
+ protected string _Path;
+ /// <summary>
+ /// When provided in a partial class, allows value of Path to be changed before setting.
+ /// </summary>
+ partial void SetPath(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Path to be changed before returning.
+ /// </summary>
+ partial void GetPath(ref string result);
+
+ /// <summary>
+ /// Required, Max length = 65535
+ /// Absolute Path
+ /// </summary>
+ [Required]
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string Path
+ {
+ get
+ {
+ string value = _Path;
+ GetPath(ref value);
+ return (_Path = value);
+ }
+ set
{
- _Id = value;
+ string oldValue = _Path;
+ SetPath(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Path = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Path
- /// </summary>
- protected string _Path;
- /// <summary>
- /// When provided in a partial class, allows value of Path to be changed before setting.
- /// </summary>
- partial void SetPath(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Path to be changed before returning.
- /// </summary>
- partial void GetPath(ref string result);
-
- /// <summary>
- /// Required, Max length = 65535
- /// Absolute Path
- /// </summary>
- [Required]
- [MaxLength(65535)]
- [StringLength(65535)]
- public string Path
- {
- get
- {
- string value = _Path;
- GetPath(ref value);
- return (_Path = value);
- }
- set
- {
- string oldValue = _Path;
- SetPath(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for NetworkPath
+ /// </summary>
+ protected string _NetworkPath;
+ /// <summary>
+ /// When provided in a partial class, allows value of NetworkPath to be changed before setting.
+ /// </summary>
+ partial void SetNetworkPath(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of NetworkPath to be changed before returning.
+ /// </summary>
+ partial void GetNetworkPath(ref string result);
+
+ /// <summary>
+ /// Max length = 65535
+ /// Absolute network path, for example for transcoding sattelites.
+ /// </summary>
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string NetworkPath
+ {
+ get
{
- _Path = value;
+ string value = _NetworkPath;
+ GetNetworkPath(ref value);
+ return (_NetworkPath = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for NetworkPath
- /// </summary>
- protected string _NetworkPath;
- /// <summary>
- /// When provided in a partial class, allows value of NetworkPath to be changed before setting.
- /// </summary>
- partial void SetNetworkPath(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of NetworkPath to be changed before returning.
- /// </summary>
- partial void GetNetworkPath(ref string result);
-
- /// <summary>
- /// Max length = 65535
- /// Absolute network path, for example for transcoding sattelites.
- /// </summary>
- [MaxLength(65535)]
- [StringLength(65535)]
- public string NetworkPath
- {
- get
- {
- string value = _NetworkPath;
- GetNetworkPath(ref value);
- return (_NetworkPath = value);
- }
- set
- {
- string oldValue = _NetworkPath;
- SetNetworkPath(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _NetworkPath = value;
+ string oldValue = _NetworkPath;
+ SetNetworkPath(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _NetworkPath = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- /// <summary>
- /// Required
- /// </summary>
- public virtual global::Jellyfin.Data.Entities.Library Library { get; set; }
-
- }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [ForeignKey("Library_Id")]
+ public virtual Library Library { get; set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/MediaFile.cs b/Jellyfin.Data/Entities/MediaFile.cs
index 2a47a9632..719539e5c 100644
--- a/Jellyfin.Data/Entities/MediaFile.cs
+++ b/Jellyfin.Data/Entities/MediaFile.cs
@@ -1,209 +1,200 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class MediaFile
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected MediaFile()
- {
- MediaFileStreams = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MediaFileStream>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static MediaFile CreateMediaFileUnsafe()
- {
- return new MediaFile();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="path">Relative to the LibraryRoot</param>
- /// <param name="kind"></param>
- /// <param name="_release0"></param>
- public MediaFile(string path, global::Jellyfin.Data.Enums.MediaFileKind kind, global::Jellyfin.Data.Entities.Release _release0)
- {
- if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path));
- this.Path = path;
-
- this.Kind = kind;
-
- if (_release0 == null) throw new ArgumentNullException(nameof(_release0));
- _release0.MediaFiles.Add(this);
-
- this.MediaFileStreams = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MediaFileStream>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="path">Relative to the LibraryRoot</param>
- /// <param name="kind"></param>
- /// <param name="_release0"></param>
- public static MediaFile Create(string path, global::Jellyfin.Data.Enums.MediaFileKind kind, global::Jellyfin.Data.Entities.Release _release0)
- {
- return new MediaFile(path, kind, _release0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class MediaFile
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected MediaFile()
+ {
+ MediaFileStreams = new HashSet<MediaFileStream>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static MediaFile CreateMediaFileUnsafe()
+ {
+ return new MediaFile();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="path">Relative to the LibraryRoot</param>
+ /// <param name="kind"></param>
+ /// <param name="_release0"></param>
+ public MediaFile(string path, Enums.MediaFileKind kind, Release _release0)
+ {
+ if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path));
+ this.Path = path;
+
+ this.Kind = kind;
+
+ if (_release0 == null) throw new ArgumentNullException(nameof(_release0));
+ _release0.MediaFiles.Add(this);
+
+ this.MediaFileStreams = new HashSet<MediaFileStream>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="path">Relative to the LibraryRoot</param>
+ /// <param name="kind"></param>
+ /// <param name="_release0"></param>
+ public static MediaFile Create(string path, Enums.MediaFileKind kind, Release _release0)
+ {
+ return new MediaFile(path, kind, _release0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
+ {
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Path
+ /// </summary>
+ protected string _Path;
+ /// <summary>
+ /// When provided in a partial class, allows value of Path to be changed before setting.
+ /// </summary>
+ partial void SetPath(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Path to be changed before returning.
+ /// </summary>
+ partial void GetPath(ref string result);
+
+ /// <summary>
+ /// Required, Max length = 65535
+ /// Relative to the LibraryRoot
+ /// </summary>
+ [Required]
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string Path
+ {
+ get
+ {
+ string value = _Path;
+ GetPath(ref value);
+ return (_Path = value);
+ }
+ set
{
- _Id = value;
+ string oldValue = _Path;
+ SetPath(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Path = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Path
- /// </summary>
- protected string _Path;
- /// <summary>
- /// When provided in a partial class, allows value of Path to be changed before setting.
- /// </summary>
- partial void SetPath(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Path to be changed before returning.
- /// </summary>
- partial void GetPath(ref string result);
-
- /// <summary>
- /// Required, Max length = 65535
- /// Relative to the LibraryRoot
- /// </summary>
- [Required]
- [MaxLength(65535)]
- [StringLength(65535)]
- public string Path
- {
- get
- {
- string value = _Path;
- GetPath(ref value);
- return (_Path = value);
- }
- set
- {
- string oldValue = _Path;
- SetPath(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Kind
+ /// </summary>
+ protected Enums.MediaFileKind _Kind;
+ /// <summary>
+ /// When provided in a partial class, allows value of Kind to be changed before setting.
+ /// </summary>
+ partial void SetKind(Enums.MediaFileKind oldValue, ref Enums.MediaFileKind newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Kind to be changed before returning.
+ /// </summary>
+ partial void GetKind(ref Enums.MediaFileKind result);
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public Enums.MediaFileKind Kind
+ {
+ get
{
- _Path = value;
+ Enums.MediaFileKind value = _Kind;
+ GetKind(ref value);
+ return (_Kind = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Kind
- /// </summary>
- protected global::Jellyfin.Data.Enums.MediaFileKind _Kind;
- /// <summary>
- /// When provided in a partial class, allows value of Kind to be changed before setting.
- /// </summary>
- partial void SetKind(global::Jellyfin.Data.Enums.MediaFileKind oldValue, ref global::Jellyfin.Data.Enums.MediaFileKind newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Kind to be changed before returning.
- /// </summary>
- partial void GetKind(ref global::Jellyfin.Data.Enums.MediaFileKind result);
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public global::Jellyfin.Data.Enums.MediaFileKind Kind
- {
- get
- {
- global::Jellyfin.Data.Enums.MediaFileKind value = _Kind;
- GetKind(ref value);
- return (_Kind = value);
- }
- set
- {
- global::Jellyfin.Data.Enums.MediaFileKind oldValue = _Kind;
- SetKind(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Kind = value;
+ Enums.MediaFileKind oldValue = _Kind;
+ SetKind(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Kind = value;
+ }
}
- }
- }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection<global::Jellyfin.Data.Entities.MediaFileStream> MediaFileStreams { get; protected set; }
+ [ForeignKey("MediaFileStream_MediaFileStreams_Id")]
+ public virtual ICollection<MediaFileStream> MediaFileStreams { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/MediaFileStream.cs b/Jellyfin.Data/Entities/MediaFileStream.cs
index 6593d3cf7..7b3399731 100644
--- a/Jellyfin.Data/Entities/MediaFileStream.cs
+++ b/Jellyfin.Data/Entities/MediaFileStream.cs
@@ -1,160 +1,149 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class MediaFileStream
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected MediaFileStream()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static MediaFileStream CreateMediaFileStreamUnsafe()
- {
- return new MediaFileStream();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="streamnumber"></param>
- /// <param name="_mediafile0"></param>
- public MediaFileStream(int streamnumber, global::Jellyfin.Data.Entities.MediaFile _mediafile0)
- {
- this.StreamNumber = streamnumber;
-
- if (_mediafile0 == null) throw new ArgumentNullException(nameof(_mediafile0));
- _mediafile0.MediaFileStreams.Add(this);
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="streamnumber"></param>
- /// <param name="_mediafile0"></param>
- public static MediaFileStream Create(int streamnumber, global::Jellyfin.Data.Entities.MediaFile _mediafile0)
- {
- return new MediaFileStream(streamnumber, _mediafile0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class MediaFileStream
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected MediaFileStream()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static MediaFileStream CreateMediaFileStreamUnsafe()
+ {
+ return new MediaFileStream();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="streamnumber"></param>
+ /// <param name="_mediafile0"></param>
+ public MediaFileStream(int streamnumber, MediaFile _mediafile0)
+ {
+ this.StreamNumber = streamnumber;
+
+ if (_mediafile0 == null) throw new ArgumentNullException(nameof(_mediafile0));
+ _mediafile0.MediaFileStreams.Add(this);
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="streamnumber"></param>
+ /// <param name="_mediafile0"></param>
+ public static MediaFileStream Create(int streamnumber, MediaFile _mediafile0)
+ {
+ return new MediaFileStream(streamnumber, _mediafile0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
{
- _Id = value;
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for StreamNumber
- /// </summary>
- protected int _StreamNumber;
- /// <summary>
- /// When provided in a partial class, allows value of StreamNumber to be changed before setting.
- /// </summary>
- partial void SetStreamNumber(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of StreamNumber to be changed before returning.
- /// </summary>
- partial void GetStreamNumber(ref int result);
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public int StreamNumber
- {
- get
- {
- int value = _StreamNumber;
- GetStreamNumber(ref value);
- return (_StreamNumber = value);
- }
- set
- {
- int oldValue = _StreamNumber;
- SetStreamNumber(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for StreamNumber
+ /// </summary>
+ protected int _StreamNumber;
+ /// <summary>
+ /// When provided in a partial class, allows value of StreamNumber to be changed before setting.
+ /// </summary>
+ partial void SetStreamNumber(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of StreamNumber to be changed before returning.
+ /// </summary>
+ partial void GetStreamNumber(ref int result);
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public int StreamNumber
+ {
+ get
{
- _StreamNumber = value;
+ int value = _StreamNumber;
+ GetStreamNumber(ref value);
+ return (_StreamNumber = value);
}
- }
- }
+ set
+ {
+ int oldValue = _StreamNumber;
+ SetStreamNumber(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _StreamNumber = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Metadata.cs b/Jellyfin.Data/Entities/Metadata.cs
index 6057017e9..467ee6822 100644
--- a/Jellyfin.Data/Entities/Metadata.cs
+++ b/Jellyfin.Data/Entities/Metadata.cs
@@ -1,385 +1,380 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public abstract partial class Metadata
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to being abstract.
- /// </summary>
- protected Metadata()
- {
- PersonRoles = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.PersonRole>();
- Genres = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Genre>();
- Artwork = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Artwork>();
- Ratings = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Rating>();
- Sources = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MetadataProviderId>();
-
- Init();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- protected Metadata(string title, string language, DateTime dateadded, DateTime datemodified)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
-
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
-
- this.PersonRoles = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.PersonRole>();
- this.Genres = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Genre>();
- this.Artwork = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Artwork>();
- this.Ratings = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Rating>();
- this.Sources = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MetadataProviderId>();
-
- Init();
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public abstract partial class Metadata
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to being abstract.
+ /// </summary>
+ protected Metadata()
+ {
+ PersonRoles = new HashSet<PersonRole>();
+ Genres = new HashSet<Genre>();
+ Artwork = new HashSet<Artwork>();
+ Ratings = new HashSet<Rating>();
+ Sources = new HashSet<MetadataProviderId>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ protected Metadata(string title, string language, DateTime dateadded, DateTime datemodified)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
+
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
+
+ this.PersonRoles = new HashSet<PersonRole>();
+ this.Genres = new HashSet<Genre>();
+ this.Artwork = new HashSet<Artwork>();
+ this.Ratings = new HashSet<Rating>();
+ this.Sources = new HashSet<MetadataProviderId>();
+
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
+ {
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Title
+ /// </summary>
+ protected string _Title;
+ /// <summary>
+ /// When provided in a partial class, allows value of Title to be changed before setting.
+ /// </summary>
+ partial void SetTitle(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Title to be changed before returning.
+ /// </summary>
+ partial void GetTitle(ref string result);
+
+ /// <summary>
+ /// Required, Max length = 1024
+ /// The title or name of the object
+ /// </summary>
+ [Required]
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Title
+ {
+ get
+ {
+ string value = _Title;
+ GetTitle(ref value);
+ return (_Title = value);
+ }
+ set
+ {
+ string oldValue = _Title;
+ SetTitle(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Title = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for OriginalTitle
+ /// </summary>
+ protected string _OriginalTitle;
+ /// <summary>
+ /// When provided in a partial class, allows value of OriginalTitle to be changed before setting.
+ /// </summary>
+ partial void SetOriginalTitle(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of OriginalTitle to be changed before returning.
+ /// </summary>
+ partial void GetOriginalTitle(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string OriginalTitle
+ {
+ get
{
- _Id = value;
+ string value = _OriginalTitle;
+ GetOriginalTitle(ref value);
+ return (_OriginalTitle = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Title
- /// </summary>
- protected string _Title;
- /// <summary>
- /// When provided in a partial class, allows value of Title to be changed before setting.
- /// </summary>
- partial void SetTitle(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Title to be changed before returning.
- /// </summary>
- partial void GetTitle(ref string result);
-
- /// <summary>
- /// Required, Max length = 1024
- /// The title or name of the object
- /// </summary>
- [Required]
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Title
- {
- get
- {
- string value = _Title;
- GetTitle(ref value);
- return (_Title = value);
- }
- set
- {
- string oldValue = _Title;
- SetTitle(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Title = value;
+ string oldValue = _OriginalTitle;
+ SetOriginalTitle(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _OriginalTitle = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for OriginalTitle
- /// </summary>
- protected string _OriginalTitle;
- /// <summary>
- /// When provided in a partial class, allows value of OriginalTitle to be changed before setting.
- /// </summary>
- partial void SetOriginalTitle(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of OriginalTitle to be changed before returning.
- /// </summary>
- partial void GetOriginalTitle(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string OriginalTitle
- {
- get
- {
- string value = _OriginalTitle;
- GetOriginalTitle(ref value);
- return (_OriginalTitle = value);
- }
- set
- {
- string oldValue = _OriginalTitle;
- SetOriginalTitle(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for SortTitle
+ /// </summary>
+ protected string _SortTitle;
+ /// <summary>
+ /// When provided in a partial class, allows value of SortTitle to be changed before setting.
+ /// </summary>
+ partial void SetSortTitle(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of SortTitle to be changed before returning.
+ /// </summary>
+ partial void GetSortTitle(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string SortTitle
+ {
+ get
{
- _OriginalTitle = value;
+ string value = _SortTitle;
+ GetSortTitle(ref value);
+ return (_SortTitle = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for SortTitle
- /// </summary>
- protected string _SortTitle;
- /// <summary>
- /// When provided in a partial class, allows value of SortTitle to be changed before setting.
- /// </summary>
- partial void SetSortTitle(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of SortTitle to be changed before returning.
- /// </summary>
- partial void GetSortTitle(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string SortTitle
- {
- get
- {
- string value = _SortTitle;
- GetSortTitle(ref value);
- return (_SortTitle = value);
- }
- set
- {
- string oldValue = _SortTitle;
- SetSortTitle(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _SortTitle = value;
+ string oldValue = _SortTitle;
+ SetSortTitle(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _SortTitle = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Language
- /// </summary>
- protected string _Language;
- /// <summary>
- /// When provided in a partial class, allows value of Language to be changed before setting.
- /// </summary>
- partial void SetLanguage(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Language to be changed before returning.
- /// </summary>
- partial void GetLanguage(ref string result);
-
- /// <summary>
- /// Required, Min length = 3, Max length = 3
- /// ISO-639-3 3-character language codes
- /// </summary>
- [Required]
- [MinLength(3)]
- [MaxLength(3)]
- [StringLength(3)]
- public string Language
- {
- get
- {
- string value = _Language;
- GetLanguage(ref value);
- return (_Language = value);
- }
- set
- {
- string oldValue = _Language;
- SetLanguage(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Language
+ /// </summary>
+ protected string _Language;
+ /// <summary>
+ /// When provided in a partial class, allows value of Language to be changed before setting.
+ /// </summary>
+ partial void SetLanguage(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Language to be changed before returning.
+ /// </summary>
+ partial void GetLanguage(ref string result);
+
+ /// <summary>
+ /// Required, Min length = 3, Max length = 3
+ /// ISO-639-3 3-character language codes
+ /// </summary>
+ [Required]
+ [MinLength(3)]
+ [MaxLength(3)]
+ [StringLength(3)]
+ public string Language
+ {
+ get
{
- _Language = value;
+ string value = _Language;
+ GetLanguage(ref value);
+ return (_Language = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for ReleaseDate
- /// </summary>
- protected DateTimeOffset? _ReleaseDate;
- /// <summary>
- /// When provided in a partial class, allows value of ReleaseDate to be changed before setting.
- /// </summary>
- partial void SetReleaseDate(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
- /// <summary>
- /// When provided in a partial class, allows value of ReleaseDate to be changed before returning.
- /// </summary>
- partial void GetReleaseDate(ref DateTimeOffset? result);
-
- public DateTimeOffset? ReleaseDate
- {
- get
- {
- DateTimeOffset? value = _ReleaseDate;
- GetReleaseDate(ref value);
- return (_ReleaseDate = value);
- }
- set
- {
- DateTimeOffset? oldValue = _ReleaseDate;
- SetReleaseDate(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _ReleaseDate = value;
+ string oldValue = _Language;
+ SetLanguage(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Language = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for DateAdded
- /// </summary>
- protected DateTime _DateAdded;
- /// <summary>
- /// When provided in a partial class, allows value of DateAdded to be changed before setting.
- /// </summary>
- partial void SetDateAdded(DateTime oldValue, ref DateTime newValue);
- /// <summary>
- /// When provided in a partial class, allows value of DateAdded to be changed before returning.
- /// </summary>
- partial void GetDateAdded(ref DateTime result);
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public DateTime DateAdded
- {
- get
- {
- DateTime value = _DateAdded;
- GetDateAdded(ref value);
- return (_DateAdded = value);
- }
- internal set
- {
- DateTime oldValue = _DateAdded;
- SetDateAdded(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for ReleaseDate
+ /// </summary>
+ protected DateTimeOffset? _ReleaseDate;
+ /// <summary>
+ /// When provided in a partial class, allows value of ReleaseDate to be changed before setting.
+ /// </summary>
+ partial void SetReleaseDate(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of ReleaseDate to be changed before returning.
+ /// </summary>
+ partial void GetReleaseDate(ref DateTimeOffset? result);
+
+ public DateTimeOffset? ReleaseDate
+ {
+ get
{
- _DateAdded = value;
+ DateTimeOffset? value = _ReleaseDate;
+ GetReleaseDate(ref value);
+ return (_ReleaseDate = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for DateModified
- /// </summary>
- protected DateTime _DateModified;
- /// <summary>
- /// When provided in a partial class, allows value of DateModified to be changed before setting.
- /// </summary>
- partial void SetDateModified(DateTime oldValue, ref DateTime newValue);
- /// <summary>
- /// When provided in a partial class, allows value of DateModified to be changed before returning.
- /// </summary>
- partial void GetDateModified(ref DateTime result);
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public DateTime DateModified
- {
- get
- {
- DateTime value = _DateModified;
- GetDateModified(ref value);
- return (_DateModified = value);
- }
- internal set
- {
- DateTime oldValue = _DateModified;
- SetDateModified(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _DateModified = value;
+ DateTimeOffset? oldValue = _ReleaseDate;
+ SetReleaseDate(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _ReleaseDate = value;
+ }
}
- }
- }
+ }
+
+ /// <summary>
+ /// Backing field for DateAdded
+ /// </summary>
+ protected DateTime _DateAdded;
+ /// <summary>
+ /// When provided in a partial class, allows value of DateAdded to be changed before setting.
+ /// </summary>
+ partial void SetDateAdded(DateTime oldValue, ref DateTime newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of DateAdded to be changed before returning.
+ /// </summary>
+ partial void GetDateAdded(ref DateTime result);
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public DateTime DateAdded
+ {
+ get
+ {
+ DateTime value = _DateAdded;
+ GetDateAdded(ref value);
+ return (_DateAdded = value);
+ }
+ internal set
+ {
+ DateTime oldValue = _DateAdded;
+ SetDateAdded(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _DateAdded = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for DateModified
+ /// </summary>
+ protected DateTime _DateModified;
+ /// <summary>
+ /// When provided in a partial class, allows value of DateModified to be changed before setting.
+ /// </summary>
+ partial void SetDateModified(DateTime oldValue, ref DateTime newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of DateModified to be changed before returning.
+ /// </summary>
+ partial void GetDateModified(ref DateTime result);
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public DateTime DateModified
+ {
+ get
+ {
+ DateTime value = _DateModified;
+ GetDateModified(ref value);
+ return (_DateModified = value);
+ }
+ internal set
+ {
+ DateTime oldValue = _DateModified;
+ SetDateModified(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _DateModified = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection<global::Jellyfin.Data.Entities.PersonRole> PersonRoles { get; protected set; }
+ [ForeignKey("PersonRole_PersonRoles_Id")]
+ public virtual ICollection<PersonRole> PersonRoles { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.Genre> Genres { get; protected set; }
+ [ForeignKey("PersonRole_PersonRoles_Id")]
+ public virtual ICollection<Genre> Genres { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.Artwork> Artwork { get; protected set; }
+ [ForeignKey("PersonRole_PersonRoles_Id")]
+ public virtual ICollection<Artwork> Artwork { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.Rating> Ratings { get; protected set; }
+ [ForeignKey("PersonRole_PersonRoles_Id")]
+ public virtual ICollection<Rating> Ratings { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.MetadataProviderId> Sources { get; protected set; }
+ [ForeignKey("PersonRole_PersonRoles_Id")]
+ public virtual ICollection<MetadataProviderId> Sources { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/MetadataProvider.cs b/Jellyfin.Data/Entities/MetadataProvider.cs
index 3a8f5854e..4e4f107fb 100644
--- a/Jellyfin.Data/Entities/MetadataProvider.cs
+++ b/Jellyfin.Data/Entities/MetadataProvider.cs
@@ -1,158 +1,147 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class MetadataProvider
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected MetadataProvider()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static MetadataProvider CreateMetadataProviderUnsafe()
- {
- return new MetadataProvider();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="name"></param>
- public MetadataProvider(string name)
- {
- if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
- this.Name = name;
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="name"></param>
- public static MetadataProvider Create(string name)
- {
- return new MetadataProvider(name);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class MetadataProvider
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected MetadataProvider()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static MetadataProvider CreateMetadataProviderUnsafe()
+ {
+ return new MetadataProvider();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="name"></param>
+ public MetadataProvider(string name)
+ {
+ if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
+ this.Name = name;
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="name"></param>
+ public static MetadataProvider Create(string name)
+ {
+ return new MetadataProvider(name);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
{
- _Id = value;
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Name
- /// </summary>
- protected string _Name;
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before setting.
- /// </summary>
- partial void SetName(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before returning.
- /// </summary>
- partial void GetName(ref string result);
-
- /// <summary>
- /// Required, Max length = 1024
- /// </summary>
- [Required]
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Name
- {
- get
- {
- string value = _Name;
- GetName(ref value);
- return (_Name = value);
- }
- set
- {
- string oldValue = _Name;
- SetName(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Name
+ /// </summary>
+ protected string _Name;
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ /// </summary>
+ partial void SetName(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ /// </summary>
+ partial void GetName(ref string result);
+
+ /// <summary>
+ /// Required, Max length = 1024
+ /// </summary>
+ [Required]
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Name
+ {
+ get
{
- _Name = value;
+ string value = _Name;
+ GetName(ref value);
+ return (_Name = value);
}
- }
- }
+ set
+ {
+ string oldValue = _Name;
+ SetName(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Name = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/MetadataProviderId.cs b/Jellyfin.Data/Entities/MetadataProviderId.cs
index 87ff19e26..926f223de 100644
--- a/Jellyfin.Data/Entities/MetadataProviderId.cs
+++ b/Jellyfin.Data/Entities/MetadataProviderId.cs
@@ -1,189 +1,179 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class MetadataProviderId
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected MetadataProviderId()
- {
- // NOTE: This class has one-to-one associations with MetadataProviderId.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static MetadataProviderId CreateMetadataProviderIdUnsafe()
- {
- return new MetadataProviderId();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="providerid"></param>
- /// <param name="_metadata0"></param>
- /// <param name="_person1"></param>
- /// <param name="_personrole2"></param>
- /// <param name="_ratingsource3"></param>
- public MetadataProviderId(string providerid, global::Jellyfin.Data.Entities.Metadata _metadata0, global::Jellyfin.Data.Entities.Person _person1, global::Jellyfin.Data.Entities.PersonRole _personrole2, global::Jellyfin.Data.Entities.RatingSource _ratingsource3)
- {
- // NOTE: This class has one-to-one associations with MetadataProviderId.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- if (string.IsNullOrEmpty(providerid)) throw new ArgumentNullException(nameof(providerid));
- this.ProviderId = providerid;
-
- if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
- _metadata0.Sources.Add(this);
-
- if (_person1 == null) throw new ArgumentNullException(nameof(_person1));
- _person1.Sources.Add(this);
-
- if (_personrole2 == null) throw new ArgumentNullException(nameof(_personrole2));
- _personrole2.Sources.Add(this);
-
- if (_ratingsource3 == null) throw new ArgumentNullException(nameof(_ratingsource3));
- _ratingsource3.Source = this;
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="providerid"></param>
- /// <param name="_metadata0"></param>
- /// <param name="_person1"></param>
- /// <param name="_personrole2"></param>
- /// <param name="_ratingsource3"></param>
- public static MetadataProviderId Create(string providerid, global::Jellyfin.Data.Entities.Metadata _metadata0, global::Jellyfin.Data.Entities.Person _person1, global::Jellyfin.Data.Entities.PersonRole _personrole2, global::Jellyfin.Data.Entities.RatingSource _ratingsource3)
- {
- return new MetadataProviderId(providerid, _metadata0, _person1, _personrole2, _ratingsource3);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class MetadataProviderId
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected MetadataProviderId()
+ {
+ // NOTE: This class has one-to-one associations with MetadataProviderId.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static MetadataProviderId CreateMetadataProviderIdUnsafe()
+ {
+ return new MetadataProviderId();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="providerid"></param>
+ /// <param name="_metadata0"></param>
+ /// <param name="_person1"></param>
+ /// <param name="_personrole2"></param>
+ /// <param name="_ratingsource3"></param>
+ public MetadataProviderId(string providerid, Metadata _metadata0, Person _person1, PersonRole _personrole2, RatingSource _ratingsource3)
+ {
+ // NOTE: This class has one-to-one associations with MetadataProviderId.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ if (string.IsNullOrEmpty(providerid)) throw new ArgumentNullException(nameof(providerid));
+ this.ProviderId = providerid;
+
+ if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
+ _metadata0.Sources.Add(this);
+
+ if (_person1 == null) throw new ArgumentNullException(nameof(_person1));
+ _person1.Sources.Add(this);
+
+ if (_personrole2 == null) throw new ArgumentNullException(nameof(_personrole2));
+ _personrole2.Sources.Add(this);
+
+ if (_ratingsource3 == null) throw new ArgumentNullException(nameof(_ratingsource3));
+ _ratingsource3.Source = this;
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="providerid"></param>
+ /// <param name="_metadata0"></param>
+ /// <param name="_person1"></param>
+ /// <param name="_personrole2"></param>
+ /// <param name="_ratingsource3"></param>
+ public static MetadataProviderId Create(string providerid, Metadata _metadata0, Person _person1, PersonRole _personrole2, RatingSource _ratingsource3)
+ {
+ return new MetadataProviderId(providerid, _metadata0, _person1, _personrole2, _ratingsource3);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
+ {
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for ProviderId
+ /// </summary>
+ protected string _ProviderId;
+ /// <summary>
+ /// When provided in a partial class, allows value of ProviderId to be changed before setting.
+ /// </summary>
+ partial void SetProviderId(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of ProviderId to be changed before returning.
+ /// </summary>
+ partial void GetProviderId(ref string result);
+
+ /// <summary>
+ /// Required, Max length = 255
+ /// </summary>
+ [Required]
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string ProviderId
+ {
+ get
{
- _Id = value;
+ string value = _ProviderId;
+ GetProviderId(ref value);
+ return (_ProviderId = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for ProviderId
- /// </summary>
- protected string _ProviderId;
- /// <summary>
- /// When provided in a partial class, allows value of ProviderId to be changed before setting.
- /// </summary>
- partial void SetProviderId(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of ProviderId to be changed before returning.
- /// </summary>
- partial void GetProviderId(ref string result);
-
- /// <summary>
- /// Required, Max length = 255
- /// </summary>
- [Required]
- [MaxLength(255)]
- [StringLength(255)]
- public string ProviderId
- {
- get
- {
- string value = _ProviderId;
- GetProviderId(ref value);
- return (_ProviderId = value);
- }
- set
- {
- string oldValue = _ProviderId;
- SetProviderId(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _ProviderId = value;
+ string oldValue = _ProviderId;
+ SetProviderId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _ProviderId = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- /// <summary>
- /// Required
- /// </summary>
- public virtual global::Jellyfin.Data.Entities.MetadataProvider MetadataProvider { get; set; }
-
- }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [ForeignKey("MetadataProvider_Id")]
+ public virtual MetadataProvider MetadataProvider { get; set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/Movie.cs b/Jellyfin.Data/Entities/Movie.cs
index dfcc05a94..b359b42fc 100644
--- a/Jellyfin.Data/Entities/Movie.cs
+++ b/Jellyfin.Data/Entities/Movie.cs
@@ -1,84 +1,69 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Movie: global::Jellyfin.Data.Entities.LibraryItem
- {
- partial void Init();
+ public partial class Movie : LibraryItem
+ {
+ partial void Init();
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Movie(): base()
- {
- Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
- MovieMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MovieMetadata>();
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Movie()
+ {
+ Releases = new HashSet<Release>();
+ MovieMetadata = new HashSet<MovieMetadata>();
- Init();
- }
+ Init();
+ }
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Movie CreateMovieUnsafe()
- {
- return new Movie();
- }
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Movie CreateMovieUnsafe()
+ {
+ return new Movie();
+ }
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public Movie(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public Movie(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
- this.Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
- this.MovieMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MovieMetadata>();
+ this.Releases = new HashSet<Release>();
+ this.MovieMetadata = new HashSet<MovieMetadata>();
- Init();
- }
+ Init();
+ }
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public static Movie Create(Guid urlid, DateTime dateadded)
- {
- return new Movie(urlid, dateadded);
- }
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public static Movie Create(Guid urlid, DateTime dateadded)
+ {
+ return new Movie(urlid, dateadded);
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection<global::Jellyfin.Data.Entities.Release> Releases { get; protected set; }
+ [ForeignKey("Release_Releases_Id")]
+ public virtual ICollection<Release> Releases { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.MovieMetadata> MovieMetadata { get; protected set; }
+ [ForeignKey("MovieMetadata_MovieMetadata_Id")]
+ public virtual ICollection<MovieMetadata> MovieMetadata { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/MovieMetadata.cs b/Jellyfin.Data/Entities/MovieMetadata.cs
index bd847da8f..319ae94e5 100644
--- a/Jellyfin.Data/Entities/MovieMetadata.cs
+++ b/Jellyfin.Data/Entities/MovieMetadata.cs
@@ -1,239 +1,223 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class MovieMetadata: global::Jellyfin.Data.Entities.Metadata
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected MovieMetadata(): base()
- {
- Studios = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Company>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static MovieMetadata CreateMovieMetadataUnsafe()
- {
- return new MovieMetadata();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_movie0"></param>
- public MovieMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Movie _movie0)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
-
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
-
- if (_movie0 == null) throw new ArgumentNullException(nameof(_movie0));
- _movie0.MovieMetadata.Add(this);
-
- this.Studios = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Company>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_movie0"></param>
- public static MovieMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Movie _movie0)
- {
- return new MovieMetadata(title, language, dateadded, datemodified, _movie0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Outline
- /// </summary>
- protected string _Outline;
- /// <summary>
- /// When provided in a partial class, allows value of Outline to be changed before setting.
- /// </summary>
- partial void SetOutline(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Outline to be changed before returning.
- /// </summary>
- partial void GetOutline(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Outline
- {
- get
- {
- string value = _Outline;
- GetOutline(ref value);
- return (_Outline = value);
- }
- set
- {
- string oldValue = _Outline;
- SetOutline(oldValue, ref value);
- if (oldValue != value)
+ public partial class MovieMetadata : Metadata
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected MovieMetadata()
+ {
+ Studios = new HashSet<Company>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static MovieMetadata CreateMovieMetadataUnsafe()
+ {
+ return new MovieMetadata();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_movie0"></param>
+ public MovieMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Movie _movie0)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
+
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
+
+ if (_movie0 == null) throw new ArgumentNullException(nameof(_movie0));
+ _movie0.MovieMetadata.Add(this);
+
+ this.Studios = new HashSet<Company>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_movie0"></param>
+ public static MovieMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Movie _movie0)
+ {
+ return new MovieMetadata(title, language, dateadded, datemodified, _movie0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Outline
+ /// </summary>
+ protected string _Outline;
+ /// <summary>
+ /// When provided in a partial class, allows value of Outline to be changed before setting.
+ /// </summary>
+ partial void SetOutline(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Outline to be changed before returning.
+ /// </summary>
+ partial void GetOutline(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Outline
+ {
+ get
{
- _Outline = value;
+ string value = _Outline;
+ GetOutline(ref value);
+ return (_Outline = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Plot
- /// </summary>
- protected string _Plot;
- /// <summary>
- /// When provided in a partial class, allows value of Plot to be changed before setting.
- /// </summary>
- partial void SetPlot(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Plot to be changed before returning.
- /// </summary>
- partial void GetPlot(ref string result);
-
- /// <summary>
- /// Max length = 65535
- /// </summary>
- [MaxLength(65535)]
- [StringLength(65535)]
- public string Plot
- {
- get
- {
- string value = _Plot;
- GetPlot(ref value);
- return (_Plot = value);
- }
- set
- {
- string oldValue = _Plot;
- SetPlot(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Plot = value;
+ string oldValue = _Outline;
+ SetOutline(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Outline = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Tagline
- /// </summary>
- protected string _Tagline;
- /// <summary>
- /// When provided in a partial class, allows value of Tagline to be changed before setting.
- /// </summary>
- partial void SetTagline(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Tagline to be changed before returning.
- /// </summary>
- partial void GetTagline(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Tagline
- {
- get
- {
- string value = _Tagline;
- GetTagline(ref value);
- return (_Tagline = value);
- }
- set
- {
- string oldValue = _Tagline;
- SetTagline(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Plot
+ /// </summary>
+ protected string _Plot;
+ /// <summary>
+ /// When provided in a partial class, allows value of Plot to be changed before setting.
+ /// </summary>
+ partial void SetPlot(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Plot to be changed before returning.
+ /// </summary>
+ partial void GetPlot(ref string result);
+
+ /// <summary>
+ /// Max length = 65535
+ /// </summary>
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string Plot
+ {
+ get
{
- _Tagline = value;
+ string value = _Plot;
+ GetPlot(ref value);
+ return (_Plot = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Country
- /// </summary>
- protected string _Country;
- /// <summary>
- /// When provided in a partial class, allows value of Country to be changed before setting.
- /// </summary>
- partial void SetCountry(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Country to be changed before returning.
- /// </summary>
- partial void GetCountry(ref string result);
-
- /// <summary>
- /// Max length = 2
- /// </summary>
- [MaxLength(2)]
- [StringLength(2)]
- public string Country
- {
- get
- {
- string value = _Country;
- GetCountry(ref value);
- return (_Country = value);
- }
- set
- {
- string oldValue = _Country;
- SetCountry(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Country = value;
+ string oldValue = _Plot;
+ SetPlot(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Plot = value;
+ }
}
- }
- }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ }
+
+ /// <summary>
+ /// Backing field for Tagline
+ /// </summary>
+ protected string _Tagline;
+ /// <summary>
+ /// When provided in a partial class, allows value of Tagline to be changed before setting.
+ /// </summary>
+ partial void SetTagline(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Tagline to be changed before returning.
+ /// </summary>
+ partial void GetTagline(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Tagline
+ {
+ get
+ {
+ string value = _Tagline;
+ GetTagline(ref value);
+ return (_Tagline = value);
+ }
+ set
+ {
+ string oldValue = _Tagline;
+ SetTagline(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Tagline = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Country
+ /// </summary>
+ protected string _Country;
+ /// <summary>
+ /// When provided in a partial class, allows value of Country to be changed before setting.
+ /// </summary>
+ partial void SetCountry(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Country to be changed before returning.
+ /// </summary>
+ partial void GetCountry(ref string result);
+
+ /// <summary>
+ /// Max length = 2
+ /// </summary>
+ [MaxLength(2)]
+ [StringLength(2)]
+ public string Country
+ {
+ get
+ {
+ string value = _Country;
+ GetCountry(ref value);
+ return (_Country = value);
+ }
+ set
+ {
+ string oldValue = _Country;
+ SetCountry(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Country = value;
+ }
+ }
+ }
- public virtual ICollection<global::Jellyfin.Data.Entities.Company> Studios { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("Company_Studios_Id")]
+ public virtual ICollection<Company> Studios { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/MusicAlbum.cs b/Jellyfin.Data/Entities/MusicAlbum.cs
index 417f2595b..00cb8fe00 100644
--- a/Jellyfin.Data/Entities/MusicAlbum.cs
+++ b/Jellyfin.Data/Entities/MusicAlbum.cs
@@ -1,84 +1,68 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class MusicAlbum: global::Jellyfin.Data.Entities.LibraryItem
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected MusicAlbum(): base()
- {
- MusicAlbumMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MusicAlbumMetadata>();
- Tracks = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Track>();
+ public partial class MusicAlbum : LibraryItem
+ {
+ partial void Init();
- Init();
- }
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected MusicAlbum()
+ {
+ MusicAlbumMetadata = new HashSet<MusicAlbumMetadata>();
+ Tracks = new HashSet<Track>();
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static MusicAlbum CreateMusicAlbumUnsafe()
- {
- return new MusicAlbum();
- }
+ Init();
+ }
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public MusicAlbum(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static MusicAlbum CreateMusicAlbumUnsafe()
+ {
+ return new MusicAlbum();
+ }
- this.MusicAlbumMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MusicAlbumMetadata>();
- this.Tracks = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Track>();
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public MusicAlbum(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
- Init();
- }
+ this.MusicAlbumMetadata = new HashSet<MusicAlbumMetadata>();
+ this.Tracks = new HashSet<Track>();
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public static MusicAlbum Create(Guid urlid, DateTime dateadded)
- {
- return new MusicAlbum(urlid, dateadded);
- }
+ Init();
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public static MusicAlbum Create(Guid urlid, DateTime dateadded)
+ {
+ return new MusicAlbum(urlid, dateadded);
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- public virtual ICollection<global::Jellyfin.Data.Entities.MusicAlbumMetadata> MusicAlbumMetadata { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("MusicAlbumMetadata_MusicAlbumMetadata_Id")]
+ public virtual ICollection<MusicAlbumMetadata> MusicAlbumMetadata { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.Track> Tracks { get; protected set; }
+ [ForeignKey("Track_Tracks_Id")]
+ public virtual ICollection<Track> Tracks { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/MusicAlbumMetadata.cs b/Jellyfin.Data/Entities/MusicAlbumMetadata.cs
index cd72ecba5..b52ca6564 100644
--- a/Jellyfin.Data/Entities/MusicAlbumMetadata.cs
+++ b/Jellyfin.Data/Entities/MusicAlbumMetadata.cs
@@ -1,202 +1,187 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class MusicAlbumMetadata: global::Jellyfin.Data.Entities.Metadata
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected MusicAlbumMetadata(): base()
- {
- Labels = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Company>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static MusicAlbumMetadata CreateMusicAlbumMetadataUnsafe()
- {
- return new MusicAlbumMetadata();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_musicalbum0"></param>
- public MusicAlbumMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.MusicAlbum _musicalbum0)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
-
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
-
- if (_musicalbum0 == null) throw new ArgumentNullException(nameof(_musicalbum0));
- _musicalbum0.MusicAlbumMetadata.Add(this);
-
- this.Labels = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Company>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_musicalbum0"></param>
- public static MusicAlbumMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.MusicAlbum _musicalbum0)
- {
- return new MusicAlbumMetadata(title, language, dateadded, datemodified, _musicalbum0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Barcode
- /// </summary>
- protected string _Barcode;
- /// <summary>
- /// When provided in a partial class, allows value of Barcode to be changed before setting.
- /// </summary>
- partial void SetBarcode(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Barcode to be changed before returning.
- /// </summary>
- partial void GetBarcode(ref string result);
-
- /// <summary>
- /// Max length = 255
- /// </summary>
- [MaxLength(255)]
- [StringLength(255)]
- public string Barcode
- {
- get
- {
- string value = _Barcode;
- GetBarcode(ref value);
- return (_Barcode = value);
- }
- set
- {
- string oldValue = _Barcode;
- SetBarcode(oldValue, ref value);
- if (oldValue != value)
+ public partial class MusicAlbumMetadata : Metadata
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected MusicAlbumMetadata()
+ {
+ Labels = new HashSet<Company>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static MusicAlbumMetadata CreateMusicAlbumMetadataUnsafe()
+ {
+ return new MusicAlbumMetadata();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_musicalbum0"></param>
+ public MusicAlbumMetadata(string title, string language, DateTime dateadded, DateTime datemodified, MusicAlbum _musicalbum0)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
+
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
+
+ if (_musicalbum0 == null) throw new ArgumentNullException(nameof(_musicalbum0));
+ _musicalbum0.MusicAlbumMetadata.Add(this);
+
+ this.Labels = new HashSet<Company>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_musicalbum0"></param>
+ public static MusicAlbumMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, MusicAlbum _musicalbum0)
+ {
+ return new MusicAlbumMetadata(title, language, dateadded, datemodified, _musicalbum0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Barcode
+ /// </summary>
+ protected string _Barcode;
+ /// <summary>
+ /// When provided in a partial class, allows value of Barcode to be changed before setting.
+ /// </summary>
+ partial void SetBarcode(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Barcode to be changed before returning.
+ /// </summary>
+ partial void GetBarcode(ref string result);
+
+ /// <summary>
+ /// Max length = 255
+ /// </summary>
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string Barcode
+ {
+ get
+ {
+ string value = _Barcode;
+ GetBarcode(ref value);
+ return (_Barcode = value);
+ }
+ set
+ {
+ string oldValue = _Barcode;
+ SetBarcode(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Barcode = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for LabelNumber
+ /// </summary>
+ protected string _LabelNumber;
+ /// <summary>
+ /// When provided in a partial class, allows value of LabelNumber to be changed before setting.
+ /// </summary>
+ partial void SetLabelNumber(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of LabelNumber to be changed before returning.
+ /// </summary>
+ partial void GetLabelNumber(ref string result);
+
+ /// <summary>
+ /// Max length = 255
+ /// </summary>
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string LabelNumber
+ {
+ get
+ {
+ string value = _LabelNumber;
+ GetLabelNumber(ref value);
+ return (_LabelNumber = value);
+ }
+ set
{
- _Barcode = value;
+ string oldValue = _LabelNumber;
+ SetLabelNumber(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _LabelNumber = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for LabelNumber
- /// </summary>
- protected string _LabelNumber;
- /// <summary>
- /// When provided in a partial class, allows value of LabelNumber to be changed before setting.
- /// </summary>
- partial void SetLabelNumber(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of LabelNumber to be changed before returning.
- /// </summary>
- partial void GetLabelNumber(ref string result);
-
- /// <summary>
- /// Max length = 255
- /// </summary>
- [MaxLength(255)]
- [StringLength(255)]
- public string LabelNumber
- {
- get
- {
- string value = _LabelNumber;
- GetLabelNumber(ref value);
- return (_LabelNumber = value);
- }
- set
- {
- string oldValue = _LabelNumber;
- SetLabelNumber(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Country
+ /// </summary>
+ protected string _Country;
+ /// <summary>
+ /// When provided in a partial class, allows value of Country to be changed before setting.
+ /// </summary>
+ partial void SetCountry(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Country to be changed before returning.
+ /// </summary>
+ partial void GetCountry(ref string result);
+
+ /// <summary>
+ /// Max length = 2
+ /// </summary>
+ [MaxLength(2)]
+ [StringLength(2)]
+ public string Country
+ {
+ get
{
- _LabelNumber = value;
+ string value = _Country;
+ GetCountry(ref value);
+ return (_Country = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Country
- /// </summary>
- protected string _Country;
- /// <summary>
- /// When provided in a partial class, allows value of Country to be changed before setting.
- /// </summary>
- partial void SetCountry(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Country to be changed before returning.
- /// </summary>
- partial void GetCountry(ref string result);
-
- /// <summary>
- /// Max length = 2
- /// </summary>
- [MaxLength(2)]
- [StringLength(2)]
- public string Country
- {
- get
- {
- string value = _Country;
- GetCountry(ref value);
- return (_Country = value);
- }
- set
- {
- string oldValue = _Country;
- SetCountry(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Country = value;
+ string oldValue = _Country;
+ SetCountry(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Country = value;
+ }
}
- }
- }
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection<global::Jellyfin.Data.Entities.Company> Labels { get; protected set; }
+ [ForeignKey("Company_Labels_Id")]
+ public virtual ICollection<Company> Labels { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Permission.cs b/Jellyfin.Data/Entities/Permission.cs
index a717fc83f..0b5b52cbd 100644
--- a/Jellyfin.Data/Entities/Permission.cs
+++ b/Jellyfin.Data/Entities/Permission.cs
@@ -1,152 +1,144 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Permission
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Permission()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Permission CreatePermissionUnsafe()
- {
- return new Permission();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="kind"></param>
- /// <param name="value"></param>
- /// <param name="_user0"></param>
- /// <param name="_group1"></param>
- public Permission(global::Jellyfin.Data.Enums.PermissionKind kind, bool value, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1)
- {
- this.Kind = kind;
-
- this.Value = value;
-
- if (_user0 == null) throw new ArgumentNullException(nameof(_user0));
- _user0.Permissions.Add(this);
-
- if (_group1 == null) throw new ArgumentNullException(nameof(_group1));
- _group1.GroupPermissions.Add(this);
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="kind"></param>
- /// <param name="value"></param>
- /// <param name="_user0"></param>
- /// <param name="_group1"></param>
- public static Permission Create(global::Jellyfin.Data.Enums.PermissionKind kind, bool value, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1)
- {
- return new Permission(kind, value, _user0, _group1);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id { get; protected set; }
-
- /// <summary>
- /// Backing field for Kind
- /// </summary>
- protected global::Jellyfin.Data.Enums.PermissionKind _Kind;
- /// <summary>
- /// When provided in a partial class, allows value of Kind to be changed before setting.
- /// </summary>
- partial void SetKind(global::Jellyfin.Data.Enums.PermissionKind oldValue, ref global::Jellyfin.Data.Enums.PermissionKind newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Kind to be changed before returning.
- /// </summary>
- partial void GetKind(ref global::Jellyfin.Data.Enums.PermissionKind result);
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public global::Jellyfin.Data.Enums.PermissionKind Kind
- {
- get
- {
- global::Jellyfin.Data.Enums.PermissionKind value = _Kind;
- GetKind(ref value);
- return (_Kind = value);
- }
- set
- {
- global::Jellyfin.Data.Enums.PermissionKind oldValue = _Kind;
- SetKind(oldValue, ref value);
- if (oldValue != value)
+ public partial class Permission
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Permission()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Permission CreatePermissionUnsafe()
+ {
+ return new Permission();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="kind"></param>
+ /// <param name="value"></param>
+ /// <param name="_user0"></param>
+ /// <param name="_group1"></param>
+ public Permission(Enums.PermissionKind kind, bool value, User _user0, Group _group1)
+ {
+ this.Kind = kind;
+
+ this.Value = value;
+
+ if (_user0 == null) throw new ArgumentNullException(nameof(_user0));
+ _user0.Permissions.Add(this);
+
+ if (_group1 == null) throw new ArgumentNullException(nameof(_group1));
+ _group1.GroupPermissions.Add(this);
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="kind"></param>
+ /// <param name="value"></param>
+ /// <param name="_user0"></param>
+ /// <param name="_group1"></param>
+ public static Permission Create(Enums.PermissionKind kind, bool value, User _user0, Group _group1)
+ {
+ return new Permission(kind, value, _user0, _group1);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id { get; protected set; }
+
+ /// <summary>
+ /// Backing field for Kind
+ /// </summary>
+ protected Enums.PermissionKind _Kind;
+ /// <summary>
+ /// When provided in a partial class, allows value of Kind to be changed before setting.
+ /// </summary>
+ partial void SetKind(Enums.PermissionKind oldValue, ref Enums.PermissionKind newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Kind to be changed before returning.
+ /// </summary>
+ partial void GetKind(ref Enums.PermissionKind result);
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public Enums.PermissionKind Kind
+ {
+ get
{
- _Kind = value;
- OnPropertyChanged();
+ Enums.PermissionKind value = _Kind;
+ GetKind(ref value);
+ return (_Kind = value);
}
- }
- }
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public bool Value { get; set; }
-
- /// <summary>
- /// Concurrency token
- /// </summary>
- [Timestamp]
- public Byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- public virtual event PropertyChangedEventHandler PropertyChanged;
-
- protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
- {
- PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
- }
-
- }
+ set
+ {
+ Enums.PermissionKind oldValue = _Kind;
+ SetKind(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Kind = value;
+ OnPropertyChanged();
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public bool Value { get; set; }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ public virtual event PropertyChangedEventHandler PropertyChanged;
+
+ protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
+ {
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
+ }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/PermissionKind.cs b/Jellyfin.Data/Entities/PermissionKind.cs
deleted file mode 100644
index 971298674..000000000
--- a/Jellyfin.Data/Entities/PermissionKind.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
-
-namespace Jellyfin.Data.Enums
-{
- public enum PermissionKind : Int32
- {
- IsAdministrator,
- IsHidden,
- IsDisabled,
- BlockUnrateditems,
- EnbleSharedDeviceControl,
- EnableRemoteAccess,
- EnableLiveTvManagement,
- EnableLiveTvAccess,
- EnableMediaPlayback,
- EnableAudioPlaybackTranscoding,
- EnableVideoPlaybackTranscoding,
- EnableContentDeletion,
- EnableContentDownloading,
- EnableSyncTranscoding,
- EnableMediaConversion,
- EnableAllDevices,
- EnableAllChannels,
- EnableAllFolders,
- EnablePublicSharing,
- AccessSchedules
- }
-}
diff --git a/Jellyfin.Data/Entities/Person.cs b/Jellyfin.Data/Entities/Person.cs
index 3437b9581..d893b7e39 100644
--- a/Jellyfin.Data/Entities/Person.cs
+++ b/Jellyfin.Data/Entities/Person.cs
@@ -1,312 +1,302 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Person
- {
- partial void Init();
+ public partial class Person
+ {
+ partial void Init();
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Person()
- {
- Sources = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MetadataProviderId>();
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Person()
+ {
+ Sources = new HashSet<MetadataProviderId>();
- Init();
- }
+ Init();
+ }
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Person CreatePersonUnsafe()
- {
- return new Person();
- }
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Person CreatePersonUnsafe()
+ {
+ return new Person();
+ }
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid"></param>
- /// <param name="name"></param>
- public Person(Guid urlid, string name, DateTime dateadded, DateTime datemodified)
- {
- this.UrlId = urlid;
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid"></param>
+ /// <param name="name"></param>
+ public Person(Guid urlid, string name, DateTime dateadded, DateTime datemodified)
+ {
+ this.UrlId = urlid;
- if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
- this.Name = name;
+ if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
+ this.Name = name;
- this.Sources = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MetadataProviderId>();
+ this.Sources = new HashSet<MetadataProviderId>();
- Init();
- }
+ Init();
+ }
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="urlid"></param>
- /// <param name="name"></param>
- public static Person Create(Guid urlid, string name, DateTime dateadded, DateTime datemodified)
- {
- return new Person(urlid, name, dateadded, datemodified);
- }
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="urlid"></param>
+ /// <param name="name"></param>
+ public static Person Create(Guid urlid, string name, DateTime dateadded, DateTime datemodified)
+ {
+ return new Person(urlid, name, dateadded, datemodified);
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
{
- _Id = value;
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
}
- }
- }
+ }
- /// <summary>
- /// Backing field for UrlId
- /// </summary>
- protected Guid _UrlId;
- /// <summary>
- /// When provided in a partial class, allows value of UrlId to be changed before setting.
- /// </summary>
- partial void SetUrlId(Guid oldValue, ref Guid newValue);
- /// <summary>
- /// When provided in a partial class, allows value of UrlId to be changed before returning.
- /// </summary>
- partial void GetUrlId(ref Guid result);
+ /// <summary>
+ /// Backing field for UrlId
+ /// </summary>
+ protected Guid _UrlId;
+ /// <summary>
+ /// When provided in a partial class, allows value of UrlId to be changed before setting.
+ /// </summary>
+ partial void SetUrlId(Guid oldValue, ref Guid newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of UrlId to be changed before returning.
+ /// </summary>
+ partial void GetUrlId(ref Guid result);
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public Guid UrlId
- {
- get
- {
- Guid value = _UrlId;
- GetUrlId(ref value);
- return (_UrlId = value);
- }
- set
- {
- Guid oldValue = _UrlId;
- SetUrlId(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public Guid UrlId
+ {
+ get
{
- _UrlId = value;
+ Guid value = _UrlId;
+ GetUrlId(ref value);
+ return (_UrlId = value);
}
- }
- }
+ set
+ {
+ Guid oldValue = _UrlId;
+ SetUrlId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _UrlId = value;
+ }
+ }
+ }
- /// <summary>
- /// Backing field for Name
- /// </summary>
- protected string _Name;
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before setting.
- /// </summary>
- partial void SetName(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before returning.
- /// </summary>
- partial void GetName(ref string result);
+ /// <summary>
+ /// Backing field for Name
+ /// </summary>
+ protected string _Name;
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ /// </summary>
+ partial void SetName(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ /// </summary>
+ partial void GetName(ref string result);
- /// <summary>
- /// Required, Max length = 1024
- /// </summary>
- [Required]
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Name
- {
- get
- {
- string value = _Name;
- GetName(ref value);
- return (_Name = value);
- }
- set
- {
- string oldValue = _Name;
- SetName(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Required, Max length = 1024
+ /// </summary>
+ [Required]
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Name
+ {
+ get
+ {
+ string value = _Name;
+ GetName(ref value);
+ return (_Name = value);
+ }
+ set
{
- _Name = value;
+ string oldValue = _Name;
+ SetName(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Name = value;
+ }
}
- }
- }
+ }
- /// <summary>
- /// Backing field for SourceId
- /// </summary>
- protected string _SourceId;
- /// <summary>
- /// When provided in a partial class, allows value of SourceId to be changed before setting.
- /// </summary>
- partial void SetSourceId(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of SourceId to be changed before returning.
- /// </summary>
- partial void GetSourceId(ref string result);
+ /// <summary>
+ /// Backing field for SourceId
+ /// </summary>
+ protected string _SourceId;
+ /// <summary>
+ /// When provided in a partial class, allows value of SourceId to be changed before setting.
+ /// </summary>
+ partial void SetSourceId(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of SourceId to be changed before returning.
+ /// </summary>
+ partial void GetSourceId(ref string result);
- /// <summary>
- /// Max length = 255
- /// </summary>
- [MaxLength(255)]
- [StringLength(255)]
- public string SourceId
- {
- get
- {
- string value = _SourceId;
- GetSourceId(ref value);
- return (_SourceId = value);
- }
- set
- {
- string oldValue = _SourceId;
- SetSourceId(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Max length = 255
+ /// </summary>
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string SourceId
+ {
+ get
{
- _SourceId = value;
+ string value = _SourceId;
+ GetSourceId(ref value);
+ return (_SourceId = value);
}
- }
- }
+ set
+ {
+ string oldValue = _SourceId;
+ SetSourceId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _SourceId = value;
+ }
+ }
+ }
- /// <summary>
- /// Backing field for DateAdded
- /// </summary>
- protected DateTime _DateAdded;
- /// <summary>
- /// When provided in a partial class, allows value of DateAdded to be changed before setting.
- /// </summary>
- partial void SetDateAdded(DateTime oldValue, ref DateTime newValue);
- /// <summary>
- /// When provided in a partial class, allows value of DateAdded to be changed before returning.
- /// </summary>
- partial void GetDateAdded(ref DateTime result);
+ /// <summary>
+ /// Backing field for DateAdded
+ /// </summary>
+ protected DateTime _DateAdded;
+ /// <summary>
+ /// When provided in a partial class, allows value of DateAdded to be changed before setting.
+ /// </summary>
+ partial void SetDateAdded(DateTime oldValue, ref DateTime newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of DateAdded to be changed before returning.
+ /// </summary>
+ partial void GetDateAdded(ref DateTime result);
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public DateTime DateAdded
- {
- get
- {
- DateTime value = _DateAdded;
- GetDateAdded(ref value);
- return (_DateAdded = value);
- }
- internal set
- {
- DateTime oldValue = _DateAdded;
- SetDateAdded(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public DateTime DateAdded
+ {
+ get
+ {
+ DateTime value = _DateAdded;
+ GetDateAdded(ref value);
+ return (_DateAdded = value);
+ }
+ internal set
{
- _DateAdded = value;
+ DateTime oldValue = _DateAdded;
+ SetDateAdded(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _DateAdded = value;
+ }
}
- }
- }
+ }
- /// <summary>
- /// Backing field for DateModified
- /// </summary>
- protected DateTime _DateModified;
- /// <summary>
- /// When provided in a partial class, allows value of DateModified to be changed before setting.
- /// </summary>
- partial void SetDateModified(DateTime oldValue, ref DateTime newValue);
- /// <summary>
- /// When provided in a partial class, allows value of DateModified to be changed before returning.
- /// </summary>
- partial void GetDateModified(ref DateTime result);
+ /// <summary>
+ /// Backing field for DateModified
+ /// </summary>
+ protected DateTime _DateModified;
+ /// <summary>
+ /// When provided in a partial class, allows value of DateModified to be changed before setting.
+ /// </summary>
+ partial void SetDateModified(DateTime oldValue, ref DateTime newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of DateModified to be changed before returning.
+ /// </summary>
+ partial void GetDateModified(ref DateTime result);
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public DateTime DateModified
- {
- get
- {
- DateTime value = _DateModified;
- GetDateModified(ref value);
- return (_DateModified = value);
- }
- internal set
- {
- DateTime oldValue = _DateModified;
- SetDateModified(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public DateTime DateModified
+ {
+ get
+ {
+ DateTime value = _DateModified;
+ GetDateModified(ref value);
+ return (_DateModified = value);
+ }
+ internal set
{
- _DateModified = value;
+ DateTime oldValue = _DateModified;
+ SetDateModified(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _DateModified = value;
+ }
}
- }
- }
+ }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- public virtual ICollection<global::Jellyfin.Data.Entities.MetadataProviderId> Sources { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("MetadataProviderId_Sources_Id")]
+ public virtual ICollection<MetadataProviderId> Sources { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/PersonRole.cs b/Jellyfin.Data/Entities/PersonRole.cs
index d8e2dbc11..9bd12c7fb 100644
--- a/Jellyfin.Data/Entities/PersonRole.cs
+++ b/Jellyfin.Data/Entities/PersonRole.cs
@@ -1,215 +1,209 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class PersonRole
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected PersonRole()
- {
- // NOTE: This class has one-to-one associations with PersonRole.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- Sources = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MetadataProviderId>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static PersonRole CreatePersonRoleUnsafe()
- {
- return new PersonRole();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="type"></param>
- /// <param name="_metadata0"></param>
- public PersonRole(global::Jellyfin.Data.Enums.PersonRoleType type, global::Jellyfin.Data.Entities.Metadata _metadata0)
- {
- // NOTE: This class has one-to-one associations with PersonRole.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- this.Type = type;
-
- if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
- _metadata0.PersonRoles.Add(this);
-
- this.Sources = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MetadataProviderId>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="type"></param>
- /// <param name="_metadata0"></param>
- public static PersonRole Create(global::Jellyfin.Data.Enums.PersonRoleType type, global::Jellyfin.Data.Entities.Metadata _metadata0)
- {
- return new PersonRole(type, _metadata0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class PersonRole
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected PersonRole()
+ {
+ // NOTE: This class has one-to-one associations with PersonRole.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ Sources = new HashSet<MetadataProviderId>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static PersonRole CreatePersonRoleUnsafe()
+ {
+ return new PersonRole();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="type"></param>
+ /// <param name="_metadata0"></param>
+ public PersonRole(Enums.PersonRoleType type, Metadata _metadata0)
+ {
+ // NOTE: This class has one-to-one associations with PersonRole.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ this.Type = type;
+
+ if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
+ _metadata0.PersonRoles.Add(this);
+
+ this.Sources = new HashSet<MetadataProviderId>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="type"></param>
+ /// <param name="_metadata0"></param>
+ public static PersonRole Create(Enums.PersonRoleType type, Metadata _metadata0)
+ {
+ return new PersonRole(type, _metadata0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
+ {
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Role
+ /// </summary>
+ protected string _Role;
+ /// <summary>
+ /// When provided in a partial class, allows value of Role to be changed before setting.
+ /// </summary>
+ partial void SetRole(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Role to be changed before returning.
+ /// </summary>
+ partial void GetRole(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Role
+ {
+ get
{
- _Id = value;
+ string value = _Role;
+ GetRole(ref value);
+ return (_Role = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Role
- /// </summary>
- protected string _Role;
- /// <summary>
- /// When provided in a partial class, allows value of Role to be changed before setting.
- /// </summary>
- partial void SetRole(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Role to be changed before returning.
- /// </summary>
- partial void GetRole(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Role
- {
- get
- {
- string value = _Role;
- GetRole(ref value);
- return (_Role = value);
- }
- set
- {
- string oldValue = _Role;
- SetRole(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Role = value;
+ string oldValue = _Role;
+ SetRole(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Role = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Type
- /// </summary>
- protected global::Jellyfin.Data.Enums.PersonRoleType _Type;
- /// <summary>
- /// When provided in a partial class, allows value of Type to be changed before setting.
- /// </summary>
- partial void SetType(global::Jellyfin.Data.Enums.PersonRoleType oldValue, ref global::Jellyfin.Data.Enums.PersonRoleType newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Type to be changed before returning.
- /// </summary>
- partial void GetType(ref global::Jellyfin.Data.Enums.PersonRoleType result);
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public global::Jellyfin.Data.Enums.PersonRoleType Type
- {
- get
- {
- global::Jellyfin.Data.Enums.PersonRoleType value = _Type;
- GetType(ref value);
- return (_Type = value);
- }
- set
- {
- global::Jellyfin.Data.Enums.PersonRoleType oldValue = _Type;
- SetType(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Type
+ /// </summary>
+ protected Enums.PersonRoleType _Type;
+ /// <summary>
+ /// When provided in a partial class, allows value of Type to be changed before setting.
+ /// </summary>
+ partial void SetType(Enums.PersonRoleType oldValue, ref Enums.PersonRoleType newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Type to be changed before returning.
+ /// </summary>
+ partial void GetType(ref Enums.PersonRoleType result);
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public Enums.PersonRoleType Type
+ {
+ get
{
- _Type = value;
+ Enums.PersonRoleType value = _Type;
+ GetType(ref value);
+ return (_Type = value);
}
- }
- }
+ set
+ {
+ Enums.PersonRoleType oldValue = _Type;
+ SetType(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Type = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /// <summary>
+ /// Required
+ /// </summary>
+ [ForeignKey("Person_Id")]
- /// <summary>
- /// Required
- /// </summary>
- public virtual global::Jellyfin.Data.Entities.Person Person { get; set; }
+ public virtual Person Person { get; set; }
- public virtual global::Jellyfin.Data.Entities.Artwork Artwork { get; set; }
+ [ForeignKey("Artwork_Artwork_Id")]
+ public virtual Artwork Artwork { get; set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.MetadataProviderId> Sources { get; protected set; }
+ [ForeignKey("MetadataProviderId_Sources_Id")]
+ public virtual ICollection<MetadataProviderId> Sources { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Photo.cs b/Jellyfin.Data/Entities/Photo.cs
index 16c97fef5..7abe62891 100644
--- a/Jellyfin.Data/Entities/Photo.cs
+++ b/Jellyfin.Data/Entities/Photo.cs
@@ -1,84 +1,68 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Photo: global::Jellyfin.Data.Entities.LibraryItem
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Photo(): base()
- {
- PhotoMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.PhotoMetadata>();
- Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
+ public partial class Photo : LibraryItem
+ {
+ partial void Init();
- Init();
- }
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Photo()
+ {
+ PhotoMetadata = new HashSet<PhotoMetadata>();
+ Releases = new HashSet<Release>();
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Photo CreatePhotoUnsafe()
- {
- return new Photo();
- }
+ Init();
+ }
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public Photo(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Photo CreatePhotoUnsafe()
+ {
+ return new Photo();
+ }
- this.PhotoMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.PhotoMetadata>();
- this.Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public Photo(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
- Init();
- }
+ this.PhotoMetadata = new HashSet<PhotoMetadata>();
+ this.Releases = new HashSet<Release>();
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public static Photo Create(Guid urlid, DateTime dateadded)
- {
- return new Photo(urlid, dateadded);
- }
+ Init();
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public static Photo Create(Guid urlid, DateTime dateadded)
+ {
+ return new Photo(urlid, dateadded);
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- public virtual ICollection<global::Jellyfin.Data.Entities.PhotoMetadata> PhotoMetadata { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("PhotoMetadata_PhotoMetadata_Id")]
+ public virtual ICollection<PhotoMetadata> PhotoMetadata { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.Release> Releases { get; protected set; }
+ [ForeignKey("Release_Releases_Id")]
+ public virtual ICollection<Release> Releases { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/PhotoMetadata.cs b/Jellyfin.Data/Entities/PhotoMetadata.cs
index 9c47d022e..c5502f707 100644
--- a/Jellyfin.Data/Entities/PhotoMetadata.cs
+++ b/Jellyfin.Data/Entities/PhotoMetadata.cs
@@ -1,86 +1,68 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class PhotoMetadata: global::Jellyfin.Data.Entities.Metadata
- {
- partial void Init();
+ public partial class PhotoMetadata : Metadata
+ {
+ partial void Init();
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected PhotoMetadata(): base()
- {
- Init();
- }
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected PhotoMetadata()
+ {
+ Init();
+ }
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static PhotoMetadata CreatePhotoMetadataUnsafe()
- {
- return new PhotoMetadata();
- }
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static PhotoMetadata CreatePhotoMetadataUnsafe()
+ {
+ return new PhotoMetadata();
+ }
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_photo0"></param>
- public PhotoMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Photo _photo0)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_photo0"></param>
+ public PhotoMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Photo _photo0)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
- if (_photo0 == null) throw new ArgumentNullException(nameof(_photo0));
- _photo0.PhotoMetadata.Add(this);
+ if (_photo0 == null) throw new ArgumentNullException(nameof(_photo0));
+ _photo0.PhotoMetadata.Add(this);
- Init();
- }
+ Init();
+ }
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_photo0"></param>
- public static PhotoMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Photo _photo0)
- {
- return new PhotoMetadata(title, language, dateadded, datemodified, _photo0);
- }
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_photo0"></param>
+ public static PhotoMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Photo _photo0)
+ {
+ return new PhotoMetadata(title, language, dateadded, datemodified, _photo0);
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Preference.cs b/Jellyfin.Data/Entities/Preference.cs
index 3d69ea2f3..505f52e6b 100644
--- a/Jellyfin.Data/Entities/Preference.cs
+++ b/Jellyfin.Data/Entities/Preference.cs
@@ -1,117 +1,107 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Preference
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Preference()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Preference CreatePreferenceUnsafe()
- {
- return new Preference();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="kind"></param>
- /// <param name="value"></param>
- /// <param name="_user0"></param>
- /// <param name="_group1"></param>
- public Preference(global::Jellyfin.Data.Enums.PreferenceKind kind, string value, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1)
- {
- this.Kind = kind;
-
- if (string.IsNullOrEmpty(value)) throw new ArgumentNullException(nameof(value));
- this.Value = value;
-
- if (_user0 == null) throw new ArgumentNullException(nameof(_user0));
- _user0.Preferences.Add(this);
-
- if (_group1 == null) throw new ArgumentNullException(nameof(_group1));
- _group1.Preferences.Add(this);
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="kind"></param>
- /// <param name="value"></param>
- /// <param name="_user0"></param>
- /// <param name="_group1"></param>
- public static Preference Create(global::Jellyfin.Data.Enums.PreferenceKind kind, string value, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1)
- {
- return new Preference(kind, value, _user0, _group1);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id { get; protected set; }
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public global::Jellyfin.Data.Enums.PreferenceKind Kind { get; set; }
-
- /// <summary>
- /// Required, Max length = 65535
- /// </summary>
- [Required]
- [MaxLength(65535)]
- [StringLength(65535)]
- public string Value { get; set; }
-
- /// <summary>
- /// Concurrency token
- /// </summary>
- [Timestamp]
- public Byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- }
+ public partial class Preference
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Preference()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Preference CreatePreferenceUnsafe()
+ {
+ return new Preference();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="kind"></param>
+ /// <param name="value"></param>
+ /// <param name="_user0"></param>
+ /// <param name="_group1"></param>
+ public Preference(Enums.PreferenceKind kind, string value, User _user0, Group _group1)
+ {
+ this.Kind = kind;
+
+ if (string.IsNullOrEmpty(value)) throw new ArgumentNullException(nameof(value));
+ this.Value = value;
+
+ if (_user0 == null) throw new ArgumentNullException(nameof(_user0));
+ _user0.Preferences.Add(this);
+
+ if (_group1 == null) throw new ArgumentNullException(nameof(_group1));
+ _group1.Preferences.Add(this);
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="kind"></param>
+ /// <param name="value"></param>
+ /// <param name="_user0"></param>
+ /// <param name="_group1"></param>
+ public static Preference Create(Enums.PreferenceKind kind, string value, User _user0, Group _group1)
+ {
+ return new Preference(kind, value, _user0, _group1);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id { get; protected set; }
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public Enums.PreferenceKind Kind { get; set; }
+
+ /// <summary>
+ /// Required, Max length = 65535
+ /// </summary>
+ [Required]
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string Value { get; set; }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ }
}
diff --git a/Jellyfin.Data/Entities/PreferenceKind.cs b/Jellyfin.Data/Entities/PreferenceKind.cs
deleted file mode 100644
index e6673afb1..000000000
--- a/Jellyfin.Data/Entities/PreferenceKind.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
-
-namespace Jellyfin.Data.Enums
-{
- public enum PreferenceKind : Int32
- {
- MaxParentalRating,
- BlockedTags,
- RemoteClientBitrateLimit,
- EnabledDevices,
- EnabledChannels,
- EnabledFolders,
- EnableContentDeletionFromFolders
- }
-}
diff --git a/Jellyfin.Data/Entities/ProviderMapping.cs b/Jellyfin.Data/Entities/ProviderMapping.cs
index e50a01489..6197bd97b 100644
--- a/Jellyfin.Data/Entities/ProviderMapping.cs
+++ b/Jellyfin.Data/Entities/ProviderMapping.cs
@@ -1,133 +1,123 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class ProviderMapping
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected ProviderMapping()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static ProviderMapping CreateProviderMappingUnsafe()
- {
- return new ProviderMapping();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="providername"></param>
- /// <param name="providersecrets"></param>
- /// <param name="providerdata"></param>
- /// <param name="_user0"></param>
- /// <param name="_group1"></param>
- public ProviderMapping(string providername, string providersecrets, string providerdata, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1)
- {
- if (string.IsNullOrEmpty(providername)) throw new ArgumentNullException(nameof(providername));
- this.ProviderName = providername;
-
- if (string.IsNullOrEmpty(providersecrets)) throw new ArgumentNullException(nameof(providersecrets));
- this.ProviderSecrets = providersecrets;
-
- if (string.IsNullOrEmpty(providerdata)) throw new ArgumentNullException(nameof(providerdata));
- this.ProviderData = providerdata;
-
- if (_user0 == null) throw new ArgumentNullException(nameof(_user0));
- _user0.ProviderMappings.Add(this);
-
- if (_group1 == null) throw new ArgumentNullException(nameof(_group1));
- _group1.ProviderMappings.Add(this);
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="providername"></param>
- /// <param name="providersecrets"></param>
- /// <param name="providerdata"></param>
- /// <param name="_user0"></param>
- /// <param name="_group1"></param>
- public static ProviderMapping Create(string providername, string providersecrets, string providerdata, global::Jellyfin.Data.Entities.User _user0, global::Jellyfin.Data.Entities.Group _group1)
- {
- return new ProviderMapping(providername, providersecrets, providerdata, _user0, _group1);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id { get; protected set; }
-
- /// <summary>
- /// Required, Max length = 255
- /// </summary>
- [Required]
- [MaxLength(255)]
- [StringLength(255)]
- public string ProviderName { get; set; }
-
- /// <summary>
- /// Required, Max length = 65535
- /// </summary>
- [Required]
- [MaxLength(65535)]
- [StringLength(65535)]
- public string ProviderSecrets { get; set; }
-
- /// <summary>
- /// Required, Max length = 65535
- /// </summary>
- [Required]
- [MaxLength(65535)]
- [StringLength(65535)]
- public string ProviderData { get; set; }
-
- /// <summary>
- /// Concurrency token
- /// </summary>
- [Timestamp]
- public Byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- }
+ public partial class ProviderMapping
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected ProviderMapping()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static ProviderMapping CreateProviderMappingUnsafe()
+ {
+ return new ProviderMapping();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="providername"></param>
+ /// <param name="providersecrets"></param>
+ /// <param name="providerdata"></param>
+ /// <param name="_user0"></param>
+ /// <param name="_group1"></param>
+ public ProviderMapping(string providername, string providersecrets, string providerdata, User _user0, Group _group1)
+ {
+ if (string.IsNullOrEmpty(providername)) throw new ArgumentNullException(nameof(providername));
+ this.ProviderName = providername;
+
+ if (string.IsNullOrEmpty(providersecrets)) throw new ArgumentNullException(nameof(providersecrets));
+ this.ProviderSecrets = providersecrets;
+
+ if (string.IsNullOrEmpty(providerdata)) throw new ArgumentNullException(nameof(providerdata));
+ this.ProviderData = providerdata;
+
+ if (_user0 == null) throw new ArgumentNullException(nameof(_user0));
+ _user0.ProviderMappings.Add(this);
+
+ if (_group1 == null) throw new ArgumentNullException(nameof(_group1));
+ _group1.ProviderMappings.Add(this);
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="providername"></param>
+ /// <param name="providersecrets"></param>
+ /// <param name="providerdata"></param>
+ /// <param name="_user0"></param>
+ /// <param name="_group1"></param>
+ public static ProviderMapping Create(string providername, string providersecrets, string providerdata, User _user0, Group _group1)
+ {
+ return new ProviderMapping(providername, providersecrets, providerdata, _user0, _group1);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id { get; protected set; }
+
+ /// <summary>
+ /// Required, Max length = 255
+ /// </summary>
+ [Required]
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string ProviderName { get; set; }
+
+ /// <summary>
+ /// Required, Max length = 65535
+ /// </summary>
+ [Required]
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string ProviderSecrets { get; set; }
+
+ /// <summary>
+ /// Required, Max length = 65535
+ /// </summary>
+ [Required]
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string ProviderData { get; set; }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ }
}
diff --git a/Jellyfin.Data/Entities/Rating.cs b/Jellyfin.Data/Entities/Rating.cs
index b1098a1d7..f70ea8b33 100644
--- a/Jellyfin.Data/Entities/Rating.cs
+++ b/Jellyfin.Data/Entities/Rating.cs
@@ -1,197 +1,187 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Rating
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Rating()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Rating CreateRatingUnsafe()
- {
- return new Rating();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="value"></param>
- /// <param name="_metadata0"></param>
- public Rating(double value, global::Jellyfin.Data.Entities.Metadata _metadata0)
- {
- this.Value = value;
-
- if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
- _metadata0.Ratings.Add(this);
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="value"></param>
- /// <param name="_metadata0"></param>
- public static Rating Create(double value, global::Jellyfin.Data.Entities.Metadata _metadata0)
- {
- return new Rating(value, _metadata0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class Rating
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Rating()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Rating CreateRatingUnsafe()
+ {
+ return new Rating();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="value"></param>
+ /// <param name="_metadata0"></param>
+ public Rating(double value, Metadata _metadata0)
+ {
+ this.Value = value;
+
+ if (_metadata0 == null) throw new ArgumentNullException(nameof(_metadata0));
+ _metadata0.Ratings.Add(this);
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="value"></param>
+ /// <param name="_metadata0"></param>
+ public static Rating Create(double value, Metadata _metadata0)
+ {
+ return new Rating(value, _metadata0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
+ {
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
+ }
+ protected set
+ {
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Value
+ /// </summary>
+ protected double _Value;
+ /// <summary>
+ /// When provided in a partial class, allows value of Value to be changed before setting.
+ /// </summary>
+ partial void SetValue(double oldValue, ref double newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Value to be changed before returning.
+ /// </summary>
+ partial void GetValue(ref double result);
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public double Value
+ {
+ get
+ {
+ double value = _Value;
+ GetValue(ref value);
+ return (_Value = value);
+ }
+ set
{
- _Id = value;
+ double oldValue = _Value;
+ SetValue(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Value = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Value
- /// </summary>
- protected double _Value;
- /// <summary>
- /// When provided in a partial class, allows value of Value to be changed before setting.
- /// </summary>
- partial void SetValue(double oldValue, ref double newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Value to be changed before returning.
- /// </summary>
- partial void GetValue(ref double result);
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public double Value
- {
- get
- {
- double value = _Value;
- GetValue(ref value);
- return (_Value = value);
- }
- set
- {
- double oldValue = _Value;
- SetValue(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Votes
+ /// </summary>
+ protected int? _Votes;
+ /// <summary>
+ /// When provided in a partial class, allows value of Votes to be changed before setting.
+ /// </summary>
+ partial void SetVotes(int? oldValue, ref int? newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Votes to be changed before returning.
+ /// </summary>
+ partial void GetVotes(ref int? result);
+
+ public int? Votes
+ {
+ get
{
- _Value = value;
+ int? value = _Votes;
+ GetVotes(ref value);
+ return (_Votes = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Votes
- /// </summary>
- protected int? _Votes;
- /// <summary>
- /// When provided in a partial class, allows value of Votes to be changed before setting.
- /// </summary>
- partial void SetVotes(int? oldValue, ref int? newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Votes to be changed before returning.
- /// </summary>
- partial void GetVotes(ref int? result);
-
- public int? Votes
- {
- get
- {
- int? value = _Votes;
- GetVotes(ref value);
- return (_Votes = value);
- }
- set
- {
- int? oldValue = _Votes;
- SetVotes(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Votes = value;
+ int? oldValue = _Votes;
+ SetVotes(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Votes = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- /// <summary>
- /// If this is NULL it&apos;s the internal user rating.
- /// </summary>
- public virtual global::Jellyfin.Data.Entities.RatingSource RatingType { get; set; }
-
- }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ /// <summary>
+ /// If this is NULL it&apos;s the internal user rating.
+ /// </summary>
+ [ForeignKey("RatingSource_RatingType_Id")]
+ public virtual RatingSource RatingType { get; set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/RatingSource.cs b/Jellyfin.Data/Entities/RatingSource.cs
index 32d5634c2..070f1ae27 100644
--- a/Jellyfin.Data/Entities/RatingSource.cs
+++ b/Jellyfin.Data/Entities/RatingSource.cs
@@ -1,242 +1,231 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- /// <summary>
- /// This is the entity to store review ratings, not age ratings
- /// </summary>
- public partial class RatingSource
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected RatingSource()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static RatingSource CreateRatingSourceUnsafe()
- {
- return new RatingSource();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="maximumvalue"></param>
- /// <param name="minimumvalue"></param>
- /// <param name="_rating0"></param>
- public RatingSource(double maximumvalue, double minimumvalue, global::Jellyfin.Data.Entities.Rating _rating0)
- {
- this.MaximumValue = maximumvalue;
-
- this.MinimumValue = minimumvalue;
-
- if (_rating0 == null) throw new ArgumentNullException(nameof(_rating0));
- _rating0.RatingType = this;
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="maximumvalue"></param>
- /// <param name="minimumvalue"></param>
- /// <param name="_rating0"></param>
- public static RatingSource Create(double maximumvalue, double minimumvalue, global::Jellyfin.Data.Entities.Rating _rating0)
- {
- return new RatingSource(maximumvalue, minimumvalue, _rating0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ /// <summary>
+ /// This is the entity to store review ratings, not age ratings
+ /// </summary>
+ public partial class RatingSource
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected RatingSource()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static RatingSource CreateRatingSourceUnsafe()
+ {
+ return new RatingSource();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="maximumvalue"></param>
+ /// <param name="minimumvalue"></param>
+ /// <param name="_rating0"></param>
+ public RatingSource(double maximumvalue, double minimumvalue, Rating _rating0)
+ {
+ this.MaximumValue = maximumvalue;
+
+ this.MinimumValue = minimumvalue;
+
+ if (_rating0 == null) throw new ArgumentNullException(nameof(_rating0));
+ _rating0.RatingType = this;
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="maximumvalue"></param>
+ /// <param name="minimumvalue"></param>
+ /// <param name="_rating0"></param>
+ public static RatingSource Create(double maximumvalue, double minimumvalue, Rating _rating0)
+ {
+ return new RatingSource(maximumvalue, minimumvalue, _rating0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
{
- _Id = value;
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Name
- /// </summary>
- protected string _Name;
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before setting.
- /// </summary>
- partial void SetName(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before returning.
- /// </summary>
- partial void GetName(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Name
- {
- get
- {
- string value = _Name;
- GetName(ref value);
- return (_Name = value);
- }
- set
- {
- string oldValue = _Name;
- SetName(oldValue, ref value);
- if (oldValue != value)
+ protected set
{
- _Name = value;
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for MaximumValue
- /// </summary>
- protected double _MaximumValue;
- /// <summary>
- /// When provided in a partial class, allows value of MaximumValue to be changed before setting.
- /// </summary>
- partial void SetMaximumValue(double oldValue, ref double newValue);
- /// <summary>
- /// When provided in a partial class, allows value of MaximumValue to be changed before returning.
- /// </summary>
- partial void GetMaximumValue(ref double result);
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public double MaximumValue
- {
- get
- {
- double value = _MaximumValue;
- GetMaximumValue(ref value);
- return (_MaximumValue = value);
- }
- set
- {
- double oldValue = _MaximumValue;
- SetMaximumValue(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Name
+ /// </summary>
+ protected string _Name;
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ /// </summary>
+ partial void SetName(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ /// </summary>
+ partial void GetName(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Name
+ {
+ get
{
- _MaximumValue = value;
+ string value = _Name;
+ GetName(ref value);
+ return (_Name = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for MinimumValue
- /// </summary>
- protected double _MinimumValue;
- /// <summary>
- /// When provided in a partial class, allows value of MinimumValue to be changed before setting.
- /// </summary>
- partial void SetMinimumValue(double oldValue, ref double newValue);
- /// <summary>
- /// When provided in a partial class, allows value of MinimumValue to be changed before returning.
- /// </summary>
- partial void GetMinimumValue(ref double result);
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public double MinimumValue
- {
- get
- {
- double value = _MinimumValue;
- GetMinimumValue(ref value);
- return (_MinimumValue = value);
- }
- set
- {
- double oldValue = _MinimumValue;
- SetMinimumValue(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _MinimumValue = value;
+ string oldValue = _Name;
+ SetName(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Name = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- public virtual global::Jellyfin.Data.Entities.MetadataProviderId Source { get; set; }
-
- }
+ }
+
+ /// <summary>
+ /// Backing field for MaximumValue
+ /// </summary>
+ protected double _MaximumValue;
+ /// <summary>
+ /// When provided in a partial class, allows value of MaximumValue to be changed before setting.
+ /// </summary>
+ partial void SetMaximumValue(double oldValue, ref double newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of MaximumValue to be changed before returning.
+ /// </summary>
+ partial void GetMaximumValue(ref double result);
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public double MaximumValue
+ {
+ get
+ {
+ double value = _MaximumValue;
+ GetMaximumValue(ref value);
+ return (_MaximumValue = value);
+ }
+ set
+ {
+ double oldValue = _MaximumValue;
+ SetMaximumValue(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _MaximumValue = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for MinimumValue
+ /// </summary>
+ protected double _MinimumValue;
+ /// <summary>
+ /// When provided in a partial class, allows value of MinimumValue to be changed before setting.
+ /// </summary>
+ partial void SetMinimumValue(double oldValue, ref double newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of MinimumValue to be changed before returning.
+ /// </summary>
+ partial void GetMinimumValue(ref double result);
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public double MinimumValue
+ {
+ get
+ {
+ double value = _MinimumValue;
+ GetMinimumValue(ref value);
+ return (_MinimumValue = value);
+ }
+ set
+ {
+ double oldValue = _MinimumValue;
+ SetMinimumValue(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _MinimumValue = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("MetadataProviderId_Source_Id")]
+ public virtual MetadataProviderId Source { get; set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/Release.cs b/Jellyfin.Data/Entities/Release.cs
index e02f70be8..d1928fcf7 100644
--- a/Jellyfin.Data/Entities/Release.cs
+++ b/Jellyfin.Data/Entities/Release.cs
@@ -1,197 +1,188 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Release
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Release()
- {
- MediaFiles = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MediaFile>();
- Chapters = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Chapter>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Release CreateReleaseUnsafe()
- {
- return new Release();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="name"></param>
- /// <param name="_movie0"></param>
- /// <param name="_episode1"></param>
- /// <param name="_track2"></param>
- /// <param name="_customitem3"></param>
- /// <param name="_book4"></param>
- /// <param name="_photo5"></param>
- public Release(string name, global::Jellyfin.Data.Entities.Movie _movie0, global::Jellyfin.Data.Entities.Episode _episode1, global::Jellyfin.Data.Entities.Track _track2, global::Jellyfin.Data.Entities.CustomItem _customitem3, global::Jellyfin.Data.Entities.Book _book4, global::Jellyfin.Data.Entities.Photo _photo5)
- {
- if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
- this.Name = name;
-
- if (_movie0 == null) throw new ArgumentNullException(nameof(_movie0));
- _movie0.Releases.Add(this);
-
- if (_episode1 == null) throw new ArgumentNullException(nameof(_episode1));
- _episode1.Releases.Add(this);
-
- if (_track2 == null) throw new ArgumentNullException(nameof(_track2));
- _track2.Releases.Add(this);
-
- if (_customitem3 == null) throw new ArgumentNullException(nameof(_customitem3));
- _customitem3.Releases.Add(this);
-
- if (_book4 == null) throw new ArgumentNullException(nameof(_book4));
- _book4.Releases.Add(this);
-
- if (_photo5 == null) throw new ArgumentNullException(nameof(_photo5));
- _photo5.Releases.Add(this);
-
- this.MediaFiles = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.MediaFile>();
- this.Chapters = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Chapter>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="name"></param>
- /// <param name="_movie0"></param>
- /// <param name="_episode1"></param>
- /// <param name="_track2"></param>
- /// <param name="_customitem3"></param>
- /// <param name="_book4"></param>
- /// <param name="_photo5"></param>
- public static Release Create(string name, global::Jellyfin.Data.Entities.Movie _movie0, global::Jellyfin.Data.Entities.Episode _episode1, global::Jellyfin.Data.Entities.Track _track2, global::Jellyfin.Data.Entities.CustomItem _customitem3, global::Jellyfin.Data.Entities.Book _book4, global::Jellyfin.Data.Entities.Photo _photo5)
- {
- return new Release(name, _movie0, _episode1, _track2, _customitem3, _book4, _photo5);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Id
- /// </summary>
- internal int _Id;
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before setting.
- /// </summary>
- partial void SetId(int oldValue, ref int newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Id to be changed before returning.
- /// </summary>
- partial void GetId(ref int result);
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public int Id
- {
- get
- {
- int value = _Id;
- GetId(ref value);
- return (_Id = value);
- }
- protected set
- {
- int oldValue = _Id;
- SetId(oldValue, ref value);
- if (oldValue != value)
+ public partial class Release
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Release()
+ {
+ MediaFiles = new HashSet<MediaFile>();
+ Chapters = new HashSet<Chapter>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Release CreateReleaseUnsafe()
+ {
+ return new Release();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="name"></param>
+ /// <param name="_movie0"></param>
+ /// <param name="_episode1"></param>
+ /// <param name="_track2"></param>
+ /// <param name="_customitem3"></param>
+ /// <param name="_book4"></param>
+ /// <param name="_photo5"></param>
+ public Release(string name, Movie _movie0, Episode _episode1, Track _track2, CustomItem _customitem3, Book _book4, Photo _photo5)
+ {
+ if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
+ this.Name = name;
+
+ if (_movie0 == null) throw new ArgumentNullException(nameof(_movie0));
+ _movie0.Releases.Add(this);
+
+ if (_episode1 == null) throw new ArgumentNullException(nameof(_episode1));
+ _episode1.Releases.Add(this);
+
+ if (_track2 == null) throw new ArgumentNullException(nameof(_track2));
+ _track2.Releases.Add(this);
+
+ if (_customitem3 == null) throw new ArgumentNullException(nameof(_customitem3));
+ _customitem3.Releases.Add(this);
+
+ if (_book4 == null) throw new ArgumentNullException(nameof(_book4));
+ _book4.Releases.Add(this);
+
+ if (_photo5 == null) throw new ArgumentNullException(nameof(_photo5));
+ _photo5.Releases.Add(this);
+
+ this.MediaFiles = new HashSet<MediaFile>();
+ this.Chapters = new HashSet<Chapter>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="name"></param>
+ /// <param name="_movie0"></param>
+ /// <param name="_episode1"></param>
+ /// <param name="_track2"></param>
+ /// <param name="_customitem3"></param>
+ /// <param name="_book4"></param>
+ /// <param name="_photo5"></param>
+ public static Release Create(string name, Movie _movie0, Episode _episode1, Track _track2, CustomItem _customitem3, Book _book4, Photo _photo5)
+ {
+ return new Release(name, _movie0, _episode1, _track2, _customitem3, _book4, _photo5);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Id
+ /// </summary>
+ internal int _Id;
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ /// </summary>
+ partial void SetId(int oldValue, ref int newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ /// </summary>
+ partial void GetId(ref int result);
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
{
- _Id = value;
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Name
- /// </summary>
- protected string _Name;
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before setting.
- /// </summary>
- partial void SetName(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Name to be changed before returning.
- /// </summary>
- partial void GetName(ref string result);
-
- /// <summary>
- /// Required, Max length = 1024
- /// </summary>
- [Required]
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Name
- {
- get
- {
- string value = _Name;
- GetName(ref value);
- return (_Name = value);
- }
- set
- {
- string oldValue = _Name;
- SetName(oldValue, ref value);
- if (oldValue != value)
+ protected set
{
- _Name = value;
+ int oldValue = _Id;
+ SetId(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Id = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- public virtual ICollection<global::Jellyfin.Data.Entities.MediaFile> MediaFiles { get; protected set; }
-
- public virtual ICollection<global::Jellyfin.Data.Entities.Chapter> Chapters { get; protected set; }
-
- }
+ }
+
+ /// <summary>
+ /// Backing field for Name
+ /// </summary>
+ protected string _Name;
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ /// </summary>
+ partial void SetName(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ /// </summary>
+ partial void GetName(ref string result);
+
+ /// <summary>
+ /// Required, Max length = 1024
+ /// </summary>
+ [Required]
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Name
+ {
+ get
+ {
+ string value = _Name;
+ GetName(ref value);
+ return (_Name = value);
+ }
+ set
+ {
+ string oldValue = _Name;
+ SetName(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Name = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("MediaFile_MediaFiles_Id")]
+ public virtual ICollection<MediaFile> MediaFiles { get; protected set; }
+
+ [ForeignKey("Chapter_Chapters_Id")]
+ public virtual ICollection<Chapter> Chapters { get; protected set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/Season.cs b/Jellyfin.Data/Entities/Season.cs
index fdfdf2409..96e89cde0 100644
--- a/Jellyfin.Data/Entities/Season.cs
+++ b/Jellyfin.Data/Entities/Season.cs
@@ -1,127 +1,111 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Season: global::Jellyfin.Data.Entities.LibraryItem
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Season(): base()
- {
- // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- SeasonMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.SeasonMetadata>();
- Episodes = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Episode>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Season CreateSeasonUnsafe()
- {
- return new Season();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- /// <param name="_series0"></param>
- public Season(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.Series _series0)
- {
- // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- this.UrlId = urlid;
-
- if (_series0 == null) throw new ArgumentNullException(nameof(_series0));
- _series0.Seasons.Add(this);
-
- this.SeasonMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.SeasonMetadata>();
- this.Episodes = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Episode>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- /// <param name="_series0"></param>
- public static Season Create(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.Series _series0)
- {
- return new Season(urlid, dateadded, _series0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for SeasonNumber
- /// </summary>
- protected int? _SeasonNumber;
- /// <summary>
- /// When provided in a partial class, allows value of SeasonNumber to be changed before setting.
- /// </summary>
- partial void SetSeasonNumber(int? oldValue, ref int? newValue);
- /// <summary>
- /// When provided in a partial class, allows value of SeasonNumber to be changed before returning.
- /// </summary>
- partial void GetSeasonNumber(ref int? result);
-
- public int? SeasonNumber
- {
- get
- {
- int? value = _SeasonNumber;
- GetSeasonNumber(ref value);
- return (_SeasonNumber = value);
- }
- set
- {
- int? oldValue = _SeasonNumber;
- SetSeasonNumber(oldValue, ref value);
- if (oldValue != value)
+ public partial class Season : LibraryItem
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Season()
+ {
+ // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ SeasonMetadata = new HashSet<SeasonMetadata>();
+ Episodes = new HashSet<Episode>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Season CreateSeasonUnsafe()
+ {
+ return new Season();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ /// <param name="_series0"></param>
+ public Season(Guid urlid, DateTime dateadded, Series _series0)
+ {
+ // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ this.UrlId = urlid;
+
+ if (_series0 == null) throw new ArgumentNullException(nameof(_series0));
+ _series0.Seasons.Add(this);
+
+ this.SeasonMetadata = new HashSet<SeasonMetadata>();
+ this.Episodes = new HashSet<Episode>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ /// <param name="_series0"></param>
+ public static Season Create(Guid urlid, DateTime dateadded, Series _series0)
+ {
+ return new Season(urlid, dateadded, _series0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for SeasonNumber
+ /// </summary>
+ protected int? _SeasonNumber;
+ /// <summary>
+ /// When provided in a partial class, allows value of SeasonNumber to be changed before setting.
+ /// </summary>
+ partial void SetSeasonNumber(int? oldValue, ref int? newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of SeasonNumber to be changed before returning.
+ /// </summary>
+ partial void GetSeasonNumber(ref int? result);
+
+ public int? SeasonNumber
+ {
+ get
{
- _SeasonNumber = value;
+ int? value = _SeasonNumber;
+ GetSeasonNumber(ref value);
+ return (_SeasonNumber = value);
}
- }
- }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ set
+ {
+ int? oldValue = _SeasonNumber;
+ SetSeasonNumber(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _SeasonNumber = value;
+ }
+ }
+ }
- public virtual ICollection<global::Jellyfin.Data.Entities.SeasonMetadata> SeasonMetadata { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("SeasonMetadata_SeasonMetadata_Id")]
+ public virtual ICollection<SeasonMetadata> SeasonMetadata { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.Episode> Episodes { get; protected set; }
+ [ForeignKey("Episode_Episodes_Id")]
+ public virtual ICollection<Episode> Episodes { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/SeasonMetadata.cs b/Jellyfin.Data/Entities/SeasonMetadata.cs
index 5939cbbca..64ecbfbfa 100644
--- a/Jellyfin.Data/Entities/SeasonMetadata.cs
+++ b/Jellyfin.Data/Entities/SeasonMetadata.cs
@@ -1,123 +1,106 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class SeasonMetadata: global::Jellyfin.Data.Entities.Metadata
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected SeasonMetadata(): base()
- {
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static SeasonMetadata CreateSeasonMetadataUnsafe()
- {
- return new SeasonMetadata();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_season0"></param>
- public SeasonMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Season _season0)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
-
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
-
- if (_season0 == null) throw new ArgumentNullException(nameof(_season0));
- _season0.SeasonMetadata.Add(this);
-
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_season0"></param>
- public static SeasonMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Season _season0)
- {
- return new SeasonMetadata(title, language, dateadded, datemodified, _season0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Outline
- /// </summary>
- protected string _Outline;
- /// <summary>
- /// When provided in a partial class, allows value of Outline to be changed before setting.
- /// </summary>
- partial void SetOutline(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Outline to be changed before returning.
- /// </summary>
- partial void GetOutline(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Outline
- {
- get
- {
- string value = _Outline;
- GetOutline(ref value);
- return (_Outline = value);
- }
- set
- {
- string oldValue = _Outline;
- SetOutline(oldValue, ref value);
- if (oldValue != value)
+ public partial class SeasonMetadata : Metadata
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected SeasonMetadata()
+ {
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static SeasonMetadata CreateSeasonMetadataUnsafe()
+ {
+ return new SeasonMetadata();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_season0"></param>
+ public SeasonMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Season _season0)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
+
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
+
+ if (_season0 == null) throw new ArgumentNullException(nameof(_season0));
+ _season0.SeasonMetadata.Add(this);
+
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_season0"></param>
+ public static SeasonMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Season _season0)
+ {
+ return new SeasonMetadata(title, language, dateadded, datemodified, _season0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Outline
+ /// </summary>
+ protected string _Outline;
+ /// <summary>
+ /// When provided in a partial class, allows value of Outline to be changed before setting.
+ /// </summary>
+ partial void SetOutline(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Outline to be changed before returning.
+ /// </summary>
+ partial void GetOutline(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Outline
+ {
+ get
+ {
+ string value = _Outline;
+ GetOutline(ref value);
+ return (_Outline = value);
+ }
+ set
{
- _Outline = value;
+ string oldValue = _Outline;
+ SetOutline(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Outline = value;
+ }
}
- }
- }
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Series.cs b/Jellyfin.Data/Entities/Series.cs
index a57064824..097b9958e 100644
--- a/Jellyfin.Data/Entities/Series.cs
+++ b/Jellyfin.Data/Entities/Series.cs
@@ -1,183 +1,167 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Series: global::Jellyfin.Data.Entities.LibraryItem
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Series(): base()
- {
- SeriesMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.SeriesMetadata>();
- Seasons = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Season>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Series CreateSeriesUnsafe()
- {
- return new Series();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public Series(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
-
- this.SeriesMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.SeriesMetadata>();
- this.Seasons = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Season>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- public static Series Create(Guid urlid, DateTime dateadded)
- {
- return new Series(urlid, dateadded);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for AirsDayOfWeek
- /// </summary>
- protected global::Jellyfin.Data.Enums.Weekday? _AirsDayOfWeek;
- /// <summary>
- /// When provided in a partial class, allows value of AirsDayOfWeek to be changed before setting.
- /// </summary>
- partial void SetAirsDayOfWeek(global::Jellyfin.Data.Enums.Weekday? oldValue, ref global::Jellyfin.Data.Enums.Weekday? newValue);
- /// <summary>
- /// When provided in a partial class, allows value of AirsDayOfWeek to be changed before returning.
- /// </summary>
- partial void GetAirsDayOfWeek(ref global::Jellyfin.Data.Enums.Weekday? result);
-
- public global::Jellyfin.Data.Enums.Weekday? AirsDayOfWeek
- {
- get
- {
- global::Jellyfin.Data.Enums.Weekday? value = _AirsDayOfWeek;
- GetAirsDayOfWeek(ref value);
- return (_AirsDayOfWeek = value);
- }
- set
- {
- global::Jellyfin.Data.Enums.Weekday? oldValue = _AirsDayOfWeek;
- SetAirsDayOfWeek(oldValue, ref value);
- if (oldValue != value)
+ public partial class Series : LibraryItem
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Series()
+ {
+ SeriesMetadata = new HashSet<SeriesMetadata>();
+ Seasons = new HashSet<Season>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Series CreateSeriesUnsafe()
+ {
+ return new Series();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public Series(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
+
+ this.SeriesMetadata = new HashSet<SeriesMetadata>();
+ this.Seasons = new HashSet<Season>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ public static Series Create(Guid urlid, DateTime dateadded)
+ {
+ return new Series(urlid, dateadded);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for AirsDayOfWeek
+ /// </summary>
+ protected Enums.Weekday? _AirsDayOfWeek;
+ /// <summary>
+ /// When provided in a partial class, allows value of AirsDayOfWeek to be changed before setting.
+ /// </summary>
+ partial void SetAirsDayOfWeek(Enums.Weekday? oldValue, ref Enums.Weekday? newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of AirsDayOfWeek to be changed before returning.
+ /// </summary>
+ partial void GetAirsDayOfWeek(ref Enums.Weekday? result);
+
+ public Enums.Weekday? AirsDayOfWeek
+ {
+ get
{
- _AirsDayOfWeek = value;
+ Enums.Weekday? value = _AirsDayOfWeek;
+ GetAirsDayOfWeek(ref value);
+ return (_AirsDayOfWeek = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for AirsTime
- /// </summary>
- protected DateTimeOffset? _AirsTime;
- /// <summary>
- /// When provided in a partial class, allows value of AirsTime to be changed before setting.
- /// </summary>
- partial void SetAirsTime(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
- /// <summary>
- /// When provided in a partial class, allows value of AirsTime to be changed before returning.
- /// </summary>
- partial void GetAirsTime(ref DateTimeOffset? result);
-
- /// <summary>
- /// The time the show airs, ignore the date portion
- /// </summary>
- public DateTimeOffset? AirsTime
- {
- get
- {
- DateTimeOffset? value = _AirsTime;
- GetAirsTime(ref value);
- return (_AirsTime = value);
- }
- set
- {
- DateTimeOffset? oldValue = _AirsTime;
- SetAirsTime(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _AirsTime = value;
+ Enums.Weekday? oldValue = _AirsDayOfWeek;
+ SetAirsDayOfWeek(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _AirsDayOfWeek = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for FirstAired
- /// </summary>
- protected DateTimeOffset? _FirstAired;
- /// <summary>
- /// When provided in a partial class, allows value of FirstAired to be changed before setting.
- /// </summary>
- partial void SetFirstAired(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
- /// <summary>
- /// When provided in a partial class, allows value of FirstAired to be changed before returning.
- /// </summary>
- partial void GetFirstAired(ref DateTimeOffset? result);
-
- public DateTimeOffset? FirstAired
- {
- get
- {
- DateTimeOffset? value = _FirstAired;
- GetFirstAired(ref value);
- return (_FirstAired = value);
- }
- set
- {
- DateTimeOffset? oldValue = _FirstAired;
- SetFirstAired(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for AirsTime
+ /// </summary>
+ protected DateTimeOffset? _AirsTime;
+ /// <summary>
+ /// When provided in a partial class, allows value of AirsTime to be changed before setting.
+ /// </summary>
+ partial void SetAirsTime(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of AirsTime to be changed before returning.
+ /// </summary>
+ partial void GetAirsTime(ref DateTimeOffset? result);
+
+ /// <summary>
+ /// The time the show airs, ignore the date portion
+ /// </summary>
+ public DateTimeOffset? AirsTime
+ {
+ get
{
- _FirstAired = value;
+ DateTimeOffset? value = _AirsTime;
+ GetAirsTime(ref value);
+ return (_AirsTime = value);
}
- }
- }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ set
+ {
+ DateTimeOffset? oldValue = _AirsTime;
+ SetAirsTime(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _AirsTime = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for FirstAired
+ /// </summary>
+ protected DateTimeOffset? _FirstAired;
+ /// <summary>
+ /// When provided in a partial class, allows value of FirstAired to be changed before setting.
+ /// </summary>
+ partial void SetFirstAired(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of FirstAired to be changed before returning.
+ /// </summary>
+ partial void GetFirstAired(ref DateTimeOffset? result);
+
+ public DateTimeOffset? FirstAired
+ {
+ get
+ {
+ DateTimeOffset? value = _FirstAired;
+ GetFirstAired(ref value);
+ return (_FirstAired = value);
+ }
+ set
+ {
+ DateTimeOffset? oldValue = _FirstAired;
+ SetFirstAired(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _FirstAired = value;
+ }
+ }
+ }
- public virtual ICollection<global::Jellyfin.Data.Entities.SeriesMetadata> SeriesMetadata { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("SeriesMetadata_SeriesMetadata_Id")]
+ public virtual ICollection<SeriesMetadata> SeriesMetadata { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.Season> Seasons { get; protected set; }
+ [ForeignKey("Season_Seasons_Id")]
+ public virtual ICollection<Season> Seasons { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/SeriesMetadata.cs b/Jellyfin.Data/Entities/SeriesMetadata.cs
index 9a91371df..52691783f 100644
--- a/Jellyfin.Data/Entities/SeriesMetadata.cs
+++ b/Jellyfin.Data/Entities/SeriesMetadata.cs
@@ -1,239 +1,223 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class SeriesMetadata: global::Jellyfin.Data.Entities.Metadata
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected SeriesMetadata(): base()
- {
- Networks = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Company>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static SeriesMetadata CreateSeriesMetadataUnsafe()
- {
- return new SeriesMetadata();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_series0"></param>
- public SeriesMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Series _series0)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
-
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
-
- if (_series0 == null) throw new ArgumentNullException(nameof(_series0));
- _series0.SeriesMetadata.Add(this);
-
- this.Networks = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Company>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_series0"></param>
- public static SeriesMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Series _series0)
- {
- return new SeriesMetadata(title, language, dateadded, datemodified, _series0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for Outline
- /// </summary>
- protected string _Outline;
- /// <summary>
- /// When provided in a partial class, allows value of Outline to be changed before setting.
- /// </summary>
- partial void SetOutline(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Outline to be changed before returning.
- /// </summary>
- partial void GetOutline(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Outline
- {
- get
- {
- string value = _Outline;
- GetOutline(ref value);
- return (_Outline = value);
- }
- set
- {
- string oldValue = _Outline;
- SetOutline(oldValue, ref value);
- if (oldValue != value)
+ public partial class SeriesMetadata : Metadata
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected SeriesMetadata()
+ {
+ Networks = new HashSet<Company>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static SeriesMetadata CreateSeriesMetadataUnsafe()
+ {
+ return new SeriesMetadata();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_series0"></param>
+ public SeriesMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Series _series0)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
+
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
+
+ if (_series0 == null) throw new ArgumentNullException(nameof(_series0));
+ _series0.SeriesMetadata.Add(this);
+
+ this.Networks = new HashSet<Company>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_series0"></param>
+ public static SeriesMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Series _series0)
+ {
+ return new SeriesMetadata(title, language, dateadded, datemodified, _series0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for Outline
+ /// </summary>
+ protected string _Outline;
+ /// <summary>
+ /// When provided in a partial class, allows value of Outline to be changed before setting.
+ /// </summary>
+ partial void SetOutline(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Outline to be changed before returning.
+ /// </summary>
+ partial void GetOutline(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Outline
+ {
+ get
{
- _Outline = value;
+ string value = _Outline;
+ GetOutline(ref value);
+ return (_Outline = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Plot
- /// </summary>
- protected string _Plot;
- /// <summary>
- /// When provided in a partial class, allows value of Plot to be changed before setting.
- /// </summary>
- partial void SetPlot(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Plot to be changed before returning.
- /// </summary>
- partial void GetPlot(ref string result);
-
- /// <summary>
- /// Max length = 65535
- /// </summary>
- [MaxLength(65535)]
- [StringLength(65535)]
- public string Plot
- {
- get
- {
- string value = _Plot;
- GetPlot(ref value);
- return (_Plot = value);
- }
- set
- {
- string oldValue = _Plot;
- SetPlot(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Plot = value;
+ string oldValue = _Outline;
+ SetOutline(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Outline = value;
+ }
}
- }
- }
-
- /// <summary>
- /// Backing field for Tagline
- /// </summary>
- protected string _Tagline;
- /// <summary>
- /// When provided in a partial class, allows value of Tagline to be changed before setting.
- /// </summary>
- partial void SetTagline(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Tagline to be changed before returning.
- /// </summary>
- partial void GetTagline(ref string result);
-
- /// <summary>
- /// Max length = 1024
- /// </summary>
- [MaxLength(1024)]
- [StringLength(1024)]
- public string Tagline
- {
- get
- {
- string value = _Tagline;
- GetTagline(ref value);
- return (_Tagline = value);
- }
- set
- {
- string oldValue = _Tagline;
- SetTagline(oldValue, ref value);
- if (oldValue != value)
+ }
+
+ /// <summary>
+ /// Backing field for Plot
+ /// </summary>
+ protected string _Plot;
+ /// <summary>
+ /// When provided in a partial class, allows value of Plot to be changed before setting.
+ /// </summary>
+ partial void SetPlot(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Plot to be changed before returning.
+ /// </summary>
+ partial void GetPlot(ref string result);
+
+ /// <summary>
+ /// Max length = 65535
+ /// </summary>
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string Plot
+ {
+ get
{
- _Tagline = value;
+ string value = _Plot;
+ GetPlot(ref value);
+ return (_Plot = value);
}
- }
- }
-
- /// <summary>
- /// Backing field for Country
- /// </summary>
- protected string _Country;
- /// <summary>
- /// When provided in a partial class, allows value of Country to be changed before setting.
- /// </summary>
- partial void SetCountry(string oldValue, ref string newValue);
- /// <summary>
- /// When provided in a partial class, allows value of Country to be changed before returning.
- /// </summary>
- partial void GetCountry(ref string result);
-
- /// <summary>
- /// Max length = 2
- /// </summary>
- [MaxLength(2)]
- [StringLength(2)]
- public string Country
- {
- get
- {
- string value = _Country;
- GetCountry(ref value);
- return (_Country = value);
- }
- set
- {
- string oldValue = _Country;
- SetCountry(oldValue, ref value);
- if (oldValue != value)
+ set
{
- _Country = value;
+ string oldValue = _Plot;
+ SetPlot(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Plot = value;
+ }
}
- }
- }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ }
+
+ /// <summary>
+ /// Backing field for Tagline
+ /// </summary>
+ protected string _Tagline;
+ /// <summary>
+ /// When provided in a partial class, allows value of Tagline to be changed before setting.
+ /// </summary>
+ partial void SetTagline(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Tagline to be changed before returning.
+ /// </summary>
+ partial void GetTagline(ref string result);
+
+ /// <summary>
+ /// Max length = 1024
+ /// </summary>
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Tagline
+ {
+ get
+ {
+ string value = _Tagline;
+ GetTagline(ref value);
+ return (_Tagline = value);
+ }
+ set
+ {
+ string oldValue = _Tagline;
+ SetTagline(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Tagline = value;
+ }
+ }
+ }
+
+ /// <summary>
+ /// Backing field for Country
+ /// </summary>
+ protected string _Country;
+ /// <summary>
+ /// When provided in a partial class, allows value of Country to be changed before setting.
+ /// </summary>
+ partial void SetCountry(string oldValue, ref string newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of Country to be changed before returning.
+ /// </summary>
+ partial void GetCountry(ref string result);
+
+ /// <summary>
+ /// Max length = 2
+ /// </summary>
+ [MaxLength(2)]
+ [StringLength(2)]
+ public string Country
+ {
+ get
+ {
+ string value = _Country;
+ GetCountry(ref value);
+ return (_Country = value);
+ }
+ set
+ {
+ string oldValue = _Country;
+ SetCountry(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _Country = value;
+ }
+ }
+ }
- public virtual ICollection<global::Jellyfin.Data.Entities.Company> Networks { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("Company_Networks_Id")]
+ public virtual ICollection<Company> Networks { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Track.cs b/Jellyfin.Data/Entities/Track.cs
index 1d3ad372f..079d73d2b 100644
--- a/Jellyfin.Data/Entities/Track.cs
+++ b/Jellyfin.Data/Entities/Track.cs
@@ -1,127 +1,112 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class Track: global::Jellyfin.Data.Entities.LibraryItem
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected Track(): base()
- {
- // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
- TrackMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.TrackMetadata>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static Track CreateTrackUnsafe()
- {
- return new Track();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- /// <param name="_musicalbum0"></param>
- public Track(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.MusicAlbum _musicalbum0)
- {
- // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
- // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
-
- this.UrlId = urlid;
-
- if (_musicalbum0 == null) throw new ArgumentNullException(nameof(_musicalbum0));
- _musicalbum0.Tracks.Add(this);
-
- this.Releases = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Release>();
- this.TrackMetadata = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.TrackMetadata>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
- /// <param name="_musicalbum0"></param>
- public static Track Create(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.MusicAlbum _musicalbum0)
- {
- return new Track(urlid, dateadded, _musicalbum0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Backing field for TrackNumber
- /// </summary>
- protected int? _TrackNumber;
- /// <summary>
- /// When provided in a partial class, allows value of TrackNumber to be changed before setting.
- /// </summary>
- partial void SetTrackNumber(int? oldValue, ref int? newValue);
- /// <summary>
- /// When provided in a partial class, allows value of TrackNumber to be changed before returning.
- /// </summary>
- partial void GetTrackNumber(ref int? result);
-
- public int? TrackNumber
- {
- get
- {
- int? value = _TrackNumber;
- GetTrackNumber(ref value);
- return (_TrackNumber = value);
- }
- set
- {
- int? oldValue = _TrackNumber;
- SetTrackNumber(oldValue, ref value);
- if (oldValue != value)
+ public partial class Track : LibraryItem
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected Track()
+ {
+ // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ Releases = new HashSet<Release>();
+ TrackMetadata = new HashSet<TrackMetadata>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static Track CreateTrackUnsafe()
+ {
+ return new Track();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ /// <param name="_musicalbum0"></param>
+ public Track(Guid urlid, DateTime dateadded, MusicAlbum _musicalbum0)
+ {
+ // NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem.
+ // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.
+
+ this.UrlId = urlid;
+
+ if (_musicalbum0 == null) throw new ArgumentNullException(nameof(_musicalbum0));
+ _musicalbum0.Tracks.Add(this);
+
+ this.Releases = new HashSet<Release>();
+ this.TrackMetadata = new HashSet<TrackMetadata>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="urlid">This is whats gets displayed in the Urls and API requests. This could also be a string.</param>
+ /// <param name="_musicalbum0"></param>
+ public static Track Create(Guid urlid, DateTime dateadded, MusicAlbum _musicalbum0)
+ {
+ return new Track(urlid, dateadded, _musicalbum0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Backing field for TrackNumber
+ /// </summary>
+ protected int? _TrackNumber;
+ /// <summary>
+ /// When provided in a partial class, allows value of TrackNumber to be changed before setting.
+ /// </summary>
+ partial void SetTrackNumber(int? oldValue, ref int? newValue);
+ /// <summary>
+ /// When provided in a partial class, allows value of TrackNumber to be changed before returning.
+ /// </summary>
+ partial void GetTrackNumber(ref int? result);
+
+ public int? TrackNumber
+ {
+ get
+ {
+ int? value = _TrackNumber;
+ GetTrackNumber(ref value);
+ return (_TrackNumber = value);
+ }
+ set
{
- _TrackNumber = value;
+ int? oldValue = _TrackNumber;
+ SetTrackNumber(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _TrackNumber = value;
+ }
}
- }
- }
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection<global::Jellyfin.Data.Entities.Release> Releases { get; protected set; }
+ [ForeignKey("Release_Releases_Id")]
+ public virtual ICollection<Release> Releases { get; protected set; }
- public virtual ICollection<global::Jellyfin.Data.Entities.TrackMetadata> TrackMetadata { get; protected set; }
+ [ForeignKey("TrackMetadata_TrackMetadata_Id")]
+ public virtual ICollection<TrackMetadata> TrackMetadata { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/TrackMetadata.cs b/Jellyfin.Data/Entities/TrackMetadata.cs
index f4c61459c..86c9161f6 100644
--- a/Jellyfin.Data/Entities/TrackMetadata.cs
+++ b/Jellyfin.Data/Entities/TrackMetadata.cs
@@ -1,86 +1,68 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
-using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class TrackMetadata: global::Jellyfin.Data.Entities.Metadata
- {
- partial void Init();
+ public partial class TrackMetadata : Metadata
+ {
+ partial void Init();
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected TrackMetadata(): base()
- {
- Init();
- }
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected TrackMetadata()
+ {
+ Init();
+ }
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static TrackMetadata CreateTrackMetadataUnsafe()
- {
- return new TrackMetadata();
- }
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static TrackMetadata CreateTrackMetadataUnsafe()
+ {
+ return new TrackMetadata();
+ }
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_track0"></param>
- public TrackMetadata(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Track _track0)
- {
- if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
- this.Title = title;
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_track0"></param>
+ public TrackMetadata(string title, string language, DateTime dateadded, DateTime datemodified, Track _track0)
+ {
+ if (string.IsNullOrEmpty(title)) throw new ArgumentNullException(nameof(title));
+ this.Title = title;
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
+ if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
+ this.Language = language;
- if (_track0 == null) throw new ArgumentNullException(nameof(_track0));
- _track0.TrackMetadata.Add(this);
+ if (_track0 == null) throw new ArgumentNullException(nameof(_track0));
+ _track0.TrackMetadata.Add(this);
- Init();
- }
+ Init();
+ }
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="title">The title or name of the object</param>
- /// <param name="language">ISO-639-3 3-character language codes</param>
- /// <param name="_track0"></param>
- public static TrackMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, global::Jellyfin.Data.Entities.Track _track0)
- {
- return new TrackMetadata(title, language, dateadded, datemodified, _track0);
- }
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="title">The title or name of the object</param>
+ /// <param name="language">ISO-639-3 3-character language codes</param>
+ /// <param name="_track0"></param>
+ public static TrackMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Track _track0)
+ {
+ return new TrackMetadata(title, language, dateadded, datemodified, _track0);
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/User.cs b/Jellyfin.Data/Entities/User.cs
index 2ee3c8f4f..a81d5215b 100644
--- a/Jellyfin.Data/Entities/User.cs
+++ b/Jellyfin.Data/Entities/User.cs
@@ -1,242 +1,235 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
using System;
using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
-using System.Linq;
-using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities
{
- public partial class User
- {
- partial void Init();
-
- /// <summary>
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- /// </summary>
- protected User()
- {
- Groups = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Group>();
- Permissions = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Permission>();
- ProviderMappings = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.ProviderMapping>();
- Preferences = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Preference>();
-
- Init();
- }
-
- /// <summary>
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- /// </summary>
- public static User CreateUserUnsafe()
- {
- return new User();
- }
-
- /// <summary>
- /// Public constructor with required data
- /// </summary>
- /// <param name="username"></param>
- /// <param name="mustupdatepassword"></param>
- /// <param name="audiolanguagepreference"></param>
- /// <param name="authenticationproviderid"></param>
- /// <param name="invalidloginattemptcount"></param>
- /// <param name="subtitlemode"></param>
- /// <param name="playdefaultaudiotrack"></param>
- public User(string username, bool mustupdatepassword, string audiolanguagepreference, string authenticationproviderid, int invalidloginattemptcount, string subtitlemode, bool playdefaultaudiotrack)
- {
- if (string.IsNullOrEmpty(username)) throw new ArgumentNullException(nameof(username));
- this.Username = username;
-
- this.MustUpdatePassword = mustupdatepassword;
-
- if (string.IsNullOrEmpty(audiolanguagepreference)) throw new ArgumentNullException(nameof(audiolanguagepreference));
- this.AudioLanguagePreference = audiolanguagepreference;
-
- if (string.IsNullOrEmpty(authenticationproviderid)) throw new ArgumentNullException(nameof(authenticationproviderid));
- this.AuthenticationProviderId = authenticationproviderid;
-
- this.InvalidLoginAttemptCount = invalidloginattemptcount;
-
- if (string.IsNullOrEmpty(subtitlemode)) throw new ArgumentNullException(nameof(subtitlemode));
- this.SubtitleMode = subtitlemode;
-
- this.PlayDefaultAudioTrack = playdefaultaudiotrack;
-
- this.Groups = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Group>();
- this.Permissions = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Permission>();
- this.ProviderMappings = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.ProviderMapping>();
- this.Preferences = new System.Collections.Generic.HashSet<global::Jellyfin.Data.Entities.Preference>();
-
- Init();
- }
-
- /// <summary>
- /// Static create function (for use in LINQ queries, etc.)
- /// </summary>
- /// <param name="username"></param>
- /// <param name="mustupdatepassword"></param>
- /// <param name="audiolanguagepreference"></param>
- /// <param name="authenticationproviderid"></param>
- /// <param name="invalidloginattemptcount"></param>
- /// <param name="subtitlemode"></param>
- /// <param name="playdefaultaudiotrack"></param>
- public static User Create(string username, bool mustupdatepassword, string audiolanguagepreference, string authenticationproviderid, int invalidloginattemptcount, string subtitlemode, bool playdefaultaudiotrack)
- {
- return new User(username, mustupdatepassword, audiolanguagepreference, authenticationproviderid, invalidloginattemptcount, subtitlemode, playdefaultaudiotrack);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- /// <summary>
- /// Identity, Indexed, Required
- /// </summary>
- [Key]
- [Required]
- public Guid Id { get; protected set; }
-
- /// <summary>
- /// Required
- /// </summary>
- [ConcurrencyCheck]
- [Required]
- public byte[] LastLoginTimestamp { get; set; }
-
- /// <summary>
- /// Required, Max length = 255
- /// </summary>
- [Required]
- [MaxLength(255)]
- [StringLength(255)]
- public string Username { get; set; }
-
- /// <summary>
- /// Max length = 65535
- /// </summary>
- [MaxLength(65535)]
- [StringLength(65535)]
- public string Password { get; set; }
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public bool MustUpdatePassword { get; set; }
-
- /// <summary>
- /// Required, Max length = 255
- /// </summary>
- [Required]
- [MaxLength(255)]
- [StringLength(255)]
- public string AudioLanguagePreference { get; set; }
-
- /// <summary>
- /// Required, Max length = 255
- /// </summary>
- [Required]
- [MaxLength(255)]
- [StringLength(255)]
- public string AuthenticationProviderId { get; set; }
-
- /// <summary>
- /// Max length = 65535
- /// </summary>
- [MaxLength(65535)]
- [StringLength(65535)]
- public string GroupedFolders { get; set; }
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public int InvalidLoginAttemptCount { get; set; }
-
- /// <summary>
- /// Max length = 65535
- /// </summary>
- [MaxLength(65535)]
- [StringLength(65535)]
- public string LatestItemExcludes { get; set; }
-
- public int? LoginAttemptsBeforeLockout { get; set; }
-
- /// <summary>
- /// Max length = 65535
- /// </summary>
- [MaxLength(65535)]
- [StringLength(65535)]
- public string MyMediaExcludes { get; set; }
-
- /// <summary>
- /// Max length = 65535
- /// </summary>
- [MaxLength(65535)]
- [StringLength(65535)]
- public string OrderedViews { get; set; }
-
- /// <summary>
- /// Required, Max length = 255
- /// </summary>
- [Required]
- [MaxLength(255)]
- [StringLength(255)]
- public string SubtitleMode { get; set; }
-
- /// <summary>
- /// Required
- /// </summary>
- [Required]
- public bool PlayDefaultAudioTrack { get; set; }
-
- /// <summary>
- /// Max length = 255
- /// </summary>
- [MaxLength(255)]
- [StringLength(255)]
- public string SubtitleLanguagePrefernce { get; set; }
-
- public bool? DisplayMissingEpisodes { get; set; }
-
- public bool? DisplayCollectionsView { get; set; }
-
- public bool? HidePlayedInLatest { get; set; }
-
- public bool? RememberAudioSelections { get; set; }
-
- public bool? RememberSubtitleSelections { get; set; }
-
- public bool? EnableNextEpisodeAutoPlay { get; set; }
-
- public bool? EnableUserPreferenceAccess { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- public virtual ICollection<global::Jellyfin.Data.Entities.Group> Groups { get; protected set; }
-
- public virtual ICollection<global::Jellyfin.Data.Entities.Permission> Permissions { get; protected set; }
-
- public virtual ICollection<global::Jellyfin.Data.Entities.ProviderMapping> ProviderMappings { get; protected set; }
-
- public virtual ICollection<global::Jellyfin.Data.Entities.Preference> Preferences { get; protected set; }
-
- }
+ public partial class User
+ {
+ partial void Init();
+
+ /// <summary>
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ /// </summary>
+ protected User()
+ {
+ Groups = new HashSet<Group>();
+ Permissions = new HashSet<Permission>();
+ ProviderMappings = new HashSet<ProviderMapping>();
+ Preferences = new HashSet<Preference>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ /// </summary>
+ public static User CreateUserUnsafe()
+ {
+ return new User();
+ }
+
+ /// <summary>
+ /// Public constructor with required data
+ /// </summary>
+ /// <param name="username"></param>
+ /// <param name="mustupdatepassword"></param>
+ /// <param name="audiolanguagepreference"></param>
+ /// <param name="authenticationproviderid"></param>
+ /// <param name="invalidloginattemptcount"></param>
+ /// <param name="subtitlemode"></param>
+ /// <param name="playdefaultaudiotrack"></param>
+ public User(string username, bool mustupdatepassword, string audiolanguagepreference, string authenticationproviderid, int invalidloginattemptcount, string subtitlemode, bool playdefaultaudiotrack)
+ {
+ if (string.IsNullOrEmpty(username)) throw new ArgumentNullException(nameof(username));
+ this.Username = username;
+
+ this.MustUpdatePassword = mustupdatepassword;
+
+ if (string.IsNullOrEmpty(audiolanguagepreference)) throw new ArgumentNullException(nameof(audiolanguagepreference));
+ this.AudioLanguagePreference = audiolanguagepreference;
+
+ if (string.IsNullOrEmpty(authenticationproviderid)) throw new ArgumentNullException(nameof(authenticationproviderid));
+ this.AuthenticationProviderId = authenticationproviderid;
+
+ this.InvalidLoginAttemptCount = invalidloginattemptcount;
+
+ if (string.IsNullOrEmpty(subtitlemode)) throw new ArgumentNullException(nameof(subtitlemode));
+ this.SubtitleMode = subtitlemode;
+
+ this.PlayDefaultAudioTrack = playdefaultaudiotrack;
+
+ this.Groups = new HashSet<Group>();
+ this.Permissions = new HashSet<Permission>();
+ this.ProviderMappings = new HashSet<ProviderMapping>();
+ this.Preferences = new HashSet<Preference>();
+
+ Init();
+ }
+
+ /// <summary>
+ /// Static create function (for use in LINQ queries, etc.)
+ /// </summary>
+ /// <param name="username"></param>
+ /// <param name="mustupdatepassword"></param>
+ /// <param name="audiolanguagepreference"></param>
+ /// <param name="authenticationproviderid"></param>
+ /// <param name="invalidloginattemptcount"></param>
+ /// <param name="subtitlemode"></param>
+ /// <param name="playdefaultaudiotrack"></param>
+ public static User Create(string username, bool mustupdatepassword, string audiolanguagepreference, string authenticationproviderid, int invalidloginattemptcount, string subtitlemode, bool playdefaultaudiotrack)
+ {
+ return new User(username, mustupdatepassword, audiolanguagepreference, authenticationproviderid, invalidloginattemptcount, subtitlemode, playdefaultaudiotrack);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ /// <summary>
+ /// Identity, Indexed, Required
+ /// </summary>
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id { get; protected set; }
+
+ /// <summary>
+ /// Required, Max length = 255
+ /// </summary>
+ [Required]
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string Username { get; set; }
+
+ /// <summary>
+ /// Max length = 65535
+ /// </summary>
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string Password { get; set; }
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public bool MustUpdatePassword { get; set; }
+
+ /// <summary>
+ /// Required, Max length = 255
+ /// </summary>
+ [Required]
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string AudioLanguagePreference { get; set; }
+
+ /// <summary>
+ /// Required, Max length = 255
+ /// </summary>
+ [Required]
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string AuthenticationProviderId { get; set; }
+
+ /// <summary>
+ /// Max length = 65535
+ /// </summary>
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string GroupedFolders { get; set; }
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public int InvalidLoginAttemptCount { get; set; }
+
+ /// <summary>
+ /// Max length = 65535
+ /// </summary>
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string LatestItemExcludes { get; set; }
+
+ public int? LoginAttemptsBeforeLockout { get; set; }
+
+ /// <summary>
+ /// Max length = 65535
+ /// </summary>
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string MyMediaExcludes { get; set; }
+
+ /// <summary>
+ /// Max length = 65535
+ /// </summary>
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string OrderedViews { get; set; }
+
+ /// <summary>
+ /// Required, Max length = 255
+ /// </summary>
+ [Required]
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string SubtitleMode { get; set; }
+
+ /// <summary>
+ /// Required
+ /// </summary>
+ [Required]
+ public bool PlayDefaultAudioTrack { get; set; }
+
+ /// <summary>
+ /// Max length = 255
+ /// </summary>
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string SubtitleLanguagePrefernce { get; set; }
+
+ public bool? DisplayMissingEpisodes { get; set; }
+
+ public bool? DisplayCollectionsView { get; set; }
+
+ public bool? HidePlayedInLatest { get; set; }
+
+ public bool? RememberAudioSelections { get; set; }
+
+ public bool? RememberSubtitleSelections { get; set; }
+
+ public bool? EnableNextEpisodeAutoPlay { get; set; }
+
+ public bool? EnableUserPreferenceAccess { get; set; }
+
+ /// <summary>
+ /// Required, ConcurrenyToken
+ /// </summary>
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("Group_Groups_Id")]
+ public virtual ICollection<Group> Groups { get; protected set; }
+
+ [ForeignKey("Permission_Permissions_Id")]
+ public virtual ICollection<Permission> Permissions { get; protected set; }
+
+ [ForeignKey("ProviderMapping_ProviderMappings_Id")]
+ public virtual ICollection<ProviderMapping> ProviderMappings { get; protected set; }
+
+ [ForeignKey("Preference_Preferences_Id")]
+ public virtual ICollection<Preference> Preferences { get; protected set; }
+
+ }
}
diff --git a/Jellyfin.Data/Enums/ArtKind.cs b/Jellyfin.Data/Enums/ArtKind.cs
index 52e33048e..6b69d68b2 100644
--- a/Jellyfin.Data/Enums/ArtKind.cs
+++ b/Jellyfin.Data/Enums/ArtKind.cs
@@ -1,25 +1,11 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
-
namespace Jellyfin.Data.Enums
{
- public enum ArtKind : Int32
- {
- Other,
- Poster,
- Banner,
- Thumbnail,
- Logo
- }
+ public enum ArtKind
+ {
+ Other,
+ Poster,
+ Banner,
+ Thumbnail,
+ Logo
+ }
}
diff --git a/Jellyfin.Data/Enums/MediaFileKind.cs b/Jellyfin.Data/Enums/MediaFileKind.cs
index 34d1b20f5..12f48c558 100644
--- a/Jellyfin.Data/Enums/MediaFileKind.cs
+++ b/Jellyfin.Data/Enums/MediaFileKind.cs
@@ -1,25 +1,11 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
-
namespace Jellyfin.Data.Enums
{
- public enum MediaFileKind : Int32
- {
- Main,
- Sidecar,
- AdditionalPart,
- AlternativeFormat,
- AdditionalStream
- }
+ public enum MediaFileKind
+ {
+ Main,
+ Sidecar,
+ AdditionalPart,
+ AlternativeFormat,
+ AdditionalStream
+ }
}
diff --git a/Jellyfin.Data/Enums/PermissionKind.cs b/Jellyfin.Data/Enums/PermissionKind.cs
new file mode 100644
index 000000000..1506471e8
--- /dev/null
+++ b/Jellyfin.Data/Enums/PermissionKind.cs
@@ -0,0 +1,26 @@
+namespace Jellyfin.Data.Enums
+{
+ public enum PermissionKind
+ {
+ IsAdministrator,
+ IsHidden,
+ IsDisabled,
+ BlockUnrateditems,
+ EnbleSharedDeviceControl,
+ EnableRemoteAccess,
+ EnableLiveTvManagement,
+ EnableLiveTvAccess,
+ EnableMediaPlayback,
+ EnableAudioPlaybackTranscoding,
+ EnableVideoPlaybackTranscoding,
+ EnableContentDeletion,
+ EnableContentDownloading,
+ EnableSyncTranscoding,
+ EnableMediaConversion,
+ EnableAllDevices,
+ EnableAllChannels,
+ EnableAllFolders,
+ EnablePublicSharing,
+ AccessSchedules
+ }
+}
diff --git a/Jellyfin.Data/Enums/PersonRoleType.cs b/Jellyfin.Data/Enums/PersonRoleType.cs
index f5c8f43c5..6e52f2c85 100644
--- a/Jellyfin.Data/Enums/PersonRoleType.cs
+++ b/Jellyfin.Data/Enums/PersonRoleType.cs
@@ -1,32 +1,18 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
-
namespace Jellyfin.Data.Enums
{
- public enum PersonRoleType : Int32
- {
- Other,
- Director,
- Artist,
- OriginalArtist,
- Actor,
- VoiceActor,
- Producer,
- Remixer,
- Conductor,
- Composer,
- Author,
- Editor
- }
+ public enum PersonRoleType
+ {
+ Other,
+ Director,
+ Artist,
+ OriginalArtist,
+ Actor,
+ VoiceActor,
+ Producer,
+ Remixer,
+ Conductor,
+ Composer,
+ Author,
+ Editor
+ }
}
diff --git a/Jellyfin.Data/Enums/PreferenceKind.cs b/Jellyfin.Data/Enums/PreferenceKind.cs
new file mode 100644
index 000000000..cd2cb791a
--- /dev/null
+++ b/Jellyfin.Data/Enums/PreferenceKind.cs
@@ -0,0 +1,13 @@
+namespace Jellyfin.Data.Enums
+{
+ public enum PreferenceKind
+ {
+ MaxParentalRating,
+ BlockedTags,
+ RemoteClientBitrateLimit,
+ EnabledDevices,
+ EnabledChannels,
+ EnabledFolders,
+ EnableContentDeletionFromFolders
+ }
+}
diff --git a/Jellyfin.Data/Enums/Weekday.cs b/Jellyfin.Data/Enums/Weekday.cs
index ce0c6e4ce..b80a03a33 100644
--- a/Jellyfin.Data/Enums/Weekday.cs
+++ b/Jellyfin.Data/Enums/Weekday.cs
@@ -1,27 +1,13 @@
-//------------------------------------------------------------------------------
-// <auto-generated>
-// This code was generated from a template.
-//
-// Manual changes to this file may cause unexpected behavior in your application.
-// Manual changes to this file will be overwritten if the code is regenerated.
-//
-// Produced by Entity Framework Visual Editor
-// https://github.com/msawczyn/EFDesigner
-// </auto-generated>
-//------------------------------------------------------------------------------
-
-using System;
-
namespace Jellyfin.Data.Enums
{
- public enum Weekday : Int32
- {
- Sunday,
- Monday,
- Tuesday,
- Wednesday,
- Thursday,
- Friday,
- Saturday
- }
+ public enum Weekday
+ {
+ Sunday,
+ Monday,
+ Tuesday,
+ Wednesday,
+ Thursday,
+ Friday,
+ Saturday
+ }
}
diff --git a/Jellyfin.Data/ISavingChanges.cs b/Jellyfin.Data/ISavingChanges.cs
index 5388b921d..f392dae6a 100644
--- a/Jellyfin.Data/ISavingChanges.cs
+++ b/Jellyfin.Data/ISavingChanges.cs
@@ -1,4 +1,4 @@
-#pragma warning disable CS1591
+#pragma warning disable CS1591
namespace Jellyfin.Data
{
diff --git a/Jellyfin.Data/Structs/.gitkeep b/Jellyfin.Data/Structs/.gitkeep
deleted file mode 100644
index e69de29bb..000000000
--- a/Jellyfin.Data/Structs/.gitkeep
+++ /dev/null
diff --git a/Jellyfin.Server/Migrations/IMigrationRoutine.cs b/Jellyfin.Server/Migrations/IMigrationRoutine.cs
index eab995d67..b79fdeac0 100644
--- a/Jellyfin.Server/Migrations/IMigrationRoutine.cs
+++ b/Jellyfin.Server/Migrations/IMigrationRoutine.cs
@@ -21,8 +21,6 @@ namespace Jellyfin.Server.Migrations
/// <summary>
/// Execute the migration routine.
/// </summary>
- /// <param name="host">Host that hosts current version.</param>
- /// <param name="logger">Host logger.</param>
- public void Perform(CoreAppHost host, ILogger logger);
+ public void Perform();
}
}
diff --git a/Jellyfin.Server/Migrations/MigrationRunner.cs b/Jellyfin.Server/Migrations/MigrationRunner.cs
index 82e304586..c4927f877 100644
--- a/Jellyfin.Server/Migrations/MigrationRunner.cs
+++ b/Jellyfin.Server/Migrations/MigrationRunner.cs
@@ -1,6 +1,7 @@
using System;
using System.Linq;
using MediaBrowser.Common.Configuration;
+using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
namespace Jellyfin.Server.Migrations
@@ -13,11 +14,11 @@ namespace Jellyfin.Server.Migrations
/// <summary>
/// The list of known migrations, in order of applicability.
/// </summary>
- internal static readonly IMigrationRoutine[] Migrations =
+ private static readonly Type[] _migrationTypes =
{
- new Routines.DisableTranscodingThrottling(),
- new Routines.CreateUserLoggingConfigFile(),
- new Routines.MigrateActivityLogDb()
+ typeof(Routines.DisableTranscodingThrottling),
+ typeof(Routines.CreateUserLoggingConfigFile),
+ typeof(Routines.MigrateActivityLogDb()
};
/// <summary>
@@ -28,6 +29,10 @@ namespace Jellyfin.Server.Migrations
public static void Run(CoreAppHost host, ILoggerFactory loggerFactory)
{
var logger = loggerFactory.CreateLogger<MigrationRunner>();
+ var migrations = _migrationTypes
+ .Select(m => ActivatorUtilities.CreateInstance(host.ServiceProvider, m))
+ .OfType<IMigrationRoutine>()
+ .ToArray();
var migrationOptions = ((IConfigurationManager)host.ServerConfigurationManager).GetConfiguration<MigrationOptions>(MigrationsListStore.StoreKey);
if (!host.ServerConfigurationManager.Configuration.IsStartupWizardCompleted && migrationOptions.Applied.Count == 0)
@@ -35,16 +40,16 @@ namespace Jellyfin.Server.Migrations
// If startup wizard is not finished, this is a fresh install.
// Don't run any migrations, just mark all of them as applied.
logger.LogInformation("Marking all known migrations as applied because this is a fresh install");
- migrationOptions.Applied.AddRange(Migrations.Select(m => (m.Id, m.Name)));
+ migrationOptions.Applied.AddRange(migrations.Select(m => (m.Id, m.Name)));
host.ServerConfigurationManager.SaveConfiguration(MigrationsListStore.StoreKey, migrationOptions);
return;
}
var appliedMigrationIds = migrationOptions.Applied.Select(m => m.Id).ToHashSet();
- for (var i = 0; i < Migrations.Length; i++)
+ for (var i = 0; i < migrations.Length; i++)
{
- var migrationRoutine = Migrations[i];
+ var migrationRoutine = migrations[i];
if (appliedMigrationIds.Contains(migrationRoutine.Id))
{
logger.LogDebug("Skipping migration '{Name}' since it is already applied", migrationRoutine.Name);
@@ -55,7 +60,7 @@ namespace Jellyfin.Server.Migrations
try
{
- migrationRoutine.Perform(host, logger);
+ migrationRoutine.Perform();
}
catch (Exception ex)
{
diff --git a/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs b/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
index 3bc32c047..89514c89b 100644
--- a/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
+++ b/Jellyfin.Server/Migrations/Routines/CreateUserLoggingConfigFile.cs
@@ -36,6 +36,13 @@ namespace Jellyfin.Server.Migrations.Routines
@"{""Serilog"":{""MinimumLevel"":""Information"",""WriteTo"":[{""Name"":""Console"",""Args"":{""outputTemplate"":""[{Timestamp:HH:mm:ss}] [{Level:u3}] [{ThreadId}] {SourceContext}: {Message:lj}{NewLine}{Exception}""}},{""Name"":""Async"",""Args"":{""configure"":[{""Name"":""File"",""Args"":{""path"":""%JELLYFIN_LOG_DIR%//log_.log"",""rollingInterval"":""Day"",""retainedFileCountLimit"":3,""rollOnFileSizeLimit"":true,""fileSizeLimitBytes"":100000000,""outputTemplate"":""[{Timestamp:yyyy-MM-dd HH:mm:ss.fff zzz}] [{Level:u3}] [{ThreadId}] {SourceContext}:{Message}{NewLine}{Exception}""}}]}}],""Enrich"":[""FromLogContext"",""WithThreadId""]}}",
};
+ private readonly IApplicationPaths _appPaths;
+
+ public CreateUserLoggingConfigFile(IApplicationPaths appPaths)
+ {
+ _appPaths = appPaths;
+ }
+
/// <inheritdoc/>
public Guid Id => Guid.Parse("{EF103419-8451-40D8-9F34-D1A8E93A1679}");
@@ -43,9 +50,9 @@ namespace Jellyfin.Server.Migrations.Routines
public string Name => "CreateLoggingConfigHeirarchy";
/// <inheritdoc/>
- public void Perform(CoreAppHost host, ILogger logger)
+ public void Perform()
{
- var logDirectory = host.Resolve<IApplicationPaths>().ConfigurationDirectoryPath;
+ var logDirectory = _appPaths.ConfigurationDirectoryPath;
var existingConfigPath = Path.Combine(logDirectory, "logging.json");
// If the existing logging.json config file is unmodified, then 'reset' it by moving it to 'logging.old.json'
diff --git a/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs b/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
index 6f8e4a8ff..b2e957d5b 100644
--- a/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
+++ b/Jellyfin.Server/Migrations/Routines/DisableTranscodingThrottling.cs
@@ -10,6 +10,15 @@ namespace Jellyfin.Server.Migrations.Routines
/// </summary>
internal class DisableTranscodingThrottling : IMigrationRoutine
{
+ private readonly ILogger _logger;
+ private readonly IConfigurationManager _configManager;
+
+ public DisableTranscodingThrottling(ILogger<DisableTranscodingThrottling> logger, IConfigurationManager configManager)
+ {
+ _logger = logger;
+ _configManager = configManager;
+ }
+
/// <inheritdoc/>
public Guid Id => Guid.Parse("{4124C2CD-E939-4FFB-9BE9-9B311C413638}");
@@ -17,16 +26,16 @@ namespace Jellyfin.Server.Migrations.Routines
public string Name => "DisableTranscodingThrottling";
/// <inheritdoc/>
- public void Perform(CoreAppHost host, ILogger logger)
+ public void Perform()
{
// Set EnableThrottling to false since it wasn't used before and may introduce issues
- var encoding = ((IConfigurationManager)host.ServerConfigurationManager).GetConfiguration<EncodingOptions>("encoding");
+ var encoding = _configManager.GetConfiguration<EncodingOptions>("encoding");
if (encoding.EnableThrottling)
{
- logger.LogInformation("Disabling transcoding throttling during migration");
+ _logger.LogInformation("Disabling transcoding throttling during migration");
encoding.EnableThrottling = false;
- host.ServerConfigurationManager.SaveConfiguration("encoding", encoding);
+ _configManager.SaveConfiguration("encoding", encoding);
}
}
}
diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.cs
index 9635cc6ec..ae423532e 100644
--- a/Jellyfin.Server/Program.cs
+++ b/Jellyfin.Server/Program.cs
@@ -161,23 +161,7 @@ namespace Jellyfin.Server
ApplicationHost.LogEnvironmentInfo(_logger, appPaths);
- // Make sure we have all the code pages we can get
- // Ref: https://docs.microsoft.com/en-us/dotnet/api/system.text.codepagesencodingprovider.instance?view=netcore-3.0#remarks
- Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
-
- // Increase the max http request limit
- // The default connection limit is 10 for ASP.NET hosted applications and 2 for all others.
- ServicePointManager.DefaultConnectionLimit = Math.Max(96, ServicePointManager.DefaultConnectionLimit);
-
- // Disable the "Expect: 100-Continue" header by default
- // http://stackoverflow.com/questions/566437/http-post-returns-the-error-417-expectation-failed-c
- ServicePointManager.Expect100Continue = false;
-
- Batteries_V2.Init();
- if (raw.sqlite3_enable_shared_cache(1) != raw.SQLITE_OK)
- {
- _logger.LogWarning("Failed to enable shared cache for SQLite");
- }
+ PerformStaticInitialization();
var appHost = new CoreAppHost(
appPaths,
@@ -205,7 +189,7 @@ namespace Jellyfin.Server
ServiceCollection serviceCollection = new ServiceCollection();
appHost.Init(serviceCollection);
- var webHost = CreateWebHostBuilder(appHost, serviceCollection, options, startupConfig, appPaths).Build();
+ var webHost = new WebHostBuilder().ConfigureWebHostBuilder(appHost, serviceCollection, options, startupConfig, appPaths).Build();
// Re-use the web host service provider in the app host since ASP.NET doesn't allow a custom service collection.
appHost.ServiceProvider = webHost.Services;
@@ -250,14 +234,49 @@ namespace Jellyfin.Server
}
}
- private static IWebHostBuilder CreateWebHostBuilder(
+ /// <summary>
+ /// Call static initialization methods for the application.
+ /// </summary>
+ public static void PerformStaticInitialization()
+ {
+ // Make sure we have all the code pages we can get
+ // Ref: https://docs.microsoft.com/en-us/dotnet/api/system.text.codepagesencodingprovider.instance?view=netcore-3.0#remarks
+ Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
+
+ // Increase the max http request limit
+ // The default connection limit is 10 for ASP.NET hosted applications and 2 for all others.
+ ServicePointManager.DefaultConnectionLimit = Math.Max(96, ServicePointManager.DefaultConnectionLimit);
+
+ // Disable the "Expect: 100-Continue" header by default
+ // http://stackoverflow.com/questions/566437/http-post-returns-the-error-417-expectation-failed-c
+ ServicePointManager.Expect100Continue = false;
+
+ Batteries_V2.Init();
+ if (raw.sqlite3_enable_shared_cache(1) != raw.SQLITE_OK)
+ {
+ _logger.LogWarning("Failed to enable shared cache for SQLite");
+ }
+ }
+
+ /// <summary>
+ /// Configure the web host builder.
+ /// </summary>
+ /// <param name="builder">The builder to configure.</param>
+ /// <param name="appHost">The application host.</param>
+ /// <param name="serviceCollection">The application service collection.</param>
+ /// <param name="commandLineOpts">The command line options passed to the application.</param>
+ /// <param name="startupConfig">The application configuration.</param>
+ /// <param name="appPaths">The application paths.</param>
+ /// <returns>The configured web host builder.</returns>
+ public static IWebHostBuilder ConfigureWebHostBuilder(
+ this IWebHostBuilder builder,
ApplicationHost appHost,
IServiceCollection serviceCollection,
StartupOptions commandLineOpts,
IConfiguration startupConfig,
IApplicationPaths appPaths)
{
- return new WebHostBuilder()
+ return builder
.UseKestrel((builderContext, options) =>
{
var addresses = appHost.ServerConfigurationManager
@@ -278,7 +297,6 @@ namespace Jellyfin.Server
{
_logger.LogInformation("Kestrel listening on {IpAddress}", address);
options.Listen(address, appHost.HttpPort);
-
if (appHost.EnableHttps && appHost.Certificate != null)
{
options.Listen(address, appHost.HttpsPort, listenOptions =>
@@ -289,11 +307,18 @@ namespace Jellyfin.Server
}
else if (builderContext.HostingEnvironment.IsDevelopment())
{
- options.Listen(address, appHost.HttpsPort, listenOptions =>
+ try
{
- listenOptions.UseHttps();
- listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
- });
+ options.Listen(address, appHost.HttpsPort, listenOptions =>
+ {
+ listenOptions.UseHttps();
+ listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
+ });
+ }
+ catch (InvalidOperationException ex)
+ {
+ _logger.LogError(ex, "Failed to listen to HTTPS using the ASP.NET Core HTTPS development certificate. Please ensure it has been installed and set as trusted.");
+ }
}
}
}
@@ -312,11 +337,18 @@ namespace Jellyfin.Server
}
else if (builderContext.HostingEnvironment.IsDevelopment())
{
- options.ListenAnyIP(appHost.HttpsPort, listenOptions =>
+ try
{
- listenOptions.UseHttps();
- listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
- });
+ options.ListenAnyIP(appHost.HttpsPort, listenOptions =>
+ {
+ listenOptions.UseHttps();
+ listenOptions.Protocols = HttpProtocols.Http1AndHttp2;
+ });
+ }
+ catch (InvalidOperationException ex)
+ {
+ _logger.LogError(ex, "Failed to listen to HTTPS using the ASP.NET Core HTTPS development certificate. Please ensure it has been installed and set as trusted.");
+ }
}
}
})
@@ -496,7 +528,9 @@ namespace Jellyfin.Server
/// Initialize the logging configuration file using the bundled resource file as a default if it doesn't exist
/// already.
/// </summary>
- private static async Task InitLoggingConfigFile(IApplicationPaths appPaths)
+ /// <param name="appPaths">The application paths.</param>
+ /// <returns>A task representing the creation of the configuration file, or a completed task if the file already exists.</returns>
+ public static async Task InitLoggingConfigFile(IApplicationPaths appPaths)
{
// Do nothing if the config file already exists
string configPath = Path.Combine(appPaths.ConfigurationDirectoryPath, LoggingConfigFileDefault);
@@ -516,7 +550,13 @@ namespace Jellyfin.Server
await resource.CopyToAsync(dst).ConfigureAwait(false);
}
- private static IConfiguration CreateAppConfiguration(StartupOptions commandLineOpts, IApplicationPaths appPaths)
+ /// <summary>
+ /// Create the application configuration.
+ /// </summary>
+ /// <param name="commandLineOpts">The command line options passed to the program.</param>
+ /// <param name="appPaths">The application paths.</param>
+ /// <returns>The application configuration.</returns>
+ public static IConfiguration CreateAppConfiguration(StartupOptions commandLineOpts, IApplicationPaths appPaths)
{
return new ConfigurationBuilder()
.ConfigureAppConfiguration(commandLineOpts, appPaths)
diff --git a/MediaBrowser.Api/Images/RemoteImageService.cs b/MediaBrowser.Api/Images/RemoteImageService.cs
index 222bb34d3..23bf54712 100644
--- a/MediaBrowser.Api/Images/RemoteImageService.cs
+++ b/MediaBrowser.Api/Images/RemoteImageService.cs
@@ -265,17 +265,20 @@ namespace MediaBrowser.Api.Images
{
Url = url,
BufferContent = false
-
}).ConfigureAwait(false);
- var ext = result.ContentType.Split('/').Last();
+ var ext = result.ContentType.Split('/')[^1];
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
Directory.CreateDirectory(Path.GetDirectoryName(fullCachePath));
- using (var stream = result.Content)
+ var stream = result.Content;
+ await using (stream.ConfigureAwait(false))
{
- using var filestream = new FileStream(fullCachePath, FileMode.Create, FileAccess.Write, FileShare.Read, IODefaults.FileStreamBufferSize, true);
- await stream.CopyToAsync(filestream).ConfigureAwait(false);
+ var filestream = new FileStream(fullCachePath, FileMode.Create, FileAccess.Write, FileShare.Read, IODefaults.FileStreamBufferSize, true);
+ await using (filestream.ConfigureAwait(false))
+ {
+ await stream.CopyToAsync(filestream).ConfigureAwait(false);
+ }
}
Directory.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
diff --git a/MediaBrowser.Api/ItemLookupService.cs b/MediaBrowser.Api/ItemLookupService.cs
index 0bbe7e1cf..68e3dfa59 100644
--- a/MediaBrowser.Api/ItemLookupService.cs
+++ b/MediaBrowser.Api/ItemLookupService.cs
@@ -299,22 +299,26 @@ namespace MediaBrowser.Api
{
var result = await _providerManager.GetSearchImage(providerName, url, CancellationToken.None).ConfigureAwait(false);
- var ext = result.ContentType.Split('/').Last();
+ var ext = result.ContentType.Split('/')[^1];
var fullCachePath = GetFullCachePath(urlHash + "." + ext);
Directory.CreateDirectory(Path.GetDirectoryName(fullCachePath));
- using (var stream = result.Content)
+ var stream = result.Content;
+
+ await using (stream.ConfigureAwait(false))
{
- using var fileStream = new FileStream(
+ var fileStream = new FileStream(
fullCachePath,
FileMode.Create,
FileAccess.Write,
FileShare.Read,
IODefaults.FileStreamBufferSize,
true);
-
- await stream.CopyToAsync(fileStream).ConfigureAwait(false);
+ await using (fileStream.ConfigureAwait(false))
+ {
+ await stream.CopyToAsync(fileStream).ConfigureAwait(false);
+ }
}
Directory.CreateDirectory(Path.GetDirectoryName(pointerCachePath));
diff --git a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
index 52962366c..4213193ba 100644
--- a/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/BaseHlsService.cs
@@ -209,24 +209,28 @@ namespace MediaBrowser.Api.Playback.Hls
try
{
// Need to use FileShare.ReadWrite because we're reading the file at the same time it's being written
- using var fileStream = GetPlaylistFileStream(playlist);
- using var reader = new StreamReader(fileStream);
- var count = 0;
-
- while (!reader.EndOfStream)
+ var fileStream = GetPlaylistFileStream(playlist);
+ await using (fileStream.ConfigureAwait(false))
{
- var line = reader.ReadLine();
+ using var reader = new StreamReader(fileStream);
+ var count = 0;
- if (line.IndexOf("#EXTINF:", StringComparison.OrdinalIgnoreCase) != -1)
+ while (!reader.EndOfStream)
{
- count++;
- if (count >= segmentCount)
+ var line = await reader.ReadLineAsync().ConfigureAwait(false);
+
+ if (line.IndexOf("#EXTINF:", StringComparison.OrdinalIgnoreCase) != -1)
{
- Logger.LogDebug("Finished waiting for {0} segments in {1}", segmentCount, playlist);
- return;
+ count++;
+ if (count >= segmentCount)
+ {
+ Logger.LogDebug("Finished waiting for {0} segments in {1}", segmentCount, playlist);
+ return;
+ }
}
}
}
+
await Task.Delay(100, cancellationToken).ConfigureAwait(false);
}
catch (IOException)
diff --git a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
index 20e18cc26..7f74e85e9 100644
--- a/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
+++ b/MediaBrowser.Api/Playback/Hls/DynamicHlsService.cs
@@ -720,22 +720,203 @@ namespace MediaBrowser.Api.Playback.Hls
//return state.VideoRequest.VideoBitRate.HasValue;
}
+ /// <summary>
+ /// Get the H.26X level of the output video stream.
+ /// </summary>
+ /// <param name="state">StreamState of the current stream.</param>
+ /// <returns>H.26X level of the output video stream.</returns>
+ private int? GetOutputVideoCodecLevel(StreamState state)
+ {
+ string levelString;
+ if (string.Equals(state.OutputVideoCodec, "copy", StringComparison.OrdinalIgnoreCase)
+ && state.VideoStream.Level.HasValue)
+ {
+ levelString = state.VideoStream?.Level.ToString();
+ }
+ else
+ {
+ levelString = state.GetRequestedLevel(state.ActualOutputVideoCodec);
+ }
+
+ if (int.TryParse(levelString, NumberStyles.Integer, CultureInfo.InvariantCulture, out var parsedLevel))
+ {
+ return parsedLevel;
+ }
+
+ return null;
+ }
+
+ /// <summary>
+ /// Gets a formatted string of the output audio codec, for use in the CODECS field.
+ /// </summary>
+ /// <seealso cref="AppendPlaylistCodecsField(StringBuilder, StreamState)"/>
+ /// <seealso cref="GetPlaylistVideoCodecs(StreamState, string, int)"/>
+ /// <param name="state">StreamState of the current stream.</param>
+ /// <returns>Formatted audio codec string.</returns>
+ private string GetPlaylistAudioCodecs(StreamState state)
+ {
+
+ if (string.Equals(state.ActualOutputAudioCodec, "aac", StringComparison.OrdinalIgnoreCase))
+ {
+ string profile = state.GetRequestedProfiles("aac").FirstOrDefault();
+
+ return HlsCodecStringFactory.GetAACString(profile);
+ }
+ else if (string.Equals(state.ActualOutputAudioCodec, "mp3", StringComparison.OrdinalIgnoreCase))
+ {
+ return HlsCodecStringFactory.GetMP3String();
+ }
+ else if (string.Equals(state.ActualOutputAudioCodec, "ac3", StringComparison.OrdinalIgnoreCase))
+ {
+ return HlsCodecStringFactory.GetAC3String();
+ }
+ else if (string.Equals(state.ActualOutputAudioCodec, "eac3", StringComparison.OrdinalIgnoreCase))
+ {
+ return HlsCodecStringFactory.GetEAC3String();
+ }
+
+ return string.Empty;
+ }
+
+ /// <summary>
+ /// Gets a formatted string of the output video codec, for use in the CODECS field.
+ /// </summary>
+ /// <seealso cref="AppendPlaylistCodecsField(StringBuilder, StreamState)"/>
+ /// <seealso cref="GetPlaylistAudioCodecs(StreamState)"/>
+ /// <param name="state">StreamState of the current stream.</param>
+ /// <returns>Formatted video codec string.</returns>
+ private string GetPlaylistVideoCodecs(StreamState state, string codec, int level)
+ {
+ if (level == 0)
+ {
+ // This is 0 when there's no requested H.26X level in the device profile
+ // and the source is not encoded in H.26X
+ Logger.LogError("Got invalid H.26X level when building CODECS field for HLS master playlist");
+ return string.Empty;
+ }
+
+ if (string.Equals(codec, "h264", StringComparison.OrdinalIgnoreCase))
+ {
+ string profile = state.GetRequestedProfiles("h264").FirstOrDefault();
+
+ return HlsCodecStringFactory.GetH264String(profile, level);
+ }
+ else if (string.Equals(codec, "h265", StringComparison.OrdinalIgnoreCase)
+ || string.Equals(codec, "hevc", StringComparison.OrdinalIgnoreCase))
+ {
+ string profile = state.GetRequestedProfiles("h265").FirstOrDefault();
+
+ return HlsCodecStringFactory.GetH265String(profile, level);
+ }
+
+ return string.Empty;
+ }
+
+ /// <summary>
+ /// Appends a CODECS field containing formatted strings of
+ /// the active streams output video and audio codecs.
+ /// </summary>
+ /// <seealso cref="AppendPlaylist(StringBuilder, StreamState, string, int, string)"/>
+ /// <seealso cref="GetPlaylistVideoCodecs(StreamState, string, int)"/>
+ /// <seealso cref="GetPlaylistAudioCodecs(StreamState)"/>
+ /// <param name="builder">StringBuilder to append the field to.</param>
+ /// <param name="state">StreamState of the current stream.</param>
+ private void AppendPlaylistCodecsField(StringBuilder builder, StreamState state)
+ {
+ // Video
+ string videoCodecs = string.Empty;
+ int? videoCodecLevel = GetOutputVideoCodecLevel(state);
+ if (!string.IsNullOrEmpty(state.ActualOutputVideoCodec) && videoCodecLevel.HasValue)
+ {
+ videoCodecs = GetPlaylistVideoCodecs(state, state.ActualOutputVideoCodec, videoCodecLevel.Value);
+ }
+
+ // Audio
+ string audioCodecs = string.Empty;
+ if (!string.IsNullOrEmpty(state.ActualOutputAudioCodec))
+ {
+ audioCodecs = GetPlaylistAudioCodecs(state);
+ }
+
+ StringBuilder codecs = new StringBuilder();
+
+ codecs.Append(videoCodecs)
+ .Append(',')
+ .Append(audioCodecs);
+
+ if (codecs.Length > 1)
+ {
+ builder.Append(",CODECS=\"")
+ .Append(codecs)
+ .Append('"');
+ }
+ }
+
+ /// <summary>
+ /// Appends a FRAME-RATE field containing the framerate of the output stream.
+ /// </summary>
+ /// <seealso cref="AppendPlaylist(StringBuilder, StreamState, string, int, string)"/>
+ /// <param name="builder">StringBuilder to append the field to.</param>
+ /// <param name="state">StreamState of the current stream.</param>
+ private void AppendPlaylistFramerateField(StringBuilder builder, StreamState state)
+ {
+ double? framerate = null;
+ if (state.TargetFramerate.HasValue)
+ {
+ framerate = Math.Round(state.TargetFramerate.GetValueOrDefault(), 3);
+ }
+ else if (state.VideoStream.RealFrameRate.HasValue)
+ {
+ framerate = Math.Round(state.VideoStream.RealFrameRate.GetValueOrDefault(), 3);
+ }
+
+ if (framerate.HasValue)
+ {
+ builder.Append(",FRAME-RATE=\"")
+ .Append(framerate.Value)
+ .Append('"');
+ }
+ }
+
+ /// <summary>
+ /// Appends a RESOLUTION field containing the resolution of the output stream.
+ /// </summary>
+ /// <seealso cref="AppendPlaylist(StringBuilder, StreamState, string, int, string)"/>
+ /// <param name="builder">StringBuilder to append the field to.</param>
+ /// <param name="state">StreamState of the current stream.</param>
+ private void AppendPlaylistResolutionField(StringBuilder builder, StreamState state)
+ {
+ if (state.OutputWidth.HasValue && state.OutputHeight.HasValue)
+ {
+ builder.Append(",RESOLUTION=\"")
+ .Append(state.OutputWidth.GetValueOrDefault())
+ .Append('x')
+ .Append(state.OutputHeight.GetValueOrDefault())
+ .Append('"');
+ }
+ }
+
private void AppendPlaylist(StringBuilder builder, StreamState state, string url, int bitrate, string subtitleGroup)
{
- var header = "#EXT-X-STREAM-INF:BANDWIDTH=" + bitrate.ToString(CultureInfo.InvariantCulture) + ",AVERAGE-BANDWIDTH=" + bitrate.ToString(CultureInfo.InvariantCulture);
+ builder.Append("#EXT-X-STREAM-INF:BANDWIDTH=")
+ .Append(bitrate.ToString(CultureInfo.InvariantCulture))
+ .Append(",AVERAGE-BANDWIDTH=")
+ .Append(bitrate.ToString(CultureInfo.InvariantCulture));
- // tvos wants resolution, codecs, framerate
- //if (state.TargetFramerate.HasValue)
- //{
- // header += string.Format(",FRAME-RATE=\"{0}\"", state.TargetFramerate.Value.ToString(CultureInfo.InvariantCulture));
- //}
+ AppendPlaylistCodecsField(builder, state);
+
+ AppendPlaylistResolutionField(builder, state);
+
+ AppendPlaylistFramerateField(builder, state);
if (!string.IsNullOrWhiteSpace(subtitleGroup))
{
- header += string.Format(",SUBTITLES=\"{0}\"", subtitleGroup);
+ builder.Append(",SUBTITLES=\"")
+ .Append(subtitleGroup)
+ .Append('"');
}
- builder.AppendLine(header);
+ builder.Append(Environment.NewLine);
builder.AppendLine(url);
}
diff --git a/MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs b/MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs
new file mode 100644
index 000000000..3bbb77a65
--- /dev/null
+++ b/MediaBrowser.Api/Playback/Hls/HlsCodecStringFactory.cs
@@ -0,0 +1,126 @@
+using System;
+using System.Text;
+
+
+namespace MediaBrowser.Api.Playback
+{
+ /// <summary>
+ /// Get various codec strings for use in HLS playlists.
+ /// </summary>
+ static class HlsCodecStringFactory
+ {
+
+ /// <summary>
+ /// Gets a MP3 codec string.
+ /// </summary>
+ /// <returns>MP3 codec string.</returns>
+ public static string GetMP3String()
+ {
+ return "mp4a.40.34";
+ }
+
+ /// <summary>
+ /// Gets an AAC codec string.
+ /// </summary>
+ /// <param name="profile">AAC profile.</param>
+ /// <returns>AAC codec string.</returns>
+ public static string GetAACString(string profile)
+ {
+ StringBuilder result = new StringBuilder("mp4a", 9);
+
+ if (string.Equals(profile, "HE", StringComparison.OrdinalIgnoreCase))
+ {
+ result.Append(".40.5");
+ }
+ else
+ {
+ // Default to LC if profile is invalid
+ result.Append(".40.2");
+ }
+
+ return result.ToString();
+ }
+
+ /// <summary>
+ /// Gets a H.264 codec string.
+ /// </summary>
+ /// <param name="profile">H.264 profile.</param>
+ /// <param name="level">H.264 level.</param>
+ /// <returns>H.264 string.</returns>
+ public static string GetH264String(string profile, int level)
+ {
+ StringBuilder result = new StringBuilder("avc1", 11);
+
+ if (string.Equals(profile, "high", StringComparison.OrdinalIgnoreCase))
+ {
+ result.Append(".6400");
+ }
+ else if (string.Equals(profile, "main", StringComparison.OrdinalIgnoreCase))
+ {
+ result.Append(".4D40");
+ }
+ else if (string.Equals(profile, "baseline", StringComparison.OrdinalIgnoreCase))
+ {
+ result.Append(".42E0");
+ }
+ else
+ {
+ // Default to constrained baseline if profile is invalid
+ result.Append(".4240");
+ }
+
+ string levelHex = level.ToString("X2");
+ result.Append(levelHex);
+
+ return result.ToString();
+ }
+
+ /// <summary>
+ /// Gets a H.265 codec string.
+ /// </summary>
+ /// <param name="profile">H.265 profile.</param>
+ /// <param name="level">H.265 level.</param>
+ /// <returns>H.265 string.</returns>
+ public static string GetH265String(string profile, int level)
+ {
+ // The h265 syntax is a bit of a mystery at the time this comment was written.
+ // This is what I've found through various sources:
+ // FORMAT: [codecTag].[profile].[constraint?].L[level * 30].[UNKNOWN]
+ StringBuilder result = new StringBuilder("hev1", 16);
+
+ if (string.Equals(profile, "main10", StringComparison.OrdinalIgnoreCase))
+ {
+ result.Append(".2.6");
+ }
+ else
+ {
+ // Default to main if profile is invalid
+ result.Append(".1.6");
+ }
+
+ result.Append(".L")
+ .Append(level * 3)
+ .Append(".B0");
+
+ return result.ToString();
+ }
+
+ /// <summary>
+ /// Gets an AC-3 codec string.
+ /// </summary>
+ /// <returns>AC-3 codec string.</returns>
+ public static string GetAC3String()
+ {
+ return "mp4a.a5";
+ }
+
+ /// <summary>
+ /// Gets an E-AC-3 codec string.
+ /// </summary>
+ /// <returns>E-AC-3 codec string.</returns>
+ public static string GetEAC3String()
+ {
+ return "mp4a.a6";
+ }
+ }
+}
diff --git a/MediaBrowser.Api/UserService.cs b/MediaBrowser.Api/UserService.cs
index 78fc6c694..7d4d5fcf9 100644
--- a/MediaBrowser.Api/UserService.cs
+++ b/MediaBrowser.Api/UserService.cs
@@ -35,7 +35,7 @@ namespace MediaBrowser.Api
}
[Route("/Users/Public", "GET", Summary = "Gets a list of publicly visible users for display on a login screen.")]
- public class GetPublicUsers : IReturn<UserDto[]>
+ public class GetPublicUsers : IReturn<PublicUserDto[]>
{
}
@@ -266,22 +266,38 @@ namespace MediaBrowser.Api
_authContext = authContext;
}
+ /// <summary>
+ /// Gets the public available Users information
+ /// </summary>
+ /// <param name="request">The request.</param>
+ /// <returns>System.Object.</returns>
public object Get(GetPublicUsers request)
{
- // If the startup wizard hasn't been completed then just return all users
- if (!ServerConfigurationManager.Configuration.IsStartupWizardCompleted)
+ var result = _userManager
+ .Users
+ .Where(item => !item.Policy.IsDisabled);
+
+ if (ServerConfigurationManager.Configuration.IsStartupWizardCompleted)
{
- return Get(new GetUsers
+ var deviceId = _authContext.GetAuthorizationInfo(Request).DeviceId;
+ result = result.Where(item => !item.Policy.IsHidden);
+
+ if (!string.IsNullOrWhiteSpace(deviceId))
{
- IsDisabled = false
- });
+ result = result.Where(i => _deviceManager.CanAccessDevice(i, deviceId));
+ }
+
+ if (!_networkManager.IsInLocalNetwork(Request.RemoteIp))
+ {
+ result = result.Where(i => i.Policy.EnableRemoteAccess);
+ }
}
- return Get(new GetUsers
- {
- IsHidden = false,
- IsDisabled = false
- }, true, true);
+ return ToOptimizedResult(result
+ .OrderBy(u => u.Name)
+ .Select(i => _userManager.GetPublicUserDto(i, Request.RemoteIp))
+ .ToArray()
+ );
}
/// <summary>
diff --git a/MediaBrowser.Controller/Library/IUserManager.cs b/MediaBrowser.Controller/Library/IUserManager.cs
index be7b4ce59..ec6cb35eb 100644
--- a/MediaBrowser.Controller/Library/IUserManager.cs
+++ b/MediaBrowser.Controller/Library/IUserManager.cs
@@ -144,6 +144,14 @@ namespace MediaBrowser.Controller.Library
UserDto GetUserDto(User user, string remoteEndPoint = null);
/// <summary>
+ /// Gets the user public dto.
+ /// </summary>
+ /// <param name="user">Ther user.</param>\
+ /// <param name="remoteEndPoint">The remote end point.</param>
+ /// <returns>A public UserDto, aka a UserDto stripped of personal data.</returns>
+ PublicUserDto GetPublicUserDto(User user, string remoteEndPoint = null);
+
+ /// <summary>
/// Authenticates the user.
/// </summary>
Task<User> AuthenticateUser(string username, string password, string passwordSha1, string remoteEndPoint, bool isUserSession);
diff --git a/MediaBrowser.Model/Dlna/CodecProfile.cs b/MediaBrowser.Model/Dlna/CodecProfile.cs
index 756e500dd..7bb961deb 100644
--- a/MediaBrowser.Model/Dlna/CodecProfile.cs
+++ b/MediaBrowser.Model/Dlna/CodecProfile.cs
@@ -1,8 +1,8 @@
#pragma warning disable CS1591
using System;
+using System.Linq;
using System.Xml.Serialization;
-using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dlna
{
@@ -57,7 +57,7 @@ namespace MediaBrowser.Model.Dlna
foreach (var val in codec)
{
- if (ListHelper.ContainsIgnoreCase(codecs, val))
+ if (codecs.Contains(val, StringComparer.OrdinalIgnoreCase))
{
return true;
}
diff --git a/MediaBrowser.Model/Dlna/ConditionProcessor.cs b/MediaBrowser.Model/Dlna/ConditionProcessor.cs
index 7423efaf6..0c3bd8882 100644
--- a/MediaBrowser.Model/Dlna/ConditionProcessor.cs
+++ b/MediaBrowser.Model/Dlna/ConditionProcessor.cs
@@ -1,8 +1,8 @@
#pragma warning disable CS1591
using System;
+using System.Linq;
using System.Globalization;
-using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.Model.Dlna
@@ -167,9 +167,7 @@ namespace MediaBrowser.Model.Dlna
switch (condition.Condition)
{
case ProfileConditionType.EqualsAny:
- {
- return ListHelper.ContainsIgnoreCase(expected.Split('|'), currentValue);
- }
+ return expected.Split('|').Contains(currentValue, StringComparer.OrdinalIgnoreCase);
case ProfileConditionType.Equals:
return string.Equals(currentValue, expected, StringComparison.OrdinalIgnoreCase);
case ProfileConditionType.NotEquals:
diff --git a/MediaBrowser.Model/Dlna/ContainerProfile.cs b/MediaBrowser.Model/Dlna/ContainerProfile.cs
index e6691c513..cc2417a70 100644
--- a/MediaBrowser.Model/Dlna/ContainerProfile.cs
+++ b/MediaBrowser.Model/Dlna/ContainerProfile.cs
@@ -1,8 +1,8 @@
#pragma warning disable CS1591
using System;
+using System.Linq;
using System.Xml.Serialization;
-using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dlna
{
@@ -45,7 +45,7 @@ namespace MediaBrowser.Model.Dlna
public static bool ContainsContainer(string profileContainers, string inputContainer)
{
var isNegativeList = false;
- if (profileContainers != null && profileContainers.StartsWith("-"))
+ if (profileContainers != null && profileContainers.StartsWith("-", StringComparison.Ordinal))
{
isNegativeList = true;
profileContainers = profileContainers.Substring(1);
@@ -72,7 +72,7 @@ namespace MediaBrowser.Model.Dlna
foreach (var container in allInputContainers)
{
- if (ListHelper.ContainsIgnoreCase(profileContainers, container))
+ if (profileContainers.Contains(container, StringComparer.OrdinalIgnoreCase))
{
return false;
}
@@ -86,7 +86,7 @@ namespace MediaBrowser.Model.Dlna
foreach (var container in allInputContainers)
{
- if (ListHelper.ContainsIgnoreCase(profileContainers, container))
+ if (profileContainers.Contains(container, StringComparer.OrdinalIgnoreCase))
{
return true;
}
diff --git a/MediaBrowser.Model/Dlna/DeviceProfile.cs b/MediaBrowser.Model/Dlna/DeviceProfile.cs
index 0cefbbe01..3813ac5eb 100644
--- a/MediaBrowser.Model/Dlna/DeviceProfile.cs
+++ b/MediaBrowser.Model/Dlna/DeviceProfile.cs
@@ -1,8 +1,8 @@
#pragma warning disable CS1591
using System;
+using System.Linq;
using System.Xml.Serialization;
-using MediaBrowser.Model.Extensions;
using MediaBrowser.Model.MediaInfo;
namespace MediaBrowser.Model.Dlna
@@ -93,14 +93,14 @@ namespace MediaBrowser.Model.Dlna
public DeviceProfile()
{
- DirectPlayProfiles = new DirectPlayProfile[] { };
- TranscodingProfiles = new TranscodingProfile[] { };
- ResponseProfiles = new ResponseProfile[] { };
- CodecProfiles = new CodecProfile[] { };
- ContainerProfiles = new ContainerProfile[] { };
+ DirectPlayProfiles = Array.Empty<DirectPlayProfile>();
+ TranscodingProfiles = Array.Empty<TranscodingProfile>();
+ ResponseProfiles = Array.Empty<ResponseProfile>();
+ CodecProfiles = Array.Empty<CodecProfile>();
+ ContainerProfiles = Array.Empty<ContainerProfile>();
SubtitleProfiles = Array.Empty<SubtitleProfile>();
- XmlRootAttributes = new XmlAttribute[] { };
+ XmlRootAttributes = Array.Empty<XmlAttribute>();
SupportedMediaTypes = "Audio,Photo,Video";
MaxStreamingBitrate = 8000000;
@@ -129,13 +129,14 @@ namespace MediaBrowser.Model.Dlna
continue;
}
- if (!ListHelper.ContainsIgnoreCase(i.GetAudioCodecs(), audioCodec ?? string.Empty))
+ if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
return i;
}
+
return null;
}
@@ -155,7 +156,7 @@ namespace MediaBrowser.Model.Dlna
continue;
}
- if (!ListHelper.ContainsIgnoreCase(i.GetAudioCodecs(), audioCodec ?? string.Empty))
+ if (!i.GetAudioCodecs().Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
@@ -185,7 +186,7 @@ namespace MediaBrowser.Model.Dlna
}
var audioCodecs = i.GetAudioCodecs();
- if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
+ if (audioCodecs.Length > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
@@ -288,13 +289,13 @@ namespace MediaBrowser.Model.Dlna
}
var audioCodecs = i.GetAudioCodecs();
- if (audioCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(audioCodecs, audioCodec ?? string.Empty))
+ if (audioCodecs.Length > 0 && !audioCodecs.Contains(audioCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
var videoCodecs = i.GetVideoCodecs();
- if (videoCodecs.Length > 0 && !ListHelper.ContainsIgnoreCase(videoCodecs, videoCodec ?? string.Empty))
+ if (videoCodecs.Length > 0 && !videoCodecs.Contains(videoCodec ?? string.Empty, StringComparer.OrdinalIgnoreCase))
{
continue;
}
diff --git a/MediaBrowser.Model/Dlna/SubtitleProfile.cs b/MediaBrowser.Model/Dlna/SubtitleProfile.cs
index 6a8f655ac..9c28019aa 100644
--- a/MediaBrowser.Model/Dlna/SubtitleProfile.cs
+++ b/MediaBrowser.Model/Dlna/SubtitleProfile.cs
@@ -1,7 +1,8 @@
#pragma warning disable CS1591
+using System;
+using System.Linq;
using System.Xml.Serialization;
-using MediaBrowser.Model.Extensions;
namespace MediaBrowser.Model.Dlna
{
@@ -40,7 +41,7 @@ namespace MediaBrowser.Model.Dlna
}
var languages = GetLanguages();
- return languages.Length == 0 || ListHelper.ContainsIgnoreCase(languages, subLanguage);
+ return languages.Length == 0 || languages.Contains(subLanguage, StringComparer.OrdinalIgnoreCase);
}
}
}
diff --git a/MediaBrowser.Model/Dto/PublicUserDto.cs b/MediaBrowser.Model/Dto/PublicUserDto.cs
new file mode 100644
index 000000000..b6bfaf2e9
--- /dev/null
+++ b/MediaBrowser.Model/Dto/PublicUserDto.cs
@@ -0,0 +1,48 @@
+using System;
+
+namespace MediaBrowser.Model.Dto
+{
+ /// <summary>
+ /// Class PublicUserDto. Its goal is to show only public information about a user
+ /// </summary>
+ public class PublicUserDto : IItemDto
+ {
+ /// <summary>
+ /// Gets or sets the name.
+ /// </summary>
+ /// <value>The name.</value>
+ public string Name { get; set; }
+
+ /// <summary>
+ /// Gets or sets the primary image tag.
+ /// </summary>
+ /// <value>The primary image tag.</value>
+ public string PrimaryImageTag { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance has password.
+ /// </summary>
+ /// <value><c>true</c> if this instance has password; otherwise, <c>false</c>.</value>
+ public bool HasPassword { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether this instance has configured password.
+ /// Note that in this case this method should not be here, but it is necessary when changing password at the
+ /// first login.
+ /// </summary>
+ /// <value><c>true</c> if this instance has configured password; otherwise, <c>false</c>.</value>
+ public bool HasConfiguredPassword { get; set; }
+
+ /// <summary>
+ /// Gets or sets the primary image aspect ratio.
+ /// </summary>
+ /// <value>The primary image aspect ratio.</value>
+ public double? PrimaryImageAspectRatio { get; set; }
+
+ /// <inheritdoc />
+ public override string ToString()
+ {
+ return Name ?? base.ToString();
+ }
+ }
+}
diff --git a/MediaBrowser.Model/Extensions/ListHelper.cs b/MediaBrowser.Model/Extensions/ListHelper.cs
deleted file mode 100644
index 90ce6f2e5..000000000
--- a/MediaBrowser.Model/Extensions/ListHelper.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-#pragma warning disable CS1591
-
-using System;
-
-namespace MediaBrowser.Model.Extensions
-{
- // TODO: @bond remove
- public static class ListHelper
- {
- public static bool ContainsIgnoreCase(string[] list, string value)
- {
- if (value == null)
- {
- throw new ArgumentNullException(nameof(value));
- }
-
- foreach (var item in list)
- {
- if (string.Equals(item, value, StringComparison.OrdinalIgnoreCase))
- {
- return true;
- }
- }
- return false;
- }
- }
-}
diff --git a/MediaBrowser.Model/Net/MimeTypes.cs b/MediaBrowser.Model/Net/MimeTypes.cs
index 06efedb30..fe2fbe7e4 100644
--- a/MediaBrowser.Model/Net/MimeTypes.cs
+++ b/MediaBrowser.Model/Net/MimeTypes.cs
@@ -17,115 +17,132 @@ namespace MediaBrowser.Model.Net
/// </summary>
private static readonly HashSet<string> _videoFileExtensions = new HashSet<string>(StringComparer.OrdinalIgnoreCase)
{
- ".mkv",
- ".m2t",
- ".m2ts",
+ ".3gp",
+ ".asf",
+ ".avi",
+ ".divx",
+ ".dvr-ms",
+ ".f4v",
+ ".flv",
".img",
".iso",
+ ".m2t",
+ ".m2ts",
+ ".m2v",
+ ".m4v",
".mk3d",
- ".ts",
- ".rmvb",
+ ".mkv",
".mov",
- ".avi",
+ ".mp4",
".mpg",
".mpeg",
- ".wmv",
- ".mp4",
- ".divx",
- ".dvr-ms",
- ".wtv",
+ ".mts",
+ ".ogg",
".ogm",
".ogv",
- ".asf",
- ".m4v",
- ".flv",
- ".f4v",
- ".3gp",
+ ".rec",
+ ".ts",
+ ".rmvb",
".webm",
- ".mts",
- ".m2v",
- ".rec"
+ ".wmv",
+ ".wtv",
};
// http://en.wikipedia.org/wiki/Internet_media_type
+ // https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types
+ // http://www.iana.org/assignments/media-types/media-types.xhtml
// Add more as needed
private static readonly Dictionary<string, string> _mimeTypeLookup = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase)
{
// Type application
+ { ".7z", "application/x-7z-compressed" },
+ { ".azw", "application/vnd.amazon.ebook" },
+ { ".azw3", "application/vnd.amazon.ebook" },
{ ".cbz", "application/x-cbz" },
{ ".cbr", "application/epub+zip" },
{ ".eot", "application/vnd.ms-fontobject" },
{ ".epub", "application/epub+zip" },
{ ".js", "application/x-javascript" },
{ ".json", "application/json" },
+ { ".m3u8", "application/x-mpegURL" },
{ ".map", "application/x-javascript" },
+ { ".mobi", "application/x-mobipocket-ebook" },
{ ".pdf", "application/pdf" },
+ { ".rar", "application/vnd.rar" },
+ { ".srt", "application/x-subrip" },
{ ".ttml", "application/ttml+xml" },
- { ".m3u8", "application/x-mpegURL" },
- { ".mobi", "application/x-mobipocket-ebook" },
- { ".xml", "application/xml" },
{ ".wasm", "application/wasm" },
+ { ".xml", "application/xml" },
+ { ".zip", "application/zip" },
// Type image
+ { ".bmp", "image/bmp" },
+ { ".gif", "image/gif" },
+ { ".ico", "image/vnd.microsoft.icon" },
{ ".jpg", "image/jpeg" },
{ ".jpeg", "image/jpeg" },
- { ".tbn", "image/jpeg" },
{ ".png", "image/png" },
- { ".gif", "image/gif" },
- { ".tiff", "image/tiff" },
- { ".webp", "image/webp" },
- { ".ico", "image/vnd.microsoft.icon" },
{ ".svg", "image/svg+xml" },
{ ".svgz", "image/svg+xml" },
+ { ".tbn", "image/jpeg" },
+ { ".tif", "image/tiff" },
+ { ".tiff", "image/tiff" },
+ { ".webp", "image/webp" },
// Type font
{ ".ttf" , "font/ttf" },
{ ".woff" , "font/woff" },
+ { ".woff2" , "font/woff2" },
// Type text
{ ".ass", "text/x-ssa" },
{ ".ssa", "text/x-ssa" },
{ ".css", "text/css" },
{ ".csv", "text/csv" },
+ { ".rtf", "text/rtf" },
{ ".txt", "text/plain" },
{ ".vtt", "text/vtt" },
// Type video
- { ".mpg", "video/mpeg" },
- { ".ogv", "video/ogg" },
- { ".mov", "video/quicktime" },
- { ".webm", "video/webm" },
- { ".mkv", "video/x-matroska" },
- { ".wmv", "video/x-ms-wmv" },
- { ".flv", "video/x-flv" },
- { ".avi", "video/x-msvideo" },
- { ".asf", "video/x-ms-asf" },
- { ".m4v", "video/x-m4v" },
- { ".m4s", "video/mp4" },
{ ".3gp", "video/3gpp" },
{ ".3g2", "video/3gpp2" },
+ { ".asf", "video/x-ms-asf" },
+ { ".avi", "video/x-msvideo" },
+ { ".flv", "video/x-flv" },
+ { ".mp4", "video/mp4" },
+ { ".m4s", "video/mp4" },
+ { ".m4v", "video/x-m4v" },
+ { ".mpegts", "video/mp2t" },
+ { ".mpg", "video/mpeg" },
+ { ".mkv", "video/x-matroska" },
+ { ".mov", "video/quicktime" },
{ ".mpd", "video/vnd.mpeg.dash.mpd" },
+ { ".ogv", "video/ogg" },
{ ".ts", "video/mp2t" },
- { ".mpegts", "video/mp2t" },
+ { ".webm", "video/webm" },
+ { ".wmv", "video/x-ms-wmv" },
// Type audio
- { ".mp3", "audio/mpeg" },
- { ".m4a", "audio/mp4" },
{ ".aac", "audio/mp4" },
- { ".webma", "audio/webm" },
- { ".wav", "audio/wav" },
- { ".wma", "audio/x-ms-wma" },
- { ".ogg", "audio/ogg" },
- { ".oga", "audio/ogg" },
- { ".opus", "audio/ogg" },
{ ".ac3", "audio/ac3" },
+ { ".ape", "audio/x-ape" },
{ ".dsf", "audio/dsf" },
- { ".m4b", "audio/m4b" },
- { ".xsp", "audio/xsp" },
{ ".dsp", "audio/dsp" },
{ ".flac", "audio/flac" },
- { ".ape", "audio/x-ape" },
+ { ".m4a", "audio/mp4" },
+ { ".m4b", "audio/m4b" },
+ { ".mid", "audio/midi" },
+ { ".midi", "audio/midi" },
+ { ".mp3", "audio/mpeg" },
+ { ".oga", "audio/ogg" },
+ { ".ogg", "audio/ogg" },
+ { ".opus", "audio/ogg" },
+ { ".vorbis", "audio/vorbis" },
+ { ".wav", "audio/wav" },
+ { ".webma", "audio/webm" },
+ { ".wma", "audio/x-ms-wma" },
{ ".wv", "audio/x-wavpack" },
+ { ".xsp", "audio/xsp" },
};
private static readonly Dictionary<string, string> _extensionLookup = CreateExtensionLookup();
diff --git a/MediaBrowser.Model/Notifications/NotificationOptions.cs b/MediaBrowser.Model/Notifications/NotificationOptions.cs
index 79a128e9b..9c54bd70e 100644
--- a/MediaBrowser.Model/Notifications/NotificationOptions.cs
+++ b/MediaBrowser.Model/Notifications/NotificationOptions.cs
@@ -1,7 +1,7 @@
#pragma warning disable CS1591
using System;
-using MediaBrowser.Model.Extensions;
+using System.Linq;
using MediaBrowser.Model.Users;
namespace MediaBrowser.Model.Notifications
@@ -81,8 +81,12 @@ namespace MediaBrowser.Model.Notifications
{
foreach (NotificationOption i in Options)
{
- if (string.Equals(type, i.Type, StringComparison.OrdinalIgnoreCase)) return i;
+ if (string.Equals(type, i.Type, StringComparison.OrdinalIgnoreCase))
+ {
+ return i;
+ }
}
+
return null;
}
@@ -98,7 +102,7 @@ namespace MediaBrowser.Model.Notifications
NotificationOption opt = GetOptions(notificationType);
return opt == null ||
- !ListHelper.ContainsIgnoreCase(opt.DisabledServices, service);
+ !opt.DisabledServices.Contains(service, StringComparer.OrdinalIgnoreCase);
}
public bool IsEnabledToMonitorUser(string type, Guid userId)
@@ -106,7 +110,7 @@ namespace MediaBrowser.Model.Notifications
NotificationOption opt = GetOptions(type);
return opt != null && opt.Enabled &&
- !ListHelper.ContainsIgnoreCase(opt.DisabledMonitorUsers, userId.ToString(""));
+ !opt.DisabledMonitorUsers.Contains(userId.ToString(""), StringComparer.OrdinalIgnoreCase);
}
public bool IsEnabledToSendToUser(string type, string userId, UserPolicy userPolicy)
@@ -125,7 +129,7 @@ namespace MediaBrowser.Model.Notifications
return true;
}
- return ListHelper.ContainsIgnoreCase(opt.SendToUsers, userId);
+ return opt.SendToUsers.Contains(userId, StringComparer.OrdinalIgnoreCase);
}
return false;
diff --git a/MediaBrowser.sln b/MediaBrowser.sln
index 6d01b0dcd..210e2b644 100644
--- a/MediaBrowser.sln
+++ b/MediaBrowser.sln
@@ -2,6 +2,8 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30011.22
MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.Server", "Jellyfin.Server\Jellyfin.Server.csproj", "{07E39F42-A2C6-4B32-AF8C-725F957A73FF}"
+EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaBrowser.Controller", "MediaBrowser.Controller\MediaBrowser.Controller.csproj", "{17E1F4E6-8ABD-4FE5-9ECF-43D4B6087BA2}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaBrowser.Api", "MediaBrowser.Api\MediaBrowser.Api.csproj", "{4FD51AC5-2C16-4308-A993-C3A84F3B4582}"
@@ -36,11 +38,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Emby.Naming", "Emby.Naming\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaBrowser.MediaEncoding", "MediaBrowser.MediaEncoding\MediaBrowser.MediaEncoding.csproj", "{960295EE-4AF4-4440-A525-B4C295B01A61}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.Server", "Jellyfin.Server\Jellyfin.Server.csproj", "{07E39F42-A2C6-4B32-AF8C-725F957A73FF}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{41093F42-C7CC-4D07-956B-6182CBEDE2EC}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
+ jellyfin.ruleset = jellyfin.ruleset
SharedVersion.cs = SharedVersion.cs
EndProjectSection
EndProject
@@ -49,6 +50,9 @@ EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.Api", "Jellyfin.Api\Jellyfin.Api.csproj", "{DFBEFB4C-DA19-4143-98B7-27320C7F7163}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}"
+ ProjectSection(SolutionItems) = preProject
+ tests\jellyfin-tests.ruleset = tests\jellyfin-tests.ruleset
+ EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.Common.Tests", "tests\Jellyfin.Common.Tests\Jellyfin.Common.Tests.csproj", "{DF194677-DFD3-42AF-9F75-D44D5A416478}"
EndProject
@@ -66,6 +70,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.Data", "Jellyfin.D
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Jellyfin.Server.Implementations", "Jellyfin.Server.Implementations\Jellyfin.Server.Implementations.csproj", "{DAE48069-6D86-4BA6-B148-D1D49B6DDA52}"
EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MediaBrowser.Api.Tests", "tests\MediaBrowser.Api.Tests\MediaBrowser.Api.Tests.csproj", "{7C93C84F-105C-48E5-A878-406FA0A5B296}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -184,18 +190,14 @@ Global
{DAE48069-6D86-4BA6-B148-D1D49B6DDA52}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DAE48069-6D86-4BA6-B148-D1D49B6DDA52}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DAE48069-6D86-4BA6-B148-D1D49B6DDA52}.Release|Any CPU.Build.0 = Release|Any CPU
+ {7C93C84F-105C-48E5-A878-406FA0A5B296}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7C93C84F-105C-48E5-A878-406FA0A5B296}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7C93C84F-105C-48E5-A878-406FA0A5B296}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7C93C84F-105C-48E5-A878-406FA0A5B296}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
- GlobalSection(NestedProjects) = preSolution
- {DF194677-DFD3-42AF-9F75-D44D5A416478} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
- {28464062-0939-4AA7-9F7B-24DDDA61A7C0} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
- {3998657B-1CCC-49DD-A19F-275DC8495F57} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
- {A2FD0A10-8F62-4F9D-B171-FFDF9F0AFA9D} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
- {2E3A1B4B-4225-4AAA-8B29-0181A84E7AEE} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
- {462584F7-5023-4019-9EAC-B98CA458C0A0} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
- EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {3448830C-EBDC-426C-85CD-7BBB9651A7FE}
EndGlobalSection
@@ -217,4 +219,13 @@ Global
$0.DotNetNamingPolicy = $2
$2.DirectoryNamespaceAssociation = PrefixedHierarchical
EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {DF194677-DFD3-42AF-9F75-D44D5A416478} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
+ {28464062-0939-4AA7-9F7B-24DDDA61A7C0} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
+ {3998657B-1CCC-49DD-A19F-275DC8495F57} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
+ {A2FD0A10-8F62-4F9D-B171-FFDF9F0AFA9D} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
+ {2E3A1B4B-4225-4AAA-8B29-0181A84E7AEE} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
+ {462584F7-5023-4019-9EAC-B98CA458C0A0} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
+ {7C93C84F-105C-48E5-A878-406FA0A5B296} = {FBBB5129-006E-4AD7-BAD5-8B7CA1D10ED6}
+ EndGlobalSection
EndGlobal
diff --git a/tests/Jellyfin.Naming.Tests/Video/BaseVideoTest.cs b/tests/Jellyfin.Naming.Tests/Video/BaseVideoTest.cs
deleted file mode 100644
index 0c2978aca..000000000
--- a/tests/Jellyfin.Naming.Tests/Video/BaseVideoTest.cs
+++ /dev/null
@@ -1,13 +0,0 @@
-using Emby.Naming.Common;
-using Emby.Naming.Video;
-
-namespace Jellyfin.Naming.Tests.Video
-{
- public abstract class BaseVideoTest
- {
- private readonly NamingOptions _namingOptions = new NamingOptions();
-
- protected VideoResolver GetParser()
- => new VideoResolver(_namingOptions);
- }
-}
diff --git a/tests/Jellyfin.Naming.Tests/Video/CleanDateTimeTests.cs b/tests/Jellyfin.Naming.Tests/Video/CleanDateTimeTests.cs
index 49cb2387b..917d8fb3a 100644
--- a/tests/Jellyfin.Naming.Tests/Video/CleanDateTimeTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/CleanDateTimeTests.cs
@@ -46,6 +46,7 @@ namespace Jellyfin.Naming.Tests.Video
[InlineData("Maximum Ride - 2016 - WEBDL-1080p - x264 AC3.mkv", "Maximum Ride", 2016)]
// FIXME: [InlineData("Robin Hood [Multi-Subs] [2018].mkv", "Robin Hood", 2018)]
[InlineData(@"3.Days.to.Kill.2014.720p.BluRay.x264.YIFY.mkv", "3.Days.to.Kill", 2014)] // In this test case, running CleanDateTime first produces no date, so it will attempt to run CleanString first and then CleanDateTime again
+ [InlineData("3 days to kill (2005).mkv", "3 days to kill", 2005)]
public void CleanDateTimeTest(string input, string expectedName, int? expectedYear)
{
input = Path.GetFileName(input);
diff --git a/tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs b/tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs
index a64d17349..a2722a175 100644
--- a/tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/ExtraTests.cs
@@ -5,7 +5,7 @@ using Xunit;
namespace Jellyfin.Naming.Tests.Video
{
- public class ExtraTests : BaseVideoTest
+ public class ExtraTests
{
private readonly NamingOptions _videoOptions = new NamingOptions();
diff --git a/tests/Jellyfin.Naming.Tests/Video/Format3DTests.cs b/tests/Jellyfin.Naming.Tests/Video/Format3DTests.cs
index ed3112936..d2b3d6ff0 100644
--- a/tests/Jellyfin.Naming.Tests/Video/Format3DTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/Format3DTests.cs
@@ -4,26 +4,26 @@ using Xunit;
namespace Jellyfin.Naming.Tests.Video
{
- public class Format3DTests : BaseVideoTest
+ public class Format3DTests
{
+ private readonly NamingOptions _namingOptions = new NamingOptions();
+
[Fact]
public void TestKodiFormat3D()
{
- var options = new NamingOptions();
-
- Test("Super movie.3d.mp4", false, null, options);
- Test("Super movie.3d.hsbs.mp4", true, "hsbs", options);
- Test("Super movie.3d.sbs.mp4", true, "sbs", options);
- Test("Super movie.3d.htab.mp4", true, "htab", options);
- Test("Super movie.3d.tab.mp4", true, "tab", options);
- Test("Super movie 3d hsbs.mp4", true, "hsbs", options);
+ Test("Super movie.3d.mp4", false, null);
+ Test("Super movie.3d.hsbs.mp4", true, "hsbs");
+ Test("Super movie.3d.sbs.mp4", true, "sbs");
+ Test("Super movie.3d.htab.mp4", true, "htab");
+ Test("Super movie.3d.tab.mp4", true, "tab");
+ Test("Super movie 3d hsbs.mp4", true, "hsbs");
}
[Fact]
public void Test3DName()
{
var result =
- GetParser().ResolveFile(@"C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.3d.hsbs.mkv");
+ new VideoResolver(_namingOptions).ResolveFile(@"C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.3d.hsbs.mkv");
Assert.Equal("hsbs", result.Format3D);
Assert.Equal("Oblivion", result.Name);
@@ -34,32 +34,31 @@ namespace Jellyfin.Naming.Tests.Video
{
// These were introduced for Media Browser 3
// Kodi conventions are preferred but these still need to be supported
- var options = new NamingOptions();
- Test("Super movie.3d.mp4", false, null, options);
- Test("Super movie.3d.hsbs.mp4", true, "hsbs", options);
- Test("Super movie.3d.sbs.mp4", true, "sbs", options);
- Test("Super movie.3d.htab.mp4", true, "htab", options);
- Test("Super movie.3d.tab.mp4", true, "tab", options);
+ Test("Super movie.3d.mp4", false, null);
+ Test("Super movie.3d.hsbs.mp4", true, "hsbs");
+ Test("Super movie.3d.sbs.mp4", true, "sbs");
+ Test("Super movie.3d.htab.mp4", true, "htab");
+ Test("Super movie.3d.tab.mp4", true, "tab");
- Test("Super movie.hsbs.mp4", true, "hsbs", options);
- Test("Super movie.sbs.mp4", true, "sbs", options);
- Test("Super movie.htab.mp4", true, "htab", options);
- Test("Super movie.tab.mp4", true, "tab", options);
- Test("Super movie.sbs3d.mp4", true, "sbs3d", options);
- Test("Super movie.3d.mvc.mp4", true, "mvc", options);
+ Test("Super movie.hsbs.mp4", true, "hsbs");
+ Test("Super movie.sbs.mp4", true, "sbs");
+ Test("Super movie.htab.mp4", true, "htab");
+ Test("Super movie.tab.mp4", true, "tab");
+ Test("Super movie.sbs3d.mp4", true, "sbs3d");
+ Test("Super movie.3d.mvc.mp4", true, "mvc");
- Test("Super movie [3d].mp4", false, null, options);
- Test("Super movie [hsbs].mp4", true, "hsbs", options);
- Test("Super movie [fsbs].mp4", true, "fsbs", options);
- Test("Super movie [ftab].mp4", true, "ftab", options);
- Test("Super movie [htab].mp4", true, "htab", options);
- Test("Super movie [sbs3d].mp4", true, "sbs3d", options);
+ Test("Super movie [3d].mp4", false, null);
+ Test("Super movie [hsbs].mp4", true, "hsbs");
+ Test("Super movie [fsbs].mp4", true, "fsbs");
+ Test("Super movie [ftab].mp4", true, "ftab");
+ Test("Super movie [htab].mp4", true, "htab");
+ Test("Super movie [sbs3d].mp4", true, "sbs3d");
}
- private void Test(string input, bool is3D, string format3D, NamingOptions options)
+ private void Test(string input, bool is3D, string? format3D)
{
- var parser = new Format3DParser(options);
+ var parser = new Format3DParser(_namingOptions);
var result = parser.Parse(input);
diff --git a/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs b/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs
index b8fbb2cb2..03fe32b6e 100644
--- a/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/MultiVersionTests.cs
@@ -8,6 +8,8 @@ namespace Jellyfin.Naming.Tests.Video
{
public class MultiVersionTests
{
+ private readonly NamingOptions _namingOptions = new NamingOptions();
+
// FIXME
// [Fact]
public void TestMultiEdition1()
@@ -430,8 +432,7 @@ namespace Jellyfin.Naming.Tests.Video
private VideoListResolver GetResolver()
{
- var options = new NamingOptions();
- return new VideoListResolver(options);
+ return new VideoListResolver(_namingOptions);
}
}
}
diff --git a/tests/Jellyfin.Naming.Tests/Video/StackTests.cs b/tests/Jellyfin.Naming.Tests/Video/StackTests.cs
index 3e0cbaf0c..3630a07e4 100644
--- a/tests/Jellyfin.Naming.Tests/Video/StackTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/StackTests.cs
@@ -6,8 +6,10 @@ using Xunit;
namespace Jellyfin.Naming.Tests.Video
{
- public class StackTests : BaseVideoTest
+ public class StackTests
{
+ private readonly NamingOptions _namingOptions = new NamingOptions();
+
[Fact]
public void TestSimpleStack()
{
@@ -446,7 +448,7 @@ namespace Jellyfin.Naming.Tests.Video
private StackResolver GetResolver()
{
- return new StackResolver(new NamingOptions());
+ return new StackResolver(_namingOptions);
}
}
}
diff --git a/tests/Jellyfin.Naming.Tests/Video/StubTests.cs b/tests/Jellyfin.Naming.Tests/Video/StubTests.cs
index 8d5ced9a4..e31d97e2e 100644
--- a/tests/Jellyfin.Naming.Tests/Video/StubTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/StubTests.cs
@@ -4,8 +4,10 @@ using Xunit;
namespace Jellyfin.Naming.Tests.Video
{
- public class StubTests : BaseVideoTest
+ public class StubTests
{
+ private readonly NamingOptions _namingOptions = new NamingOptions();
+
[Fact]
public void TestStubs()
{
@@ -27,16 +29,14 @@ namespace Jellyfin.Naming.Tests.Video
public void TestStubName()
{
var result =
- GetParser().ResolveFile(@"C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.dvd.disc");
+ new VideoResolver(_namingOptions).ResolveFile(@"C:/Users/media/Desktop/Video Test/Movies/Oblivion/Oblivion.dvd.disc");
Assert.Equal("Oblivion", result.Name);
}
private void Test(string path, bool isStub, string stubType)
{
- var options = new NamingOptions();
-
- var isStubResult = StubResolver.TryResolveFile(path, options, out var stubTypeResult);
+ var isStubResult = StubResolver.TryResolveFile(path, _namingOptions, out var stubTypeResult);
Assert.Equal(isStub, isStubResult);
diff --git a/tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs b/tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs
index ef8a17898..566dc9f7c 100644
--- a/tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/VideoListResolverTests.cs
@@ -8,6 +8,7 @@ namespace Jellyfin.Naming.Tests.Video
{
public class VideoListResolverTests
{
+ private readonly NamingOptions _namingOptions = new NamingOptions();
// FIXME
// [Fact]
public void TestStackAndExtras()
@@ -450,8 +451,7 @@ namespace Jellyfin.Naming.Tests.Video
private VideoListResolver GetResolver()
{
- var options = new NamingOptions();
- return new VideoListResolver(options);
+ return new VideoListResolver(_namingOptions);
}
}
}
diff --git a/tests/Jellyfin.Naming.Tests/Video/VideoResolverTests.cs b/tests/Jellyfin.Naming.Tests/Video/VideoResolverTests.cs
index 5a3ce8886..114735cee 100644
--- a/tests/Jellyfin.Naming.Tests/Video/VideoResolverTests.cs
+++ b/tests/Jellyfin.Naming.Tests/Video/VideoResolverTests.cs
@@ -1,275 +1,200 @@
-using MediaBrowser.Model.Entities;
+using System.Collections.Generic;
+using Emby.Naming.Common;
+using Emby.Naming.Video;
+using MediaBrowser.Model.Entities;
using Xunit;
namespace Jellyfin.Naming.Tests.Video
{
- public class VideoResolverTests : BaseVideoTest
+ public class VideoResolverTests
{
- // FIXME
- // [Fact]
- public void TestSimpleFile()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/Brave (2007)/Brave (2006).mkv");
-
- Assert.Equal(2006, result.Year);
- Assert.False(result.IsStub);
- Assert.False(result.Is3D);
- Assert.Equal("Brave", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void TestSimpleFile2()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/Bad Boys (1995)/Bad Boys (1995).mkv");
-
- Assert.Equal(1995, result.Year);
- Assert.False(result.IsStub);
- Assert.False(result.Is3D);
- Assert.Equal("Bad Boys", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void TestSimpleFileWithNumericName()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/300 (2007)/300 (2006).mkv");
-
- Assert.Equal(2006, result.Year);
- Assert.False(result.IsStub);
- Assert.False(result.Is3D);
- Assert.Equal("300", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void TestExtra()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/Brave (2007)/Brave (2006)-trailer.mkv");
-
- Assert.Equal(2006, result.Year);
- Assert.False(result.IsStub);
- Assert.False(result.Is3D);
- Assert.Equal(ExtraType.Trailer, result.ExtraType);
- Assert.Equal("Brave (2006)-trailer", result.Name);
- }
-
- // FIXME
- // [Fact]
- public void TestExtraWithNumericName()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/300 (2007)/300 (2006)-trailer.mkv");
-
- Assert.Equal(2006, result.Year);
- Assert.False(result.IsStub);
- Assert.False(result.Is3D);
- Assert.Equal("300 (2006)-trailer", result.Name);
- Assert.Equal(ExtraType.Trailer, result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void TestStubFileWithNumericName()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/300 (2007)/300 (2006).bluray.disc");
-
- Assert.Equal(2006, result.Year);
- Assert.True(result.IsStub);
- Assert.Equal("bluray", result.StubType);
- Assert.False(result.Is3D);
- Assert.Equal("300", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void TestStubFile()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/Brave (2007)/Brave (2006).bluray.disc");
-
- Assert.Equal(2006, result.Year);
- Assert.True(result.IsStub);
- Assert.Equal("bluray", result.StubType);
- Assert.False(result.Is3D);
- Assert.Equal("Brave", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void TestExtraStubWithNumericNameNotSupported()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/300 (2007)/300 (2006)-trailer.bluray.disc");
-
- Assert.Equal(2006, result.Year);
- Assert.True(result.IsStub);
- Assert.Equal("bluray", result.StubType);
- Assert.False(result.Is3D);
- Assert.Equal("300", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void TestExtraStubNotSupported()
- {
- // Using a stub for an extra is currently not supported
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/brave (2007)/brave (2006)-trailer.bluray.disc");
-
- Assert.Equal(2006, result.Year);
- Assert.True(result.IsStub);
- Assert.Equal("bluray", result.StubType);
- Assert.False(result.Is3D);
- Assert.Equal("brave", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void Test3DFileWithNumericName()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/300 (2007)/300 (2006).3d.sbs.mkv");
-
- Assert.Equal(2006, result.Year);
- Assert.False(result.IsStub);
- Assert.True(result.Is3D);
- Assert.Equal("sbs", result.Format3D);
- Assert.Equal("300", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void TestBad3DFileWithNumericName()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/300 (2007)/300 (2006).3d1.sbas.mkv");
-
- Assert.Equal(2006, result.Year);
- Assert.False(result.IsStub);
- Assert.False(result.Is3D);
- Assert.Equal("300", result.Name);
- Assert.Null(result.ExtraType);
- Assert.Null(result.Format3D);
- }
-
- // FIXME
- // [Fact]
- public void Test3DFile()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/brave (2007)/brave (2006).3d.sbs.mkv");
-
- Assert.Equal(2006, result.Year);
- Assert.False(result.IsStub);
- Assert.True(result.Is3D);
- Assert.Equal("sbs", result.Format3D);
- Assert.Equal("brave", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- [Fact]
- public void TestNameWithoutDate()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/American Psycho/American.Psycho.mkv");
-
- Assert.Null(result.Year);
- Assert.False(result.IsStub);
- Assert.False(result.Is3D);
- Assert.Null(result.Format3D);
- Assert.Equal("American.Psycho", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void TestCleanDateAndStringsSequence()
- {
- var parser = GetParser();
-
- // In this test case, running CleanDateTime first produces no date, so it will attempt to run CleanString first and then CleanDateTime again
- var result =
- parser.ResolveFile(@"/server/Movies/3.Days.to.Kill/3.Days.to.Kill.2014.720p.BluRay.x264.YIFY.mkv");
-
- Assert.Equal(2014, result.Year);
- Assert.False(result.IsStub);
- Assert.False(result.Is3D);
- Assert.Null(result.Format3D);
- Assert.Equal("3.Days.to.Kill", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- // FIXME
- // [Fact]
- public void TestCleanDateAndStringsSequence1()
- {
- var parser = GetParser();
-
- // In this test case, running CleanDateTime first produces no date, so it will attempt to run CleanString first and then CleanDateTime again
- var result =
- parser.ResolveFile(@"/server/Movies/3 days to kill (2005)/3 days to kill (2005).mkv");
-
- Assert.Equal(2005, result.Year);
- Assert.False(result.IsStub);
- Assert.False(result.Is3D);
- Assert.Null(result.Format3D);
- Assert.Equal("3 days to kill", result.Name);
- Assert.Null(result.ExtraType);
- }
-
- [Fact]
- public void TestFolderNameWithExtension()
- {
- var parser = GetParser();
-
- var result =
- parser.ResolveFile(@"/server/Movies/7 Psychos.mkv/7 Psychos.mkv");
-
- Assert.Null(result.Year);
- Assert.False(result.IsStub);
- Assert.False(result.Is3D);
- Assert.Equal("7 Psychos", result.Name);
- Assert.Null(result.ExtraType);
+ private readonly NamingOptions _namingOptions = new NamingOptions();
+
+ public static IEnumerable<object[]> GetResolveFileTestData()
+ {
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/7 Psychos.mkv/7 Psychos.mkv",
+ Container = "mkv",
+ Name = "7 Psychos"
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/3 days to kill (2005)/3 days to kill (2005).mkv",
+ Container = "mkv",
+ Name = "3 days to kill",
+ Year = 2005
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/American Psycho/American.Psycho.mkv",
+ Container = "mkv",
+ Name = "American.Psycho",
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/brave (2007)/brave (2006).3d.sbs.mkv",
+ Container = "mkv",
+ Name = "brave",
+ Year = 2006,
+ Is3D = true,
+ Format3D = "sbs",
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/300 (2007)/300 (2006).3d1.sbas.mkv",
+ Container = "mkv",
+ Name = "300",
+ Year = 2006
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/300 (2007)/300 (2006).3d.sbs.mkv",
+ Container = "mkv",
+ Name = "300",
+ Year = 2006,
+ Is3D = true,
+ Format3D = "sbs",
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/brave (2007)/brave (2006)-trailer.bluray.disc",
+ Container = "disc",
+ Name = "brave",
+ Year = 2006,
+ IsStub = true,
+ StubType = "bluray",
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/300 (2007)/300 (2006)-trailer.bluray.disc",
+ Container = "disc",
+ Name = "300",
+ Year = 2006,
+ IsStub = true,
+ StubType = "bluray",
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/Brave (2007)/Brave (2006).bluray.disc",
+ Container = "disc",
+ Name = "Brave",
+ Year = 2006,
+ IsStub = true,
+ StubType = "bluray",
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/300 (2007)/300 (2006).bluray.disc",
+ Container = "disc",
+ Name = "300",
+ Year = 2006,
+ IsStub = true,
+ StubType = "bluray",
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/300 (2007)/300 (2006)-trailer.mkv",
+ Container = "mkv",
+ Name = "300",
+ Year = 2006,
+ ExtraType = ExtraType.Trailer,
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/Brave (2007)/Brave (2006)-trailer.mkv",
+ Container = "mkv",
+ Name = "Brave",
+ Year = 2006,
+ ExtraType = ExtraType.Trailer,
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/300 (2007)/300 (2006).mkv",
+ Container = "mkv",
+ Name = "300",
+ Year = 2006
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/Bad Boys (1995)/Bad Boys (1995).mkv",
+ Container = "mkv",
+ Name = "Bad Boys",
+ Year = 1995,
+ }
+ };
+ yield return new object[]
+ {
+ new VideoFileInfo()
+ {
+ Path = @"/server/Movies/Brave (2007)/Brave (2006).mkv",
+ Container = "mkv",
+ Name = "Brave",
+ Year = 2006,
+ }
+ };
+ }
+
+
+ [Theory]
+ [MemberData(nameof(GetResolveFileTestData))]
+ public void ResolveFile_ValidFileName_Success(VideoFileInfo expectedResult)
+ {
+ var result = new VideoResolver(_namingOptions).ResolveFile(expectedResult.Path);
+
+ Assert.NotNull(result);
+ Assert.Equal(result.Path, expectedResult.Path);
+ Assert.Equal(result.Container, expectedResult.Container);
+ Assert.Equal(result.Name, expectedResult.Name);
+ Assert.Equal(result.Year, expectedResult.Year);
+ Assert.Equal(result.ExtraType, expectedResult.ExtraType);
+ Assert.Equal(result.Format3D, expectedResult.Format3D);
+ Assert.Equal(result.Is3D, expectedResult.Is3D);
+ Assert.Equal(result.IsStub, expectedResult.IsStub);
+ Assert.Equal(result.StubType, expectedResult.StubType);
+ Assert.Equal(result.IsDirectory, expectedResult.IsDirectory);
+ Assert.Equal(result.FileNameWithoutExtension, expectedResult.FileNameWithoutExtension);
}
}
}
diff --git a/tests/MediaBrowser.Api.Tests/BrandingServiceTests.cs b/tests/MediaBrowser.Api.Tests/BrandingServiceTests.cs
new file mode 100644
index 000000000..34698fe25
--- /dev/null
+++ b/tests/MediaBrowser.Api.Tests/BrandingServiceTests.cs
@@ -0,0 +1,49 @@
+using System.Text.Json;
+using System.Threading.Tasks;
+using MediaBrowser.Model.Branding;
+using Xunit;
+
+namespace MediaBrowser.Api.Tests
+{
+ public sealed class BrandingServiceTests : IClassFixture<JellyfinApplicationFactory>
+ {
+ private readonly JellyfinApplicationFactory _factory;
+
+ public BrandingServiceTests(JellyfinApplicationFactory factory)
+ {
+ _factory = factory;
+ }
+
+ [Fact]
+ public async Task GetConfiguration_ReturnsCorrectResponse()
+ {
+ // Arrange
+ var client = _factory.CreateClient();
+
+ // Act
+ var response = await client.GetAsync("/Branding/Configuration");
+
+ // Assert
+ response.EnsureSuccessStatusCode();
+ Assert.Equal("application/json; charset=utf-8", response.Content.Headers.ContentType.ToString());
+ var responseBody = await response.Content.ReadAsStreamAsync();
+ _ = await JsonSerializer.DeserializeAsync<BrandingOptions>(responseBody);
+ }
+
+ [Theory]
+ [InlineData("/Branding/Css")]
+ [InlineData("/Branding/Css.css")]
+ public async Task GetCss_ReturnsCorrectResponse(string url)
+ {
+ // Arrange
+ var client = _factory.CreateClient();
+
+ // Act
+ var response = await client.GetAsync(url);
+
+ // Assert
+ response.EnsureSuccessStatusCode();
+ Assert.Equal("text/css", response.Content.Headers.ContentType.ToString());
+ }
+ }
+}
diff --git a/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs b/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs
new file mode 100644
index 000000000..c39ed07de
--- /dev/null
+++ b/tests/MediaBrowser.Api.Tests/JellyfinApplicationFactory.cs
@@ -0,0 +1,120 @@
+using System;
+using System.Collections.Concurrent;
+using System.IO;
+using Emby.Server.Implementations;
+using Emby.Server.Implementations.IO;
+using Emby.Server.Implementations.Networking;
+using Jellyfin.Drawing.Skia;
+using Jellyfin.Server;
+using MediaBrowser.Common;
+using Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Mvc.Testing;
+using Microsoft.AspNetCore.TestHost;
+using Microsoft.Extensions.DependencyInjection;
+using Microsoft.Extensions.Logging;
+using Serilog;
+using Serilog.Extensions.Logging;
+
+namespace MediaBrowser.Api.Tests
+{
+ /// <summary>
+ /// Factory for bootstrapping the Jellyfin application in memory for functional end to end tests.
+ /// </summary>
+ public class JellyfinApplicationFactory : WebApplicationFactory<Startup>
+ {
+ private static readonly string _testPathRoot = Path.Combine(Path.GetTempPath(), "jellyfin-test-data");
+ private static readonly ConcurrentBag<IDisposable> _disposableComponents = new ConcurrentBag<IDisposable>();
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="JellyfinApplicationFactory"/> class.
+ /// </summary>
+ public JellyfinApplicationFactory()
+ {
+ // Perform static initialization that only needs to happen once per test-run
+ Log.Logger = new LoggerConfiguration().WriteTo.Console().CreateLogger();
+ Program.PerformStaticInitialization();
+ }
+
+ /// <inheritdoc/>
+ protected override IWebHostBuilder CreateWebHostBuilder()
+ {
+ return new WebHostBuilder();
+ }
+
+ /// <inheritdoc/>
+ protected override void ConfigureWebHost(IWebHostBuilder builder)
+ {
+ // Specify the startup command line options
+ var commandLineOpts = new StartupOptions
+ {
+ NoWebClient = true,
+ NoAutoRunWebApp = true
+ };
+
+ // Use a temporary directory for the application paths
+ var webHostPathRoot = Path.Combine(_testPathRoot, "test-host-" + Path.GetFileNameWithoutExtension(Path.GetRandomFileName()));
+ Directory.CreateDirectory(Path.Combine(webHostPathRoot, "logs"));
+ Directory.CreateDirectory(Path.Combine(webHostPathRoot, "config"));
+ Directory.CreateDirectory(Path.Combine(webHostPathRoot, "cache"));
+ Directory.CreateDirectory(Path.Combine(webHostPathRoot, "jellyfin-web"));
+ var appPaths = new ServerApplicationPaths(
+ webHostPathRoot,
+ Path.Combine(webHostPathRoot, "logs"),
+ Path.Combine(webHostPathRoot, "config"),
+ Path.Combine(webHostPathRoot, "cache"),
+ Path.Combine(webHostPathRoot, "jellyfin-web"));
+
+ // Create the logging config file
+ // TODO: We shouldn't need to do this since we are only logging to console
+ Program.InitLoggingConfigFile(appPaths).GetAwaiter().GetResult();
+
+ // Create a copy of the application configuration to use for startup
+ var startupConfig = Program.CreateAppConfiguration(commandLineOpts, appPaths);
+
+ ILoggerFactory loggerFactory = new SerilogLoggerFactory();
+ _disposableComponents.Add(loggerFactory);
+
+ // Create the app host and initialize it
+ var appHost = new CoreAppHost(
+ appPaths,
+ loggerFactory,
+ commandLineOpts,
+ new ManagedFileSystem(loggerFactory.CreateLogger<ManagedFileSystem>(), appPaths),
+ new NetworkManager(loggerFactory.CreateLogger<NetworkManager>()));
+ _disposableComponents.Add(appHost);
+ var serviceCollection = new ServiceCollection();
+ appHost.Init(serviceCollection);
+
+ // Configure the web host builder
+ Program.ConfigureWebHostBuilder(builder, appHost, serviceCollection, commandLineOpts, startupConfig, appPaths);
+ }
+
+ /// <inheritdoc/>
+ protected override TestServer CreateServer(IWebHostBuilder builder)
+ {
+ // Create the test server using the base implementation
+ var testServer = base.CreateServer(builder);
+
+ // Finish initializing the app host
+ var appHost = (CoreAppHost)testServer.Services.GetRequiredService<IApplicationHost>();
+ appHost.ServiceProvider = testServer.Services;
+ appHost.InitializeServices().GetAwaiter().GetResult();
+ appHost.RunStartupTasksAsync().GetAwaiter().GetResult();
+
+ return testServer;
+ }
+
+ /// <inheritdoc/>
+ protected override void Dispose(bool disposing)
+ {
+ foreach (var disposable in _disposableComponents)
+ {
+ disposable.Dispose();
+ }
+
+ _disposableComponents.Clear();
+
+ base.Dispose(disposing);
+ }
+ }
+}
diff --git a/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.csproj b/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.csproj
new file mode 100644
index 000000000..f30e48690
--- /dev/null
+++ b/tests/MediaBrowser.Api.Tests/MediaBrowser.Api.Tests.csproj
@@ -0,0 +1,33 @@
+<Project Sdk="Microsoft.NET.Sdk">
+
+ <PropertyGroup>
+ <TargetFramework>netcoreapp3.1</TargetFramework>
+ <IsPackable>false</IsPackable>
+ <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+ <Nullable>enable</Nullable>
+ </PropertyGroup>
+
+ <ItemGroup>
+ <PackageReference Include="Microsoft.AspNetCore.Mvc.Testing" Version="3.1.3" />
+ <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.5.0" />
+ <PackageReference Include="xunit" Version="2.4.1" />
+ <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" />
+ <PackageReference Include="coverlet.collector" Version="1.2.1" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <ProjectReference Include="..\..\Jellyfin.Server\Jellyfin.Server.csproj" />
+ <ProjectReference Include="..\..\MediaBrowser.Api\MediaBrowser.Api.csproj" />
+ </ItemGroup>
+
+ <!-- Code Analyzers-->
+ <ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="All" />
+ <PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
+ </ItemGroup>
+
+ <PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
+ <CodeAnalysisRuleSet>../jellyfin-tests.ruleset</CodeAnalysisRuleSet>
+ </PropertyGroup>
+
+</Project>
diff --git a/tests/jellyfin-tests.ruleset b/tests/jellyfin-tests.ruleset
new file mode 100644
index 000000000..5a113e955
--- /dev/null
+++ b/tests/jellyfin-tests.ruleset
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RuleSet Name="Rules for MediaBrowser.Api.Tests" Description="Code analysis rules for MediaBrowser.Api.Tests.csproj" ToolsVersion="14.0">
+
+ <!-- Include the solution default RuleSet. The rules in this file will override the defaults. -->
+ <Include Path="../jellyfin.ruleset" Action="Default" />
+
+ <!-- StyleCop Analyzer Rules -->
+ <Rules AnalyzerId="StyleCop.Analyzers" RuleNamespace="StyleCop.Analyzers">
+ <!-- SA0001: XML comment analysis is disabled due to project configuration -->
+ <Rule Id="SA0001" Action="None" />
+ </Rules>
+
+ <!-- FxCop Analyzer Rules -->
+ <Rules AnalyzerId="Microsoft.CodeAnalysis.FxCopAnalyzers" RuleNamespace="Microsoft.Design">
+ <!-- CA1707: Identifiers should not contain underscores -->
+ <Rule Id="CA1707" Action="None" />
+ <!-- CA2007: Consider calling ConfigureAwait on the awaited task -->
+ <Rule Id="CA2007" Action="None" />
+ <!-- CA2234: Pass system uri objects instead of strings -->
+ <Rule Id="CA2234" Action="Info" />
+ </Rules>
+</RuleSet>