diff --git a/Sources/Linaris/Resources/AppIcon/lin.svg b/Sources/Linaris/Resources/AppIcon/lin.svg new file mode 100644 index 0000000..90819de --- /dev/null +++ b/Sources/Linaris/Resources/AppIcon/lin.svg @@ -0,0 +1,1694 @@ + + + + diff --git a/Sources/Model/Playlist.cs b/Sources/Model/Playlist.cs index 60e0680..d920e4b 100644 --- a/Sources/Model/Playlist.cs +++ b/Sources/Model/Playlist.cs @@ -1,22 +1,31 @@ using Model.Stub; using System.Collections.ObjectModel; +using System.ComponentModel; +using System.Runtime.CompilerServices; using System.Security.Cryptography; using System.Xml.Serialization; namespace Model; -public class Playlist +public class Playlist : INotifyPropertyChanged { + public event PropertyChangedEventHandler? PropertyChanged; + + protected void OnPropertyChanged([CallerMemberName] string? propertyName = null) + => PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); + public string Name { get => name; set { - if (value != null && value.Length < Manager.MAX_NAME_LENGTH) + if (string.IsNullOrWhiteSpace(value) || value.Length > Manager.MAX_NAME_LENGTH) { - name = value; + value = "IncorrectName"; } + name = value; + OnPropertyChanged(); } } diff --git a/Sources/Model/Title.cs b/Sources/Model/Title.cs index 9b177f5..9327bad 100644 --- a/Sources/Model/Title.cs +++ b/Sources/Model/Title.cs @@ -19,7 +19,7 @@ public class Title set { - if (value.Length > Manager.MAX_NAME_LENGTH || string.IsNullOrWhiteSpace(value)) + if (string.IsNullOrWhiteSpace(value) || value.Length > Manager.MAX_NAME_LENGTH) { value = "IncorrectName"; } diff --git a/Sources/TestUnitaires/TU_CustomTitle.cs b/Sources/TestUnitaires/TU_CustomTitle.cs index 5599ad1..8e2c15b 100644 --- a/Sources/TestUnitaires/TU_CustomTitle.cs +++ b/Sources/TestUnitaires/TU_CustomTitle.cs @@ -20,10 +20,8 @@ namespace TestUnitaires CustomTitle ct = new CustomTitle(name, url, info, path); Assert.True(ct.Name != null && ct.Name.Length < 75); Assert.True(ct.ImageURL != null && ct.ImageURL.Contains('.')); - Assert.False(ct.ImageURL.Contains(' ')); Assert.True(ct.Information != null && ct.Information.Length < 500); Assert.True(ct.Path != null && ct.Path.Contains('.')); - Assert.False(ct.Path.Contains(' ')); } } diff --git a/Sources/TestUnitaires/TU_InfoTitle.cs b/Sources/TestUnitaires/TU_InfoTitle.cs index 8463810..3417c5c 100644 --- a/Sources/TestUnitaires/TU_InfoTitle.cs +++ b/Sources/TestUnitaires/TU_InfoTitle.cs @@ -19,7 +19,6 @@ namespace TestUnitaires InfoTitle it = new InfoTitle(name, url, info, new Artist("test"), desc, g); Assert.True(it.Name != null && it.Name.Length < 75); Assert.True(it.ImageURL != null && it.ImageURL.Contains('.')); - Assert.False(it.ImageURL.Contains(' ')); Assert.True(it.Information != null && it.Information.Length < 500); Assert.True(it.Description != null && it.Description.Length < 500); } diff --git a/Sources/TestUnitaires/TU_Playlist.cs b/Sources/TestUnitaires/TU_Playlist.cs index ff8219e..f5e7a19 100644 --- a/Sources/TestUnitaires/TU_Playlist.cs +++ b/Sources/TestUnitaires/TU_Playlist.cs @@ -19,7 +19,6 @@ namespace TestUnitaires Playlist p = new Playlist(name, desc, url); Assert.True(p.Name != null && p.Name.Length < 75); Assert.True(p.ImageURL != null && p.ImageURL.Contains('.')); - Assert.False(p.ImageURL.Contains(' ')); Assert.True(p.Description != null && p.Description.Length < 500); } [Theory] diff --git a/Sources/TestUnitaires/TU_Title.cs b/Sources/TestUnitaires/TU_Title.cs index c22de93..7a01d32 100644 --- a/Sources/TestUnitaires/TU_Title.cs +++ b/Sources/TestUnitaires/TU_Title.cs @@ -19,7 +19,6 @@ namespace TestUnitaires Title t = new Title(name, url, info); Assert.True(t.Name != null && t.Name.Length < 75); Assert.True(t.ImageURL != null && t.ImageURL.Contains('.')); - Assert.False(t.ImageURL.Contains(' ')); Assert.True(t.Information != null && t.Information.Length < 500); } }