Fix Minor issues
continuous-integration/drone/push Build is failing Details

pull/16/head
Corentin LEMAIRE 2 years ago
parent 94cb705c52
commit 099892fcf0

@ -5,17 +5,7 @@ namespace Model;
public class InfoTitle : Title
{
public Artist Artist
{
get
{
return artist;
}
set
{
artist = value;
}
}
public Artist Artist { get; set; }
private Artist artist = new Artist();

@ -14,7 +14,7 @@ public class Manager
public IDataManager DataManager { get; set; }
private List<Album> albums = new List<Album>();
private List<Album> albums;
public IEnumerable<Album> Albums
{
@ -24,7 +24,7 @@ public class Manager
}
}
private List<CustomTitle> customTitles = new List<CustomTitle>();
private List<CustomTitle> customTitles;
public IEnumerable<CustomTitle> CustomTitles
{
@ -34,7 +34,7 @@ public class Manager
}
}
private List<InfoTitle> infoTitles = new List<InfoTitle>();
private List<InfoTitle> infoTitles;
public IEnumerable<InfoTitle> InfoTitles
{
@ -44,7 +44,7 @@ public class Manager
}
}
private List<Playlist> playlists = new List<Playlist>();
private List<Playlist> playlists;
public IEnumerable<Playlist> Playlists
{
@ -54,7 +54,7 @@ public class Manager
}
}
private List<Artist> artists = new List<Artist>();
private List<Artist> artists;
public IEnumerable<Artist> Artists
{

@ -84,20 +84,34 @@ public class Playlist
{
index = 0;
}
else
{
return;
}
}
}
private int index = 0;
public bool Shuffle = false;
public bool Shuffle
{
get => shuffle;
set { shuffle = value; }
}
private bool shuffle = false;
public bool Loop = false;
public bool Loop
{
get => loop;
set { loop = value; }
}
private bool loop = false;
public bool LoopTitle
{
get => loopTitle;
set { loopTitle = value; }
}
public bool LoopTitle = false;
private bool loopTitle = false;
private readonly List<int> played = new List<int>();
@ -167,7 +181,7 @@ public class Playlist
}
else
{
if (played.Count == 0)
if (!played.Any())
{
return;
}

@ -11,7 +11,7 @@ using System.IO;
namespace Model.Serialization;
public class LINQ_XML_Serialization : IDataManager
public class Linq_Xml_Serialization : 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 Linq_Xml_Serialization()
{
playlists = new List<Playlist>();
artists = new List<Artist>();
@ -195,7 +195,7 @@ public class LINQ_XML_Serialization : IDataManager
new XAttribute("Name", p.Name),
new XElement("Description", p.Description),
new XElement("ImageURL", p.ImageURL),
new XElement("Titles", p.Titles.Count() > 0 ? p.Titles.Select(a => a.ImageURL).Aggregate((albumUrl, nextAlbum) => albumUrl + " " + nextAlbum) : "")
new XElement("Titles", p.Titles.Any() ? p.Titles.Select(a => a.ImageURL).Aggregate((albumUrl, nextAlbum) => albumUrl + " " + nextAlbum) : "")
));
PlaylistFile.Add(new XElement("Playlists", playlist));
@ -247,7 +247,7 @@ public class LINQ_XML_Serialization : IDataManager
new XAttribute("Name", playlist.Name),
new XElement("Description", playlist.Description),
new XElement("ImageURL", playlist.ImageURL),
new XElement("Titles", playlist.Titles.Count() > 0 ? playlist.Titles.Select(p => p.ImageURL).Aggregate((playlistUrl, nextPlaylist) => playlistUrl + " " + nextPlaylist) : "")
new XElement("Titles", playlist.Titles.Any() ? playlist.Titles.Select(p => p.ImageURL).Aggregate((playlistUrl, nextPlaylist) => playlistUrl + " " + nextPlaylist) : "")
));
PlaylistsFichier.Add(new XElement("Playlists", playlist));
@ -398,10 +398,10 @@ public class LINQ_XML_Serialization : IDataManager
var album = albums.Select(p => new XElement("Album",
new XAttribute("Name", p.Name),
new XElement("ImageURL", p.ImageURL),
new XElement("Artist", p.Titles.Count() > 0 ? p.Titles.Select(a => a.Name).Aggregate((artistName, nextArtist) => artistName + " " + nextArtist) : ""),
new XElement("Artist", p.Titles.Any() ? p.Titles.Select(a => a.Name).Aggregate((artistName, nextArtist) => artistName + " " + nextArtist) : ""),
new XElement("Description", p.Description),
new XElement("Information", p.Information),
new XElement("Titles", p.Titles.Count() > 0 ? p.Titles.Select(a => a.ImageURL).Aggregate((albumUrl, nextAlbum) => albumUrl + " " + nextAlbum) : "")
new XElement("Titles", p.Titles.Any() ? p.Titles.Select(a => a.ImageURL).Aggregate((albumUrl, nextAlbum) => albumUrl + " " + nextAlbum) : "")
));
AlbumFile.Add(new XElement("Albums", album));
@ -460,7 +460,7 @@ public class LINQ_XML_Serialization : IDataManager
new XElement("Artist", a.Artist.Name),
new XElement("Description", a.Description),
new XElement("Information", a.Information),
new XElement("Titles", a.Titles.Count() > 0 ? a.Titles.Select(p => p.ImageURL).Aggregate((albumUrl, nextAlbum) => albumUrl + " " + nextAlbum) : "")
new XElement("Titles", a.Titles.Any() ? a.Titles.Select(p => p.ImageURL).Aggregate((albumUrl, nextAlbum) => albumUrl + " " + nextAlbum) : "")
));
AlbumsFile.Add(new XElement("Albums", album));
@ -488,7 +488,7 @@ public class LINQ_XML_Serialization : IDataManager
new XAttribute("Name", p.Name),
new XElement("ImageURL", p.ImageURL),
new XElement("Information", p.Information),
new XElement("Feats", p.Feat.Count() > 0 ? p.Feat.Select(a => a.Name).Aggregate((artistName, nextArtist) => artistName + " " + nextArtist) : ""),
new XElement("Feats", p.Feat.Any() ? p.Feat.Select(a => a.Name).Aggregate((artistName, nextArtist) => artistName + " " + nextArtist) : ""),
new XElement("Description", p.Description),
new XElement("Genre", p.Genre)
));
@ -547,7 +547,7 @@ public class LINQ_XML_Serialization : IDataManager
new XElement("Information", it.Information),
new XElement("Genre", it.Genre.ToString()),
new XElement("Description", it.Description),
new XElement("Feats", it.Feat.Count() > 0 ? it.Feat.Select(p => p.Name).Aggregate((featName, nextFeat) => featName + " " + nextFeat) : "")
new XElement("Feats", it.Feat.Any() ? it.Feat.Select(p => p.Name).Aggregate((featName, nextFeat) => featName + " " + nextFeat) : "")
));
InfosFile.Add(new XElement("InfoTitles", info));

@ -148,12 +148,12 @@ public class StubManager : IDataManager
public void LoadSerialization()
{
return;
}
public void SaveSerialization()
{
return;
}
public CustomTitle? GetCustomTitleByUrl(string custom)

Loading…
Cancel
Save