mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-03 04:42:52 +01:00
Remove constructor side effects and remove unneeded parameterless constructors
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
#pragma warning disable CA2227
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Jellyfin.Data.Interfaces;
|
||||
|
||||
@@ -14,30 +13,13 @@ namespace Jellyfin.Data.Entities.Libraries
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Track"/> class.
|
||||
/// </summary>
|
||||
/// <param name="album">The album.</param>
|
||||
public Track(MusicAlbum album)
|
||||
/// <param name="library">The library.</param>
|
||||
public Track(Library library) : base(library)
|
||||
{
|
||||
if (album == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(album));
|
||||
}
|
||||
|
||||
album.Tracks.Add(this);
|
||||
|
||||
Releases = new HashSet<Release>();
|
||||
TrackMetadata = new HashSet<TrackMetadata>();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Track"/> class.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Default constructor. Protected due to required properties, but present because EF needs it.
|
||||
/// </remarks>
|
||||
protected Track()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the track number.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user