diff --git a/Sources/Linaris.sln b/Sources/Linaris.sln
index 45bb19a..8627edb 100644
--- a/Sources/Linaris.sln
+++ b/Sources/Linaris.sln
@@ -4,16 +4,13 @@ Microsoft Visual Studio Solution File, Format Version 12.00
VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Linaris", "Linaris\Linaris.csproj", "{9E6281F7-95F6-472C-B268-894CE377C8A9}"
- ProjectSection(ProjectDependencies) = postProject
- {AA1DB94B-8273-437F-A07A-BB1F5F0D278D} = {AA1DB94B-8273-437F-A07A-BB1F5F0D278D}
- EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Console", "Console\Console.csproj", "{BB50C1E3-5A9A-40AF-8CD7-55B41064290B}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Model\Model.csproj", "{AA1DB94B-8273-437F-A07A-BB1F5F0D278D}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestUnitaires", "TestUnitaires\TestUnitaires.csproj", "{8B0671CF-1302-4244-8837-916E632007E2}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Model", "Model\Model.csproj", "{275B609D-6073-4122-B9F8-1373F76565B2}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -30,14 +27,14 @@ Global
{BB50C1E3-5A9A-40AF-8CD7-55B41064290B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BB50C1E3-5A9A-40AF-8CD7-55B41064290B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BB50C1E3-5A9A-40AF-8CD7-55B41064290B}.Release|Any CPU.Build.0 = Release|Any CPU
- {AA1DB94B-8273-437F-A07A-BB1F5F0D278D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {AA1DB94B-8273-437F-A07A-BB1F5F0D278D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {AA1DB94B-8273-437F-A07A-BB1F5F0D278D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {AA1DB94B-8273-437F-A07A-BB1F5F0D278D}.Release|Any CPU.Build.0 = Release|Any CPU
{8B0671CF-1302-4244-8837-916E632007E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8B0671CF-1302-4244-8837-916E632007E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8B0671CF-1302-4244-8837-916E632007E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8B0671CF-1302-4244-8837-916E632007E2}.Release|Any CPU.Build.0 = Release|Any CPU
+ {275B609D-6073-4122-B9F8-1373F76565B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {275B609D-6073-4122-B9F8-1373F76565B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {275B609D-6073-4122-B9F8-1373F76565B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {275B609D-6073-4122-B9F8-1373F76565B2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/Sources/Linaris/App.xaml.cs b/Sources/Linaris/App.xaml.cs
index e0f54a0..eaea099 100644
--- a/Sources/Linaris/App.xaml.cs
+++ b/Sources/Linaris/App.xaml.cs
@@ -18,6 +18,11 @@ public partial class App : Application
var Window = base.CreateWindow(activationState);
+ Window.Destroying += (sender, eventArgs) =>
+ {
+ Manager.SaveSerialization();
+ };
+
Window.Stopped += (sender, eventArgs) =>
{
Manager.SaveSerialization();
diff --git a/Sources/Linaris/Platforms/Android/AndroidManifest.xml b/Sources/Linaris/Platforms/Android/AndroidManifest.xml
index ee07413..ec020fe 100644
--- a/Sources/Linaris/Platforms/Android/AndroidManifest.xml
+++ b/Sources/Linaris/Platforms/Android/AndroidManifest.xml
@@ -3,5 +3,6 @@
+
\ No newline at end of file
diff --git a/Sources/Model/Album.cs b/Sources/Model/Album.cs
index 3beee9a..bc1cac5 100644
--- a/Sources/Model/Album.cs
+++ b/Sources/Model/Album.cs
@@ -125,7 +125,7 @@ namespace Model
infoTitles.Remove(title);
}
- public override bool Equals(object? obj)
+ public override bool Equals(object obj)
{
if (obj is null) return false;
if (obj.GetType() != typeof(Album)) return false;
diff --git a/Sources/Model/Artist.cs b/Sources/Model/Artist.cs
index ac71c24..a97b7fe 100644
--- a/Sources/Model/Artist.cs
+++ b/Sources/Model/Artist.cs
@@ -30,7 +30,7 @@ public class Artist
}
- public override bool Equals(object? obj)
+ public override bool Equals(object obj)
{
if(obj == null) return false;
if(obj.GetType() != typeof(Artist)) return false;
diff --git a/Sources/Model/CustomTitle.cs b/Sources/Model/CustomTitle.cs
index 50b9054..a940115 100644
--- a/Sources/Model/CustomTitle.cs
+++ b/Sources/Model/CustomTitle.cs
@@ -75,10 +75,10 @@ public class CustomTitle : Title, INotifyPropertyChanged
public CustomTitle() : base(Manager.DEFAULT_NAME, Manager.DEFAULT_URL, Manager.DEFAULT_DESC) { }
- public bool Equals(CustomTitle? other)
+ public bool Equals(CustomTitle other)
=> Path.Equals(other?.Path);
- public override bool Equals(object? obj)
+ public override bool Equals(object obj)
{
if (ReferenceEquals(obj, null)) return false;
if (ReferenceEquals(this, obj)) return true;
diff --git a/Sources/Model/Data/customs.xml b/Sources/Model/Data/customs.xml
deleted file mode 100644
index 3f6b639..0000000
--- a/Sources/Model/Data/customs.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-
-
-
- none.png
-
- D:\Musique\Création\croissant.mp3
-
-
- none.png
-
- D:\Musique\Création\emma.mp3
-
-
- none.png
-
- D:\Musique\Création\Emma-.mp3
-
-
- none.png
-
- D:\Musique\Création\heaven.mp3
-
-
- none.png
-
- D:\Musique\Création\winter.mp3
-
-
\ No newline at end of file
diff --git a/Sources/Model/Data/playlists.xml b/Sources/Model/Data/playlists.xml
deleted file mode 100644
index d378e0c..0000000
--- a/Sources/Model/Data/playlists.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
- D:\Images\blackcat.gif
- D:\Musique\Création\emma.mp3 D:\Musique\Création\croissant.mp3 D:\Musique\Création\Emma-.mp3 D:\Musique\Création\heaven.mp3 D:\Musique\Création\winter.mp3 D:\Musique\Création\emma.mp3
-
-
-
- none.png
- D:\Musique\Création\emma.mp3
-
-
\ No newline at end of file
diff --git a/Sources/Model/IDataManager.cs b/Sources/Model/IDataManager.cs
index d871037..0d6e647 100644
--- a/Sources/Model/IDataManager.cs
+++ b/Sources/Model/IDataManager.cs
@@ -28,25 +28,25 @@ public interface IDataManager
// Read
ObservableCollection GetCustomTitles();
- CustomTitle? GetCustomTitleByPath(string custom);
+ CustomTitle GetCustomTitleByPath(string custom);
ObservableCollection GetInfoTitles();
- InfoTitle? GetInfoTitleByName(string name);
+ InfoTitle GetInfoTitleByName(string name);
ObservableCollection GetAlbums();
- Album? GetAlbumByName(string name);
+ Album GetAlbumByName(string name);
- Album? GetAlbumById(long id);
+ Album GetAlbumById(long id);
List GetArtists();
- Artist? GetArtistByName(string name);
+ Artist GetArtistByName(string name);
ObservableCollection GetPlaylists();
- Playlist? GetPlaylistByName(string name);
+ Playlist GetPlaylistByName(string name);
// Update
diff --git a/Sources/Model/InfoTitle.cs b/Sources/Model/InfoTitle.cs
index 2f5a86c..fd4ea14 100644
--- a/Sources/Model/InfoTitle.cs
+++ b/Sources/Model/InfoTitle.cs
@@ -67,7 +67,7 @@ public class InfoTitle : Title
}
}
- public override bool Equals(object? obj)
+ public override bool Equals(object obj)
{
if (obj is null) return false;
if (obj.GetType() != typeof(InfoTitle)) return false;
diff --git a/Sources/Model/Manager.cs b/Sources/Model/Manager.cs
index 5992abc..5cf228b 100644
--- a/Sources/Model/Manager.cs
+++ b/Sources/Model/Manager.cs
@@ -82,9 +82,9 @@ public class Manager
}
}
- private Playlist? currentPlaylist;
+ private Playlist currentPlaylist;
- public Playlist? CurrentPlaylist
+ public Playlist CurrentPlaylist
{
get => currentPlaylist;
set
@@ -93,9 +93,9 @@ public class Manager
}
}
- private InfoTitle? currentInfoTitle;
+ private InfoTitle currentInfoTitle;
- public InfoTitle? CurrentInfoTitle
+ public InfoTitle CurrentInfoTitle
{
get => currentInfoTitle;
set
@@ -104,9 +104,9 @@ public class Manager
}
}
- private CustomTitle? currentPlaying;
+ private CustomTitle currentPlaying;
- public CustomTitle? CurrentPlaying
+ public CustomTitle CurrentPlaying
{
get => currentPlaying;
set
@@ -224,32 +224,32 @@ public class Manager
DataManager.SaveSerialization();
}
- public Playlist? GetPlaylistByName(string name)
+ public Playlist GetPlaylistByName(string name)
{
return DataManager.GetPlaylistByName(name);
}
- public Artist? GetArtistByName(string name)
+ public Artist GetArtistByName(string name)
{
return DataManager.GetArtistByName(name);
}
- public CustomTitle? GetCustomTitleByPath(string path)
+ public CustomTitle GetCustomTitleByPath(string path)
{
return DataManager.GetCustomTitleByPath(path);
}
- public InfoTitle? GetInfoTitleByName(string name)
+ public InfoTitle GetInfoTitleByName(string name)
{
return DataManager.GetInfoTitleByName(name);
}
- public Album? GetAlbumByName(string name)
+ public Album GetAlbumByName(string name)
{
return DataManager.GetAlbumByName(name);
}
- public Album? GetAlbumById(long id)
+ public Album GetAlbumById(long id)
{
return DataManager.GetAlbumById(id);
}
diff --git a/Sources/Model/Model.csproj b/Sources/Model/Model.csproj
index 4658cbf..7f8d823 100644
--- a/Sources/Model/Model.csproj
+++ b/Sources/Model/Model.csproj
@@ -1,9 +1,20 @@
-
- net7.0
- enable
- enable
-
+
+ net7.0;net7.0-android;net7.0-ios;net7.0-maccatalyst
+ $(TargetFrameworks);net7.0-windows10.0.19041.0
+
+
+ true
+ true
+ enable
+
+ 14.2
+ 14.0
+ 21.0
+ 10.0.17763.0
+ 10.0.17763.0
+ 6.5
+
diff --git a/Sources/Model/Platforms/Android/PlatformClass1.cs b/Sources/Model/Platforms/Android/PlatformClass1.cs
new file mode 100644
index 0000000..cbc4c43
--- /dev/null
+++ b/Sources/Model/Platforms/Android/PlatformClass1.cs
@@ -0,0 +1,6 @@
+namespace Model;
+
+// All the code in this file is only included on Android.
+public class PlatformClass1
+{
+}
diff --git a/Sources/Model/Platforms/MacCatalyst/PlatformClass1.cs b/Sources/Model/Platforms/MacCatalyst/PlatformClass1.cs
new file mode 100644
index 0000000..7dd4da1
--- /dev/null
+++ b/Sources/Model/Platforms/MacCatalyst/PlatformClass1.cs
@@ -0,0 +1,6 @@
+namespace Model;
+
+// All the code in this file is only included on Mac Catalyst.
+public class PlatformClass1
+{
+}
diff --git a/Sources/Model/Platforms/Tizen/PlatformClass1.cs b/Sources/Model/Platforms/Tizen/PlatformClass1.cs
new file mode 100644
index 0000000..f721897
--- /dev/null
+++ b/Sources/Model/Platforms/Tizen/PlatformClass1.cs
@@ -0,0 +1,9 @@
+using System;
+
+namespace Model
+{
+ // All the code in this file is only included on Tizen.
+ public class PlatformClass1
+ {
+ }
+}
\ No newline at end of file
diff --git a/Sources/Model/Platforms/Windows/PlatformClass1.cs b/Sources/Model/Platforms/Windows/PlatformClass1.cs
new file mode 100644
index 0000000..142559b
--- /dev/null
+++ b/Sources/Model/Platforms/Windows/PlatformClass1.cs
@@ -0,0 +1,6 @@
+namespace Model;
+
+// All the code in this file is only included on Windows.
+public class PlatformClass1
+{
+}
diff --git a/Sources/Model/Platforms/iOS/PlatformClass1.cs b/Sources/Model/Platforms/iOS/PlatformClass1.cs
new file mode 100644
index 0000000..a71b66a
--- /dev/null
+++ b/Sources/Model/Platforms/iOS/PlatformClass1.cs
@@ -0,0 +1,6 @@
+namespace Model;
+
+// All the code in this file is only included on iOS.
+public class PlatformClass1
+{
+}
diff --git a/Sources/Model/Playlist.cs b/Sources/Model/Playlist.cs
index c93b7b7..fa64f77 100644
--- a/Sources/Model/Playlist.cs
+++ b/Sources/Model/Playlist.cs
@@ -8,9 +8,9 @@ namespace Model;
public class Playlist : INotifyPropertyChanged
{
- public event PropertyChangedEventHandler? PropertyChanged;
+ public event PropertyChangedEventHandler PropertyChanged;
- protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
+ protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
public string Name
@@ -199,7 +199,7 @@ public class Playlist : INotifyPropertyChanged
}
}
- public CustomTitle? GetCurrentTitle()
+ public CustomTitle GetCurrentTitle()
{
if (Index < titles.Count)
{
@@ -212,7 +212,7 @@ public class Playlist : INotifyPropertyChanged
}
- public override bool Equals(object? obj)
+ public override bool Equals(object obj)
{
if (obj is null) return false;
if (obj.GetType() != typeof(Playlist)) return false;
diff --git a/Sources/Model/Serialization/LINQ_XML_Serialization.cs b/Sources/Model/Serialization/LINQ_XML_Serialization.cs
index 0247b5e..a3e4bab 100644
--- a/Sources/Model/Serialization/LINQ_XML_Serialization.cs
+++ b/Sources/Model/Serialization/LINQ_XML_Serialization.cs
@@ -2,12 +2,13 @@
using System.Xml.Linq;
using System.Collections.ObjectModel;
using Model.Stub;
+using Microsoft.Maui.Storage;
namespace Model.Serialization;
public class LinqXmlSerialization : IDataManager
{
- private static string XMLPATH = GetSerializationDirectory();
+ private static string XMLPATH = Path.Combine(FileSystem.Current.AppDataDirectory, "Data");
private static string XMLFILEPLAYLISTS = Path.Combine(XMLPATH, "playlists.xml");
@@ -231,7 +232,7 @@ public class LinqXmlSerialization : IDataManager
foreach(var custom in customsList)
{
- CustomTitle? customTitle = GetCustomTitleByPath(custom);
+ CustomTitle customTitle = GetCustomTitleByPath(custom);
if (customTitle == null)
{
@@ -385,7 +386,7 @@ public class LinqXmlSerialization : IDataManager
else return Genre.K_POP;
}
- public InfoTitle? GetInfoTitleByName(string name)
+ public InfoTitle GetInfoTitleByName(string name)
{
foreach(InfoTitle it in infoTitles)
{
@@ -397,7 +398,7 @@ public class LinqXmlSerialization : IDataManager
return null;
}
- public Artist? GetArtistByName(string name)
+ public Artist GetArtistByName(string name)
{
foreach(Artist a in artists)
{
@@ -409,7 +410,7 @@ public class LinqXmlSerialization : IDataManager
return null;
}
- public Album? GetAlbumByName(string name)
+ public Album GetAlbumByName(string name)
{
foreach(Album a in albums)
{
@@ -421,7 +422,7 @@ public class LinqXmlSerialization : IDataManager
return null;
}
- public Album? GetAlbumById(long id)
+ public Album GetAlbumById(long id)
{
foreach(Album a in albums)
{
@@ -430,7 +431,7 @@ public class LinqXmlSerialization : IDataManager
return null;
}
- public CustomTitle? GetCustomTitleByPath(string custom)
+ public CustomTitle GetCustomTitleByPath(string custom)
{
foreach(CustomTitle customTitle in customTitles)
{
@@ -482,7 +483,7 @@ public class LinqXmlSerialization : IDataManager
}
}
- public Playlist? GetPlaylistByName(string name)
+ public Playlist GetPlaylistByName(string name)
{
foreach(Playlist p in playlists)
{
@@ -504,7 +505,7 @@ public class LinqXmlSerialization : IDataManager
public void UpdateCustomTitleByPath(string path, string name, string newUrl, string info, string newPath)
{
- CustomTitle? title = GetCustomTitleByPath(path);
+ CustomTitle title = GetCustomTitleByPath(path);
if (title != null)
{
title.Name = name;
@@ -525,7 +526,7 @@ public class LinqXmlSerialization : IDataManager
public void UpdateInfoTitleByName(string name, string newUrl, string info, Artist artist, string description, Genre genre)
{
- InfoTitle? title = GetInfoTitleByName(name);
+ InfoTitle title = GetInfoTitleByName(name);
if (title != null)
{
title.Name = name;
@@ -547,7 +548,7 @@ public class LinqXmlSerialization : IDataManager
public void UpdateAlbumByName(string name, string newUrl, Artist artist, string description, string info)
{
- Album? album = GetAlbumByName(name);
+ Album album = GetAlbumByName(name);
if (album != null)
{
album.Name = name;
@@ -562,7 +563,7 @@ public class LinqXmlSerialization : IDataManager
{
album.Name = name;
album.ImageURL = url;
- Artist? artist2 = GetArtistByName(artist);
+ Artist artist2 = GetArtistByName(artist);
if (artist2 != null)
{
album.Artist = artist2;
@@ -573,12 +574,12 @@ public class LinqXmlSerialization : IDataManager
public void UpdateAlbumByNameByArtistName(string name, string newUrl, string artist, string description, string info)
{
- Album? album = GetAlbumByName(name);
+ Album album = GetAlbumByName(name);
if (album != null)
{
album.Name = name;
album.ImageURL = newUrl;
- Artist? artist2 = GetArtistByName(artist);
+ Artist artist2 = GetArtistByName(artist);
if (artist2 != null)
{
album.Artist = artist2;
@@ -597,7 +598,7 @@ public class LinqXmlSerialization : IDataManager
public void UpdatePlaylistByName(string name, string description, string newUrl)
{
- Playlist? playlist = GetPlaylistByName(name);
+ Playlist playlist = GetPlaylistByName(name);
if (playlist != null)
{
playlist.Name = name;
@@ -613,7 +614,7 @@ public class LinqXmlSerialization : IDataManager
public void UpdateArtistByName(string name, string newName)
{
- Artist? artist = GetArtistByName(newName);
+ Artist artist = GetArtistByName(newName);
if (artist != null)
{
artist.Name = newName;
@@ -780,10 +781,4 @@ public class LinqXmlSerialization : IDataManager
return false;
}
- static string GetSerializationDirectory()
- {
- DirectoryInfo? directory = new DirectoryInfo(AppDomain.CurrentDomain.BaseDirectory);
- return Path.Combine(directory.ToString(),"Linaris/Data");
- }
-
}
diff --git a/Sources/Model/Stub/StubAlbum.cs b/Sources/Model/Stub/StubAlbum.cs
index 4e95502..0c6d94f 100644
--- a/Sources/Model/Stub/StubAlbum.cs
+++ b/Sources/Model/Stub/StubAlbum.cs
@@ -48,7 +48,7 @@ public class StubAlbum
{
return albums;
}
- public Album? GetAlbumByName(string name)
+ public Album GetAlbumByName(string name)
{
foreach(Album album in albums)
{
diff --git a/Sources/Model/Stub/StubArtist.cs b/Sources/Model/Stub/StubArtist.cs
index 2290b93..0d4ae1d 100644
--- a/Sources/Model/Stub/StubArtist.cs
+++ b/Sources/Model/Stub/StubArtist.cs
@@ -21,7 +21,7 @@ public class StubArtist
{
return artists;
}
- public Artist? GetArtistByName(string name)
+ public Artist GetArtistByName(string name)
{
foreach (var artist in artists)
{
diff --git a/Sources/Model/Stub/StubManager.cs b/Sources/Model/Stub/StubManager.cs
index 50055c6..6af47a4 100644
--- a/Sources/Model/Stub/StubManager.cs
+++ b/Sources/Model/Stub/StubManager.cs
@@ -161,7 +161,7 @@ public class StubManager : IDataManager
// Doesn't do anything because it's Stubs
}
- public CustomTitle? GetCustomTitleByPath(string custom)
+ public CustomTitle GetCustomTitleByPath(string custom)
{
foreach (CustomTitle customTitle in StubCustomTitle.GetCustomTitles())
{
@@ -173,7 +173,7 @@ public class StubManager : IDataManager
return null;
}
- public InfoTitle? GetInfoTitleByName(string name)
+ public InfoTitle GetInfoTitleByName(string name)
{
foreach(InfoTitle title in StubInfoTitle.GetInfoTitles())
{
@@ -185,7 +185,7 @@ public class StubManager : IDataManager
return null;
}
- public Album? GetAlbumByName(string name)
+ public Album GetAlbumByName(string name)
{
foreach(Album album in StubAlbum.GetAlbums())
{
@@ -197,7 +197,7 @@ public class StubManager : IDataManager
return null;
}
- public Artist? GetArtistByName(string name)
+ public Artist GetArtistByName(string name)
{
foreach(Artist artist in StubArtist.GetArtists())
{
@@ -249,7 +249,7 @@ public class StubManager : IDataManager
}
}
- public Playlist? GetPlaylistByName(string name)
+ public Playlist GetPlaylistByName(string name)
{
foreach (Playlist p in StubPlaylist.Playlists)
{
@@ -271,7 +271,7 @@ public class StubManager : IDataManager
public void UpdateCustomTitleByPath(string path, string name, string newUrl, string info, string newPath)
{
- CustomTitle? title = GetCustomTitleByPath(path);
+ CustomTitle title = GetCustomTitleByPath(path);
if (title != null)
{
title.Name = name;
@@ -292,7 +292,7 @@ public class StubManager : IDataManager
public void UpdateInfoTitleByName(string name, string newUrl, string info, Artist artist, string description, Genre genre)
{
- InfoTitle? title = GetInfoTitleByName(name);
+ InfoTitle title = GetInfoTitleByName(name);
if (title != null)
{
title.Name = name;
@@ -314,7 +314,7 @@ public class StubManager : IDataManager
public void UpdateAlbumByName(string name, string newUrl, Artist artist, string description, string info)
{
- Album? album = GetAlbumByName(name);
+ Album album = GetAlbumByName(name);
if (album != null)
{
album.Name = name;
@@ -329,7 +329,7 @@ public class StubManager : IDataManager
{
album.Name = name;
album.ImageURL = url;
- Artist? artist2 = GetArtistByName(artist);
+ Artist artist2 = GetArtistByName(artist);
if (artist2 != null)
{
album.Artist = artist2;
@@ -340,12 +340,12 @@ public class StubManager : IDataManager
public void UpdateAlbumByNameByArtistName(string name, string newUrl, string artist, string description, string info)
{
- Album? album = GetAlbumByName(name);
+ Album album = GetAlbumByName(name);
if (album != null)
{
album.Name = name;
album.ImageURL = newUrl;
- Artist? artist2 = GetArtistByName(artist);
+ Artist artist2 = GetArtistByName(artist);
if (artist2 != null)
{
album.Artist = artist2;
@@ -364,7 +364,7 @@ public class StubManager : IDataManager
public void UpdatePlaylistByName(string name, string description, string newUrl)
{
- Playlist? playlist = GetPlaylistByName(name);
+ Playlist playlist = GetPlaylistByName(name);
if (playlist != null)
{
playlist.Name = name;
@@ -380,7 +380,7 @@ public class StubManager : IDataManager
public void UpdateArtistByName(string name, string newName)
{
- Artist? artist = GetArtistByName(newName);
+ Artist artist = GetArtistByName(newName);
if (artist != null)
{
artist.Name = newName;
@@ -547,7 +547,7 @@ public class StubManager : IDataManager
return false;
}
- public Album? GetAlbumById(long id)
+ public Album GetAlbumById(long id)
{
foreach(Album album in StubAlbum.Albums)
{
diff --git a/Sources/Model/Stub/StubPlaylist.cs b/Sources/Model/Stub/StubPlaylist.cs
index 773e49e..0459d08 100644
--- a/Sources/Model/Stub/StubPlaylist.cs
+++ b/Sources/Model/Stub/StubPlaylist.cs
@@ -33,7 +33,7 @@ public class StubPlaylist
{
return playlists;
}
- public Playlist? GetPlaylistByName(string name)
+ public Playlist GetPlaylistByName(string name)
{
foreach(var playlist in playlists)
{
diff --git a/Sources/Model/Title.cs b/Sources/Model/Title.cs
index 573c967..89e4a90 100644
--- a/Sources/Model/Title.cs
+++ b/Sources/Model/Title.cs
@@ -8,9 +8,9 @@ namespace Model;
public class Title
{
- public event PropertyChangedEventHandler? PropertyChanged;
+ public event PropertyChangedEventHandler PropertyChanged;
- protected void OnPropertyChanged([CallerMemberName] string? propertyName = null)
+ protected void OnPropertyChanged([CallerMemberName] string propertyName = null)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
public string Name
@@ -74,7 +74,7 @@ public class Title
Information = informations;
}
- public override bool Equals(object? obj)
+ public override bool Equals(object obj)
{
if (obj is null) return false;
if (obj.GetType() != typeof(Title)) return false;
diff --git a/Sources/TestUnitaires/TestUnitaires.csproj b/Sources/TestUnitaires/TestUnitaires.csproj
index dedc487..ec9d410 100644
--- a/Sources/TestUnitaires/TestUnitaires.csproj
+++ b/Sources/TestUnitaires/TestUnitaires.csproj
@@ -1,4 +1,4 @@
-
+
net7.0