mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-04-25 19:44:43 +01:00
Remove constructor side effects and remove unneeded parameterless constructors
This commit is contained in:
@@ -19,8 +19,7 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// </summary>
|
||||
/// <param name="path">The path relative to the LibraryRoot.</param>
|
||||
/// <param name="kind">The file kind.</param>
|
||||
/// <param name="release">The release.</param>
|
||||
public MediaFile(string path, MediaFileKind kind, Release release)
|
||||
public MediaFile(string path, MediaFileKind kind)
|
||||
{
|
||||
if (string.IsNullOrEmpty(path))
|
||||
{
|
||||
@@ -30,26 +29,9 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
Path = path;
|
||||
Kind = kind;
|
||||
|
||||
if (release == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(release));
|
||||
}
|
||||
|
||||
release.MediaFiles.Add(this);
|
||||
|
||||
MediaFileStreams = new HashSet<MediaFileStream>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="MediaFile"/> class.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default constructor. Protected due to required properties, but present because EF needs it.
|
||||
/// </remarks>
|
||||
protected MediaFile()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the id.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user