|
|
|
@ -479,9 +479,9 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Retourne l'objet InfoTitle avec un nom équivalent à celui donné en paramètre</returns>
|
|
|
|
|
public InfoTitle GetInfoTitleByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (InfoTitle it in infoTitles.Where(it => it.Name.Equals(name)))
|
|
|
|
|
if (infoTitles.Any(it => it.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
return it;
|
|
|
|
|
return infoTitles.Where(it => it.Name.Equals(name)).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -493,9 +493,9 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Retourne l'objet Artist avec un nom équivalent à celui donné en paramètre</returns>
|
|
|
|
|
public Artist GetArtistByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (Artist a in artists.Where(artist => artist.Name.Equals(name)))
|
|
|
|
|
if (artists.Any(artist => artist.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
return a;
|
|
|
|
|
return artists.Where(artist => artist.Name.Equals(name)).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -507,9 +507,9 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Retourne l'objet Album avec un nom équivalent à celui donné en paramètre</returns>
|
|
|
|
|
public Album GetAlbumByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (Album a in albums.Where(a => a.Name.Equals(name)))
|
|
|
|
|
if (albums.Any(a => a.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
return a;
|
|
|
|
|
return albums.Where(a => a.Name.Equals(name)).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -521,9 +521,9 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Retourne l'objet Album avec un ID équivalent à celui donné en paramètre</returns>
|
|
|
|
|
public Album GetAlbumById(long id)
|
|
|
|
|
{
|
|
|
|
|
foreach (Album a in albums.Where(a => a.ID == id))
|
|
|
|
|
if (albums.Any(a => a.ID == id))
|
|
|
|
|
{
|
|
|
|
|
return a;
|
|
|
|
|
return albums.Where(a => a.ID == id).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -535,9 +535,9 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Retourne l'objet CustomTitle avec un chemin d'accès équivalent à celui donné en paramètre</returns>
|
|
|
|
|
public CustomTitle GetCustomTitleByPath(string custom)
|
|
|
|
|
{
|
|
|
|
|
foreach (CustomTitle customTitle in customTitles.Where(customTitle => customTitle.Path.Equals(custom)))
|
|
|
|
|
if (customTitles.Any(customTitle => customTitle.Path.Equals(custom)))
|
|
|
|
|
{
|
|
|
|
|
return customTitle;
|
|
|
|
|
return customTitles.Where(customTitle => customTitle.Path.Equals(custom)).FirstOrDefault();
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -609,7 +609,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Retourne l'objet Playlist avec un nom équivalent à celui donné en paramètre</returns>
|
|
|
|
|
public Playlist GetPlaylistByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (Playlist p in playlists.Where(p => p.Name.Equals(name)))
|
|
|
|
|
if (playlists.Any(p => p.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
@ -901,7 +901,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
|
|
|
|
|
public bool ExistsPlaylist(Playlist playlist)
|
|
|
|
|
{
|
|
|
|
|
foreach (Playlist p in playlists.Where(p => p.Equals(playlist)))
|
|
|
|
|
if (playlists.Any(p => p.Equals(playlist)))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -915,7 +915,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
|
|
|
|
|
public bool ExistsPlaylistByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (Playlist p in playlists.Where(p => p.Name.Equals(name)))
|
|
|
|
|
if (playlists.Any(p => p.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -929,7 +929,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
|
|
|
|
|
public bool ExistsAlbum(Album album)
|
|
|
|
|
{
|
|
|
|
|
foreach (Album a in albums.Where(a => a.Equals(album)))
|
|
|
|
|
if (albums.Any(a => a.Equals(album)))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -943,7 +943,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
|
|
|
|
|
public bool ExistsAlbumByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (Album a in albums.Where(a => a.Name.Equals(name)))
|
|
|
|
|
if (albums.Any(a => a.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -957,7 +957,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
|
|
|
|
|
public bool ExistsArtist(Artist artist)
|
|
|
|
|
{
|
|
|
|
|
foreach (Artist a in artists.Where(a => a.Equals(artist)))
|
|
|
|
|
if (artists.Any(a => a.Equals(artist)))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -971,7 +971,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
|
|
|
|
|
public bool ExistsArtistByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (Artist a in artists.Where(a => a.Name.Equals(name)))
|
|
|
|
|
if (artists.Any(a => a.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -985,7 +985,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
|
|
|
|
|
public bool ExistsCustomTitle(CustomTitle title)
|
|
|
|
|
{
|
|
|
|
|
foreach (CustomTitle ct in customTitles.Where(ct => title.Equals(ct)))
|
|
|
|
|
if (customTitles.Any(ct => title.Equals(ct)))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -999,7 +999,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
|
|
|
|
|
public bool ExistsCustomTitleByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (CustomTitle ct in customTitles.Where(ct => ct.Name.Equals(name)))
|
|
|
|
|
if (customTitles.Any(ct => ct.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -1013,7 +1013,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
|
|
|
|
|
public bool ExistsInfoTitle(InfoTitle title)
|
|
|
|
|
{
|
|
|
|
|
foreach (InfoTitle it in infoTitles.Where(it => it.Equals(title)))
|
|
|
|
|
if (infoTitles.Any(it => it.Equals(title)))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -1027,7 +1027,7 @@ namespace Model.Serialization
|
|
|
|
|
/// <returns>Booléen True s'il est contenu dans l'application, False sinon</returns>
|
|
|
|
|
public bool ExistsInfoTitleByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach (InfoTitle it in infoTitles.Where(it => it.Name.Equals(name)))
|
|
|
|
|
if (infoTitles.Any(it => it.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|