diff --git a/.editorconfig b/.editorconfig
index dc9aaa3ed5..b84e563efa 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 473005b556..b3aad85cec 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 fd0cb5e255..64d041cb05 100644
--- a/DvdLib/DvdLib.csproj
+++ b/DvdLib/DvdLib.csproj
@@ -13,6 +13,7 @@
netstandard2.1
false
true
+ true
diff --git a/DvdLib/Ifo/Cell.cs b/DvdLib/Ifo/Cell.cs
index 268ab897ee..2eab400f7d 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 e588e51ac0..6e33a0ec5a 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 2b973e0830..216aa0f77a 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 bd3bd97040..1e69429f82 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 5af58a2dc8..ca20baa73f 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 3688089ec7..978af90c2e 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 af08afa356..9f62512706 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 7b003005b9..4860360afd 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 335e929928..abf806d2c0 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 757a5a05db..5d111ebc06 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 0b75a8cce9..b4aee614b0 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 newName))
+ && TryCleanString(name, out ReadOnlySpan 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 db7c35a7c8..dea9b6682a 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 22955850ab..6ee6230fc6 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;
}
+
+ ///
+ ///
+ /// There is nothing to dispose here since and
+ /// are managed by .
+ /// See .
+ ///
+ protected override void Dispose(bool dispose)
+ {
+ }
}
}
diff --git a/Emby.Server.Implementations/Library/UserManager.cs b/Emby.Server.Implementations/Library/UserManager.cs
index d63bc6bda8..b8feb5535f 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 1363eaf854..20447347b3 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 e0bbe90b36..d93920f433 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 de1baada84..e7bd3959bf 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 b39adefe70..f8d6e0e09b 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 2c9dae6a17..c2349ba5bb 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 9611e33f57..8780a884ba 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 2662913621..8abe31d2a0 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 6947178d7a..c169a35e79 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 0758bbe9ce..7f5a56e86c 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 8df137302f..bbdf99abab 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 baa12e98ec..41c74d54de 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 b60dd33bd5..60c58d472d 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 b7c50394ae..c8662b2cab 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 0000000000..b2e0b66fe1
--- /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 224748e611..a67a67582f 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 9c638f4395..ee5131c1ff 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 be13686dc2..bf3029368a 100644
--- a/Jellyfin.Data/Entities/Artwork.cs
+++ b/Jellyfin.Data/Entities/Artwork.cs
@@ -1,208 +1,195 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected Artwork()
- {
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static Artwork CreateArtworkUnsafe()
- {
- return new Artwork();
- }
-
- ///
- /// Public constructor with required data
- ///
- ///
- ///
- ///
- ///
- 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();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- ///
- ///
- ///
- ///
- 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
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected Artwork()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static Artwork CreateArtworkUnsafe()
+ {
+ return new Artwork();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ ///
+ ///
+ ///
+ 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();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static Artwork Create(string path, Enums.ArtKind kind, Metadata _metadata0, PersonRole _personrole1)
+ {
+ return new Artwork(path, kind, _metadata0, _personrole1);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Path
+ ///
+ protected string _Path;
+ ///
+ /// When provided in a partial class, allows value of Path to be changed before setting.
+ ///
+ partial void SetPath(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Path to be changed before returning.
+ ///
+ partial void GetPath(ref string result);
+
+ ///
+ /// Required, Max length = 65535
+ ///
+ [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for Path
- ///
- protected string _Path;
- ///
- /// When provided in a partial class, allows value of Path to be changed before setting.
- ///
- partial void SetPath(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Path to be changed before returning.
- ///
- partial void GetPath(ref string result);
-
- ///
- /// Required, Max length = 65535
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for Kind
+ ///
+ internal Enums.ArtKind _Kind;
+ ///
+ /// When provided in a partial class, allows value of Kind to be changed before setting.
+ ///
+ partial void SetKind(Enums.ArtKind oldValue, ref Enums.ArtKind newValue);
+ ///
+ /// When provided in a partial class, allows value of Kind to be changed before returning.
+ ///
+ partial void GetKind(ref Enums.ArtKind result);
+
+ ///
+ /// Indexed, Required
+ ///
+ [Required]
+ public Enums.ArtKind Kind
+ {
+ get
{
- _Path = value;
+ Enums.ArtKind value = _Kind;
+ GetKind(ref value);
+ return (_Kind = value);
}
- }
- }
-
- ///
- /// Backing field for Kind
- ///
- internal global::Jellyfin.Data.Enums.ArtKind _Kind;
- ///
- /// When provided in a partial class, allows value of Kind to be changed before setting.
- ///
- partial void SetKind(global::Jellyfin.Data.Enums.ArtKind oldValue, ref global::Jellyfin.Data.Enums.ArtKind newValue);
- ///
- /// When provided in a partial class, allows value of Kind to be changed before returning.
- ///
- partial void GetKind(ref global::Jellyfin.Data.Enums.ArtKind result);
-
- ///
- /// Indexed, Required
- ///
- [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;
+ }
}
- }
- }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- ///
- /// Required
- ///
- [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 30c89ae5c5..42d24e31d5 100644
--- a/Jellyfin.Data/Entities/Book.cs
+++ b/Jellyfin.Data/Entities/Book.cs
@@ -1,84 +1,69 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected Book(): base()
- {
- BookMetadata = new System.Collections.Generic.HashSet();
- Releases = new System.Collections.Generic.HashSet();
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected Book()
+ {
+ BookMetadata = new HashSet();
+ Releases = new HashSet();
- Init();
- }
+ Init();
+ }
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static Book CreateBookUnsafe()
- {
- return new Book();
- }
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static Book CreateBookUnsafe()
+ {
+ return new Book();
+ }
- ///
- /// Public constructor with required data
- ///
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- public Book(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
+ ///
+ /// Public constructor with required data
+ ///
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ public Book(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
- this.BookMetadata = new System.Collections.Generic.HashSet();
- this.Releases = new System.Collections.Generic.HashSet();
+ this.BookMetadata = new HashSet();
+ this.Releases = new HashSet();
- Init();
- }
+ Init();
+ }
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- public static Book Create(Guid urlid, DateTime dateadded)
- {
- return new Book(urlid, dateadded);
- }
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ public static Book Create(Guid urlid, DateTime dateadded)
+ {
+ return new Book(urlid, dateadded);
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection BookMetadata { get; protected set; }
+ [ForeignKey("BookMetadata_BookMetadata_Id")]
+ public virtual ICollection BookMetadata { get; protected set; }
- public virtual ICollection Releases { get; protected set; }
+ [ForeignKey("Release_Releases_Id")]
+ public virtual ICollection Releases { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/BookMetadata.cs b/Jellyfin.Data/Entities/BookMetadata.cs
index 3a28244d69..d52fe76051 100644
--- a/Jellyfin.Data/Entities/BookMetadata.cs
+++ b/Jellyfin.Data/Entities/BookMetadata.cs
@@ -1,123 +1,107 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected BookMetadata(): base()
- {
- Publishers = new System.Collections.Generic.HashSet();
-
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static BookMetadata CreateBookMetadataUnsafe()
- {
- return new BookMetadata();
- }
-
- ///
- /// Public constructor with required data
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- ///
- 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();
-
- Init();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- ///
- 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
- *************************************************************************/
-
- ///
- /// Backing field for ISBN
- ///
- protected long? _ISBN;
- ///
- /// When provided in a partial class, allows value of ISBN to be changed before setting.
- ///
- partial void SetISBN(long? oldValue, ref long? newValue);
- ///
- /// When provided in a partial class, allows value of ISBN to be changed before returning.
- ///
- 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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected BookMetadata()
+ {
+ Publishers = new HashSet();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static BookMetadata CreateBookMetadataUnsafe()
+ {
+ return new BookMetadata();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ ///
+ 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();
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ ///
+ public static BookMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Book _book0)
+ {
+ return new BookMetadata(title, language, dateadded, datemodified, _book0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for ISBN
+ ///
+ protected long? _ISBN;
+ ///
+ /// When provided in a partial class, allows value of ISBN to be changed before setting.
+ ///
+ partial void SetISBN(long? oldValue, ref long? newValue);
+ ///
+ /// When provided in a partial class, allows value of ISBN to be changed before returning.
+ ///
+ 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 Publishers { get; protected set; }
+ [ForeignKey("Company_Publishers_Id")]
+ public virtual ICollection Publishers { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/Chapter.cs b/Jellyfin.Data/Entities/Chapter.cs
index 21a5dd73ee..d48cb9b627 100644
--- a/Jellyfin.Data/Entities/Chapter.cs
+++ b/Jellyfin.Data/Entities/Chapter.cs
@@ -1,274 +1,263 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected Chapter()
- {
- Init();
- }
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected Chapter()
+ {
+ Init();
+ }
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static Chapter CreateChapterUnsafe()
- {
- return new Chapter();
- }
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static Chapter CreateChapterUnsafe()
+ {
+ return new Chapter();
+ }
- ///
- /// Public constructor with required data
- ///
- /// ISO-639-3 3-character language codes
- ///
- ///
- public Chapter(string language, long timestart, global::Jellyfin.Data.Entities.Release _release0)
- {
- if (string.IsNullOrEmpty(language)) throw new ArgumentNullException(nameof(language));
- this.Language = language;
+ ///
+ /// Public constructor with required data
+ ///
+ /// ISO-639-3 3-character language codes
+ ///
+ ///
+ 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();
+ }
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// ISO-639-3 3-character language codes
- ///
- ///
- public static Chapter Create(string language, long timestart, global::Jellyfin.Data.Entities.Release _release0)
- {
- return new Chapter(language, timestart, _release0);
- }
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// ISO-639-3 3-character language codes
+ ///
+ ///
+ public static Chapter Create(string language, long timestart, Release _release0)
+ {
+ return new Chapter(language, timestart, _release0);
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
- ///
- /// Identity, Indexed, Required
- ///
- [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)
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
}
- }
- }
+ }
- ///
- /// Backing field for Name
- ///
- protected string _Name;
- ///
- /// When provided in a partial class, allows value of Name to be changed before setting.
- ///
- partial void SetName(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Name to be changed before returning.
- ///
- partial void GetName(ref string result);
+ ///
+ /// Backing field for Name
+ ///
+ protected string _Name;
+ ///
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ ///
+ partial void SetName(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ ///
+ partial void GetName(ref string result);
- ///
- /// Max length = 1024
- ///
- [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)
+ ///
+ /// Max length = 1024
+ ///
+ [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;
+ }
+ }
+ }
- ///
- /// Backing field for Language
- ///
- protected string _Language;
- ///
- /// When provided in a partial class, allows value of Language to be changed before setting.
- ///
- partial void SetLanguage(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Language to be changed before returning.
- ///
- partial void GetLanguage(ref string result);
+ ///
+ /// Backing field for Language
+ ///
+ protected string _Language;
+ ///
+ /// When provided in a partial class, allows value of Language to be changed before setting.
+ ///
+ partial void SetLanguage(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Language to be changed before returning.
+ ///
+ partial void GetLanguage(ref string result);
- ///
- /// Required, Min length = 3, Max length = 3
- /// ISO-639-3 3-character language codes
- ///
- [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)
+ ///
+ /// Required, Min length = 3, Max length = 3
+ /// ISO-639-3 3-character language codes
+ ///
+ [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;
+ }
}
- }
- }
+ }
- ///
- /// Backing field for TimeStart
- ///
- protected long _TimeStart;
- ///
- /// When provided in a partial class, allows value of TimeStart to be changed before setting.
- ///
- partial void SetTimeStart(long oldValue, ref long newValue);
- ///
- /// When provided in a partial class, allows value of TimeStart to be changed before returning.
- ///
- partial void GetTimeStart(ref long result);
+ ///
+ /// Backing field for TimeStart
+ ///
+ protected long _TimeStart;
+ ///
+ /// When provided in a partial class, allows value of TimeStart to be changed before setting.
+ ///
+ partial void SetTimeStart(long oldValue, ref long newValue);
+ ///
+ /// When provided in a partial class, allows value of TimeStart to be changed before returning.
+ ///
+ partial void GetTimeStart(ref long result);
- ///
- /// Required
- ///
- [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)
+ ///
+ /// Required
+ ///
+ [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;
+ }
}
- }
- }
+ }
- ///
- /// Backing field for TimeEnd
- ///
- protected long? _TimeEnd;
- ///
- /// When provided in a partial class, allows value of TimeEnd to be changed before setting.
- ///
- partial void SetTimeEnd(long? oldValue, ref long? newValue);
- ///
- /// When provided in a partial class, allows value of TimeEnd to be changed before returning.
- ///
- partial void GetTimeEnd(ref long? result);
+ ///
+ /// Backing field for TimeEnd
+ ///
+ protected long? _TimeEnd;
+ ///
+ /// When provided in a partial class, allows value of TimeEnd to be changed before setting.
+ ///
+ partial void SetTimeEnd(long? oldValue, ref long? newValue);
+ ///
+ /// When provided in a partial class, allows value of TimeEnd to be changed before returning.
+ ///
+ 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;
+ }
+ }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- ///
- /// Required
- ///
- [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 68979eb2fe..e2fa3a5bd3 100644
--- a/Jellyfin.Data/Entities/Collection.cs
+++ b/Jellyfin.Data/Entities/Collection.cs
@@ -1,131 +1,120 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
-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();
- ///
- /// Default constructor
- ///
- public Collection()
- {
- CollectionItem = new System.Collections.Generic.LinkedList();
+ ///
+ /// Default constructor
+ ///
+ public Collection()
+ {
+ CollectionItem = new LinkedList();
- Init();
- }
+ Init();
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
- ///
- /// Identity, Indexed, Required
- ///
- [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)
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
}
- }
- }
+ }
- ///
- /// Backing field for Name
- ///
- protected string _Name;
- ///
- /// When provided in a partial class, allows value of Name to be changed before setting.
- ///
- partial void SetName(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Name to be changed before returning.
- ///
- partial void GetName(ref string result);
+ ///
+ /// Backing field for Name
+ ///
+ protected string _Name;
+ ///
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ ///
+ partial void SetName(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ ///
+ partial void GetName(ref string result);
- ///
- /// Max length = 1024
- ///
- [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)
+ ///
+ /// Max length = 1024
+ ///
+ [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;
+ }
}
- }
- }
+ }
- ///
- /// Required
- ///
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- public virtual ICollection CollectionItem { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("CollectionItem_CollectionItem_Id")]
+ public virtual ICollection CollectionItem { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/CollectionItem.cs b/Jellyfin.Data/Entities/CollectionItem.cs
index 8e575e0a28..4a3d066396 100644
--- a/Jellyfin.Data/Entities/CollectionItem.cs
+++ b/Jellyfin.Data/Entities/CollectionItem.cs
@@ -1,151 +1,143 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- 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();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static CollectionItem CreateCollectionItemUnsafe()
- {
- return new CollectionItem();
- }
-
- ///
- /// Public constructor with required data
- ///
- ///
- ///
- ///
- 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();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- ///
- ///
- ///
- 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
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ 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();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static CollectionItem CreateCollectionItemUnsafe()
+ {
+ return new CollectionItem();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ ///
+ ///
+ 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();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ ///
+ ///
+ public static CollectionItem Create(Collection _collection0, CollectionItem _collectionitem1, CollectionItem _collectionitem2)
+ {
+ return new CollectionItem(_collection0, _collectionitem1, _collectionitem2);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
}
- }
- }
-
- ///
- /// Required
- ///
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- ///
- /// Required
- ///
- public virtual global::Jellyfin.Data.Entities.LibraryItem LibraryItem { get; set; }
-
- ///
- /// TODO check if this properly updated dependant and has the proper principal relationship
- ///
- public virtual global::Jellyfin.Data.Entities.CollectionItem Next { get; set; }
-
- ///
- /// TODO check if this properly updated dependant and has the proper principal relationship
- ///
- public virtual global::Jellyfin.Data.Entities.CollectionItem Previous { get; set; }
-
- }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Required
+ ///
+ [ForeignKey("LibraryItem_Id")]
+ public virtual LibraryItem LibraryItem { get; set; }
+
+ ///
+ /// TODO check if this properly updated dependant and has the proper principal relationship
+ ///
+ [ForeignKey("CollectionItem_Next_Id")]
+ public virtual CollectionItem Next { get; set; }
+
+ ///
+ /// TODO check if this properly updated dependant and has the proper principal relationship
+ ///
+ [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 444ae9c564..0650271c65 100644
--- a/Jellyfin.Data/Entities/Company.cs
+++ b/Jellyfin.Data/Entities/Company.cs
@@ -1,147 +1,137 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected Company()
- {
- CompanyMetadata = new System.Collections.Generic.HashSet();
-
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static Company CreateCompanyUnsafe()
- {
- return new Company();
- }
-
- ///
- /// Public constructor with required data
- ///
- ///
- ///
- ///
- ///
- ///
- 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();
-
- Init();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- ///
- ///
- ///
- ///
- ///
- 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
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected Company()
+ {
+ CompanyMetadata = new HashSet();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static Company CreateCompanyUnsafe()
+ {
+ return new Company();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ 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();
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static Company Create(MovieMetadata _moviemetadata0, SeriesMetadata _seriesmetadata1, MusicAlbumMetadata _musicalbummetadata2, BookMetadata _bookmetadata3, Company _company4)
+ {
+ return new Company(_moviemetadata0, _seriesmetadata1, _musicalbummetadata2, _bookmetadata3, _company4);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id
+ {
+ get
{
- _Id = value;
+ int value = _Id;
+ GetId(ref value);
+ return (_Id = value);
}
- }
- }
-
- ///
- /// Required
- ///
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- public virtual ICollection 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;
+ }
+ }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("CompanyMetadata_CompanyMetadata_Id")]
+ public virtual ICollection 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 6d636e8846..b3ec9c1a7f 100644
--- a/Jellyfin.Data/Entities/CompanyMetadata.cs
+++ b/Jellyfin.Data/Entities/CompanyMetadata.cs
@@ -1,234 +1,216 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected CompanyMetadata(): base()
- {
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static CompanyMetadata CreateCompanyMetadataUnsafe()
- {
- return new CompanyMetadata();
- }
-
- ///
- /// Public constructor with required data
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- ///
- 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();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- ///
- 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
- *************************************************************************/
-
- ///
- /// Backing field for Description
- ///
- protected string _Description;
- ///
- /// When provided in a partial class, allows value of Description to be changed before setting.
- ///
- partial void SetDescription(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Description to be changed before returning.
- ///
- partial void GetDescription(ref string result);
-
- ///
- /// Max length = 65535
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected CompanyMetadata()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static CompanyMetadata CreateCompanyMetadataUnsafe()
+ {
+ return new CompanyMetadata();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ ///
+ 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();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ ///
+ public static CompanyMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Company _company0)
+ {
+ return new CompanyMetadata(title, language, dateadded, datemodified, _company0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Description
+ ///
+ protected string _Description;
+ ///
+ /// When provided in a partial class, allows value of Description to be changed before setting.
+ ///
+ partial void SetDescription(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Description to be changed before returning.
+ ///
+ partial void GetDescription(ref string result);
+
+ ///
+ /// Max length = 65535
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Headquarters
+ ///
+ protected string _Headquarters;
+ ///
+ /// When provided in a partial class, allows value of Headquarters to be changed before setting.
+ ///
+ partial void SetHeadquarters(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Headquarters to be changed before returning.
+ ///
+ partial void GetHeadquarters(ref string result);
+
+ ///
+ /// Max length = 255
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Country
+ ///
+ protected string _Country;
+ ///
+ /// When provided in a partial class, allows value of Country to be changed before setting.
+ ///
+ partial void SetCountry(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Country to be changed before returning.
+ ///
+ partial void GetCountry(ref string result);
+
+ ///
+ /// Max length = 2
+ ///
+ [MaxLength(2)]
+ [StringLength(2)]
+ public string Country
+ {
+ get
{
- _Description = value;
+ string value = _Country;
+ GetCountry(ref value);
+ return (_Country = value);
}
- }
- }
-
- ///
- /// Backing field for Headquarters
- ///
- protected string _Headquarters;
- ///
- /// When provided in a partial class, allows value of Headquarters to be changed before setting.
- ///
- partial void SetHeadquarters(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Headquarters to be changed before returning.
- ///
- partial void GetHeadquarters(ref string result);
-
- ///
- /// Max length = 255
- ///
- [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for Country
- ///
- protected string _Country;
- ///
- /// When provided in a partial class, allows value of Country to be changed before setting.
- ///
- partial void SetCountry(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Country to be changed before returning.
- ///
- partial void GetCountry(ref string result);
-
- ///
- /// Max length = 2
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for Homepage
+ ///
+ protected string _Homepage;
+ ///
+ /// When provided in a partial class, allows value of Homepage to be changed before setting.
+ ///
+ partial void SetHomepage(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Homepage to be changed before returning.
+ ///
+ partial void GetHomepage(ref string result);
+
+ ///
+ /// Max length = 1024
+ ///
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Homepage
+ {
+ get
{
- _Country = value;
+ string value = _Homepage;
+ GetHomepage(ref value);
+ return (_Homepage = value);
}
- }
- }
-
- ///
- /// Backing field for Homepage
- ///
- protected string _Homepage;
- ///
- /// When provided in a partial class, allows value of Homepage to be changed before setting.
- ///
- partial void SetHomepage(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Homepage to be changed before returning.
- ///
- partial void GetHomepage(ref string result);
-
- ///
- /// Max length = 1024
- ///
- [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 eb6d2752d3..2006717bf2 100644
--- a/Jellyfin.Data/Entities/CustomItem.cs
+++ b/Jellyfin.Data/Entities/CustomItem.cs
@@ -1,84 +1,68 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected CustomItem(): base()
- {
- CustomItemMetadata = new System.Collections.Generic.HashSet();
- Releases = new System.Collections.Generic.HashSet();
+ public partial class CustomItem : LibraryItem
+ {
+ partial void Init();
- Init();
- }
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected CustomItem()
+ {
+ CustomItemMetadata = new HashSet();
+ Releases = new HashSet();
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static CustomItem CreateCustomItemUnsafe()
- {
- return new CustomItem();
- }
+ Init();
+ }
- ///
- /// Public constructor with required data
- ///
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- public CustomItem(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static CustomItem CreateCustomItemUnsafe()
+ {
+ return new CustomItem();
+ }
- this.CustomItemMetadata = new System.Collections.Generic.HashSet();
- this.Releases = new System.Collections.Generic.HashSet();
+ ///
+ /// Public constructor with required data
+ ///
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ public CustomItem(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
- Init();
- }
+ this.CustomItemMetadata = new HashSet();
+ this.Releases = new HashSet();
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- public static CustomItem Create(Guid urlid, DateTime dateadded)
- {
- return new CustomItem(urlid, dateadded);
- }
+ Init();
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ public static CustomItem Create(Guid urlid, DateTime dateadded)
+ {
+ return new CustomItem(urlid, dateadded);
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- public virtual ICollection CustomItemMetadata { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("CustomItemMetadata_CustomItemMetadata_Id")]
+ public virtual ICollection CustomItemMetadata { get; protected set; }
- public virtual ICollection Releases { get; protected set; }
+ [ForeignKey("Release_Releases_Id")]
+ public virtual ICollection Releases { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/CustomItemMetadata.cs b/Jellyfin.Data/Entities/CustomItemMetadata.cs
index f2c15d3fe3..e09e4467ac 100644
--- a/Jellyfin.Data/Entities/CustomItemMetadata.cs
+++ b/Jellyfin.Data/Entities/CustomItemMetadata.cs
@@ -1,86 +1,67 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected CustomItemMetadata(): base()
- {
- Init();
- }
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected CustomItemMetadata()
+ {
+ Init();
+ }
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static CustomItemMetadata CreateCustomItemMetadataUnsafe()
- {
- return new CustomItemMetadata();
- }
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static CustomItemMetadata CreateCustomItemMetadataUnsafe()
+ {
+ return new CustomItemMetadata();
+ }
- ///
- /// Public constructor with required data
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- ///
- 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;
+ ///
+ /// Public constructor with required data
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ ///
+ 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();
+ }
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- ///
- 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);
- }
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ ///
+ 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 3a23f0976f..6f6baa14de 100644
--- a/Jellyfin.Data/Entities/Episode.cs
+++ b/Jellyfin.Data/Entities/Episode.cs
@@ -1,127 +1,110 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- 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();
- EpisodeMetadata = new System.Collections.Generic.HashSet();
-
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static Episode CreateEpisodeUnsafe()
- {
- return new Episode();
- }
-
- ///
- /// Public constructor with required data
- ///
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- ///
- 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();
- this.EpisodeMetadata = new System.Collections.Generic.HashSet();
-
- Init();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- ///
- public static Episode Create(Guid urlid, DateTime dateadded, global::Jellyfin.Data.Entities.Season _season0)
- {
- return new Episode(urlid, dateadded, _season0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- ///
- /// Backing field for EpisodeNumber
- ///
- protected int? _EpisodeNumber;
- ///
- /// When provided in a partial class, allows value of EpisodeNumber to be changed before setting.
- ///
- partial void SetEpisodeNumber(int? oldValue, ref int? newValue);
- ///
- /// When provided in a partial class, allows value of EpisodeNumber to be changed before returning.
- ///
- 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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ 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();
+ EpisodeMetadata = new HashSet();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static Episode CreateEpisodeUnsafe()
+ {
+ return new Episode();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ ///
+ 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();
+ this.EpisodeMetadata = new HashSet();
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ ///
+ public static Episode Create(Guid urlid, DateTime dateadded, Season _season0)
+ {
+ return new Episode(urlid, dateadded, _season0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for EpisodeNumber
+ ///
+ protected int? _EpisodeNumber;
+ ///
+ /// When provided in a partial class, allows value of EpisodeNumber to be changed before setting.
+ ///
+ partial void SetEpisodeNumber(int? oldValue, ref int? newValue);
+ ///
+ /// When provided in a partial class, allows value of EpisodeNumber to be changed before returning.
+ ///
+ 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 Releases { get; protected set; }
+ set
+ {
+ int? oldValue = _EpisodeNumber;
+ SetEpisodeNumber(oldValue, ref value);
+ if (oldValue != value)
+ {
+ _EpisodeNumber = value;
+ }
+ }
+ }
- public virtual ICollection EpisodeMetadata { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("Release_Releases_Id")]
+ public virtual ICollection Releases { get; protected set; }
+ [ForeignKey("EpisodeMetadata_EpisodeMetadata_Id")]
+ public virtual ICollection EpisodeMetadata { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/EpisodeMetadata.cs b/Jellyfin.Data/Entities/EpisodeMetadata.cs
index 963219140d..e5431bf223 100644
--- a/Jellyfin.Data/Entities/EpisodeMetadata.cs
+++ b/Jellyfin.Data/Entities/EpisodeMetadata.cs
@@ -1,197 +1,179 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected EpisodeMetadata(): base()
- {
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static EpisodeMetadata CreateEpisodeMetadataUnsafe()
- {
- return new EpisodeMetadata();
- }
-
- ///
- /// Public constructor with required data
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- ///
- 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();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- ///
- 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
- *************************************************************************/
-
- ///
- /// Backing field for Outline
- ///
- protected string _Outline;
- ///
- /// When provided in a partial class, allows value of Outline to be changed before setting.
- ///
- partial void SetOutline(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Outline to be changed before returning.
- ///
- partial void GetOutline(ref string result);
-
- ///
- /// Max length = 1024
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected EpisodeMetadata()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static EpisodeMetadata CreateEpisodeMetadataUnsafe()
+ {
+ return new EpisodeMetadata();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ ///
+ 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();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ ///
+ public static EpisodeMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Episode _episode0)
+ {
+ return new EpisodeMetadata(title, language, dateadded, datemodified, _episode0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Outline
+ ///
+ protected string _Outline;
+ ///
+ /// When provided in a partial class, allows value of Outline to be changed before setting.
+ ///
+ partial void SetOutline(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Outline to be changed before returning.
+ ///
+ partial void GetOutline(ref string result);
+
+ ///
+ /// Max length = 1024
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Plot
+ ///
+ protected string _Plot;
+ ///
+ /// When provided in a partial class, allows value of Plot to be changed before setting.
+ ///
+ partial void SetPlot(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Plot to be changed before returning.
+ ///
+ partial void GetPlot(ref string result);
+
+ ///
+ /// Max length = 65535
+ ///
+ [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for Plot
- ///
- protected string _Plot;
- ///
- /// When provided in a partial class, allows value of Plot to be changed before setting.
- ///
- partial void SetPlot(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Plot to be changed before returning.
- ///
- partial void GetPlot(ref string result);
-
- ///
- /// Max length = 65535
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for Tagline
+ ///
+ protected string _Tagline;
+ ///
+ /// When provided in a partial class, allows value of Tagline to be changed before setting.
+ ///
+ partial void SetTagline(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Tagline to be changed before returning.
+ ///
+ partial void GetTagline(ref string result);
+
+ ///
+ /// Max length = 1024
+ ///
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Tagline
+ {
+ get
{
- _Plot = value;
+ string value = _Tagline;
+ GetTagline(ref value);
+ return (_Tagline = value);
}
- }
- }
-
- ///
- /// Backing field for Tagline
- ///
- protected string _Tagline;
- ///
- /// When provided in a partial class, allows value of Tagline to be changed before setting.
- ///
- partial void SetTagline(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Tagline to be changed before returning.
- ///
- partial void GetTagline(ref string result);
-
- ///
- /// Max length = 1024
- ///
- [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 982600553e..38f289a8e3 100644
--- a/Jellyfin.Data/Entities/Genre.cs
+++ b/Jellyfin.Data/Entities/Genre.cs
@@ -1,163 +1,152 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected Genre()
- {
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static Genre CreateGenreUnsafe()
- {
- return new Genre();
- }
-
- ///
- /// Public constructor with required data
- ///
- ///
- ///
- 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();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- ///
- ///
- public static Genre Create(string name, global::Jellyfin.Data.Entities.Metadata _metadata0)
- {
- return new Genre(name, _metadata0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected Genre()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static Genre CreateGenreUnsafe()
+ {
+ return new Genre();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ ///
+ 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();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ ///
+ public static Genre Create(string name, Metadata _metadata0)
+ {
+ return new Genre(name, _metadata0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for Name
- ///
- internal string _Name;
- ///
- /// When provided in a partial class, allows value of Name to be changed before setting.
- ///
- partial void SetName(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Name to be changed before returning.
- ///
- partial void GetName(ref string result);
-
- ///
- /// Indexed, Required, Max length = 255
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for Name
+ ///
+ internal string _Name;
+ ///
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ ///
+ partial void SetName(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ ///
+ partial void GetName(ref string result);
+
+ ///
+ /// Indexed, Required, Max length = 255
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- ///
- /// Required
- ///
- [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 ff19e9b019..54f9f49057 100644
--- a/Jellyfin.Data/Entities/Group.cs
+++ b/Jellyfin.Data/Entities/Group.cs
@@ -1,115 +1,109 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected Group()
- {
- GroupPermissions = new System.Collections.Generic.HashSet();
- ProviderMappings = new System.Collections.Generic.HashSet();
- Preferences = new System.Collections.Generic.HashSet();
-
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static Group CreateGroupUnsafe()
- {
- return new Group();
- }
-
- ///
- /// Public constructor with required data
- ///
- ///
- ///
- 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();
- this.ProviderMappings = new System.Collections.Generic.HashSet();
- this.Preferences = new System.Collections.Generic.HashSet();
-
- Init();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- ///
- ///
- public static Group Create(string name, global::Jellyfin.Data.Entities.User _user0)
- {
- return new Group(name, _user0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- ///
- /// Identity, Indexed, Required
- ///
- [Key]
- [Required]
- public int Id { get; protected set; }
-
- ///
- /// Required, Max length = 255
- ///
- [Required]
- [MaxLength(255)]
- [StringLength(255)]
- public string Name { get; set; }
-
- ///
- /// Concurrency token
- ///
- [Timestamp]
- public Byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- public virtual ICollection GroupPermissions { get; protected set; }
-
- public virtual ICollection ProviderMappings { get; protected set; }
-
- public virtual ICollection Preferences { get; protected set; }
-
- }
+ public partial class Group
+ {
+ partial void Init();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected Group()
+ {
+ GroupPermissions = new HashSet();
+ ProviderMappings = new HashSet();
+ Preferences = new HashSet();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static Group CreateGroupUnsafe()
+ {
+ return new Group();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ ///
+ 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();
+ this.ProviderMappings = new HashSet();
+ this.Preferences = new HashSet();
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ ///
+ public static Group Create(string name, User _user0)
+ {
+ return new Group(name, _user0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [Key]
+ [Required]
+ [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
+ public int Id { get; protected set; }
+
+ ///
+ /// Required, Max length = 255
+ ///
+ [Required]
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string Name { get; set; }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ [ForeignKey("Permission_GroupPermissions_Id")]
+ public virtual ICollection GroupPermissions { get; protected set; }
+
+ [ForeignKey("ProviderMapping_ProviderMappings_Id")]
+ public virtual ICollection ProviderMappings { get; protected set; }
+
+ [ForeignKey("Preference_Preferences_Id")]
+ public virtual ICollection Preferences { get; protected set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/Library.cs b/Jellyfin.Data/Entities/Library.cs
index 19ca142947..c11c09e916 100644
--- a/Jellyfin.Data/Entities/Library.cs
+++ b/Jellyfin.Data/Entities/Library.cs
@@ -1,158 +1,147 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected Library()
- {
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static Library CreateLibraryUnsafe()
- {
- return new Library();
- }
-
- ///
- /// Public constructor with required data
- ///
- ///
- public Library(string name)
- {
- if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
- this.Name = name;
-
-
- Init();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- ///
- public static Library Create(string name)
- {
- return new Library(name);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected Library()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static Library CreateLibraryUnsafe()
+ {
+ return new Library();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public Library(string name)
+ {
+ if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
+ this.Name = name;
+
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static Library Create(string name)
+ {
+ return new Library(name);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for Name
- ///
- protected string _Name;
- ///
- /// When provided in a partial class, allows value of Name to be changed before setting.
- ///
- partial void SetName(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Name to be changed before returning.
- ///
- partial void GetName(ref string result);
-
- ///
- /// Required, Max length = 1024
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for Name
+ ///
+ protected string _Name;
+ ///
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ ///
+ partial void SetName(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ ///
+ partial void GetName(ref string result);
+
+ ///
+ /// Required, Max length = 1024
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- ///
- /// Required
- ///
- [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 1987196d69..af6c640b97 100644
--- a/Jellyfin.Data/Entities/LibraryItem.cs
+++ b/Jellyfin.Data/Entities/LibraryItem.cs
@@ -1,180 +1,170 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to being abstract.
- ///
- protected LibraryItem()
- {
- Init();
- }
-
- ///
- /// Public constructor with required data
- ///
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- protected LibraryItem(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
-
-
- Init();
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to being abstract.
+ ///
+ protected LibraryItem()
+ {
+ Init();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ protected LibraryItem(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
+
+
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for UrlId
+ ///
+ internal Guid _UrlId;
+ ///
+ /// When provided in a partial class, allows value of UrlId to be changed before setting.
+ ///
+ partial void SetUrlId(Guid oldValue, ref Guid newValue);
+ ///
+ /// When provided in a partial class, allows value of UrlId to be changed before returning.
+ ///
+ partial void GetUrlId(ref Guid result);
+
+ ///
+ /// Indexed, Required
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ ///
+ [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for UrlId
- ///
- internal Guid _UrlId;
- ///
- /// When provided in a partial class, allows value of UrlId to be changed before setting.
- ///
- partial void SetUrlId(Guid oldValue, ref Guid newValue);
- ///
- /// When provided in a partial class, allows value of UrlId to be changed before returning.
- ///
- partial void GetUrlId(ref Guid result);
-
- ///
- /// Indexed, Required
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for DateAdded
+ ///
+ protected DateTime _DateAdded;
+ ///
+ /// When provided in a partial class, allows value of DateAdded to be changed before setting.
+ ///
+ partial void SetDateAdded(DateTime oldValue, ref DateTime newValue);
+ ///
+ /// When provided in a partial class, allows value of DateAdded to be changed before returning.
+ ///
+ partial void GetDateAdded(ref DateTime result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public DateTime DateAdded
+ {
+ get
{
- _UrlId = value;
+ DateTime value = _DateAdded;
+ GetDateAdded(ref value);
+ return (_DateAdded = value);
}
- }
- }
-
- ///
- /// Backing field for DateAdded
- ///
- protected DateTime _DateAdded;
- ///
- /// When provided in a partial class, allows value of DateAdded to be changed before setting.
- ///
- partial void SetDateAdded(DateTime oldValue, ref DateTime newValue);
- ///
- /// When provided in a partial class, allows value of DateAdded to be changed before returning.
- ///
- partial void GetDateAdded(ref DateTime result);
-
- ///
- /// Required
- ///
- [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;
+ }
}
- }
- }
-
- ///
- /// Required
- ///
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- ///
- /// Required
- ///
- public virtual global::Jellyfin.Data.Entities.LibraryRoot LibraryRoot { get; set; }
-
- }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Required
+ ///
+ [ForeignKey("LibraryRoot_Id")]
+ public virtual LibraryRoot LibraryRoot { get; set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/LibraryRoot.cs b/Jellyfin.Data/Entities/LibraryRoot.cs
index 015fc4ea98..bbc23e1c96 100644
--- a/Jellyfin.Data/Entities/LibraryRoot.cs
+++ b/Jellyfin.Data/Entities/LibraryRoot.cs
@@ -1,202 +1,192 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected LibraryRoot()
- {
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static LibraryRoot CreateLibraryRootUnsafe()
- {
- return new LibraryRoot();
- }
-
- ///
- /// Public constructor with required data
- ///
- /// Absolute Path
- public LibraryRoot(string path)
- {
- if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path));
- this.Path = path;
-
-
- Init();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// Absolute Path
- public static LibraryRoot Create(string path)
- {
- return new LibraryRoot(path);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected LibraryRoot()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static LibraryRoot CreateLibraryRootUnsafe()
+ {
+ return new LibraryRoot();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ /// Absolute Path
+ public LibraryRoot(string path)
+ {
+ if (string.IsNullOrEmpty(path)) throw new ArgumentNullException(nameof(path));
+ this.Path = path;
+
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// Absolute Path
+ public static LibraryRoot Create(string path)
+ {
+ return new LibraryRoot(path);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Path
+ ///
+ protected string _Path;
+ ///
+ /// When provided in a partial class, allows value of Path to be changed before setting.
+ ///
+ partial void SetPath(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Path to be changed before returning.
+ ///
+ partial void GetPath(ref string result);
+
+ ///
+ /// Required, Max length = 65535
+ /// Absolute Path
+ ///
+ [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for Path
- ///
- protected string _Path;
- ///
- /// When provided in a partial class, allows value of Path to be changed before setting.
- ///
- partial void SetPath(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Path to be changed before returning.
- ///
- partial void GetPath(ref string result);
-
- ///
- /// Required, Max length = 65535
- /// Absolute Path
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for NetworkPath
+ ///
+ protected string _NetworkPath;
+ ///
+ /// When provided in a partial class, allows value of NetworkPath to be changed before setting.
+ ///
+ partial void SetNetworkPath(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of NetworkPath to be changed before returning.
+ ///
+ partial void GetNetworkPath(ref string result);
+
+ ///
+ /// Max length = 65535
+ /// Absolute network path, for example for transcoding sattelites.
+ ///
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string NetworkPath
+ {
+ get
{
- _Path = value;
+ string value = _NetworkPath;
+ GetNetworkPath(ref value);
+ return (_NetworkPath = value);
}
- }
- }
-
- ///
- /// Backing field for NetworkPath
- ///
- protected string _NetworkPath;
- ///
- /// When provided in a partial class, allows value of NetworkPath to be changed before setting.
- ///
- partial void SetNetworkPath(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of NetworkPath to be changed before returning.
- ///
- partial void GetNetworkPath(ref string result);
-
- ///
- /// Max length = 65535
- /// Absolute network path, for example for transcoding sattelites.
- ///
- [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;
+ }
}
- }
- }
-
- ///
- /// Required
- ///
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- ///
- /// Required
- ///
- public virtual global::Jellyfin.Data.Entities.Library Library { get; set; }
-
- }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Required
+ ///
+ [ForeignKey("Library_Id")]
+ public virtual Library Library { get; set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/MediaFile.cs b/Jellyfin.Data/Entities/MediaFile.cs
index 2a47a96325..719539e5c2 100644
--- a/Jellyfin.Data/Entities/MediaFile.cs
+++ b/Jellyfin.Data/Entities/MediaFile.cs
@@ -1,209 +1,200 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected MediaFile()
- {
- MediaFileStreams = new System.Collections.Generic.HashSet();
-
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static MediaFile CreateMediaFileUnsafe()
- {
- return new MediaFile();
- }
-
- ///
- /// Public constructor with required data
- ///
- /// Relative to the LibraryRoot
- ///
- ///
- 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();
-
- Init();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// Relative to the LibraryRoot
- ///
- ///
- 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
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected MediaFile()
+ {
+ MediaFileStreams = new HashSet();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static MediaFile CreateMediaFileUnsafe()
+ {
+ return new MediaFile();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ /// Relative to the LibraryRoot
+ ///
+ ///
+ 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();
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// Relative to the LibraryRoot
+ ///
+ ///
+ public static MediaFile Create(string path, Enums.MediaFileKind kind, Release _release0)
+ {
+ return new MediaFile(path, kind, _release0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Path
+ ///
+ protected string _Path;
+ ///
+ /// When provided in a partial class, allows value of Path to be changed before setting.
+ ///
+ partial void SetPath(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Path to be changed before returning.
+ ///
+ partial void GetPath(ref string result);
+
+ ///
+ /// Required, Max length = 65535
+ /// Relative to the LibraryRoot
+ ///
+ [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for Path
- ///
- protected string _Path;
- ///
- /// When provided in a partial class, allows value of Path to be changed before setting.
- ///
- partial void SetPath(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Path to be changed before returning.
- ///
- partial void GetPath(ref string result);
-
- ///
- /// Required, Max length = 65535
- /// Relative to the LibraryRoot
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for Kind
+ ///
+ protected Enums.MediaFileKind _Kind;
+ ///
+ /// When provided in a partial class, allows value of Kind to be changed before setting.
+ ///
+ partial void SetKind(Enums.MediaFileKind oldValue, ref Enums.MediaFileKind newValue);
+ ///
+ /// When provided in a partial class, allows value of Kind to be changed before returning.
+ ///
+ partial void GetKind(ref Enums.MediaFileKind result);
+
+ ///
+ /// Required
+ ///
+ [Required]
+ public Enums.MediaFileKind Kind
+ {
+ get
{
- _Path = value;
+ Enums.MediaFileKind value = _Kind;
+ GetKind(ref value);
+ return (_Kind = value);
}
- }
- }
-
- ///
- /// Backing field for Kind
- ///
- protected global::Jellyfin.Data.Enums.MediaFileKind _Kind;
- ///
- /// When provided in a partial class, allows value of Kind to be changed before setting.
- ///
- partial void SetKind(global::Jellyfin.Data.Enums.MediaFileKind oldValue, ref global::Jellyfin.Data.Enums.MediaFileKind newValue);
- ///
- /// When provided in a partial class, allows value of Kind to be changed before returning.
- ///
- partial void GetKind(ref global::Jellyfin.Data.Enums.MediaFileKind result);
-
- ///
- /// Required
- ///
- [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;
+ }
}
- }
- }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- ///
- /// Required
- ///
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection MediaFileStreams { get; protected set; }
+ [ForeignKey("MediaFileStream_MediaFileStreams_Id")]
+ public virtual ICollection MediaFileStreams { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/MediaFileStream.cs b/Jellyfin.Data/Entities/MediaFileStream.cs
index 6593d3cf75..7b3399731a 100644
--- a/Jellyfin.Data/Entities/MediaFileStream.cs
+++ b/Jellyfin.Data/Entities/MediaFileStream.cs
@@ -1,160 +1,149 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected MediaFileStream()
- {
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static MediaFileStream CreateMediaFileStreamUnsafe()
- {
- return new MediaFileStream();
- }
-
- ///
- /// Public constructor with required data
- ///
- ///
- ///
- 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();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- ///
- ///
- public static MediaFileStream Create(int streamnumber, global::Jellyfin.Data.Entities.MediaFile _mediafile0)
- {
- return new MediaFileStream(streamnumber, _mediafile0);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected MediaFileStream()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static MediaFileStream CreateMediaFileStreamUnsafe()
+ {
+ return new MediaFileStream();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ ///
+ public MediaFileStream(int streamnumber, MediaFile _mediafile0)
+ {
+ this.StreamNumber = streamnumber;
+
+ if (_mediafile0 == null) throw new ArgumentNullException(nameof(_mediafile0));
+ _mediafile0.MediaFileStreams.Add(this);
+
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ ///
+ public static MediaFileStream Create(int streamnumber, MediaFile _mediafile0)
+ {
+ return new MediaFileStream(streamnumber, _mediafile0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for StreamNumber
- ///
- protected int _StreamNumber;
- ///
- /// When provided in a partial class, allows value of StreamNumber to be changed before setting.
- ///
- partial void SetStreamNumber(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of StreamNumber to be changed before returning.
- ///
- partial void GetStreamNumber(ref int result);
-
- ///
- /// Required
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for StreamNumber
+ ///
+ protected int _StreamNumber;
+ ///
+ /// When provided in a partial class, allows value of StreamNumber to be changed before setting.
+ ///
+ partial void SetStreamNumber(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of StreamNumber to be changed before returning.
+ ///
+ partial void GetStreamNumber(ref int result);
+
+ ///
+ /// Required
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- ///
- /// Required
- ///
- [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 6057017e94..467ee68226 100644
--- a/Jellyfin.Data/Entities/Metadata.cs
+++ b/Jellyfin.Data/Entities/Metadata.cs
@@ -1,385 +1,380 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to being abstract.
- ///
- protected Metadata()
- {
- PersonRoles = new System.Collections.Generic.HashSet();
- Genres = new System.Collections.Generic.HashSet();
- Artwork = new System.Collections.Generic.HashSet();
- Ratings = new System.Collections.Generic.HashSet();
- Sources = new System.Collections.Generic.HashSet();
-
- Init();
- }
-
- ///
- /// Public constructor with required data
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- 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();
- this.Genres = new System.Collections.Generic.HashSet();
- this.Artwork = new System.Collections.Generic.HashSet();
- this.Ratings = new System.Collections.Generic.HashSet();
- this.Sources = new System.Collections.Generic.HashSet();
-
- Init();
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to being abstract.
+ ///
+ protected Metadata()
+ {
+ PersonRoles = new HashSet();
+ Genres = new HashSet();
+ Artwork = new HashSet();
+ Ratings = new HashSet();
+ Sources = new HashSet();
+
+ Init();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ 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();
+ this.Genres = new HashSet();
+ this.Artwork = new HashSet();
+ this.Ratings = new HashSet();
+ this.Sources = new HashSet();
+
+ Init();
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Title
+ ///
+ protected string _Title;
+ ///
+ /// When provided in a partial class, allows value of Title to be changed before setting.
+ ///
+ partial void SetTitle(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Title to be changed before returning.
+ ///
+ partial void GetTitle(ref string result);
+
+ ///
+ /// Required, Max length = 1024
+ /// The title or name of the object
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for OriginalTitle
+ ///
+ protected string _OriginalTitle;
+ ///
+ /// When provided in a partial class, allows value of OriginalTitle to be changed before setting.
+ ///
+ partial void SetOriginalTitle(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of OriginalTitle to be changed before returning.
+ ///
+ partial void GetOriginalTitle(ref string result);
+
+ ///
+ /// Max length = 1024
+ ///
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string OriginalTitle
+ {
+ get
{
- _Id = value;
+ string value = _OriginalTitle;
+ GetOriginalTitle(ref value);
+ return (_OriginalTitle = value);
}
- }
- }
-
- ///
- /// Backing field for Title
- ///
- protected string _Title;
- ///
- /// When provided in a partial class, allows value of Title to be changed before setting.
- ///
- partial void SetTitle(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Title to be changed before returning.
- ///
- partial void GetTitle(ref string result);
-
- ///
- /// Required, Max length = 1024
- /// The title or name of the object
- ///
- [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for OriginalTitle
- ///
- protected string _OriginalTitle;
- ///
- /// When provided in a partial class, allows value of OriginalTitle to be changed before setting.
- ///
- partial void SetOriginalTitle(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of OriginalTitle to be changed before returning.
- ///
- partial void GetOriginalTitle(ref string result);
-
- ///
- /// Max length = 1024
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for SortTitle
+ ///
+ protected string _SortTitle;
+ ///
+ /// When provided in a partial class, allows value of SortTitle to be changed before setting.
+ ///
+ partial void SetSortTitle(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of SortTitle to be changed before returning.
+ ///
+ partial void GetSortTitle(ref string result);
+
+ ///
+ /// Max length = 1024
+ ///
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string SortTitle
+ {
+ get
{
- _OriginalTitle = value;
+ string value = _SortTitle;
+ GetSortTitle(ref value);
+ return (_SortTitle = value);
}
- }
- }
-
- ///
- /// Backing field for SortTitle
- ///
- protected string _SortTitle;
- ///
- /// When provided in a partial class, allows value of SortTitle to be changed before setting.
- ///
- partial void SetSortTitle(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of SortTitle to be changed before returning.
- ///
- partial void GetSortTitle(ref string result);
-
- ///
- /// Max length = 1024
- ///
- [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for Language
- ///
- protected string _Language;
- ///
- /// When provided in a partial class, allows value of Language to be changed before setting.
- ///
- partial void SetLanguage(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Language to be changed before returning.
- ///
- partial void GetLanguage(ref string result);
-
- ///
- /// Required, Min length = 3, Max length = 3
- /// ISO-639-3 3-character language codes
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for Language
+ ///
+ protected string _Language;
+ ///
+ /// When provided in a partial class, allows value of Language to be changed before setting.
+ ///
+ partial void SetLanguage(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Language to be changed before returning.
+ ///
+ partial void GetLanguage(ref string result);
+
+ ///
+ /// Required, Min length = 3, Max length = 3
+ /// ISO-639-3 3-character language codes
+ ///
+ [Required]
+ [MinLength(3)]
+ [MaxLength(3)]
+ [StringLength(3)]
+ public string Language
+ {
+ get
{
- _Language = value;
+ string value = _Language;
+ GetLanguage(ref value);
+ return (_Language = value);
}
- }
- }
-
- ///
- /// Backing field for ReleaseDate
- ///
- protected DateTimeOffset? _ReleaseDate;
- ///
- /// When provided in a partial class, allows value of ReleaseDate to be changed before setting.
- ///
- partial void SetReleaseDate(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
- ///
- /// When provided in a partial class, allows value of ReleaseDate to be changed before returning.
- ///
- 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;
+ }
}
- }
- }
-
- ///
- /// Backing field for DateAdded
- ///
- protected DateTime _DateAdded;
- ///
- /// When provided in a partial class, allows value of DateAdded to be changed before setting.
- ///
- partial void SetDateAdded(DateTime oldValue, ref DateTime newValue);
- ///
- /// When provided in a partial class, allows value of DateAdded to be changed before returning.
- ///
- partial void GetDateAdded(ref DateTime result);
-
- ///
- /// Required
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for ReleaseDate
+ ///
+ protected DateTimeOffset? _ReleaseDate;
+ ///
+ /// When provided in a partial class, allows value of ReleaseDate to be changed before setting.
+ ///
+ partial void SetReleaseDate(DateTimeOffset? oldValue, ref DateTimeOffset? newValue);
+ ///
+ /// When provided in a partial class, allows value of ReleaseDate to be changed before returning.
+ ///
+ partial void GetReleaseDate(ref DateTimeOffset? result);
+
+ public DateTimeOffset? ReleaseDate
+ {
+ get
{
- _DateAdded = value;
+ DateTimeOffset? value = _ReleaseDate;
+ GetReleaseDate(ref value);
+ return (_ReleaseDate = value);
}
- }
- }
-
- ///
- /// Backing field for DateModified
- ///
- protected DateTime _DateModified;
- ///
- /// When provided in a partial class, allows value of DateModified to be changed before setting.
- ///
- partial void SetDateModified(DateTime oldValue, ref DateTime newValue);
- ///
- /// When provided in a partial class, allows value of DateModified to be changed before returning.
- ///
- partial void GetDateModified(ref DateTime result);
-
- ///
- /// Required
- ///
- [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;
+ }
}
- }
- }
+ }
+
+ ///
+ /// Backing field for DateAdded
+ ///
+ protected DateTime _DateAdded;
+ ///
+ /// When provided in a partial class, allows value of DateAdded to be changed before setting.
+ ///
+ partial void SetDateAdded(DateTime oldValue, ref DateTime newValue);
+ ///
+ /// When provided in a partial class, allows value of DateAdded to be changed before returning.
+ ///
+ partial void GetDateAdded(ref DateTime result);
+
+ ///
+ /// Required
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for DateModified
+ ///
+ protected DateTime _DateModified;
+ ///
+ /// When provided in a partial class, allows value of DateModified to be changed before setting.
+ ///
+ partial void SetDateModified(DateTime oldValue, ref DateTime newValue);
+ ///
+ /// When provided in a partial class, allows value of DateModified to be changed before returning.
+ ///
+ partial void GetDateModified(ref DateTime result);
+
+ ///
+ /// Required
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- ///
- /// Required
- ///
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection PersonRoles { get; protected set; }
+ [ForeignKey("PersonRole_PersonRoles_Id")]
+ public virtual ICollection PersonRoles { get; protected set; }
- public virtual ICollection Genres { get; protected set; }
+ [ForeignKey("PersonRole_PersonRoles_Id")]
+ public virtual ICollection Genres { get; protected set; }
- public virtual ICollection Artwork { get; protected set; }
+ [ForeignKey("PersonRole_PersonRoles_Id")]
+ public virtual ICollection Artwork { get; protected set; }
- public virtual ICollection Ratings { get; protected set; }
+ [ForeignKey("PersonRole_PersonRoles_Id")]
+ public virtual ICollection Ratings { get; protected set; }
- public virtual ICollection Sources { get; protected set; }
+ [ForeignKey("PersonRole_PersonRoles_Id")]
+ public virtual ICollection Sources { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/MetadataProvider.cs b/Jellyfin.Data/Entities/MetadataProvider.cs
index 3a8f5854eb..4e4f107fb9 100644
--- a/Jellyfin.Data/Entities/MetadataProvider.cs
+++ b/Jellyfin.Data/Entities/MetadataProvider.cs
@@ -1,158 +1,147 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected MetadataProvider()
- {
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static MetadataProvider CreateMetadataProviderUnsafe()
- {
- return new MetadataProvider();
- }
-
- ///
- /// Public constructor with required data
- ///
- ///
- public MetadataProvider(string name)
- {
- if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
- this.Name = name;
-
-
- Init();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- ///
- public static MetadataProvider Create(string name)
- {
- return new MetadataProvider(name);
- }
-
- /*************************************************************************
- * Properties
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected MetadataProvider()
+ {
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static MetadataProvider CreateMetadataProviderUnsafe()
+ {
+ return new MetadataProvider();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ public MetadataProvider(string name)
+ {
+ if (string.IsNullOrEmpty(name)) throw new ArgumentNullException(nameof(name));
+ this.Name = name;
+
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ public static MetadataProvider Create(string name)
+ {
+ return new MetadataProvider(name);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for Name
- ///
- protected string _Name;
- ///
- /// When provided in a partial class, allows value of Name to be changed before setting.
- ///
- partial void SetName(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Name to be changed before returning.
- ///
- partial void GetName(ref string result);
-
- ///
- /// Required, Max length = 1024
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for Name
+ ///
+ protected string _Name;
+ ///
+ /// When provided in a partial class, allows value of Name to be changed before setting.
+ ///
+ partial void SetName(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Name to be changed before returning.
+ ///
+ partial void GetName(ref string result);
+
+ ///
+ /// Required, Max length = 1024
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
- ///
- /// Required
- ///
- [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 87ff19e26d..926f223dea 100644
--- a/Jellyfin.Data/Entities/MetadataProviderId.cs
+++ b/Jellyfin.Data/Entities/MetadataProviderId.cs
@@ -1,189 +1,179 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- 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();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static MetadataProviderId CreateMetadataProviderIdUnsafe()
- {
- return new MetadataProviderId();
- }
-
- ///
- /// Public constructor with required data
- ///
- ///
- ///
- ///
- ///
- ///
- 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();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- ///
- ///
- ///
- ///
- ///
- 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
- *************************************************************************/
-
- ///
- /// Backing field for Id
- ///
- internal int _Id;
- ///
- /// When provided in a partial class, allows value of Id to be changed before setting.
- ///
- partial void SetId(int oldValue, ref int newValue);
- ///
- /// When provided in a partial class, allows value of Id to be changed before returning.
- ///
- partial void GetId(ref int result);
-
- ///
- /// Identity, Indexed, Required
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ 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();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static MetadataProviderId CreateMetadataProviderIdUnsafe()
+ {
+ return new MetadataProviderId();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ 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();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ public static MetadataProviderId Create(string providerid, Metadata _metadata0, Person _person1, PersonRole _personrole2, RatingSource _ratingsource3)
+ {
+ return new MetadataProviderId(providerid, _metadata0, _person1, _personrole2, _ratingsource3);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Id
+ ///
+ internal int _Id;
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before setting.
+ ///
+ partial void SetId(int oldValue, ref int newValue);
+ ///
+ /// When provided in a partial class, allows value of Id to be changed before returning.
+ ///
+ partial void GetId(ref int result);
+
+ ///
+ /// Identity, Indexed, Required
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for ProviderId
+ ///
+ protected string _ProviderId;
+ ///
+ /// When provided in a partial class, allows value of ProviderId to be changed before setting.
+ ///
+ partial void SetProviderId(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of ProviderId to be changed before returning.
+ ///
+ partial void GetProviderId(ref string result);
+
+ ///
+ /// Required, Max length = 255
+ ///
+ [Required]
+ [MaxLength(255)]
+ [StringLength(255)]
+ public string ProviderId
+ {
+ get
{
- _Id = value;
+ string value = _ProviderId;
+ GetProviderId(ref value);
+ return (_ProviderId = value);
}
- }
- }
-
- ///
- /// Backing field for ProviderId
- ///
- protected string _ProviderId;
- ///
- /// When provided in a partial class, allows value of ProviderId to be changed before setting.
- ///
- partial void SetProviderId(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of ProviderId to be changed before returning.
- ///
- partial void GetProviderId(ref string result);
-
- ///
- /// Required, Max length = 255
- ///
- [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;
+ }
}
- }
- }
-
- ///
- /// Required
- ///
- [ConcurrencyCheck]
- [Required]
- public byte[] Timestamp { get; set; }
-
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
-
- ///
- /// Required
- ///
- public virtual global::Jellyfin.Data.Entities.MetadataProvider MetadataProvider { get; set; }
-
- }
+ }
+
+ ///
+ /// Required, ConcurrenyToken
+ ///
+ [ConcurrencyCheck]
+ [Required]
+ public uint RowVersion { get; set; }
+
+ public void OnSavingChanges()
+ {
+ RowVersion++;
+ }
+
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+
+ ///
+ /// Required
+ ///
+ [ForeignKey("MetadataProvider_Id")]
+ public virtual MetadataProvider MetadataProvider { get; set; }
+
+ }
}
diff --git a/Jellyfin.Data/Entities/Movie.cs b/Jellyfin.Data/Entities/Movie.cs
index dfcc05a943..b359b42fcd 100644
--- a/Jellyfin.Data/Entities/Movie.cs
+++ b/Jellyfin.Data/Entities/Movie.cs
@@ -1,84 +1,69 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected Movie(): base()
- {
- Releases = new System.Collections.Generic.HashSet();
- MovieMetadata = new System.Collections.Generic.HashSet();
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected Movie()
+ {
+ Releases = new HashSet();
+ MovieMetadata = new HashSet();
- Init();
- }
+ Init();
+ }
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static Movie CreateMovieUnsafe()
- {
- return new Movie();
- }
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static Movie CreateMovieUnsafe()
+ {
+ return new Movie();
+ }
- ///
- /// Public constructor with required data
- ///
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- public Movie(Guid urlid, DateTime dateadded)
- {
- this.UrlId = urlid;
+ ///
+ /// Public constructor with required data
+ ///
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ public Movie(Guid urlid, DateTime dateadded)
+ {
+ this.UrlId = urlid;
- this.Releases = new System.Collections.Generic.HashSet();
- this.MovieMetadata = new System.Collections.Generic.HashSet();
+ this.Releases = new HashSet();
+ this.MovieMetadata = new HashSet();
- Init();
- }
+ Init();
+ }
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// This is whats gets displayed in the Urls and API requests. This could also be a string.
- public static Movie Create(Guid urlid, DateTime dateadded)
- {
- return new Movie(urlid, dateadded);
- }
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// This is whats gets displayed in the Urls and API requests. This could also be a string.
+ public static Movie Create(Guid urlid, DateTime dateadded)
+ {
+ return new Movie(urlid, dateadded);
+ }
- /*************************************************************************
- * Properties
- *************************************************************************/
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
- /*************************************************************************
- * Navigation properties
- *************************************************************************/
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
- public virtual ICollection Releases { get; protected set; }
+ [ForeignKey("Release_Releases_Id")]
+ public virtual ICollection Releases { get; protected set; }
- public virtual ICollection MovieMetadata { get; protected set; }
+ [ForeignKey("MovieMetadata_MovieMetadata_Id")]
+ public virtual ICollection MovieMetadata { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/MovieMetadata.cs b/Jellyfin.Data/Entities/MovieMetadata.cs
index bd847da8fa..319ae94e5a 100644
--- a/Jellyfin.Data/Entities/MovieMetadata.cs
+++ b/Jellyfin.Data/Entities/MovieMetadata.cs
@@ -1,239 +1,223 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected MovieMetadata(): base()
- {
- Studios = new System.Collections.Generic.HashSet();
-
- Init();
- }
-
- ///
- /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
- ///
- public static MovieMetadata CreateMovieMetadataUnsafe()
- {
- return new MovieMetadata();
- }
-
- ///
- /// Public constructor with required data
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- ///
- 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();
-
- Init();
- }
-
- ///
- /// Static create function (for use in LINQ queries, etc.)
- ///
- /// The title or name of the object
- /// ISO-639-3 3-character language codes
- ///
- 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
- *************************************************************************/
-
- ///
- /// Backing field for Outline
- ///
- protected string _Outline;
- ///
- /// When provided in a partial class, allows value of Outline to be changed before setting.
- ///
- partial void SetOutline(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Outline to be changed before returning.
- ///
- partial void GetOutline(ref string result);
-
- ///
- /// Max length = 1024
- ///
- [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();
+
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected MovieMetadata()
+ {
+ Studios = new HashSet();
+
+ Init();
+ }
+
+ ///
+ /// Replaces default constructor, since it's protected. Caller assumes responsibility for setting all required values before saving.
+ ///
+ public static MovieMetadata CreateMovieMetadataUnsafe()
+ {
+ return new MovieMetadata();
+ }
+
+ ///
+ /// Public constructor with required data
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ ///
+ 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();
+
+ Init();
+ }
+
+ ///
+ /// Static create function (for use in LINQ queries, etc.)
+ ///
+ /// The title or name of the object
+ /// ISO-639-3 3-character language codes
+ ///
+ public static MovieMetadata Create(string title, string language, DateTime dateadded, DateTime datemodified, Movie _movie0)
+ {
+ return new MovieMetadata(title, language, dateadded, datemodified, _movie0);
+ }
+
+ /*************************************************************************
+ * Properties
+ *************************************************************************/
+
+ ///
+ /// Backing field for Outline
+ ///
+ protected string _Outline;
+ ///
+ /// When provided in a partial class, allows value of Outline to be changed before setting.
+ ///
+ partial void SetOutline(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Outline to be changed before returning.
+ ///
+ partial void GetOutline(ref string result);
+
+ ///
+ /// Max length = 1024
+ ///
+ [MaxLength(1024)]
+ [StringLength(1024)]
+ public string Outline
+ {
+ get
{
- _Outline = value;
+ string value = _Outline;
+ GetOutline(ref value);
+ return (_Outline = value);
}
- }
- }
-
- ///
- /// Backing field for Plot
- ///
- protected string _Plot;
- ///
- /// When provided in a partial class, allows value of Plot to be changed before setting.
- ///
- partial void SetPlot(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Plot to be changed before returning.
- ///
- partial void GetPlot(ref string result);
-
- ///
- /// Max length = 65535
- ///
- [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;
+ }
}
- }
- }
-
- ///
- /// Backing field for Tagline
- ///
- protected string _Tagline;
- ///
- /// When provided in a partial class, allows value of Tagline to be changed before setting.
- ///
- partial void SetTagline(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Tagline to be changed before returning.
- ///
- partial void GetTagline(ref string result);
-
- ///
- /// Max length = 1024
- ///
- [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)
+ }
+
+ ///
+ /// Backing field for Plot
+ ///
+ protected string _Plot;
+ ///
+ /// When provided in a partial class, allows value of Plot to be changed before setting.
+ ///
+ partial void SetPlot(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Plot to be changed before returning.
+ ///
+ partial void GetPlot(ref string result);
+
+ ///
+ /// Max length = 65535
+ ///
+ [MaxLength(65535)]
+ [StringLength(65535)]
+ public string Plot
+ {
+ get
{
- _Tagline = value;
+ string value = _Plot;
+ GetPlot(ref value);
+ return (_Plot = value);
}
- }
- }
-
- ///
- /// Backing field for Country
- ///
- protected string _Country;
- ///
- /// When provided in a partial class, allows value of Country to be changed before setting.
- ///
- partial void SetCountry(string oldValue, ref string newValue);
- ///
- /// When provided in a partial class, allows value of Country to be changed before returning.
- ///
- partial void GetCountry(ref string result);
-
- ///
- /// Max length = 2
- ///
- [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
- *************************************************************************/
+ }
+
+ ///
+ /// Backing field for Tagline
+ ///
+ protected string _Tagline;
+ ///
+ /// When provided in a partial class, allows value of Tagline to be changed before setting.
+ ///
+ partial void SetTagline(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Tagline to be changed before returning.
+ ///
+ partial void GetTagline(ref string result);
+
+ ///
+ /// Max length = 1024
+ ///
+ [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;
+ }
+ }
+ }
+
+ ///
+ /// Backing field for Country
+ ///
+ protected string _Country;
+ ///
+ /// When provided in a partial class, allows value of Country to be changed before setting.
+ ///
+ partial void SetCountry(string oldValue, ref string newValue);
+ ///
+ /// When provided in a partial class, allows value of Country to be changed before returning.
+ ///
+ partial void GetCountry(ref string result);
+
+ ///
+ /// Max length = 2
+ ///
+ [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 Studios { get; protected set; }
+ /*************************************************************************
+ * Navigation properties
+ *************************************************************************/
+ [ForeignKey("Company_Studios_Id")]
+ public virtual ICollection Studios { get; protected set; }
- }
+ }
}
diff --git a/Jellyfin.Data/Entities/MusicAlbum.cs b/Jellyfin.Data/Entities/MusicAlbum.cs
index 417f2595bd..00cb8fe007 100644
--- a/Jellyfin.Data/Entities/MusicAlbum.cs
+++ b/Jellyfin.Data/Entities/MusicAlbum.cs
@@ -1,84 +1,68 @@
-//------------------------------------------------------------------------------
-//
-// 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
-//
-//------------------------------------------------------------------------------
-
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();
-
- ///
- /// Default constructor. Protected due to required properties, but present because EF needs it.
- ///
- protected MusicAlbum(): base()
- {
- MusicAlbumMetadata = new System.Collections.Generic.HashSet();
- Tracks = new System.Collections.Generic.HashSet();
+ public partial class MusicAlbum : LibraryItem
+ {
+ partial void Init();
- Init();
- }
+ ///
+ /// Default constructor. Protected due to required properties, but present because EF needs it.
+ ///
+ protected MusicAlbum()
+ {
+ MusicAlbumMetadata = new HashSet();
+ Tracks = new HashSet