|
|
|
@ -1,15 +1,6 @@
|
|
|
|
|
using Model.Stub;
|
|
|
|
|
using System.Diagnostics.Metrics;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Xml;
|
|
|
|
|
using System.Xml;
|
|
|
|
|
using System.Xml.Linq;
|
|
|
|
|
using System.Xml.Serialization;
|
|
|
|
|
using static System.Reflection.Metadata.BlobBuilder;
|
|
|
|
|
using System.Reflection.Metadata;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
using System.Reflection.Emit;
|
|
|
|
|
|
|
|
|
|
namespace Model.Serialization;
|
|
|
|
|
|
|
|
|
@ -460,7 +451,7 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InfoTitle? infoTitle = GetInfoTitleByUrl(title);
|
|
|
|
|
InfoTitle? infoTitle = GetInfoTitleByName(title);
|
|
|
|
|
|
|
|
|
|
if (infoTitle == null)
|
|
|
|
|
{
|
|
|
|
@ -607,11 +598,11 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
else return Genre.K_POP;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public InfoTitle? GetInfoTitleByUrl(string url)
|
|
|
|
|
public InfoTitle? GetInfoTitleByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach(InfoTitle it in infoTitles)
|
|
|
|
|
{
|
|
|
|
|
if (it.Name == url)
|
|
|
|
|
if (it.Name == name)
|
|
|
|
|
{
|
|
|
|
|
return it;
|
|
|
|
|
}
|
|
|
|
@ -631,11 +622,11 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Album? GetAlbumByUrl(string url)
|
|
|
|
|
public Album? GetAlbumByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach(Album a in albums)
|
|
|
|
|
{
|
|
|
|
|
if (a.ImageURL == url)
|
|
|
|
|
if (a.Name == name)
|
|
|
|
|
{
|
|
|
|
|
return a;
|
|
|
|
|
}
|
|
|
|
@ -695,11 +686,11 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Playlist? GetPlaylistByUrl(string url)
|
|
|
|
|
public Playlist? GetPlaylistByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach(Playlist p in playlists)
|
|
|
|
|
{
|
|
|
|
|
if (p.ImageURL == url)
|
|
|
|
|
if (p.Name == name)
|
|
|
|
|
{
|
|
|
|
|
return p;
|
|
|
|
|
}
|
|
|
|
@ -737,9 +728,9 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
title.Genre = genre;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateInfoTitleByName(string url, string name, string newUrl, string info, Artist artist, string description, Genre genre)
|
|
|
|
|
public void UpdateInfoTitleByName(string name, string newUrl, string info, Artist artist, string description, Genre genre)
|
|
|
|
|
{
|
|
|
|
|
InfoTitle? title = GetInfoTitleByUrl(url);
|
|
|
|
|
InfoTitle? title = GetInfoTitleByName(name);
|
|
|
|
|
if (title != null)
|
|
|
|
|
{
|
|
|
|
|
title.Name = name;
|
|
|
|
@ -765,9 +756,9 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
title.Genre = genre;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateInfoTitleByNameByArtistName(string url, string name, string newUrl, string info, string artist, string description, Genre genre)
|
|
|
|
|
public void UpdateInfoTitleByNameByArtistName(string name, string newUrl, string info, string artist, string description, Genre genre)
|
|
|
|
|
{
|
|
|
|
|
InfoTitle? title = GetInfoTitleByUrl(url);
|
|
|
|
|
InfoTitle? title = GetInfoTitleByName(name);
|
|
|
|
|
if (title != null)
|
|
|
|
|
{
|
|
|
|
|
title.Name = name;
|
|
|
|
@ -792,9 +783,9 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
album.Information = info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateAlbumByUrl(string url, string name, string newUrl, Artist artist, string description, string info)
|
|
|
|
|
public void UpdateAlbumByName(string name, string newUrl, Artist artist, string description, string info)
|
|
|
|
|
{
|
|
|
|
|
Album? album = GetAlbumByUrl(url);
|
|
|
|
|
Album? album = GetAlbumByName(name);
|
|
|
|
|
if (album != null)
|
|
|
|
|
{
|
|
|
|
|
album.Name = name;
|
|
|
|
@ -818,9 +809,9 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
album.Information = info;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdateAlbumByUrlByArtistName(string url, string name, string newUrl, string artist, string description, string info)
|
|
|
|
|
public void UpdateAlbumByNameByArtistName(string name, string newUrl, string artist, string description, string info)
|
|
|
|
|
{
|
|
|
|
|
Album? album = GetAlbumByUrl(url);
|
|
|
|
|
Album? album = GetAlbumByName(name);
|
|
|
|
|
if (album != null)
|
|
|
|
|
{
|
|
|
|
|
album.Name = name;
|
|
|
|
@ -842,9 +833,9 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
playlist.ImageURL = url;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void UpdatePlaylistByUrl(string url, string name, string description, string newUrl)
|
|
|
|
|
public void UpdatePlaylistByName(string name, string description, string newUrl)
|
|
|
|
|
{
|
|
|
|
|
Playlist? playlist = GetPlaylistByUrl(url);
|
|
|
|
|
Playlist? playlist = GetPlaylistByName(name);
|
|
|
|
|
if (playlist != null)
|
|
|
|
|
{
|
|
|
|
|
playlist.Name = name;
|
|
|
|
@ -919,11 +910,11 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool ExistsPlaylistByUrl(string url)
|
|
|
|
|
public bool ExistsPlaylistByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach(Playlist p in playlists)
|
|
|
|
|
{
|
|
|
|
|
if (p.ImageURL == url)
|
|
|
|
|
if (p.Name == name)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -943,11 +934,11 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool ExistsAlbumByUrl(string url)
|
|
|
|
|
public bool ExistsAlbumByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach(Album a in albums)
|
|
|
|
|
{
|
|
|
|
|
if (a.ImageURL == url)
|
|
|
|
|
if (a.Name == name)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
@ -1015,11 +1006,11 @@ public class LinqXmlSerialization : IDataManager
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool ExistsInfoTitleByUrl(string url)
|
|
|
|
|
public bool ExistsInfoTitleByName(string name)
|
|
|
|
|
{
|
|
|
|
|
foreach(InfoTitle it in infoTitles)
|
|
|
|
|
{
|
|
|
|
|
if(it.ImageURL == url)
|
|
|
|
|
if(it.Name == name)
|
|
|
|
|
{
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|