diff --git a/Sources/Model/InfoTitle.cs b/Sources/Model/InfoTitle.cs index 1bb263e..2330477 100644 --- a/Sources/Model/InfoTitle.cs +++ b/Sources/Model/InfoTitle.cs @@ -7,8 +7,6 @@ public class InfoTitle : Title { public Artist Artist { get; set; } - private Artist artist = new Artist(); - public string Description { get => description; @@ -38,7 +36,7 @@ public class InfoTitle : Title public InfoTitle(string name, string imageURL, string information, Artist artist, string description, Genre genre) : base(name,imageURL,information) { - this.artist = artist; + Artist = artist; Description = description; Genre = genre; } diff --git a/Sources/Model/Playlist.cs b/Sources/Model/Playlist.cs index 25dd7eb..a1d5727 100644 --- a/Sources/Model/Playlist.cs +++ b/Sources/Model/Playlist.cs @@ -89,29 +89,11 @@ public class Playlist private int index = 0; - public bool Shuffle - { - get => shuffle; - set { shuffle = value; } - } - - private bool shuffle = false; + public bool Shuffle { get; set; } = false; - public bool Loop - { - get => loop; - set { loop = value; } - } - - private bool loop = false; - - public bool LoopTitle - { - get => loopTitle; - set { loopTitle = value; } - } + public bool Loop { get; set; } = false; - private bool loopTitle = false; + public bool LoopTitle { get; set; } = false; private readonly List played = new List(); @@ -221,7 +203,7 @@ public class Playlist return $"Name : {Name}"; } - int RandomGenerator(int n) + static int RandomGenerator(int n) { RandomNumberGenerator rng = RandomNumberGenerator.Create(); byte[] randomBytes = new byte[4]; diff --git a/Sources/Model/Serialization/LINQ_XML_Serialization.cs b/Sources/Model/Serialization/LINQ_XML_Serialization.cs index c0a4b44..63b9261 100644 --- a/Sources/Model/Serialization/LINQ_XML_Serialization.cs +++ b/Sources/Model/Serialization/LINQ_XML_Serialization.cs @@ -11,7 +11,7 @@ using System.IO; namespace Model.Serialization; -public class Linq_Xml_Serialization : IDataManager +public class LinqXmlSerialization : IDataManager { private static string XMLPATH = Path.Combine(Environment.CurrentDirectory, "Data"); @@ -75,7 +75,7 @@ public class Linq_Xml_Serialization : IDataManager } } - public Linq_Xml_Serialization() + public LinqXmlSerialization() { playlists = new List(); artists = new List(); @@ -562,7 +562,7 @@ public class Linq_Xml_Serialization : IDataManager } } } - public Genre GetGenreByName(string genre) + public static Genre GetGenreByName(string genre) { if (genre == "HIP_HOP") return Genre.HIP_HOP; if (genre == "POP") return Genre.POP; diff --git a/Sources/Model/Stub/StubInfoTitle.cs b/Sources/Model/Stub/StubInfoTitle.cs index 7e32d4b..3ee4cf2 100644 --- a/Sources/Model/Stub/StubInfoTitle.cs +++ b/Sources/Model/Stub/StubInfoTitle.cs @@ -60,11 +60,11 @@ public class StubInfoTitle { infoTitles.Remove(title); } - public void AddFeat(InfoTitle infoTitle, Artist artist) + public static void AddFeat(InfoTitle infoTitle, Artist artist) { infoTitle.AddFeat(artist); } - public void RemoveFeat(InfoTitle infoTitle, Artist artist) + public static void RemoveFeat(InfoTitle infoTitle, Artist artist) { infoTitle.RemoveFeat(artist); } diff --git a/Sources/Model/Stub/StubManager.cs b/Sources/Model/Stub/StubManager.cs index 91d1431..ce74617 100644 --- a/Sources/Model/Stub/StubManager.cs +++ b/Sources/Model/Stub/StubManager.cs @@ -148,12 +148,12 @@ public class StubManager : IDataManager public void LoadSerialization() { - + // Doesn't do anything because it's Stubs } public void SaveSerialization() { - + // Doesn't do anything because it's Stubs } public CustomTitle? GetCustomTitleByUrl(string custom) diff --git a/Sources/TestUnitaires/TU_Manager.cs b/Sources/TestUnitaires/TU_Manager.cs index d4fc553..026112e 100644 --- a/Sources/TestUnitaires/TU_Manager.cs +++ b/Sources/TestUnitaires/TU_Manager.cs @@ -15,7 +15,7 @@ namespace TestUnitaires [InlineData("Réference")] public void TU_Methods(string? test) { - IDataManager DataManager = new Linq_Xml_Serialization(); + IDataManager DataManager = new LinqXmlSerialization(); Playlist p = new Playlist(test, "PlaceHolder", "place.holder"); Album album = new Album(test, "place.holder", new Artist("test"), "PlaceHolder", "PlaceHolder"); CustomTitle t = new CustomTitle(test, "test. mp3", "Banger", "path");