Apply review suggestions

pull/3038/head
Patrick Barron 4 years ago
parent 2b41f8ab63
commit 55cfa96b9f

File diff suppressed because it is too large Load Diff

@ -1,15 +1,8 @@
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
{
[Table("Artwork")]
public partial class Artwork
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("Book")]
public partial class Book : LibraryItem
{
partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected Book() : base()
protected Book()
{
BookMetadata = new HashSet<BookMetadata>();
Releases = new HashSet<Release>();

@ -1,11 +1,6 @@
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
{
@ -16,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected BookMetadata() : base()
protected BookMetadata()
{
Publishers = new HashSet<Company>();

@ -1,15 +1,9 @@
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
{
[Table("Chapter")]
public partial class Chapter
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("Collection")]
public partial class Collection
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("CollectionItem")]
public partial class CollectionItem
{
partial void Init();

@ -1,15 +1,10 @@
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
{
[Table("Company")]
public partial class Company
{
partial void Init();

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

@ -1,11 +1,6 @@
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
{
@ -16,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected CustomItem() : base()
protected CustomItem()
{
CustomItemMetadata = new HashSet<CustomItemMetadata>();
Releases = new HashSet<Release>();

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

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

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

@ -1,15 +1,9 @@
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
{
[Table("Genre")]
public partial class Genre
{
partial void Init();

@ -1,15 +1,10 @@
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
{
[Table("Group")]
public partial class Group
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("Library")]
public partial class Library
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("LibraryItem")]
public abstract partial class LibraryItem
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("LibraryRoot")]
public partial class LibraryRoot
{
partial void Init();

@ -1,15 +1,10 @@
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
{
[Table("MediaFile")]
public partial class MediaFile
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("MediaFileStream")]
public partial class MediaFileStream
{
partial void Init();

@ -1,15 +1,10 @@
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
{
[Table("Metadata")]
public abstract partial class Metadata
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("MetadataProvider")]
public partial class MetadataProvider
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("MetadataProviderId")]
public partial class MetadataProviderId
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("Movie")]
public partial class Movie : LibraryItem
{
partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected Movie() : base()
protected Movie()
{
Releases = new HashSet<Release>();
MovieMetadata = new HashSet<MovieMetadata>();

@ -1,15 +1,10 @@
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
{
[Table("MovieMetadata")]
public partial class MovieMetadata : Metadata
{
partial void Init();
@ -17,7 +12,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected MovieMetadata() : base()
protected MovieMetadata()
{
Studios = new HashSet<Company>();

@ -1,15 +1,9 @@
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
{
[Table("MusicAlbum")]
public partial class MusicAlbum : LibraryItem
{
partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected MusicAlbum() : base()
protected MusicAlbum()
{
MusicAlbumMetadata = new HashSet<MusicAlbumMetadata>();
Tracks = new HashSet<Track>();

@ -1,15 +1,10 @@
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
{
[Table("MusicAlbumMetadata")]
public partial class MusicAlbumMetadata : Metadata
{
partial void Init();
@ -17,7 +12,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected MusicAlbumMetadata() : base()
protected MusicAlbumMetadata()
{
Labels = new HashSet<Company>();

@ -1,15 +1,11 @@
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
{
[Table("Permission")]
public partial class Permission
{
partial void Init();

@ -1,15 +1,10 @@
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
{
[Table("Person")]
public partial class Person
{
partial void Init();

@ -1,15 +1,10 @@
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
{
[Table("PersonRole")]
public partial class PersonRole
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("Photo")]
public partial class Photo : LibraryItem
{
partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected Photo() : base()
protected Photo()
{
PhotoMetadata = new HashSet<PhotoMetadata>();
Releases = new HashSet<Release>();

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

@ -1,15 +1,9 @@
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
{
[Table("Preference")]
public partial class Preference
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("ProviderMapping")]
public partial class ProviderMapping
{
partial void Init();

@ -1,15 +1,9 @@
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
{
[Table("Rating")]
public partial class Rating
{
partial void Init();

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

@ -1,15 +1,10 @@
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
{
[Table("Release")]
public partial class Release
{
partial void Init();

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

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

@ -1,15 +1,9 @@
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
{
[Table("Series")]
public partial class Series : LibraryItem
{
partial void Init();
@ -17,7 +11,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected Series() : base()
protected Series()
{
SeriesMetadata = new HashSet<SeriesMetadata>();
Seasons = new HashSet<Season>();

@ -1,15 +1,10 @@
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
{
[Table("SeriesMetadata")]
public partial class SeriesMetadata : Metadata
{
partial void Init();
@ -17,7 +12,7 @@ namespace Jellyfin.Data.Entities
/// <summary>
/// Default constructor. Protected due to required properties, but present because EF needs it.
/// </summary>
protected SeriesMetadata() : base()
protected SeriesMetadata()
{
Networks = new HashSet<Company>();

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

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

@ -1,15 +1,10 @@
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
{
[Table("User")]
public partial class User
{
partial void Init();

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

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

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

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

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

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

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

@ -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>

@ -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();
}
}
}

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

Loading…
Cancel
Save