|
|
|
@ -479,12 +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)
|
|
|
|
|
foreach (InfoTitle it in infoTitles.Where(it => it.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
if (it.Name.Equals(name))
|
|
|
|
|
{
|
|
|
|
|
return it;
|
|
|
|
|
}
|
|
|
|
|
return it;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -496,12 +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)
|
|
|
|
|
foreach (Artist a in artists.Where(artist => artist.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
if (a.Name.Equals(name))
|
|
|
|
|
{
|
|
|
|
|
return a;
|
|
|
|
|
}
|
|
|
|
|
return a;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -513,12 +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)
|
|
|
|
|
foreach (Album a in albums.Where(a => a.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
if (a.Name.Equals(name))
|
|
|
|
|
{
|
|
|
|
|
return a;
|
|
|
|
|
}
|
|
|
|
|
return a;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -530,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)
|
|
|
|
|
foreach (Album a in albums.Where(a => a.ID == id))
|
|
|
|
|
{
|
|
|
|
|
if (a.ID == id) return a;
|
|
|
|
|
return a;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -544,12 +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)
|
|
|
|
|
foreach (CustomTitle customTitle in customTitles.Where(customTitle => customTitle.Path.Equals(custom)))
|
|
|
|
|
{
|
|
|
|
|
if (customTitle.Path.Equals(custom))
|
|
|
|
|
{
|
|
|
|
|
return customTitle;
|
|
|
|
|
}
|
|
|
|
|
return customTitle;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -621,12 +609,9 @@ 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)
|
|
|
|
|
foreach (Playlist p in playlists.Where(p => p.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
if (p.Name.Equals(name))
|
|
|
|
|
{
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
@ -916,12 +901,9 @@ 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)
|
|
|
|
|
foreach (Playlist p in playlists.Where(p => p.Equals(playlist)))
|
|
|
|
|
{
|
|
|
|
|
if (p.Equals(playlist))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -933,12 +915,9 @@ 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)
|
|
|
|
|
foreach (Playlist p in playlists.Where(p => p.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
if (p.Name.Equals(name))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -950,12 +929,9 @@ 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)
|
|
|
|
|
foreach (Album a in albums.Where(a => a.Equals(album)))
|
|
|
|
|
{
|
|
|
|
|
if (a.Equals(album))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -967,12 +943,9 @@ 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)
|
|
|
|
|
foreach (Album a in albums.Where(a => a.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
if (a.Name.Equals(name))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -984,12 +957,9 @@ 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)
|
|
|
|
|
foreach (Artist a in artists.Where(a => a.Equals(artist)))
|
|
|
|
|
{
|
|
|
|
|
if (a.Equals(artist))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -1001,12 +971,9 @@ 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)
|
|
|
|
|
foreach (Artist a in artists.Where(a => a.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
if (a.Name.Equals(name))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -1018,12 +985,9 @@ 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)
|
|
|
|
|
foreach (CustomTitle ct in customTitles.Where(ct => title.Equals(ct)))
|
|
|
|
|
{
|
|
|
|
|
if (title.Equals(ct))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -1035,12 +999,9 @@ 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)
|
|
|
|
|
foreach (CustomTitle ct in customTitles.Where(ct => ct.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
if (ct.Name.Equals(name))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -1052,12 +1013,9 @@ 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)
|
|
|
|
|
foreach (InfoTitle it in infoTitles.Where(it => it.Equals(title)))
|
|
|
|
|
{
|
|
|
|
|
if (it.Equals(title))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -1069,12 +1027,9 @@ 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)
|
|
|
|
|
foreach (InfoTitle it in infoTitles.Where(it => it.Name.Equals(name)))
|
|
|
|
|
{
|
|
|
|
|
if (it.Name.Equals(name))
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|