Apply review suggestions

This commit is contained in:
Patrick Barron 2020-05-10 10:54:41 -04:00
parent 2b41f8ab63
commit 55cfa96b9f
54 changed files with 189 additions and 1427 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,15 +1,8 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Artwork")]
public partial class Artwork public partial class Artwork
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Book")]
public partial class Book : LibraryItem public partial class Book : LibraryItem
{ {
partial void Init(); partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected Book() : base() protected Book()
{ {
BookMetadata = new HashSet<BookMetadata>(); BookMetadata = new HashSet<BookMetadata>();
Releases = new HashSet<Release>(); Releases = new HashSet<Release>();

View File

@ -1,11 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
@ -16,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected BookMetadata() : base() protected BookMetadata()
{ {
Publishers = new HashSet<Company>(); Publishers = new HashSet<Company>();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Chapter")]
public partial class Chapter public partial class Chapter
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Collection")]
public partial class Collection public partial class Collection
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("CollectionItem")]
public partial class CollectionItem public partial class CollectionItem
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Company")]
public partial class Company public partial class Company
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,8 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("CompanyMetadata")]
public partial class CompanyMetadata : Metadata public partial class CompanyMetadata : Metadata
{ {
partial void Init(); partial void Init();
@ -17,7 +10,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected CompanyMetadata() : base() protected CompanyMetadata()
{ {
Init(); Init();
} }

View File

@ -1,11 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
@ -16,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected CustomItem() : base() protected CustomItem()
{ {
CustomItemMetadata = new HashSet<CustomItemMetadata>(); CustomItemMetadata = new HashSet<CustomItemMetadata>();
Releases = new HashSet<Release>(); Releases = new HashSet<Release>();

View File

@ -1,15 +1,7 @@
using System; 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 namespace Jellyfin.Data.Entities
{ {
[Table("CustomItemMetadata")]
public partial class CustomItemMetadata : Metadata public partial class CustomItemMetadata : Metadata
{ {
partial void Init(); partial void Init();
@ -17,7 +9,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected CustomItemMetadata() : base() protected CustomItemMetadata()
{ {
Init(); Init();
} }

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Episode")]
public partial class Episode : LibraryItem public partial class Episode : LibraryItem
{ {
partial void Init(); partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected Episode() : base() protected Episode()
{ {
// NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem. // 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. // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.

View File

@ -1,15 +1,8 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("EpisodeMetadata")]
public partial class EpisodeMetadata : Metadata public partial class EpisodeMetadata : Metadata
{ {
partial void Init(); partial void Init();
@ -17,7 +10,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected EpisodeMetadata() : base() protected EpisodeMetadata()
{ {
Init(); Init();
} }

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Genre")]
public partial class Genre public partial class Genre
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Group")]
public partial class Group public partial class Group
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Library")]
public partial class Library public partial class Library
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("LibraryItem")]
public abstract partial class LibraryItem public abstract partial class LibraryItem
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("LibraryRoot")]
public partial class LibraryRoot public partial class LibraryRoot
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("MediaFile")]
public partial class MediaFile public partial class MediaFile
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("MediaFileStream")]
public partial class MediaFileStream public partial class MediaFileStream
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Metadata")]
public abstract partial class Metadata public abstract partial class Metadata
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("MetadataProvider")]
public partial class MetadataProvider public partial class MetadataProvider
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("MetadataProviderId")]
public partial class MetadataProviderId public partial class MetadataProviderId
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Movie")]
public partial class Movie : LibraryItem public partial class Movie : LibraryItem
{ {
partial void Init(); partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected Movie() : base() protected Movie()
{ {
Releases = new HashSet<Release>(); Releases = new HashSet<Release>();
MovieMetadata = new HashSet<MovieMetadata>(); MovieMetadata = new HashSet<MovieMetadata>();

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("MovieMetadata")]
public partial class MovieMetadata : Metadata public partial class MovieMetadata : Metadata
{ {
partial void Init(); partial void Init();
@ -17,7 +12,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected MovieMetadata() : base() protected MovieMetadata()
{ {
Studios = new HashSet<Company>(); Studios = new HashSet<Company>();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("MusicAlbum")]
public partial class MusicAlbum : LibraryItem public partial class MusicAlbum : LibraryItem
{ {
partial void Init(); partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected MusicAlbum() : base() protected MusicAlbum()
{ {
MusicAlbumMetadata = new HashSet<MusicAlbumMetadata>(); MusicAlbumMetadata = new HashSet<MusicAlbumMetadata>();
Tracks = new HashSet<Track>(); Tracks = new HashSet<Track>();

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("MusicAlbumMetadata")]
public partial class MusicAlbumMetadata : Metadata public partial class MusicAlbumMetadata : Metadata
{ {
partial void Init(); partial void Init();
@ -17,7 +12,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected MusicAlbumMetadata() : base() protected MusicAlbumMetadata()
{ {
Labels = new HashSet<Company>(); Labels = new HashSet<Company>();

View File

@ -1,15 +1,11 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel; using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Permission")]
public partial class Permission public partial class Permission
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Person")]
public partial class Person public partial class Person
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("PersonRole")]
public partial class PersonRole public partial class PersonRole
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Photo")]
public partial class Photo : LibraryItem public partial class Photo : LibraryItem
{ {
partial void Init(); partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected Photo() : base() protected Photo()
{ {
PhotoMetadata = new HashSet<PhotoMetadata>(); PhotoMetadata = new HashSet<PhotoMetadata>();
Releases = new HashSet<Release>(); Releases = new HashSet<Release>();

View File

@ -1,15 +1,8 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("PhotoMetadata")]
public partial class PhotoMetadata : Metadata public partial class PhotoMetadata : Metadata
{ {
partial void Init(); partial void Init();
@ -17,7 +10,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected PhotoMetadata() : base() protected PhotoMetadata()
{ {
Init(); Init();
} }

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Preference")]
public partial class Preference public partial class Preference
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("ProviderMapping")]
public partial class ProviderMapping public partial class ProviderMapping
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Rating")]
public partial class Rating public partial class Rating
{ {
partial void Init(); partial void Init();

View File

@ -1,18 +1,12 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
/// <summary> /// <summary>
/// This is the entity to store review ratings, not age ratings /// This is the entity to store review ratings, not age ratings
/// </summary> /// </summary>
[Table("RatingSource")]
public partial class RatingSource public partial class RatingSource
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Release")]
public partial class Release public partial class Release
{ {
partial void Init(); partial void Init();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Season")]
public partial class Season : LibraryItem public partial class Season : LibraryItem
{ {
partial void Init(); partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected Season() : base() protected Season()
{ {
// NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem. // 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. // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("SeasonMetadata")]
public partial class SeasonMetadata : Metadata public partial class SeasonMetadata : Metadata
{ {
partial void Init(); partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected SeasonMetadata() : base() protected SeasonMetadata()
{ {
Init(); Init();
} }

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Series")]
public partial class Series : LibraryItem public partial class Series : LibraryItem
{ {
partial void Init(); partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected Series() : base() protected Series()
{ {
SeriesMetadata = new HashSet<SeriesMetadata>(); SeriesMetadata = new HashSet<SeriesMetadata>();
Seasons = new HashSet<Season>(); Seasons = new HashSet<Season>();

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("SeriesMetadata")]
public partial class SeriesMetadata : Metadata public partial class SeriesMetadata : Metadata
{ {
partial void Init(); partial void Init();
@ -17,7 +12,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected SeriesMetadata() : base() protected SeriesMetadata()
{ {
Networks = new HashSet<Company>(); Networks = new HashSet<Company>();

View File

@ -1,15 +1,9 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("Track")]
public partial class Track : LibraryItem public partial class Track : LibraryItem
{ {
partial void Init(); partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected Track() : base() protected Track()
{ {
// NOTE: This class has one-to-one associations with LibraryRoot, LibraryItem and CollectionItem. // 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. // One-to-one associations are not validated in constructors since this causes a scenario where each one must be constructed before the other.

View File

@ -1,15 +1,8 @@
using System; using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("TrackMetadata")]
public partial class TrackMetadata : Metadata public partial class TrackMetadata : Metadata
{ {
partial void Init(); partial void Init();
@ -17,7 +10,7 @@ namespace Jellyfin.Data.Entities
/// <summary> /// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it. /// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary> /// </summary>
protected TrackMetadata() : base() protected TrackMetadata()
{ {
Init(); Init();
} }

View File

@ -1,15 +1,10 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema; using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Runtime.CompilerServices;
namespace Jellyfin.Data.Entities namespace Jellyfin.Data.Entities
{ {
[Table("User")]
public partial class User public partial class User
{ {
partial void Init(); partial void Init();

View File

@ -1,8 +1,6 @@
using System;
namespace Jellyfin.Data.Enums namespace Jellyfin.Data.Enums
{ {
public enum ArtKind : Int32 public enum ArtKind
{ {
Other, Other,
Poster, Poster,

View File

@ -1,8 +1,6 @@
using System;
namespace Jellyfin.Data.Enums namespace Jellyfin.Data.Enums
{ {
public enum MediaFileKind : Int32 public enum MediaFileKind
{ {
Main, Main,
Sidecar, Sidecar,

View File

@ -1,8 +1,6 @@
using System;
namespace Jellyfin.Data.Enums namespace Jellyfin.Data.Enums
{ {
public enum PermissionKind : Int32 public enum PermissionKind
{ {
IsAdministrator, IsAdministrator,
IsHidden, IsHidden,

View File

@ -1,8 +1,6 @@
using System;
namespace Jellyfin.Data.Enums namespace Jellyfin.Data.Enums
{ {
public enum PersonRoleType : Int32 public enum PersonRoleType
{ {
Other, Other,
Director, Director,

View File

@ -1,8 +1,6 @@
using System;
namespace Jellyfin.Data.Enums namespace Jellyfin.Data.Enums
{ {
public enum PreferenceKind : Int32 public enum PreferenceKind
{ {
MaxParentalRating, MaxParentalRating,
BlockedTags, BlockedTags,

View File

@ -1,8 +1,6 @@
using System;
namespace Jellyfin.Data.Enums namespace Jellyfin.Data.Enums
{ {
public enum Weekday : Int32 public enum Weekday
{ {
Sunday, Sunday,
Monday, Monday,

View File

@ -0,0 +1,9 @@
#pragma warning disable CS1591
namespace Jellyfin.Data
{
public interface ISavingChanges
{
void OnSavingChanges();
}
}

View File

@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<CodeAnalysisRuleSet>../jellyfin.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<!-- Code analysers-->
<ItemGroup Condition=" '$(Configuration)' == 'Debug' ">
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="2.9.8" PrivateAssets="All" />
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" PrivateAssets="All" />
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118" PrivateAssets="All" />
<PackageReference Include="SmartAnalyzers.MultithreadingAnalyzer" Version="1.1.31" PrivateAssets="All" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\SharedVersion.cs" />
<Compile Remove="Migrations\20200430214405_InitialSchema.cs" />
<Compile Remove="Migrations\20200430214405_InitialSchema.Designer.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Jellyfin.Data\Jellyfin.Data.csproj" />
<ProjectReference Include="..\MediaBrowser.Controller\MediaBrowser.Controller.csproj" />
<ProjectReference Include="..\MediaBrowser.Model\MediaBrowser.Model.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,115 @@
#pragma warning disable CS1591
#pragma warning disable SA1201 // Constuctors should not follow properties
#pragma warning disable SA1516 // Elements should be followed by a blank line
#pragma warning disable SA1623 // Property's documentation should begin with gets or sets
#pragma warning disable SA1629 // Documentation should end with a period
#pragma warning disable SA1648 // Inheritdoc should be used with inheriting class
using System.Linq;
using Jellyfin.Data;
using Jellyfin.Data.Entities;
using Microsoft.EntityFrameworkCore;
namespace Jellyfin.Server.Implementations
{
/// <inheritdoc/>
public partial class JellyfinDb : DbContext
{
/*public virtual DbSet<Artwork> Artwork { get; set; }
public virtual DbSet<Book> Books { get; set; }
public virtual DbSet<BookMetadata> BookMetadata { get; set; }
public virtual DbSet<Chapter> Chapters { get; set; }
public virtual DbSet<Collection> Collections { get; set; }
public virtual DbSet<CollectionItem> CollectionItems { get; set; }
public virtual DbSet<Company> Companies { get; set; }
public virtual DbSet<CompanyMetadata> CompanyMetadata { get; set; }
public virtual DbSet<CustomItem> CustomItems { get; set; }
public virtual DbSet<CustomItemMetadata> CustomItemMetadata { get; set; }
public virtual DbSet<Episode> Episodes { get; set; }
public virtual DbSet<EpisodeMetadata> EpisodeMetadata { get; set; }
public virtual DbSet<Genre> Genres { get; set; }
public virtual DbSet<Group> Groups { get; set; }
public virtual DbSet<Library> Libraries { get; set; }
public virtual DbSet<LibraryItem> LibraryItems { get; set; }
public virtual DbSet<LibraryRoot> LibraryRoot { get; set; }
public virtual DbSet<MediaFile> MediaFiles { get; set; }
public virtual DbSet<MediaFileStream> MediaFileStream { get; set; }
public virtual DbSet<Metadata> Metadata { get; set; }
public virtual DbSet<MetadataProvider> MetadataProviders { get; set; }
public virtual DbSet<MetadataProviderId> MetadataProviderIds { get; set; }
public virtual DbSet<Movie> Movies { get; set; }
public virtual DbSet<MovieMetadata> MovieMetadata { get; set; }
public virtual DbSet<MusicAlbum> MusicAlbums { get; set; }
public virtual DbSet<MusicAlbumMetadata> MusicAlbumMetadata { get; set; }
public virtual DbSet<Permission> Permissions { get; set; }
public virtual DbSet<Person> People { get; set; }
public virtual DbSet<PersonRole> PersonRoles { get; set; }
public virtual DbSet<Photo> Photo { get; set; }
public virtual DbSet<PhotoMetadata> PhotoMetadata { get; set; }
public virtual DbSet<Preference> Preferences { get; set; }
public virtual DbSet<ProviderMapping> ProviderMappings { get; set; }
public virtual DbSet<Rating> Ratings { get; set; }
/// <summary>
/// Repository for global::Jellyfin.Data.Entities.RatingSource - This is the entity to
/// store review ratings, not age ratings
/// </summary>
public virtual DbSet<RatingSource> RatingSources { get; set; }
public virtual DbSet<Release> Releases { get; set; }
public virtual DbSet<Season> Seasons { get; set; }
public virtual DbSet<SeasonMetadata> SeasonMetadata { get; set; }
public virtual DbSet<Series> Series { get; set; }
public virtual DbSet<SeriesMetadata> SeriesMetadata { get; set; }
public virtual DbSet<Track> Tracks { get; set; }
public virtual DbSet<TrackMetadata> TrackMetadata { get; set; }
public virtual DbSet<User> Users { get; set; } */
/// <summary>
/// Gets or sets the default connection string.
/// </summary>
public static string ConnectionString { get; set; } = @"Data Source=jellyfin.db";
/// <inheritdoc />
public JellyfinDb(DbContextOptions<JellyfinDb> options) : base(options)
{
}
partial void CustomInit(DbContextOptionsBuilder optionsBuilder);
/// <inheritdoc />
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
{
CustomInit(optionsBuilder);
}
partial void OnModelCreatingImpl(ModelBuilder modelBuilder);
partial void OnModelCreatedImpl(ModelBuilder modelBuilder);
/// <inheritdoc />
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
OnModelCreatingImpl(modelBuilder);
modelBuilder.HasDefaultSchema("jellyfin");
/*modelBuilder.Entity<Artwork>().HasIndex(t => t.Kind);
modelBuilder.Entity<Genre>().HasIndex(t => t.Name)
.IsUnique();
modelBuilder.Entity<LibraryItem>().HasIndex(t => t.UrlId)
.IsUnique();*/
OnModelCreatedImpl(modelBuilder);
}
public override int SaveChanges()
{
foreach (var entity in ChangeTracker.Entries().Where(e => e.State == EntityState.Modified))
{
var saveEntity = entity.Entity as ISavingChanges;
saveEntity.OnSavingChanges();
}
return base.SaveChanges();
}
}
}

View File

@ -64,6 +64,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Controller.Tests",
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Data", "Jellyfin.Data\Jellyfin.Data.csproj", "{F03299F2-469F-40EF-A655-3766F97A5702}" Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Data", "Jellyfin.Data\Jellyfin.Data.csproj", "{F03299F2-469F-40EF-A655-3766F97A5702}"
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Jellyfin.Server.Implementations", "Jellyfin.Server.Implementations\Jellyfin.Server.Implementations.csproj", "{22C7DA3A-94F2-4E86-9CE6-86AB02B4F843}"
EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU Debug|Any CPU = Debug|Any CPU
@ -182,6 +184,10 @@ Global
{F03299F2-469F-40EF-A655-3766F97A5702}.Debug|Any CPU.Build.0 = Debug|Any CPU {F03299F2-469F-40EF-A655-3766F97A5702}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F03299F2-469F-40EF-A655-3766F97A5702}.Release|Any CPU.ActiveCfg = Release|Any CPU {F03299F2-469F-40EF-A655-3766F97A5702}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F03299F2-469F-40EF-A655-3766F97A5702}.Release|Any CPU.Build.0 = Release|Any CPU {F03299F2-469F-40EF-A655-3766F97A5702}.Release|Any CPU.Build.0 = Release|Any CPU
{22C7DA3A-94F2-4E86-9CE6-86AB02B4F843}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{22C7DA3A-94F2-4E86-9CE6-86AB02B4F843}.Debug|Any CPU.Build.0 = Debug|Any CPU
{22C7DA3A-94F2-4E86-9CE6-86AB02B4F843}.Release|Any CPU.ActiveCfg = Release|Any CPU
{22C7DA3A-94F2-4E86-9CE6-86AB02B4F843}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE