diff --git a/OpenLyricsClient.Plugin/ExamplePlugin.cs b/OpenLyricsClient.Plugin/ExamplePlugin.cs new file mode 100644 index 0000000..737bb9b --- /dev/null +++ b/OpenLyricsClient.Plugin/ExamplePlugin.cs @@ -0,0 +1,62 @@ +using DevBase.Format.Structure; +using DevBase.Generics; +using OpenLyricsClient.Shared.Plugin; +using OpenLyricsClient.Shared.Structure.Artwork; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; + +namespace OpenLyricsClient.Plugin +{ + public class ExamplePlugin : IPlugin + { + public PluginScope Scope => PluginScope.LyricsCollector; + + public Task CollectArtwork(SongResponseObject songResponseObject) + { + throw new NotImplementedException(); + } + + public async Task CollectLyrics(SongResponseObject songResponseObject) + { + AList lyrics = new AList(); + lyrics.Add(new LyricElement(533, "Here's my line")); + lyrics.Add(new LyricElement(536, "Here's another")); + lyrics.Add(new LyricElement(573, "Here's my line")); + lyrics.Add(new LyricElement(83, "Here's another")); + lyrics.Add(new LyricElement(5563, "Here's my line")); + lyrics.Add(new LyricElement(333, "Here's another")); + lyrics.Add(new LyricElement(43, "Here's another")); + lyrics.Add(new LyricElement(5323, "Here's another")); + lyrics.Add(new LyricElement(6333, "Here's another")); + lyrics.Add(new LyricElement(7453, "Here's another")); + lyrics.Add(new LyricElement(84583, "Here's another")); + lyrics.Add(new LyricElement(45743, "Here's another")); + return await LyricData.ConvertToData(lyrics, songResponseObject.SongRequestObject.Song.SongMetadata, "Plugin"); + } + + public Task CollectSong(SongRequestObject songRequestObject) + { + throw new NotImplementedException(); + } + + public int GetCollectedArtworkQuality() + { + throw new NotImplementedException(); + } + + public int GetCollectedLyricsQuality() + { + return 1337; + } + + public int GetCollectedSongQuality() + { + throw new NotImplementedException(); + } + + public Task ProcessLyrics(SongResponseObject songResponse, LyricData lyrics) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/OpenLyricsClient.Plugin/OpenLyricsClient.Plugin.csproj b/OpenLyricsClient.Plugin/OpenLyricsClient.Plugin.csproj new file mode 100644 index 0000000..2f29a60 --- /dev/null +++ b/OpenLyricsClient.Plugin/OpenLyricsClient.Plugin.csproj @@ -0,0 +1,13 @@ + + + + net7.0 + enable + enable + + + + + + + diff --git a/OpenLyricsClient.Shared/OpenLyricsClient.Shared.csproj b/OpenLyricsClient.Shared/OpenLyricsClient.Shared.csproj new file mode 100644 index 0000000..7a654b4 --- /dev/null +++ b/OpenLyricsClient.Shared/OpenLyricsClient.Shared.csproj @@ -0,0 +1,27 @@ + + + + net7.0 + enable + enable + + + + + + + + + + + + + + + + + ..\Libraries\XWindowManager.dll + + + + diff --git a/OpenLyricsClient.Shared/Plugin/IPlugin.cs b/OpenLyricsClient.Shared/Plugin/IPlugin.cs new file mode 100644 index 0000000..4a56b31 --- /dev/null +++ b/OpenLyricsClient.Shared/Plugin/IPlugin.cs @@ -0,0 +1,22 @@ +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OpenLyricsClient.Shared.Plugin +{ + public interface IPlugin + { + PluginScope Scope { get; } + Task ProcessLyrics(SongResponseObject songResponse, LyricData lyrics); + Task CollectLyrics(SongResponseObject songResponseObject); + int GetCollectedLyricsQuality(); + Task CollectSong(SongRequestObject songRequestObject); + int GetCollectedSongQuality(); + Task CollectArtwork(SongResponseObject songResponseObject); + int GetCollectedArtworkQuality(); + } +} diff --git a/OpenLyricsClient.Shared/Plugin/PluginScope.cs b/OpenLyricsClient.Shared/Plugin/PluginScope.cs new file mode 100644 index 0000000..e0fba3b --- /dev/null +++ b/OpenLyricsClient.Shared/Plugin/PluginScope.cs @@ -0,0 +1,15 @@ +using System; + +namespace OpenLyricsClient.Shared.Plugin +{ + [Flags] + public enum PluginScope + { + Dummy = 1, + LyricsPostprocess = 2, + LyricsViewRendering = 4, + LyricsCollector = 8, + SongCollector = 16, + ArtworkCollector = 32 + } +} diff --git a/OpenLyricsClient/Backend/Structure/Artwork/Artwork.cs b/OpenLyricsClient.Shared/Structure/Artwork/Artwork.cs similarity index 99% rename from OpenLyricsClient/Backend/Structure/Artwork/Artwork.cs rename to OpenLyricsClient.Shared/Structure/Artwork/Artwork.cs index 40bd10e..667d90c 100644 --- a/OpenLyricsClient/Backend/Structure/Artwork/Artwork.cs +++ b/OpenLyricsClient.Shared/Structure/Artwork/Artwork.cs @@ -13,7 +13,7 @@ using Bitmap = Avalonia.Media.Imaging.Bitmap; using Color = Avalonia.Media.Color; -namespace OpenLyricsClient.Backend.Structure.Artwork +namespace OpenLyricsClient.Shared.Structure.Artwork { [Serializable] public class Artwork diff --git a/OpenLyricsClient/Backend/Structure/Artwork/ArtworkReturnCode.cs b/OpenLyricsClient.Shared/Structure/Artwork/ArtworkReturnCode.cs similarity index 56% rename from OpenLyricsClient/Backend/Structure/Artwork/ArtworkReturnCode.cs rename to OpenLyricsClient.Shared/Structure/Artwork/ArtworkReturnCode.cs index 00d54f9..04a6d46 100644 --- a/OpenLyricsClient/Backend/Structure/Artwork/ArtworkReturnCode.cs +++ b/OpenLyricsClient.Shared/Structure/Artwork/ArtworkReturnCode.cs @@ -1,4 +1,4 @@ -namespace OpenLyricsClient.Backend.Structure.Artwork +namespace OpenLyricsClient.Shared.Structure.Artwork { public enum ArtworkReturnCode { diff --git a/OpenLyricsClient.Shared/Structure/Enum/DataOrigin.cs b/OpenLyricsClient.Shared/Structure/Enum/DataOrigin.cs new file mode 100644 index 0000000..c7c2e34 --- /dev/null +++ b/OpenLyricsClient.Shared/Structure/Enum/DataOrigin.cs @@ -0,0 +1,6 @@ +namespace OpenLyricsClient.Shared.Structure.Enum; + +public enum DataOrigin +{ + SPOTIFY, TIDAL +} \ No newline at end of file diff --git a/OpenLyricsClient/Backend/Structure/Enum/EnumLyricsDisplayMode.cs b/OpenLyricsClient.Shared/Structure/Enum/EnumLyricsDisplayMode.cs similarity index 52% rename from OpenLyricsClient/Backend/Structure/Enum/EnumLyricsDisplayMode.cs rename to OpenLyricsClient.Shared/Structure/Enum/EnumLyricsDisplayMode.cs index 06ed7be..f99fbc1 100644 --- a/OpenLyricsClient/Backend/Structure/Enum/EnumLyricsDisplayMode.cs +++ b/OpenLyricsClient.Shared/Structure/Enum/EnumLyricsDisplayMode.cs @@ -1,4 +1,4 @@ -namespace OpenLyricsClient.Backend.Structure.Enum; +namespace OpenLyricsClient.Shared.Structure.Enum; public enum EnumLyricsDisplayMode { diff --git a/OpenLyricsClient/Backend/Structure/Enum/EnumPlayback.cs b/OpenLyricsClient.Shared/Structure/Enum/EnumPlayback.cs similarity index 57% rename from OpenLyricsClient/Backend/Structure/Enum/EnumPlayback.cs rename to OpenLyricsClient.Shared/Structure/Enum/EnumPlayback.cs index 6fb8e14..e218848 100644 --- a/OpenLyricsClient/Backend/Structure/Enum/EnumPlayback.cs +++ b/OpenLyricsClient.Shared/Structure/Enum/EnumPlayback.cs @@ -1,4 +1,4 @@ -namespace OpenLyricsClient.Backend.Structure.Enum; +namespace OpenLyricsClient.Shared.Structure.Enum; public enum EnumPlayback { diff --git a/OpenLyricsClient/Backend/Structure/Enum/EnumRegisterTypes.cs b/OpenLyricsClient.Shared/Structure/Enum/EnumRegisterTypes.cs similarity index 93% rename from OpenLyricsClient/Backend/Structure/Enum/EnumRegisterTypes.cs rename to OpenLyricsClient.Shared/Structure/Enum/EnumRegisterTypes.cs index d87fb52..a2384d6 100644 --- a/OpenLyricsClient/Backend/Structure/Enum/EnumRegisterTypes.cs +++ b/OpenLyricsClient.Shared/Structure/Enum/EnumRegisterTypes.cs @@ -1,4 +1,4 @@ -namespace OpenLyricsClient.Backend.Structure.Enum +namespace OpenLyricsClient.Shared.Structure.Enum { public enum EnumRegisterTypes { diff --git a/OpenLyricsClient/Backend/Structure/Json/JsonArtwork.cs b/OpenLyricsClient.Shared/Structure/Json/JsonArtwork.cs similarity index 74% rename from OpenLyricsClient/Backend/Structure/Json/JsonArtwork.cs rename to OpenLyricsClient.Shared/Structure/Json/JsonArtwork.cs index 4298a09..dcc1d07 100644 --- a/OpenLyricsClient/Backend/Structure/Json/JsonArtwork.cs +++ b/OpenLyricsClient.Shared/Structure/Json/JsonArtwork.cs @@ -1,7 +1,7 @@ using Avalonia.Media; using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json; +namespace OpenLyricsClient.Shared.Structure.Json; public class JsonArtwork { diff --git a/OpenLyricsClient/Backend/Structure/Json/JsonCacheData.cs b/OpenLyricsClient.Shared/Structure/Json/JsonCacheData.cs similarity index 85% rename from OpenLyricsClient/Backend/Structure/Json/JsonCacheData.cs rename to OpenLyricsClient.Shared/Structure/Json/JsonCacheData.cs index fe4550b..d1396f0 100644 --- a/OpenLyricsClient/Backend/Structure/Json/JsonCacheData.cs +++ b/OpenLyricsClient.Shared/Structure/Json/JsonCacheData.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json; +namespace OpenLyricsClient.Shared.Structure.Json; public class JsonCacheData { diff --git a/OpenLyricsClient/Backend/Structure/Json/JsonLyricData.cs b/OpenLyricsClient.Shared/Structure/Json/JsonLyricData.cs similarity index 84% rename from OpenLyricsClient/Backend/Structure/Json/JsonLyricData.cs rename to OpenLyricsClient.Shared/Structure/Json/JsonLyricData.cs index dc9721d..7862bba 100644 --- a/OpenLyricsClient/Backend/Structure/Json/JsonLyricData.cs +++ b/OpenLyricsClient.Shared/Structure/Json/JsonLyricData.cs @@ -1,12 +1,12 @@ using Newtonsoft.Json; -using OpenLyricsClient.Backend.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Lyrics; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -namespace OpenLyricsClient.Backend.Structure.Json +namespace OpenLyricsClient.Shared.Structure.Json { public class JsonLyricData { diff --git a/OpenLyricsClient/Backend/Structure/Json/JsonSongMetadata.cs b/OpenLyricsClient.Shared/Structure/Json/JsonSongMetadata.cs similarity index 86% rename from OpenLyricsClient/Backend/Structure/Json/JsonSongMetadata.cs rename to OpenLyricsClient.Shared/Structure/Json/JsonSongMetadata.cs index b82a7d3..061976b 100644 --- a/OpenLyricsClient/Backend/Structure/Json/JsonSongMetadata.cs +++ b/OpenLyricsClient.Shared/Structure/Json/JsonSongMetadata.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json; +namespace OpenLyricsClient.Shared.Structure.Json; public class JsonSongMetadata { diff --git a/OpenLyricsClient/Backend/Structure/Json/JsonSongState.cs b/OpenLyricsClient.Shared/Structure/Json/JsonSongState.cs similarity index 56% rename from OpenLyricsClient/Backend/Structure/Json/JsonSongState.cs rename to OpenLyricsClient.Shared/Structure/Json/JsonSongState.cs index 70f8c80..e2e332a 100644 --- a/OpenLyricsClient/Backend/Structure/Json/JsonSongState.cs +++ b/OpenLyricsClient.Shared/Structure/Json/JsonSongState.cs @@ -1,8 +1,7 @@ - using Newtonsoft.Json; -using OpenLyricsClient.Backend.Structure.Song; +using OpenLyricsClient.Shared.Structure.Song; -namespace OpenLyricsClient.Backend.Structure.Json; +namespace OpenLyricsClient.Shared.Structure.Json; public class JsonSongState { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchAryGenres.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchAryGenres.cs similarity index 74% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchAryGenres.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchAryGenres.cs index 5f3595a..a1b99d2 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchAryGenres.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchAryGenres.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchAryGenres { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponse.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponse.cs similarity index 73% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponse.cs index d96ee74..223d26d 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchFetchResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessage.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessage.cs similarity index 81% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessage.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessage.cs index 882dced..50e63d4 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessage.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessage.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchFetchResponseMessage { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageBody.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageBody.cs similarity index 74% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageBody.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageBody.cs index 45bd859..ce7bf86 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageBody.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageBody.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchFetchResponseMessageBody { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageHeader.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageHeader.cs similarity index 86% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageHeader.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageHeader.cs index 4b72fd7..5b0fc72 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageHeader.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchFetchResponseMessageHeader.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchFetchResponseMessageHeader { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchLyrics.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchLyrics.cs similarity index 96% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchLyrics.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchLyrics.cs index fa296a8..522aef4 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchLyrics.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchLyrics.cs @@ -1,7 +1,7 @@ using System; using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchLyrics { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMacroCalls.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMacroCalls.cs similarity index 90% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMacroCalls.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMacroCalls.cs index 39bc30c..7484f23 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMacroCalls.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMacroCalls.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchMacroCalls { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGet.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGet.cs similarity index 74% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGet.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGet.cs index 32dd2f3..c28288f 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGet.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGet.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchMatcherTrackGet { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessage.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessage.cs similarity index 82% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessage.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessage.cs index b226166..d9f49fa 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessage.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessage.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchMatcherTrackGetMessage { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageBody.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageBody.cs similarity index 73% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageBody.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageBody.cs index e295908..64b6ec3 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageBody.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageBody.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusicMatchMatcherTrackGetMessageBody { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageHeader.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageHeader.cs similarity index 88% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageHeader.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageHeader.cs index 113ac78..ded7ec2 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageHeader.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMatcherTrackGetMessageHeader.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchMatcherTrackGetMessageHeader { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMeta.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMeta.cs similarity index 80% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMeta.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMeta.cs index 158773d..867aa0c 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMeta.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMeta.cs @@ -1,7 +1,7 @@ using System; using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchMeta { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMusicGenre.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMusicGenre.cs similarity index 89% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMusicGenre.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMusicGenre.cs index 412d875..b16f955 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMusicGenre.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMusicGenre.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchMusicGenre { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMusicGenreList.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMusicGenreList.cs similarity index 73% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMusicGenreList.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMusicGenreList.cs index fad25ad..93fb505 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchMusicGenreList.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchMusicGenreList.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchMusicGenreList { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchSnippet.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchSnippet.cs similarity index 93% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchSnippet.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchSnippet.cs index 1cbe4c2..3d5eeba 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchSnippet.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchSnippet.cs @@ -1,7 +1,7 @@ using System; using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchSnippet { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchSubtitle.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchSubtitle.cs similarity index 95% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchSubtitle.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchSubtitle.cs index 177558b..fbd9b2c 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchSubtitle.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchSubtitle.cs @@ -1,7 +1,7 @@ using System; using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchSubtitle { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchSubtitleList.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchSubtitleList.cs similarity index 72% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchSubtitleList.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchSubtitleList.cs index 482c6a1..4580703 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchSubtitleList.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchSubtitleList.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchSubtitleList { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrack.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrack.cs similarity index 98% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrack.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrack.cs index 1c400c2..669ebca 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrack.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrack.cs @@ -1,7 +1,7 @@ using System; using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrack { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGet.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGet.cs similarity index 73% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGet.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGet.cs index 46fb8d0..e98d7c3 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGet.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGet.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackLyricsGet { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessage.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessage.cs similarity index 81% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessage.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessage.cs index 4723967..1c6d893 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessage.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessage.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackLyricsGetMessage { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageBody.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageBody.cs similarity index 73% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageBody.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageBody.cs index 96a141b..29355a8 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageBody.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageBody.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackLyricsGetMessageBody { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageHeader.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageHeader.cs similarity index 80% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageHeader.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageHeader.cs index 4df67fb..fbaed31 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageHeader.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackLyricsGetMessageHeader.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackLyricsGetMessageHeader { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGet.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGet.cs similarity index 74% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGet.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGet.cs index 4a1efa5..e65af2d 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGet.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGet.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackSnippetGet { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessage.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessage.cs similarity index 82% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessage.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessage.cs index 6871c35..4d8443c 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessage.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessage.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackSnippetGetMessage { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageBody.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageBody.cs similarity index 73% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageBody.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageBody.cs index 6d2fc97..33e4396 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageBody.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageBody.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackSnippetGetMessageBody { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageHeader.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageHeader.cs similarity index 80% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageHeader.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageHeader.cs index 07e6207..6c0624b 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageHeader.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSnippetGetMessageHeader.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackSnippetGetMessageHeader { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGet.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGet.cs similarity index 74% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGet.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGet.cs index 0106930..6cbc41e 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGet.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGet.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackSubtitlesGet { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessage.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessage.cs similarity index 82% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessage.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessage.cs index 29700f3..59edf27 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessage.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessage.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackSubtitlesGetMessage { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageBody.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageBody.cs similarity index 75% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageBody.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageBody.cs index f9cd473..0ce6d0b 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageBody.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageBody.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackSubtitlesGetMessageBody { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageHeader.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageHeader.cs similarity index 86% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageHeader.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageHeader.cs index 5195017..0af4a51 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageHeader.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchTrackSubtitlesGetMessageHeader.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchTrackSubtitlesGetMessageHeader { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchUserblobGet.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchUserblobGet.cs similarity index 79% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchUserblobGet.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchUserblobGet.cs index b030a29..c35b677 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchUserblobGet.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchUserblobGet.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchUserblobGet { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessage.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessage.cs similarity index 74% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessage.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessage.cs index 54906c3..f59659b 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessage.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessage.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchUserblobGetMessage { diff --git a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessageHeader.cs b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessageHeader.cs similarity index 72% rename from OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessageHeader.cs rename to OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessageHeader.cs index 5385d4c..11fec40 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessageHeader.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Musixmatch/Json/MusixMatchUserblobGetMessageHeader.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Musixmatch.Json +namespace OpenLyricsClient.Shared.Structure.Json.Musixmatch.Json { public class MusixMatchUserblobGetMessageHeader { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseAlbumResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseAlbumResponse.cs similarity index 92% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseAlbumResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseAlbumResponse.cs index 8913827..df7fccf 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseAlbumResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseAlbumResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseAlbumResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseArtistResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseArtistResponse.cs similarity index 92% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseArtistResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseArtistResponse.cs index 17aca4e..92ea13c 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseArtistResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseArtistResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseArtistResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseDefaultResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseDefaultResponse.cs similarity index 77% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseDefaultResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseDefaultResponse.cs index ca59e5b..1600b16 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseDefaultResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseDefaultResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseDefaultResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseKlyricResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseKlyricResponse.cs similarity index 78% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseKlyricResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseKlyricResponse.cs index 9e11531..f781414 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseKlyricResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseKlyricResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseKlyricResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseLrcResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseLrcResponse.cs similarity index 78% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseLrcResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseLrcResponse.cs index f8596dd..786ed23 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseLrcResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseLrcResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseLrcResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseLyricResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseLyricResponse.cs similarity index 93% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseLyricResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseLyricResponse.cs index 52ba72d..5b47a6a 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseLyricResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseLyricResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseLyricResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseLyricUserResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseLyricUserResponse.cs similarity index 89% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseLyricUserResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseLyricUserResponse.cs index a7098e4..63ac05a 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseLyricUserResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseLyricUserResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseLyricUserResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseResultResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseResultResponse.cs similarity index 83% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseResultResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseResultResponse.cs index a89896e..25f6ca0 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseResultResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseResultResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseResultResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseSearchResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseSearchResponse.cs similarity index 83% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseSearchResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseSearchResponse.cs index 2d35e61..29f68b1 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseSearchResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseSearchResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { //Generated by https://json2csharp.com/ i love you public class NetEaseSearchResponse diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseSongResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseSongResponse.cs similarity index 94% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseSongResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseSongResponse.cs index de92fd9..4008b23 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseSongResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseSongResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseSongResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseTlyricResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseTlyricResponse.cs similarity index 78% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseTlyricResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseTlyricResponse.cs index d75d04b..7bacd63 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseTlyricResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseTlyricResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseTlyricResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseTransUserResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseTransUserResponse.cs similarity index 89% rename from OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseTransUserResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseTransUserResponse.cs index 4040abf..ec4aadb 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEase/Json/NetEaseTransUserResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEase/Json/NetEaseTransUserResponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEase.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEase.Json { public class NetEaseTransUserResponse { diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2AlbumResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2AlbumResponse.cs similarity index 87% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2AlbumResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2AlbumResponse.cs index a4331ad..c4fef31 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2AlbumResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2AlbumResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2AlbumResponse + public class NetEaseV2AlbumResponse { [JsonProperty("id")] public int Id { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2ArtistResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2ArtistResponse.cs similarity index 87% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2ArtistResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2ArtistResponse.cs index 39fef26..ead8b74 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2ArtistResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2ArtistResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2ArtistResponse + public class NetEaseV2ArtistResponse { [JsonProperty("id")] public int Id { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2KlyricResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2KlyricResponse.cs similarity index 64% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2KlyricResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2KlyricResponse.cs index 4ce3461..5f60efa 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2KlyricResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2KlyricResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2KlyricResponse + public class NetEaseV2KlyricResponse { [JsonProperty("version")] public int Version { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2LrcResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2LrcResponse.cs similarity index 65% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2LrcResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2LrcResponse.cs index e3d132c..600fe39 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2LrcResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2LrcResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2LrcResponse + public class NetEaseV2LrcResponse { [JsonProperty("version")] public int Version { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2LyricResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2LyricResponse.cs similarity index 88% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2LyricResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2LyricResponse.cs index 113add4..ea09a6c 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2LyricResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2LyricResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2LyricResponse + public class NetEaseV2LyricResponse { [JsonProperty("sgc")] public bool Sgc { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2LyricUserResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2LyricUserResponse.cs similarity index 81% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2LyricUserResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2LyricUserResponse.cs index cd630da..7aafbd9 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2LyricUserResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2LyricUserResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2LyricUserResponse + public class NetEaseV2LyricUserResponse { [JsonProperty("id")] public int Id { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2ResultResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2ResultResponse.cs similarity index 73% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2ResultResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2ResultResponse.cs index 1bab0f7..6ed6f76 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2ResultResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2ResultResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2ResultResponse + public class NetEaseV2ResultResponse { [JsonProperty("songs")] public NetEaseV2SongResponse[] Songs { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2SearchResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2SearchResponse.cs similarity index 66% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2SearchResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2SearchResponse.cs index f7241df..d27a5a0 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2SearchResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2SearchResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2SearchResponse + public class NetEaseV2SearchResponse { [JsonProperty("result")] public NetEaseV2ResultResponse Result { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2SongResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2SongResponse.cs similarity index 91% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2SongResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2SongResponse.cs index 819feae..e7bc328 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2SongResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2SongResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2SongResponse + public class NetEaseV2SongResponse { [JsonProperty("id")] public int Id { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2TlyricResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2TlyricResponse.cs similarity index 64% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2TlyricResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2TlyricResponse.cs index bcd825b..a5bd2b6 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2TlyricResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2TlyricResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2TlyricResponse + public class NetEaseV2TlyricResponse { [JsonProperty("version")] public int Version { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2TransUserResponse.cs b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2TransUserResponse.cs similarity index 81% rename from OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2TransUserResponse.cs rename to OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2TransUserResponse.cs index 2454efd..0ef7d61 100644 --- a/OpenLyricsClient/Backend/Structure/Json/NetEaseV2/Json/NetEaseV2TransUserResponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/NetEaseV2/Json/NetEaseV2TransUserResponse.cs @@ -1,8 +1,8 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json +namespace OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json { - class NetEaseV2TransUserResponse + public class NetEaseV2TransUserResponse { [JsonProperty("id")] public int Id { get; set; } diff --git a/OpenLyricsClient/Backend/Structure/Json/Textyl/Json/TextylLyricReponse.cs b/OpenLyricsClient.Shared/Structure/Json/Textyl/Json/TextylLyricReponse.cs similarity index 78% rename from OpenLyricsClient/Backend/Structure/Json/Textyl/Json/TextylLyricReponse.cs rename to OpenLyricsClient.Shared/Structure/Json/Textyl/Json/TextylLyricReponse.cs index 85d74b8..dbd9977 100644 --- a/OpenLyricsClient/Backend/Structure/Json/Textyl/Json/TextylLyricReponse.cs +++ b/OpenLyricsClient.Shared/Structure/Json/Textyl/Json/TextylLyricReponse.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure.Json.Textyl.Json +namespace OpenLyricsClient.Shared.Structure.Json.Textyl.Json { public class TextylLyricReponse { diff --git a/OpenLyricsClient/Backend/Structure/Lyrics/LyricData.cs b/OpenLyricsClient.Shared/Structure/Lyrics/LyricData.cs similarity index 66% rename from OpenLyricsClient/Backend/Structure/Lyrics/LyricData.cs rename to OpenLyricsClient.Shared/Structure/Lyrics/LyricData.cs index e0fd2bb..736b54d 100644 --- a/OpenLyricsClient/Backend/Structure/Lyrics/LyricData.cs +++ b/OpenLyricsClient.Shared/Structure/Lyrics/LyricData.cs @@ -1,12 +1,8 @@ -using System; -using System.Text; -using System.Threading.Tasks; -using DevBase.Format.Structure; +using DevBase.Format.Structure; using DevBase.Generics; -using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure.Song; +using OpenLyricsClient.Shared.Structure.Song; -namespace OpenLyricsClient.Backend.Structure.Lyrics +namespace OpenLyricsClient.Shared.Structure.Lyrics { [Serializable] public class LyricData @@ -32,6 +28,34 @@ public LyricData(LyricReturnCode lyricReturnCode, SongMetadata songMetadata) : t public LyricData(LyricReturnCode lyricReturnCode, SongMetadata songMetadata, LyricType lyricType) : this(lyricReturnCode, songMetadata, null, null, lyricType) { } + // TODO: resolve dependencies + private static string FormatStringInternal(string s) + { + s = s.Replace("Λ", "/\\"); + s = s.Replace("(", "("); + s = s.Replace(")", ")"); + s = s.Replace("【", "["); + s = s.Replace("】", "]"); + s = s.Replace("。", "."); + s = s.Replace(";", ";"); + s = s.Replace(":", ":"); + s = s.Replace("?", "?"); + s = s.Replace("!", "!"); + s = s.Replace("、", ","); + s = s.Replace(",", ","); + s = s.Replace("‘", "'"); + s = s.Replace("’", "'"); + s = s.Replace("′", "'"); + s = s.Replace("'", "'"); + s = s.Replace("“", "\""); + s = s.Replace("”", "\""); + s = s.Replace("〜", "~"); + s = s.Replace("·", "•"); + s = s.Replace("・", "•"); + s = s.Replace("’", "´"); + return s; + } + public static async Task ConvertToData(AList lyrics, SongMetadata songMetadata, string lyricProvider) { if (lyrics == null || lyrics.Length == 0) @@ -43,7 +67,7 @@ public static async Task ConvertToData(AList lyrics, So for (int i = 0; i < lyrics.Length; i++) { - string currentLine = SongFormatter.FormatString(lyrics.Get(i).Line); + string currentLine = FormatStringInternal(lyrics.Get(i).Line); lyricParts[i] = new LyricPart(lyrics.Get(i).TimeStamp, currentLine); } diff --git a/OpenLyricsClient/Backend/Structure/Lyrics/LyricPart.cs b/OpenLyricsClient.Shared/Structure/Lyrics/LyricPart.cs similarity index 92% rename from OpenLyricsClient/Backend/Structure/Lyrics/LyricPart.cs rename to OpenLyricsClient.Shared/Structure/Lyrics/LyricPart.cs index 1502239..a52e909 100644 --- a/OpenLyricsClient/Backend/Structure/Lyrics/LyricPart.cs +++ b/OpenLyricsClient.Shared/Structure/Lyrics/LyricPart.cs @@ -1,8 +1,8 @@ using System; using Newtonsoft.Json; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; -namespace OpenLyricsClient.Backend.Structure.Lyrics +namespace OpenLyricsClient.Shared.Structure.Lyrics { [Serializable] [JsonObject(MemberSerialization.OptIn)] diff --git a/OpenLyricsClient/Backend/Structure/Lyrics/LyricReturnCode.cs b/OpenLyricsClient.Shared/Structure/Lyrics/LyricReturnCode.cs similarity index 56% rename from OpenLyricsClient/Backend/Structure/Lyrics/LyricReturnCode.cs rename to OpenLyricsClient.Shared/Structure/Lyrics/LyricReturnCode.cs index c1f0999..8ebbf66 100644 --- a/OpenLyricsClient/Backend/Structure/Lyrics/LyricReturnCode.cs +++ b/OpenLyricsClient.Shared/Structure/Lyrics/LyricReturnCode.cs @@ -1,4 +1,4 @@ -namespace OpenLyricsClient.Backend.Structure.Lyrics +namespace OpenLyricsClient.Shared.Structure.Lyrics { public enum LyricReturnCode { diff --git a/OpenLyricsClient/Backend/Structure/Lyrics/LyricType.cs b/OpenLyricsClient.Shared/Structure/Lyrics/LyricType.cs similarity index 57% rename from OpenLyricsClient/Backend/Structure/Lyrics/LyricType.cs rename to OpenLyricsClient.Shared/Structure/Lyrics/LyricType.cs index b8e4343..7156ae6 100644 --- a/OpenLyricsClient/Backend/Structure/Lyrics/LyricType.cs +++ b/OpenLyricsClient.Shared/Structure/Lyrics/LyricType.cs @@ -1,4 +1,4 @@ -namespace OpenLyricsClient.Backend.Structure.Lyrics +namespace OpenLyricsClient.Shared.Structure.Lyrics { public enum LyricType { diff --git a/OpenLyricsClient/Backend/Structure/LyricsDisplayPreferences.cs b/OpenLyricsClient.Shared/Structure/LyricsDisplayPreferences.cs similarity index 66% rename from OpenLyricsClient/Backend/Structure/LyricsDisplayPreferences.cs rename to OpenLyricsClient.Shared/Structure/LyricsDisplayPreferences.cs index 7ed7872..69bb13d 100644 --- a/OpenLyricsClient/Backend/Structure/LyricsDisplayPreferences.cs +++ b/OpenLyricsClient.Shared/Structure/LyricsDisplayPreferences.cs @@ -1,6 +1,6 @@ -using OpenLyricsClient.Backend.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Enum; -namespace OpenLyricsClient.Backend.Structure; +namespace OpenLyricsClient.Shared.Structure; public class LyricsDisplayPreferences { diff --git a/OpenLyricsClient/Backend/Structure/Media/MediaData.cs b/OpenLyricsClient.Shared/Structure/Media/MediaData.cs similarity index 93% rename from OpenLyricsClient/Backend/Structure/Media/MediaData.cs rename to OpenLyricsClient.Shared/Structure/Media/MediaData.cs index a6e2721..e66cd11 100644 --- a/OpenLyricsClient/Backend/Structure/Media/MediaData.cs +++ b/OpenLyricsClient.Shared/Structure/Media/MediaData.cs @@ -1,7 +1,7 @@ using System; using System.IO; -namespace OpenLyricsClient.Backend.Structure.Media; +namespace OpenLyricsClient.Shared.Structure.Media; public class MediaData { diff --git a/OpenLyricsClient/Backend/Structure/Media/MediaReturnCode.cs b/OpenLyricsClient.Shared/Structure/Media/MediaReturnCode.cs similarity index 50% rename from OpenLyricsClient/Backend/Structure/Media/MediaReturnCode.cs rename to OpenLyricsClient.Shared/Structure/Media/MediaReturnCode.cs index 01fa87e..3ecd98e 100644 --- a/OpenLyricsClient/Backend/Structure/Media/MediaReturnCode.cs +++ b/OpenLyricsClient.Shared/Structure/Media/MediaReturnCode.cs @@ -1,4 +1,4 @@ -namespace OpenLyricsClient.Backend.Structure.Media; +namespace OpenLyricsClient.Shared.Structure.Media; public enum MediaReturnCode { diff --git a/OpenLyricsClient/Backend/Structure/MusixMatchToken.cs b/OpenLyricsClient.Shared/Structure/MusixMatchToken.cs similarity index 94% rename from OpenLyricsClient/Backend/Structure/MusixMatchToken.cs rename to OpenLyricsClient.Shared/Structure/MusixMatchToken.cs index d3fdf93..ffa0b96 100644 --- a/OpenLyricsClient/Backend/Structure/MusixMatchToken.cs +++ b/OpenLyricsClient.Shared/Structure/MusixMatchToken.cs @@ -1,7 +1,7 @@ using Microsoft.VisualBasic.CompilerServices; using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure +namespace OpenLyricsClient.Shared.Structure { public class MusixMatchToken { diff --git a/OpenLyricsClient/Backend/Structure/Other/SimpleArtist.cs b/OpenLyricsClient.Shared/Structure/Other/SimpleArtist.cs similarity index 94% rename from OpenLyricsClient/Backend/Structure/Other/SimpleArtist.cs rename to OpenLyricsClient.Shared/Structure/Other/SimpleArtist.cs index 1139ae7..c09fe64 100644 --- a/OpenLyricsClient/Backend/Structure/Other/SimpleArtist.cs +++ b/OpenLyricsClient.Shared/Structure/Other/SimpleArtist.cs @@ -2,7 +2,7 @@ using SpotifyAPI.Web; using Squalr.Engine.Utils.Extensions; -namespace OpenLyricsClient.Backend.Structure.Other; +namespace OpenLyricsClient.Shared.Structure.Other; public class SimpleArtist { diff --git a/OpenLyricsClient/Backend/Structure/Other/SimpleTrack.cs b/OpenLyricsClient.Shared/Structure/Other/SimpleTrack.cs similarity index 95% rename from OpenLyricsClient/Backend/Structure/Other/SimpleTrack.cs rename to OpenLyricsClient.Shared/Structure/Other/SimpleTrack.cs index a044486..c906dc4 100644 --- a/OpenLyricsClient/Backend/Structure/Other/SimpleTrack.cs +++ b/OpenLyricsClient.Shared/Structure/Other/SimpleTrack.cs @@ -2,7 +2,7 @@ using SpotifyAPI.Web; using Squalr.Engine.Utils.Extensions; -namespace OpenLyricsClient.Backend.Structure.Other; +namespace OpenLyricsClient.Shared.Structure.Other; public class SimpleTrack { diff --git a/OpenLyricsClient/Backend/Structure/Other/SpotifyStatistics.cs b/OpenLyricsClient.Shared/Structure/Other/SpotifyStatistics.cs similarity index 76% rename from OpenLyricsClient/Backend/Structure/Other/SpotifyStatistics.cs rename to OpenLyricsClient.Shared/Structure/Other/SpotifyStatistics.cs index 9e407cb..8fddadb 100644 --- a/OpenLyricsClient/Backend/Structure/Other/SpotifyStatistics.cs +++ b/OpenLyricsClient.Shared/Structure/Other/SpotifyStatistics.cs @@ -1,6 +1,6 @@ using SpotifyAPI.Web; -namespace OpenLyricsClient.Backend.Structure.Other; +namespace OpenLyricsClient.Shared.Structure.Other; public class SpotifyStatistics { diff --git a/OpenLyricsClient/Backend/Structure/Song/Song.cs b/OpenLyricsClient.Shared/Structure/Song/Song.cs similarity index 96% rename from OpenLyricsClient/Backend/Structure/Song/Song.cs rename to OpenLyricsClient.Shared/Structure/Song/Song.cs index 260084c..452e3e9 100644 --- a/OpenLyricsClient/Backend/Structure/Song/Song.cs +++ b/OpenLyricsClient.Shared/Structure/Song/Song.cs @@ -1,9 +1,7 @@ -using System; -using Avalonia.Input; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Lyrics; -namespace OpenLyricsClient.Backend.Structure.Song +namespace OpenLyricsClient.Shared.Structure.Song { [Serializable] public class Song diff --git a/OpenLyricsClient/Backend/Structure/Song/SongMetadata.cs b/OpenLyricsClient.Shared/Structure/Song/SongMetadata.cs similarity index 95% rename from OpenLyricsClient/Backend/Structure/Song/SongMetadata.cs rename to OpenLyricsClient.Shared/Structure/Song/SongMetadata.cs index 7a2e448..bc0f0ab 100644 --- a/OpenLyricsClient/Backend/Structure/Song/SongMetadata.cs +++ b/OpenLyricsClient.Shared/Structure/Song/SongMetadata.cs @@ -1,7 +1,7 @@ using System; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; -namespace OpenLyricsClient.Backend.Structure.Song +namespace OpenLyricsClient.Shared.Structure.Song { [Serializable] public class SongMetadata diff --git a/OpenLyricsClient/Backend/Structure/Song/SongRequestObject.cs b/OpenLyricsClient.Shared/Structure/Song/SongRequestObject.cs similarity index 92% rename from OpenLyricsClient/Backend/Structure/Song/SongRequestObject.cs rename to OpenLyricsClient.Shared/Structure/Song/SongRequestObject.cs index b75388d..8a509e0 100644 --- a/OpenLyricsClient/Backend/Structure/Song/SongRequestObject.cs +++ b/OpenLyricsClient.Shared/Structure/Song/SongRequestObject.cs @@ -1,10 +1,7 @@ -using System; -using OpenLyricsClient.Backend.Collector.Lyrics; -using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; +using OpenLyricsClient.Shared.Utils.Formatting; -namespace OpenLyricsClient.Backend.Structure.Song +namespace OpenLyricsClient.Shared.Structure.Song { [Serializable] public class SongRequestObject diff --git a/OpenLyricsClient/Backend/Structure/Song/SongResponseObject.cs b/OpenLyricsClient.Shared/Structure/Song/SongResponseObject.cs similarity index 93% rename from OpenLyricsClient/Backend/Structure/Song/SongResponseObject.cs rename to OpenLyricsClient.Shared/Structure/Song/SongResponseObject.cs index c2b1b4f..ff15fd0 100644 --- a/OpenLyricsClient/Backend/Structure/Song/SongResponseObject.cs +++ b/OpenLyricsClient.Shared/Structure/Song/SongResponseObject.cs @@ -1,6 +1,6 @@ using System; -namespace OpenLyricsClient.Backend.Structure.Song; +namespace OpenLyricsClient.Shared.Structure.Song; public class SongResponseObject { diff --git a/OpenLyricsClient/Backend/Structure/Song/SongState.cs b/OpenLyricsClient.Shared/Structure/Song/SongState.cs similarity index 71% rename from OpenLyricsClient/Backend/Structure/Song/SongState.cs rename to OpenLyricsClient.Shared/Structure/Song/SongState.cs index 9f86d69..6d95d00 100644 --- a/OpenLyricsClient/Backend/Structure/Song/SongState.cs +++ b/OpenLyricsClient.Shared/Structure/Song/SongState.cs @@ -1,4 +1,4 @@ -namespace OpenLyricsClient.Backend.Structure.Song +namespace OpenLyricsClient.Shared.Structure.Song { public enum SongState { diff --git a/OpenLyricsClient/Backend/Structure/SpotifyAccess.cs b/OpenLyricsClient.Shared/Structure/SpotifyAccess.cs similarity index 81% rename from OpenLyricsClient/Backend/Structure/SpotifyAccess.cs rename to OpenLyricsClient.Shared/Structure/SpotifyAccess.cs index ebcff82..eebae2c 100644 --- a/OpenLyricsClient/Backend/Structure/SpotifyAccess.cs +++ b/OpenLyricsClient.Shared/Structure/SpotifyAccess.cs @@ -1,8 +1,8 @@ using System; -using OpenLyricsClient.Backend.Structure.Other; +using OpenLyricsClient.Shared.Structure.Other; using SpotifyAPI.Web; -namespace OpenLyricsClient.Backend.Structure +namespace OpenLyricsClient.Shared.Structure { public class SpotifyAccess { diff --git a/OpenLyricsClient/Backend/Structure/TidalAccess.cs b/OpenLyricsClient.Shared/Structure/TidalAccess.cs similarity index 92% rename from OpenLyricsClient/Backend/Structure/TidalAccess.cs rename to OpenLyricsClient.Shared/Structure/TidalAccess.cs index 24e64a8..11af34f 100644 --- a/OpenLyricsClient/Backend/Structure/TidalAccess.cs +++ b/OpenLyricsClient.Shared/Structure/TidalAccess.cs @@ -1,6 +1,6 @@ using Newtonsoft.Json; -namespace OpenLyricsClient.Backend.Structure +namespace OpenLyricsClient.Shared.Structure { public class TidalAccess { diff --git a/OpenLyricsClient/Backend/Structure/Window.cs b/OpenLyricsClient.Shared/Structure/Window.cs similarity index 90% rename from OpenLyricsClient/Backend/Structure/Window.cs rename to OpenLyricsClient.Shared/Structure/Window.cs index a048800..8c2010a 100644 --- a/OpenLyricsClient/Backend/Structure/Window.cs +++ b/OpenLyricsClient.Shared/Structure/Window.cs @@ -1,4 +1,4 @@ -namespace OpenLyricsClient.Backend.Structure +namespace OpenLyricsClient.Shared.Structure { public class Window { diff --git a/OpenLyricsClient/Backend/Utils/AnimationUtils.cs b/OpenLyricsClient.Shared/Utils/AnimationUtils.cs similarity index 96% rename from OpenLyricsClient/Backend/Utils/AnimationUtils.cs rename to OpenLyricsClient.Shared/Utils/AnimationUtils.cs index 7522abe..b541ae0 100644 --- a/OpenLyricsClient/Backend/Utils/AnimationUtils.cs +++ b/OpenLyricsClient.Shared/Utils/AnimationUtils.cs @@ -1,7 +1,7 @@ using System.Diagnostics; using System.Threading; -namespace OpenLyricsClient.Backend.Utils; +namespace OpenLyricsClient.Shared.Utils; public class AnimationUtils { diff --git a/OpenLyricsClient/Backend/Utils/AvaloniaUtils.cs b/OpenLyricsClient.Shared/Utils/AvaloniaUtils.cs similarity index 93% rename from OpenLyricsClient/Backend/Utils/AvaloniaUtils.cs rename to OpenLyricsClient.Shared/Utils/AvaloniaUtils.cs index 976979f..ca3fbe3 100644 --- a/OpenLyricsClient/Backend/Utils/AvaloniaUtils.cs +++ b/OpenLyricsClient.Shared/Utils/AvaloniaUtils.cs @@ -4,7 +4,7 @@ using Avalonia.Controls.Platform; using Avalonia.Markup.Xaml; -namespace OpenLyricsClient.Backend.Utils; +namespace OpenLyricsClient.Shared.Utils; public class AvaloniaUtils { diff --git a/OpenLyricsClient/Backend/Utils/CryptoUtils.cs b/OpenLyricsClient.Shared/Utils/CryptoUtils.cs similarity index 93% rename from OpenLyricsClient/Backend/Utils/CryptoUtils.cs rename to OpenLyricsClient.Shared/Utils/CryptoUtils.cs index 09539c3..1c4ae9c 100644 --- a/OpenLyricsClient/Backend/Utils/CryptoUtils.cs +++ b/OpenLyricsClient.Shared/Utils/CryptoUtils.cs @@ -1,7 +1,7 @@ using System.Security.Cryptography; using System.Text; -namespace OpenLyricsClient.Backend.Utils; +namespace OpenLyricsClient.Shared.Utils; public class CryptoUtils { diff --git a/OpenLyricsClient/Backend/Utils/DataConverter.cs b/OpenLyricsClient.Shared/Utils/DataConverter.cs similarity index 92% rename from OpenLyricsClient/Backend/Utils/DataConverter.cs rename to OpenLyricsClient.Shared/Utils/DataConverter.cs index a09e071..2b3a779 100644 --- a/OpenLyricsClient/Backend/Utils/DataConverter.cs +++ b/OpenLyricsClient.Shared/Utils/DataConverter.cs @@ -2,13 +2,13 @@ using System.Collections.ObjectModel; using DevBase.Api.Apis.Deezer.Structure.Json; using DevBase.Api.Apis.Tidal.Structure.Json; -using OpenLyricsClient.Backend.Structure.Json.NetEase.Json; -using OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json; +using OpenLyricsClient.Shared.Structure.Json.NetEase.Json; +using OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json; using SpotifyAPI.Web; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { - class DataConverter + public class DataConverter { public static string GetArtistsSplit(string[] artists) { diff --git a/OpenLyricsClient/Backend/Utils/DataTransformer.cs b/OpenLyricsClient.Shared/Utils/DataTransformer.cs similarity index 79% rename from OpenLyricsClient/Backend/Utils/DataTransformer.cs rename to OpenLyricsClient.Shared/Utils/DataTransformer.cs index 3587f17..a94b63e 100644 --- a/OpenLyricsClient/Backend/Utils/DataTransformer.cs +++ b/OpenLyricsClient.Shared/Utils/DataTransformer.cs @@ -1,6 +1,6 @@ -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { - class DataTransformer + public class DataTransformer { public static string CapitalizeFirstLetter(string input) { diff --git a/OpenLyricsClient/Backend/Utils/DataValidator.cs b/OpenLyricsClient.Shared/Utils/DataValidator.cs similarity index 91% rename from OpenLyricsClient/Backend/Utils/DataValidator.cs rename to OpenLyricsClient.Shared/Utils/DataValidator.cs index ed7d707..f5c4c62 100644 --- a/OpenLyricsClient/Backend/Utils/DataValidator.cs +++ b/OpenLyricsClient.Shared/Utils/DataValidator.cs @@ -1,8 +1,8 @@ using Squalr.Engine.Utils.Extensions; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { - class DataValidator + public class DataValidator { public static bool ValidateData(string value) { diff --git a/OpenLyricsClient/Backend/Utils/Debouncer.cs b/OpenLyricsClient.Shared/Utils/Debouncer.cs similarity index 91% rename from OpenLyricsClient/Backend/Utils/Debouncer.cs rename to OpenLyricsClient.Shared/Utils/Debouncer.cs index 47dfc4e..e7f1c8d 100644 --- a/OpenLyricsClient/Backend/Utils/Debouncer.cs +++ b/OpenLyricsClient.Shared/Utils/Debouncer.cs @@ -2,7 +2,7 @@ using System.Threading; using System.Threading.Tasks; -namespace OpenLyricsClient.Backend.Utils; +namespace OpenLyricsClient.Shared.Utils; public class Debouncer { diff --git a/OpenLyricsClient/Backend/Utils/EnvironmentUtils.cs b/OpenLyricsClient.Shared/Utils/EnvironmentUtils.cs similarity index 85% rename from OpenLyricsClient/Backend/Utils/EnvironmentUtils.cs rename to OpenLyricsClient.Shared/Utils/EnvironmentUtils.cs index af8b51e..61681fc 100644 --- a/OpenLyricsClient/Backend/Utils/EnvironmentUtils.cs +++ b/OpenLyricsClient.Shared/Utils/EnvironmentUtils.cs @@ -1,7 +1,7 @@ using System; using System.Linq; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { public class EnvironmentUtils { diff --git a/OpenLyricsClient/Backend/Utils/FileUtils.cs b/OpenLyricsClient.Shared/Utils/FileUtils.cs similarity index 98% rename from OpenLyricsClient/Backend/Utils/FileUtils.cs rename to OpenLyricsClient.Shared/Utils/FileUtils.cs index f78071f..9354af8 100644 --- a/OpenLyricsClient/Backend/Utils/FileUtils.cs +++ b/OpenLyricsClient.Shared/Utils/FileUtils.cs @@ -4,7 +4,7 @@ using SpotifyAPI.Web; using Squalr.Engine.Utils.Extensions; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { public class FileUtils { diff --git a/OpenLyricsClient/Backend/Handler/Song/SongFormatter.cs b/OpenLyricsClient.Shared/Utils/Formatting/SongFormatter.cs similarity index 96% rename from OpenLyricsClient/Backend/Handler/Song/SongFormatter.cs rename to OpenLyricsClient.Shared/Utils/Formatting/SongFormatter.cs index e4298ef..6ff7a57 100644 --- a/OpenLyricsClient/Backend/Handler/Song/SongFormatter.cs +++ b/OpenLyricsClient.Shared/Utils/Formatting/SongFormatter.cs @@ -1,8 +1,8 @@ using System.Text.RegularExpressions; -namespace OpenLyricsClient.Backend.Handler.Song +namespace OpenLyricsClient.Shared.Utils.Formatting { - class SongFormatter + public class SongFormatter { public static string FormatSongName(string songName) diff --git a/OpenLyricsClient/Backend/Utils/JsonDeserializer.cs b/OpenLyricsClient.Shared/Utils/JsonDeserializer.cs similarity index 97% rename from OpenLyricsClient/Backend/Utils/JsonDeserializer.cs rename to OpenLyricsClient.Shared/Utils/JsonDeserializer.cs index 5ff25a2..b50878a 100644 --- a/OpenLyricsClient/Backend/Utils/JsonDeserializer.cs +++ b/OpenLyricsClient.Shared/Utils/JsonDeserializer.cs @@ -2,7 +2,7 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { public class JsonDeserializer { diff --git a/OpenLyricsClient/Backend/Utils/LanguageUtils.cs b/OpenLyricsClient.Shared/Utils/LanguageUtils.cs similarity index 90% rename from OpenLyricsClient/Backend/Utils/LanguageUtils.cs rename to OpenLyricsClient.Shared/Utils/LanguageUtils.cs index 5dcc138..caf073e 100644 --- a/OpenLyricsClient/Backend/Utils/LanguageUtils.cs +++ b/OpenLyricsClient.Shared/Utils/LanguageUtils.cs @@ -1,7 +1,7 @@ using System; using System.Linq; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { public class LanguageUtils { diff --git a/OpenLyricsClient/Backend/Utils/LyricsUtils.cs b/OpenLyricsClient.Shared/Utils/LyricsUtils.cs similarity index 87% rename from OpenLyricsClient/Backend/Utils/LyricsUtils.cs rename to OpenLyricsClient.Shared/Utils/LyricsUtils.cs index 113330b..7c17d6d 100644 --- a/OpenLyricsClient/Backend/Utils/LyricsUtils.cs +++ b/OpenLyricsClient.Shared/Utils/LyricsUtils.cs @@ -1,7 +1,7 @@ using DevBase.Utilities; using Microsoft.VisualBasic; -namespace OpenLyricsClient.Backend.Utils; +namespace OpenLyricsClient.Shared.Utils; public class LyricsUtils { diff --git a/OpenLyricsClient/Backend/Utils/MathUtils.cs b/OpenLyricsClient.Shared/Utils/MathUtils.cs similarity index 96% rename from OpenLyricsClient/Backend/Utils/MathUtils.cs rename to OpenLyricsClient.Shared/Utils/MathUtils.cs index 5a57727..185e310 100644 --- a/OpenLyricsClient/Backend/Utils/MathUtils.cs +++ b/OpenLyricsClient.Shared/Utils/MathUtils.cs @@ -1,8 +1,8 @@ using System; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { - class MathUtils + public class MathUtils { public static bool IsDoubleInRange(double min, double max, double current) { diff --git a/OpenLyricsClient/Backend/Utils/ProcessUtils.cs b/OpenLyricsClient.Shared/Utils/ProcessUtils.cs similarity index 97% rename from OpenLyricsClient/Backend/Utils/ProcessUtils.cs rename to OpenLyricsClient.Shared/Utils/ProcessUtils.cs index ce1b72e..5dc5d3d 100644 --- a/OpenLyricsClient/Backend/Utils/ProcessUtils.cs +++ b/OpenLyricsClient.Shared/Utils/ProcessUtils.cs @@ -3,7 +3,7 @@ using System.Runtime.InteropServices; using DevBase.Generics; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { public class ProcessUtils { diff --git a/OpenLyricsClient/Backend/Utils/TidalUtils.cs b/OpenLyricsClient.Shared/Utils/TidalUtils.cs similarity index 94% rename from OpenLyricsClient/Backend/Utils/TidalUtils.cs rename to OpenLyricsClient.Shared/Utils/TidalUtils.cs index fe50772..491cdfe 100644 --- a/OpenLyricsClient/Backend/Utils/TidalUtils.cs +++ b/OpenLyricsClient.Shared/Utils/TidalUtils.cs @@ -5,7 +5,7 @@ using System.Text; using System.Threading.Tasks; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { public class TidalUtils { diff --git a/OpenLyricsClient/Backend/Utils/WinAPI.cs b/OpenLyricsClient.Shared/Utils/WinAPI.cs similarity index 90% rename from OpenLyricsClient/Backend/Utils/WinAPI.cs rename to OpenLyricsClient.Shared/Utils/WinAPI.cs index e6c1771..e91d8eb 100644 --- a/OpenLyricsClient/Backend/Utils/WinAPI.cs +++ b/OpenLyricsClient.Shared/Utils/WinAPI.cs @@ -1,7 +1,7 @@ using System; using System.Runtime.InteropServices; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { public class WinAPI { diff --git a/OpenLyricsClient/Backend/Utils/WindowUtils.cs b/OpenLyricsClient.Shared/Utils/WindowUtils.cs similarity index 94% rename from OpenLyricsClient/Backend/Utils/WindowUtils.cs rename to OpenLyricsClient.Shared/Utils/WindowUtils.cs index 4ec6973..5378148 100644 --- a/OpenLyricsClient/Backend/Utils/WindowUtils.cs +++ b/OpenLyricsClient.Shared/Utils/WindowUtils.cs @@ -4,9 +4,9 @@ using System.Drawing; using System.Runtime.InteropServices; using Avalonia.Platform; -using OpenLyricsClient.Backend.Structure; +using OpenLyricsClient.Shared.Structure; -namespace OpenLyricsClient.Backend.Utils +namespace OpenLyricsClient.Shared.Utils { public class WindowUtils { diff --git a/OpenLyricsClient/Backend/Utils/X11.cs b/OpenLyricsClient.Shared/Utils/X11.cs similarity index 81% rename from OpenLyricsClient/Backend/Utils/X11.cs rename to OpenLyricsClient.Shared/Utils/X11.cs index dd9f8f4..e69a3f1 100644 --- a/OpenLyricsClient/Backend/Utils/X11.cs +++ b/OpenLyricsClient.Shared/Utils/X11.cs @@ -1,9 +1,9 @@ using System; using Avalonia; -using OpenLyricsClient.Backend.Structure; +using OpenLyricsClient.Shared.Structure; using X11; -namespace OpenLyricsClient.Backend.Utils; +namespace OpenLyricsClient.Shared.Utils; public class X11 { diff --git a/OpenLyricsClient.sln b/OpenLyricsClient.sln index bdaa2f4..d5fecda 100644 --- a/OpenLyricsClient.sln +++ b/OpenLyricsClient.sln @@ -3,7 +3,11 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.4.32804.182 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenLyricsClient", "OpenLyricsClient\OpenLyricsClient.csproj", "{74C7EDB4-60C1-4171-821D-907AE104431F}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenLyricsClient", "OpenLyricsClient\OpenLyricsClient.csproj", "{74C7EDB4-60C1-4171-821D-907AE104431F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenLyricsClient.Shared", "OpenLyricsClient.Shared\OpenLyricsClient.Shared.csproj", "{2E60814E-9ACF-4118-AC61-8D1638666264}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpenLyricsClient.Plugin", "OpenLyricsClient.Plugin\OpenLyricsClient.Plugin.csproj", "{501B287D-47AD-453C-8DFB-DDD46BFFBC0A}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +19,14 @@ Global {74C7EDB4-60C1-4171-821D-907AE104431F}.Debug|Any CPU.Build.0 = Debug|Any CPU {74C7EDB4-60C1-4171-821D-907AE104431F}.Release|Any CPU.ActiveCfg = Release|Any CPU {74C7EDB4-60C1-4171-821D-907AE104431F}.Release|Any CPU.Build.0 = Release|Any CPU + {2E60814E-9ACF-4118-AC61-8D1638666264}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2E60814E-9ACF-4118-AC61-8D1638666264}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2E60814E-9ACF-4118-AC61-8D1638666264}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2E60814E-9ACF-4118-AC61-8D1638666264}.Release|Any CPU.Build.0 = Release|Any CPU + {501B287D-47AD-453C-8DFB-DDD46BFFBC0A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {501B287D-47AD-453C-8DFB-DDD46BFFBC0A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {501B287D-47AD-453C-8DFB-DDD46BFFBC0A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {501B287D-47AD-453C-8DFB-DDD46BFFBC0A}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/OpenLyricsClient/App.axaml.cs b/OpenLyricsClient/App.axaml.cs index 69836be..88e2426 100644 --- a/OpenLyricsClient/App.axaml.cs +++ b/OpenLyricsClient/App.axaml.cs @@ -3,7 +3,7 @@ using Avalonia; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient.Frontend.Models.Windows; using OpenLyricsClient.Frontend.View.Windows; using ScalingManager = OpenLyricsClient.Frontend.Scaling.ScalingManager; diff --git a/OpenLyricsClient/Backend/Cache/CacheData.cs b/OpenLyricsClient/Backend/Cache/CacheData.cs index e23fbaa..a91bb2f 100644 --- a/OpenLyricsClient/Backend/Cache/CacheData.cs +++ b/OpenLyricsClient/Backend/Cache/CacheData.cs @@ -1,7 +1,7 @@ using System; -using OpenLyricsClient.Backend.Structure.Artwork; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; +using OpenLyricsClient.Shared.Structure.Artwork; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; namespace OpenLyricsClient.Backend.Cache; diff --git a/OpenLyricsClient/Backend/Cache/CacheEntry.cs b/OpenLyricsClient/Backend/Cache/CacheEntry.cs index 69d2493..32187e6 100644 --- a/OpenLyricsClient/Backend/Cache/CacheEntry.cs +++ b/OpenLyricsClient/Backend/Cache/CacheEntry.cs @@ -1,10 +1,10 @@ using System; using DevBase.Utilities; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Cache { diff --git a/OpenLyricsClient/Backend/Cache/CacheManager.cs b/OpenLyricsClient/Backend/Cache/CacheManager.cs index fdc1c5b..8a9c2d2 100644 --- a/OpenLyricsClient/Backend/Cache/CacheManager.cs +++ b/OpenLyricsClient/Backend/Cache/CacheManager.cs @@ -8,12 +8,12 @@ using Newtonsoft.Json; using OpenLyricsClient.Backend.Debugger; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Artwork; -using OpenLyricsClient.Backend.Structure.Json; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Artwork; +using OpenLyricsClient.Shared.Structure.Json; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using Squalr.Engine.Utils.Extensions; namespace OpenLyricsClient.Backend.Cache diff --git a/OpenLyricsClient/Backend/Collector/Artwork/ArtworkCollector.cs b/OpenLyricsClient/Backend/Collector/Artwork/ArtworkCollector.cs index 8e6a89d..f7e48f0 100644 --- a/OpenLyricsClient/Backend/Collector/Artwork/ArtworkCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Artwork/ArtworkCollector.cs @@ -7,15 +7,16 @@ using DevBase.Generics; using OpenLyricsClient.Backend.Collector.Artwork.Providers.Deezer; using OpenLyricsClient.Backend.Collector.Artwork.Providers.Musixmatch; +using OpenLyricsClient.Backend.Collector.Artwork.Providers.Plugin; using OpenLyricsClient.Backend.Collector.Artwork.Providers.Spotify; using OpenLyricsClient.Backend.Debugger; using OpenLyricsClient.Backend.Events.EventArgs; using OpenLyricsClient.Backend.Events.EventHandler; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Artwork; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Artwork; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Collector.Artwork { @@ -29,6 +30,7 @@ public ArtworkCollector() this._artworkCollectors.Add(new SpotifyCollector()); this._artworkCollectors.Add(new DeezerCollector()); //this._artworkCollectors.Add(new MusixMatchCollector()); + this._artworkCollectors.Add(new PluginArtworkCollector()); } public async Task CollectArtwork(SongResponseObject songResponseObject) @@ -45,7 +47,7 @@ public async Task CollectArtwork(SongResponseObject songResponseObject) IArtworkCollector artworkCollector = this._artworkCollectors.Get(i); - Structure.Artwork.Artwork artwork = await artworkCollector.GetArtwork(songResponseObject); + Shared.Structure.Artwork.Artwork artwork = await artworkCollector.GetArtwork(songResponseObject); if (!DataValidator.ValidateData(artwork)) continue; diff --git a/OpenLyricsClient/Backend/Collector/Artwork/IArtworkCollector.cs b/OpenLyricsClient/Backend/Collector/Artwork/IArtworkCollector.cs index 29520a8..88951b4 100644 --- a/OpenLyricsClient/Backend/Collector/Artwork/IArtworkCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Artwork/IArtworkCollector.cs @@ -4,14 +4,14 @@ using System.Text; using System.Threading.Tasks; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Song; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Song; namespace OpenLyricsClient.Backend.Collector.Artwork { interface IArtworkCollector { - Task GetArtwork(SongResponseObject songResponseObject); + Task GetArtwork(SongResponseObject songResponseObject); string CollectorName(); int Quality(); diff --git a/OpenLyricsClient/Backend/Collector/Artwork/Providers/Deezer/DeezerCollector.cs b/OpenLyricsClient/Backend/Collector/Artwork/Providers/Deezer/DeezerCollector.cs index 7fba0af..adeb221 100644 --- a/OpenLyricsClient/Backend/Collector/Artwork/Providers/Deezer/DeezerCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Artwork/Providers/Deezer/DeezerCollector.cs @@ -3,42 +3,42 @@ using DevBase.Web; using DevBase.Web.ResponseData; using MusixmatchClientLib.API.Model.Types; -using OpenLyricsClient.Backend.Structure.Artwork; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Artwork; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using Squalr.Engine.Utils.Extensions; namespace OpenLyricsClient.Backend.Collector.Artwork.Providers.Deezer; public class DeezerCollector : IArtworkCollector { - public async Task GetArtwork(SongResponseObject songResponseObject) + public async Task GetArtwork(SongResponseObject songResponseObject) { if (!DataValidator.ValidateData(songResponseObject)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!songResponseObject.CollectorName.Equals(this.CollectorName())) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!DataValidator.ValidateData(songResponseObject.SongRequestObject)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!(songResponseObject.Track is JsonDeezerSearchDataResponse)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); JsonDeezerSearchDataResponse track = (JsonDeezerSearchDataResponse)songResponseObject.Track; string artworkUrl = GetArtworkUrl(track); if (artworkUrl.IsNullOrEmpty()) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); - Structure.Artwork.Artwork artwork = await GetArtwork(artworkUrl); + Shared.Structure.Artwork.Artwork artwork = await GetArtwork(artworkUrl); if (DataValidator.ValidateData(artwork)) return artwork; - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); } private string GetArtworkUrl(JsonDeezerSearchDataResponse track) @@ -67,10 +67,10 @@ private string GetArtworkUrl(JsonDeezerSearchDataResponse track) return string.Empty; } - private async Task GetArtwork(string url) + private async Task GetArtwork(string url) { ResponseData artwork = await new Request(url).GetResponseAsync(); - return new Structure.Artwork.Artwork(artwork.Content, string.Empty, ArtworkReturnCode.SUCCESS); + return new Shared.Structure.Artwork.Artwork(artwork.Content, string.Empty, ArtworkReturnCode.SUCCESS); } public string CollectorName() diff --git a/OpenLyricsClient/Backend/Collector/Artwork/Providers/Musixmatch/MusixMatchCollector.cs b/OpenLyricsClient/Backend/Collector/Artwork/Providers/Musixmatch/MusixMatchCollector.cs index c5a216d..eb75a8b 100644 --- a/OpenLyricsClient/Backend/Collector/Artwork/Providers/Musixmatch/MusixMatchCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Artwork/Providers/Musixmatch/MusixMatchCollector.cs @@ -11,11 +11,11 @@ using OpenLyricsClient.Backend.Collector.Lyrics; using OpenLyricsClient.Backend.Collector.Token.Provider.Musixmatch; using OpenLyricsClient.Backend.Debugger; -using OpenLyricsClient.Backend.Structure.Artwork; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Artwork; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using Squalr.Engine.Utils.Extensions; using ResponseData = DevBase.Web.ResponseData.ResponseData; @@ -30,39 +30,39 @@ public MusixMatchCollector() this._debugger = new Debugger(this); } - public async Task GetArtwork(SongResponseObject songResponseObject) + public async Task GetArtwork(SongResponseObject songResponseObject) { if (!DataValidator.ValidateData(songResponseObject)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!songResponseObject.CollectorName.Equals(this.CollectorName())) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!DataValidator.ValidateData(songResponseObject.SongRequestObject)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!(songResponseObject.Track is Track)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); Track track = (Track)songResponseObject.Track; string artworkUrl = GetArtworkUrl(track); if (artworkUrl.IsNullOrEmpty()) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); - Structure.Artwork.Artwork artwork = await GetArtwork(artworkUrl); + Shared.Structure.Artwork.Artwork artwork = await GetArtwork(artworkUrl); if (DataValidator.ValidateData(artwork)) return artwork; - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); } - private async Task GetArtwork(string url) + private async Task GetArtwork(string url) { ResponseData artwork = await new Request(url).GetResponseAsync(); - return new Structure.Artwork.Artwork(artwork.Content, string.Empty, ArtworkReturnCode.SUCCESS); + return new Shared.Structure.Artwork.Artwork(artwork.Content, string.Empty, ArtworkReturnCode.SUCCESS); } private string GetArtworkUrl(Track track) diff --git a/OpenLyricsClient/Backend/Collector/Artwork/Providers/Plugin/PluginArtworkCollector.cs b/OpenLyricsClient/Backend/Collector/Artwork/Providers/Plugin/PluginArtworkCollector.cs new file mode 100644 index 0000000..e476e36 --- /dev/null +++ b/OpenLyricsClient/Backend/Collector/Artwork/Providers/Plugin/PluginArtworkCollector.cs @@ -0,0 +1,38 @@ +using OpenLyricsClient.Shared.Plugin; +using OpenLyricsClient.Shared.Structure.Song; +using System.Linq; +using System.Threading.Tasks; + +namespace OpenLyricsClient.Backend.Collector.Artwork.Providers.Plugin +{ + internal class PluginArtworkCollector : IArtworkCollector + { + public string CollectorName() + { + return "Plugin"; + } + + async public Task GetArtwork(SongResponseObject songResponseObject) + { + Shared.Structure.Artwork.Artwork collectedData = new Shared.Structure.Artwork.Artwork(); + foreach (IPlugin plugin in Core.INSTANCE.PluginManager.GetPluginsByScope(PluginScope.ArtworkCollector).OrderByDescending((IPlugin plugin) => plugin.GetCollectedArtworkQuality())) + { + Shared.Structure.Artwork.Artwork? data = await plugin.CollectArtwork(songResponseObject); + if (data != null && data != collectedData) + { + collectedData = data; + break; + } + } + return collectedData; + } + + public int Quality() + { + IPlugin? plugin = Core.INSTANCE.PluginManager.GetPluginsByScope(PluginScope.ArtworkCollector).MaxBy((IPlugin plugin) => plugin.GetCollectedArtworkQuality()); + if (plugin == null) + return -1; + return plugin.GetCollectedArtworkQuality(); + } + } +} diff --git a/OpenLyricsClient/Backend/Collector/Artwork/Providers/Spotify/SpotifyCollector.cs b/OpenLyricsClient/Backend/Collector/Artwork/Providers/Spotify/SpotifyCollector.cs index aa2cc87..9f4c59a 100644 --- a/OpenLyricsClient/Backend/Collector/Artwork/Providers/Spotify/SpotifyCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Artwork/Providers/Spotify/SpotifyCollector.cs @@ -1,35 +1,35 @@ using System.Net; using System.Threading.Tasks; -using OpenLyricsClient.Backend.Structure.Artwork; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Artwork; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using SpotifyAPI.Web; namespace OpenLyricsClient.Backend.Collector.Artwork.Providers.Spotify; public class SpotifyCollector : IArtworkCollector { - public async Task GetArtwork(SongResponseObject songResponseObject) + public async Task GetArtwork(SongResponseObject songResponseObject) { if (!DataValidator.ValidateData(songResponseObject)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!DataValidator.ValidateData(songResponseObject.SongRequestObject)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!DataValidator.ValidateData(songResponseObject.SongRequestObject.Song)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!DataValidator.ValidateData(songResponseObject.SongRequestObject.Song.TrackObject, songResponseObject.SongRequestObject.Song.TrackObject)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!songResponseObject.CollectorName.Equals(this.CollectorName())) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); if (!(songResponseObject.Track is FullTrack)) - return new Structure.Artwork.Artwork(); + return new Shared.Structure.Artwork.Artwork(); FullTrack track = (FullTrack)songResponseObject.Track; @@ -53,10 +53,10 @@ public class SpotifyCollector : IArtworkCollector return await GetArtwork(maxImage.Url); } - private async Task GetArtwork(string url) + private async Task GetArtwork(string url) { byte[] artwork = await new WebClient().DownloadDataTaskAsync(url); - return new Structure.Artwork.Artwork(artwork, string.Empty, ArtworkReturnCode.SUCCESS); + return new Shared.Structure.Artwork.Artwork(artwork, string.Empty, ArtworkReturnCode.SUCCESS); } public string CollectorName() diff --git a/OpenLyricsClient/Backend/Collector/Lyrics/ILyricsCollector.cs b/OpenLyricsClient/Backend/Collector/Lyrics/ILyricsCollector.cs index 001fe4c..e0c3ea8 100644 --- a/OpenLyricsClient/Backend/Collector/Lyrics/ILyricsCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Lyrics/ILyricsCollector.cs @@ -1,8 +1,8 @@ using System.Threading.Tasks; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; namespace OpenLyricsClient.Backend.Collector.Lyrics { diff --git a/OpenLyricsClient/Backend/Collector/Lyrics/LyricCollector.cs b/OpenLyricsClient/Backend/Collector/Lyrics/LyricCollector.cs index f5cd7ed..7c7f879 100644 --- a/OpenLyricsClient/Backend/Collector/Lyrics/LyricCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Lyrics/LyricCollector.cs @@ -1,18 +1,21 @@ -using System.Threading.Tasks; +using System.Linq; +using System.Threading.Tasks; using DevBase.Generics; using OpenLyricsClient.Backend.Collector.Lyrics.Providers.Deezer; using OpenLyricsClient.Backend.Collector.Lyrics.Providers.Musixmatch; using OpenLyricsClient.Backend.Collector.Lyrics.Providers.NetEase; using OpenLyricsClient.Backend.Collector.Lyrics.Providers.NetEaseV2; using OpenLyricsClient.Backend.Collector.Lyrics.Providers.OpenLyricsClient; +using OpenLyricsClient.Backend.Collector.Lyrics.Providers.Plugin; using OpenLyricsClient.Backend.Collector.Lyrics.Providers.Textyl; using OpenLyricsClient.Backend.Events; using OpenLyricsClient.Backend.Events.EventArgs; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Plugin; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Collector.Lyrics { @@ -26,12 +29,13 @@ class LyricCollector public LyricCollector() { this._lyricCollectors = new AList(); - + this._lyricCollectors.Add(new MusixmatchCollector()); this._lyricCollectors.Add(new DeezerCollector()); this._lyricCollectors.Add(new NetEaseCollector()); this._lyricCollectors.Add(new NetEaseV2Collector()); this._lyricCollectors.Add(new TextylCollector()); + this._lyricCollectors.Add(new PluginLyricsCollector()); // i think OLC is always a fallback option that always works, so put it here this._lyricCollectors.Add(new OpenLyricsClientCollector()); } @@ -61,6 +65,9 @@ public async Task CollectLyrics(SongResponseObject songResponseObject) if (lyricData.LyricReturnCode != LyricReturnCode.SUCCESS) continue; + foreach (IPlugin plugin in Core.INSTANCE.PluginManager.GetPluginsByScope(PluginScope.LyricsPostprocess)) + lyricData = await plugin.ProcessLyrics(songResponseObject, lyricData); + Core.INSTANCE.CacheManager.WriteToCache(songResponseObject.SongRequestObject, lyricData); return; } diff --git a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Deezer/DeezerCollector.cs b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Deezer/DeezerCollector.cs index 1ed0a47..87eefee 100644 --- a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Deezer/DeezerCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Deezer/DeezerCollector.cs @@ -8,9 +8,9 @@ using DevBase.Format.Structure; using DevBase.Generics; using OpenLyricsClient.Backend.Debugger; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Collector.Lyrics.Providers.Deezer; diff --git a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Musixmatch/MusixmatchCollector.cs b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Musixmatch/MusixmatchCollector.cs index e5d2935..462f8fa 100644 --- a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Musixmatch/MusixmatchCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Musixmatch/MusixmatchCollector.cs @@ -15,11 +15,11 @@ using OpenLyricsClient.Backend.Collector.Token.Provider.Musixmatch; using OpenLyricsClient.Backend.Debugger; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Collector.Lyrics.Providers.Musixmatch { diff --git a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/NetEase/NetEaseCollector.cs b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/NetEase/NetEaseCollector.cs index e40fd3c..a02f644 100644 --- a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/NetEase/NetEaseCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/NetEase/NetEaseCollector.cs @@ -12,12 +12,12 @@ using DevBase.Web.ResponseData; using OpenLyricsClient.Backend.Debugger; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Json.NetEase.Json; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Json.NetEase.Json; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Collector.Lyrics.Providers.NetEase { diff --git a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/NetEaseV2/NetEaseV2Collector.cs b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/NetEaseV2/NetEaseV2Collector.cs index 6140317..b83732a 100644 --- a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/NetEaseV2/NetEaseV2Collector.cs +++ b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/NetEaseV2/NetEaseV2Collector.cs @@ -10,11 +10,11 @@ using DevBase.Web; using DevBase.Web.ResponseData; using OpenLyricsClient.Backend.Debugger; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Collector.Lyrics.Providers.NetEaseV2 { diff --git a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/OpenLyricsClient/OpenLyricsClientCollector.cs b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/OpenLyricsClient/OpenLyricsClientCollector.cs index 52f23ee..f8e793c 100644 --- a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/OpenLyricsClient/OpenLyricsClientCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/OpenLyricsClient/OpenLyricsClientCollector.cs @@ -3,9 +3,9 @@ using DevBase.Api.Apis.OpenLyricsClient.Structure.Json; using DevBase.Format.Structure; using DevBase.Generics; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Collector.Lyrics.Providers.OpenLyricsClient; diff --git a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Plugin/PluginLyricsCollector.cs b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Plugin/PluginLyricsCollector.cs new file mode 100644 index 0000000..95cacd2 --- /dev/null +++ b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Plugin/PluginLyricsCollector.cs @@ -0,0 +1,40 @@ +using OpenLyricsClient.Shared.Plugin; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using System; +using System.Linq; +using System.Threading.Tasks; + +namespace OpenLyricsClient.Backend.Collector.Lyrics.Providers.Plugin +{ + internal class PluginLyricsCollector : ILyricsCollector + { + public string CollectorName() + { + return "Plugin"; + } + + public async Task GetLyrics(SongResponseObject songResponseObject) + { + LyricData collectedData = new LyricData(); + foreach (IPlugin plugin in Core.INSTANCE.PluginManager.GetPluginsByScope(PluginScope.LyricsCollector).OrderByDescending((IPlugin plugin) => plugin.GetCollectedLyricsQuality())) + { + LyricData? data = await plugin.CollectLyrics(songResponseObject); + if (data != null && data != collectedData) + { + collectedData = data; + break; + } + } + return collectedData; + } + + public int ProviderQuality() + { + IPlugin? plugin = Core.INSTANCE.PluginManager.GetPluginsByScope(PluginScope.LyricsCollector).MaxBy((IPlugin plugin) => plugin.GetCollectedLyricsQuality()); + if (plugin == null) + return -1; + return plugin.GetCollectedLyricsQuality(); + } + } +} diff --git a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Textyl/TextylCollector.cs b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Textyl/TextylCollector.cs index c51d3eb..7b6d686 100644 --- a/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Textyl/TextylCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Lyrics/Providers/Textyl/TextylCollector.cs @@ -5,11 +5,11 @@ using DevBase.Web; using DevBase.Web.ResponseData; using OpenLyricsClient.Backend.Debugger; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Json.Textyl.Json; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Json.Textyl.Json; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using Squalr.Engine.Utils.Extensions; namespace OpenLyricsClient.Backend.Collector.Lyrics.Providers.Textyl diff --git a/OpenLyricsClient/Backend/Collector/Media/IMediaCollector.cs b/OpenLyricsClient/Backend/Collector/Media/IMediaCollector.cs index d99ac8f..d83cb76 100644 --- a/OpenLyricsClient/Backend/Collector/Media/IMediaCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Media/IMediaCollector.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Media; -using OpenLyricsClient.Backend.Structure.Song; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Media; +using OpenLyricsClient.Shared.Structure.Song; namespace OpenLyricsClient.Backend.Collector.Media; diff --git a/OpenLyricsClient/Backend/Collector/Media/Providers/Deezer/DeezerMediaCollector.cs b/OpenLyricsClient/Backend/Collector/Media/Providers/Deezer/DeezerMediaCollector.cs index 5eb24a0..8c5cc92 100644 --- a/OpenLyricsClient/Backend/Collector/Media/Providers/Deezer/DeezerMediaCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Media/Providers/Deezer/DeezerMediaCollector.cs @@ -1,10 +1,10 @@ using System.Threading.Tasks; using DevBase.Api.Apis.Deezer.Structure.Json; using OpenLyricsClient.Backend.Debugger; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Media; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Media; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Collector.Media.Providers.Deezer; diff --git a/OpenLyricsClient/Backend/Collector/Song/ISongCollector.cs b/OpenLyricsClient/Backend/Collector/Song/ISongCollector.cs index c1eafe5..eeca64c 100644 --- a/OpenLyricsClient/Backend/Collector/Song/ISongCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Song/ISongCollector.cs @@ -1,5 +1,5 @@ using System.Threading.Tasks; -using OpenLyricsClient.Backend.Structure.Song; +using OpenLyricsClient.Shared.Structure.Song; namespace OpenLyricsClient.Backend.Collector.Song; diff --git a/OpenLyricsClient/Backend/Collector/Song/Providers/Deezer/DeezerSongCollector.cs b/OpenLyricsClient/Backend/Collector/Song/Providers/Deezer/DeezerSongCollector.cs index 6d0e02d..3f343ca 100644 --- a/OpenLyricsClient/Backend/Collector/Song/Providers/Deezer/DeezerSongCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Song/Providers/Deezer/DeezerSongCollector.cs @@ -2,8 +2,8 @@ using System.Threading.Tasks; using DevBase.Api.Apis.Deezer.Structure.Json; using OpenLyricsClient.Backend.Debugger; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using Squalr.Engine.Utils.Extensions; namespace OpenLyricsClient.Backend.Collector.Song.Providers.Deezer; diff --git a/OpenLyricsClient/Backend/Collector/Song/Providers/Musixmatch/MusixmatchCollector.cs b/OpenLyricsClient/Backend/Collector/Song/Providers/Musixmatch/MusixmatchCollector.cs index ceb5de9..9079f79 100644 --- a/OpenLyricsClient/Backend/Collector/Song/Providers/Musixmatch/MusixmatchCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Song/Providers/Musixmatch/MusixmatchCollector.cs @@ -6,10 +6,10 @@ using MusixmatchClientLib.Types; using OpenLyricsClient.Backend.Collector.Token.Provider.Musixmatch; using OpenLyricsClient.Backend.Debugger; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Collector.Song.Providers.Musixmatch { diff --git a/OpenLyricsClient/Backend/Collector/Song/Providers/NetEase/NetEaseCollector.cs b/OpenLyricsClient/Backend/Collector/Song/Providers/NetEase/NetEaseCollector.cs index 22444f4..c087150 100644 --- a/OpenLyricsClient/Backend/Collector/Song/Providers/NetEase/NetEaseCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Song/Providers/NetEase/NetEaseCollector.cs @@ -5,10 +5,10 @@ using DevBase.Web; using DevBase.Web.ResponseData; using OpenLyricsClient.Backend.Debugger; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Json.NetEase.Json; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Json.NetEase.Json; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using Squalr.Engine.Utils.Extensions; namespace OpenLyricsClient.Backend.Collector.Song.Providers.NetEase diff --git a/OpenLyricsClient/Backend/Collector/Song/Providers/NetEaseV2/NetEaseV2Collector.cs b/OpenLyricsClient/Backend/Collector/Song/Providers/NetEaseV2/NetEaseV2Collector.cs index e607190..3b6f83e 100644 --- a/OpenLyricsClient/Backend/Collector/Song/Providers/NetEaseV2/NetEaseV2Collector.cs +++ b/OpenLyricsClient/Backend/Collector/Song/Providers/NetEaseV2/NetEaseV2Collector.cs @@ -6,10 +6,11 @@ using DevBase.Web.ResponseData; using OpenLyricsClient.Backend.Debugger; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Json.NetEaseV2.Json; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Json.NetEaseV2.Json; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; +using OpenLyricsClient.Shared.Utils.Formatting; namespace OpenLyricsClient.Backend.Collector.Song.Providers.NetEaseV2 { diff --git a/OpenLyricsClient/Backend/Collector/Song/Providers/Plugin/PluginSongCollector.cs b/OpenLyricsClient/Backend/Collector/Song/Providers/Plugin/PluginSongCollector.cs new file mode 100644 index 0000000..dd951a6 --- /dev/null +++ b/OpenLyricsClient/Backend/Collector/Song/Providers/Plugin/PluginSongCollector.cs @@ -0,0 +1,39 @@ +using OpenLyricsClient.Shared.Plugin; +using OpenLyricsClient.Shared.Structure.Song; +using Org.BouncyCastle.Utilities; +using System.Linq; +using System.Threading.Tasks; + +namespace OpenLyricsClient.Backend.Collector.Song.Providers.Plugin +{ + internal class PluginSongCollector : ISongCollector + { + public string CollectorName() + { + return "Plugin"; + } + + async public Task GetSong(SongRequestObject songRequestObject) + { + SongResponseObject collectedData = null; + foreach (IPlugin plugin in Core.INSTANCE.PluginManager.GetPluginsByScope(PluginScope.SongCollector).OrderByDescending((IPlugin plugin) => plugin.GetCollectedSongQuality())) + { + SongResponseObject? data = await plugin.CollectSong(songRequestObject); + if (data != null) + { + collectedData = data; + break; + } + } + return collectedData; + } + + public int ProviderQuality() + { + IPlugin? plugin = Core.INSTANCE.PluginManager.GetPluginsByScope(PluginScope.SongCollector).MaxBy((IPlugin plugin) => plugin.GetCollectedSongQuality()); + if (plugin == null) + return -1; + return plugin.GetCollectedSongQuality(); + } + } +} diff --git a/OpenLyricsClient/Backend/Collector/Song/Providers/Spotify/SpotifyCollector.cs b/OpenLyricsClient/Backend/Collector/Song/Providers/Spotify/SpotifyCollector.cs index c73f883..784d776 100644 --- a/OpenLyricsClient/Backend/Collector/Song/Providers/Spotify/SpotifyCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Song/Providers/Spotify/SpotifyCollector.cs @@ -1,7 +1,7 @@ using System.Threading.Tasks; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using SpotifyAPI.Web; namespace OpenLyricsClient.Backend.Collector.Song.Providers.Spotify; diff --git a/OpenLyricsClient/Backend/Collector/Song/SongCollector.cs b/OpenLyricsClient/Backend/Collector/Song/SongCollector.cs index 8f7fb90..0ce158a 100644 --- a/OpenLyricsClient/Backend/Collector/Song/SongCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Song/SongCollector.cs @@ -6,14 +6,15 @@ using OpenLyricsClient.Backend.Collector.Song.Providers.Musixmatch; using OpenLyricsClient.Backend.Collector.Song.Providers.NetEase; using OpenLyricsClient.Backend.Collector.Song.Providers.NetEaseV2; +using OpenLyricsClient.Backend.Collector.Song.Providers.Plugin; using OpenLyricsClient.Backend.Collector.Song.Providers.Spotify; using OpenLyricsClient.Backend.Events; using OpenLyricsClient.Backend.Events.EventArgs; using OpenLyricsClient.Backend.Handler.Artwork; using OpenLyricsClient.Backend.Handler.Lyrics; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Collector.Song; @@ -35,6 +36,7 @@ public SongCollector(SongHandler songHandler, LyricHandler lyricHandler, Artwork this._songCollectors.Add(new NetEaseV2Collector());*/ this._songCollectors.Add(new DeezerSongCollector()); this._songCollectors.Add(new SpotifyCollector()); + this._songCollectors.Add(new PluginSongCollector()); this._songResponses = new ATupleList(); diff --git a/OpenLyricsClient/Backend/Collector/Token/Provider/Musixmatch/MusixmatchTokenCollector.cs b/OpenLyricsClient/Backend/Collector/Token/Provider/Musixmatch/MusixmatchTokenCollector.cs index 18b2221..78f3b14 100644 --- a/OpenLyricsClient/Backend/Collector/Token/Provider/Musixmatch/MusixmatchTokenCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Token/Provider/Musixmatch/MusixmatchTokenCollector.cs @@ -2,8 +2,8 @@ using MusixmatchClientLib.API.Model.Types; using MusixmatchClientLib; using OpenLyricsClient.Backend.Debugger; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Utils; using System; using System.Collections.Generic; using System.Diagnostics; @@ -12,7 +12,7 @@ using System.Threading.Tasks; using MusixmatchClientLib.Auth; using OpenLyricsClient.Backend.Settings.Sections.Tokens; -using OpenLyricsClient.Backend.Structure; +using OpenLyricsClient.Shared.Structure; namespace OpenLyricsClient.Backend.Collector.Token.Provider.Musixmatch { diff --git a/OpenLyricsClient/Backend/Collector/Token/TokenCollector.cs b/OpenLyricsClient/Backend/Collector/Token/TokenCollector.cs index 308f9a3..62a059a 100644 --- a/OpenLyricsClient/Backend/Collector/Token/TokenCollector.cs +++ b/OpenLyricsClient/Backend/Collector/Token/TokenCollector.cs @@ -7,7 +7,7 @@ using DevBase.Async.Task; using DevBase.Generics; using OpenLyricsClient.Backend.Collector.Token.Provider.Musixmatch; -using OpenLyricsClient.Backend.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Enum; namespace OpenLyricsClient.Backend.Collector.Token { diff --git a/OpenLyricsClient/Backend/Core.cs b/OpenLyricsClient/Backend/Core.cs index 4fa7b7e..2fca1e9 100644 --- a/OpenLyricsClient/Backend/Core.cs +++ b/OpenLyricsClient/Backend/Core.cs @@ -14,10 +14,11 @@ using OpenLyricsClient.Backend.Handler.Services; using OpenLyricsClient.Backend.Handler.Song; using OpenLyricsClient.Backend.Helper; +using OpenLyricsClient.Shared.Plugin; using OpenLyricsClient.Backend.Settings; using OpenLyricsClient.Backend.Settings.Sections.Connection.Spotify; using OpenLyricsClient.Backend.Settings.Sections.Lyrics; -using OpenLyricsClient.Backend.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Enum; using TaskRegister = OpenLyricsClient.Backend.Overwrite.TaskRegister; namespace OpenLyricsClient.Backend @@ -53,6 +54,8 @@ class Core private TaskSuspensionToken _tickSuspensionToken; + private PluginManager _pluginManager; + public event TickEventHandler TickHandler; public event SlowTickEventHandler SlowTickHandler; @@ -97,6 +100,9 @@ public Core() this._tokenCollector = new TokenCollector(); this._serviceHandler = new ServiceHandler(); + + this._pluginManager = new PluginManager(workingDirectory); + this._pluginManager.LoadPlugins(); // TODO: find where to put it SongHandler songHandler = new SongHandler(); @@ -167,6 +173,11 @@ public SettingsHandler SettingsHandler get => this._settingsHandler; } + public PluginManager PluginManager + { + get => this._pluginManager; + } + public ArtworkHandler ArtworkHandler { get => _artworkHandler; diff --git a/OpenLyricsClient/Backend/Debugger/Debugger.cs b/OpenLyricsClient/Backend/Debugger/Debugger.cs index ec33aac..ef84acd 100644 --- a/OpenLyricsClient/Backend/Debugger/Debugger.cs +++ b/OpenLyricsClient/Backend/Debugger/Debugger.cs @@ -1,6 +1,6 @@ using System; using System.Diagnostics; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Debugger { diff --git a/OpenLyricsClient/Backend/Events/EventArgs/ArtworkAppliedEventArgs.cs b/OpenLyricsClient/Backend/Events/EventArgs/ArtworkAppliedEventArgs.cs index 1895c88..3f5736c 100644 --- a/OpenLyricsClient/Backend/Events/EventArgs/ArtworkAppliedEventArgs.cs +++ b/OpenLyricsClient/Backend/Events/EventArgs/ArtworkAppliedEventArgs.cs @@ -1,5 +1,5 @@ using System; -using OpenLyricsClient.Backend.Structure.Artwork; +using OpenLyricsClient.Shared.Structure.Artwork; namespace OpenLyricsClient.Backend.Events.EventArgs; diff --git a/OpenLyricsClient/Backend/Events/EventArgs/ArtworkFoundEventArgs.cs b/OpenLyricsClient/Backend/Events/EventArgs/ArtworkFoundEventArgs.cs index c87db49..42650bb 100644 --- a/OpenLyricsClient/Backend/Events/EventArgs/ArtworkFoundEventArgs.cs +++ b/OpenLyricsClient/Backend/Events/EventArgs/ArtworkFoundEventArgs.cs @@ -1,6 +1,6 @@ using System; -using OpenLyricsClient.Backend.Structure.Artwork; -using OpenLyricsClient.Backend.Structure.Song; +using OpenLyricsClient.Shared.Structure.Artwork; +using OpenLyricsClient.Shared.Structure.Song; namespace OpenLyricsClient.Backend.Events.EventArgs; diff --git a/OpenLyricsClient/Backend/Events/EventArgs/BlurChangedEventArgs.cs b/OpenLyricsClient/Backend/Events/EventArgs/BlurChangedEventArgs.cs index f218fcc..bd66730 100644 --- a/OpenLyricsClient/Backend/Events/EventArgs/BlurChangedEventArgs.cs +++ b/OpenLyricsClient/Backend/Events/EventArgs/BlurChangedEventArgs.cs @@ -1,5 +1,5 @@ using System; -using OpenLyricsClient.Backend.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Lyrics; namespace OpenLyricsClient.Backend.Events.EventArgs; diff --git a/OpenLyricsClient/Backend/Events/EventArgs/LyricChangedEventArgs.cs b/OpenLyricsClient/Backend/Events/EventArgs/LyricChangedEventArgs.cs index c9f6fed..cc063ee 100644 --- a/OpenLyricsClient/Backend/Events/EventArgs/LyricChangedEventArgs.cs +++ b/OpenLyricsClient/Backend/Events/EventArgs/LyricChangedEventArgs.cs @@ -1,5 +1,5 @@ using System; -using OpenLyricsClient.Backend.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Lyrics; namespace OpenLyricsClient.Backend.Events.EventArgs; diff --git a/OpenLyricsClient/Backend/Events/EventArgs/SongChangedEventArgs.cs b/OpenLyricsClient/Backend/Events/EventArgs/SongChangedEventArgs.cs index 66053d3..0f31d00 100644 --- a/OpenLyricsClient/Backend/Events/EventArgs/SongChangedEventArgs.cs +++ b/OpenLyricsClient/Backend/Events/EventArgs/SongChangedEventArgs.cs @@ -1,7 +1,7 @@ using System; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Song; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Song; namespace OpenLyricsClient.Backend.Events.EventArgs { diff --git a/OpenLyricsClient/Backend/Handler/Artwork/ArtworkHandler.cs b/OpenLyricsClient/Backend/Handler/Artwork/ArtworkHandler.cs index d3bc3d1..4f753cb 100644 --- a/OpenLyricsClient/Backend/Handler/Artwork/ArtworkHandler.cs +++ b/OpenLyricsClient/Backend/Handler/Artwork/ArtworkHandler.cs @@ -15,9 +15,9 @@ using OpenLyricsClient.Backend.Events.EventArgs; using OpenLyricsClient.Backend.Events.EventHandler; using OpenLyricsClient.Backend.Handler.Song; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Handler.Artwork { @@ -32,7 +32,7 @@ public class ArtworkHandler : IHandler private bool _disposed; - private Structure.Artwork.Artwork _oldArtwork; + private Shared.Structure.Artwork.Artwork _oldArtwork; public event ArtworkFoundEventHandler ArtworkFoundHandler; public event ArtworkAppliedEventHandler ArtworkAppliedHandler; @@ -57,7 +57,7 @@ public ArtworkHandler(SongHandler songHandler) private void OnArtworkFoundHandler(object sender, ArtworkFoundEventArgs args) { - Structure.Song.Song song = this._songHandler.CurrentSong; + Shared.Structure.Song.Song song = this._songHandler.CurrentSong; song.Artwork = args.Artwork; ArtworkAppliedEvent(args.Artwork); @@ -165,7 +165,7 @@ private async Task ApplyArtworkTask() { await Task.Delay(500); - Structure.Song.Song song = this._songHandler.CurrentSong; + Shared.Structure.Song.Song song = this._songHandler.CurrentSong; if (!DataValidator.ValidateData(song)) continue; @@ -178,7 +178,7 @@ private async Task ApplyArtworkTask() if (!DataValidator.ValidateData(songRequestObject)) continue; - Structure.Artwork.Artwork artworkCache = Core.INSTANCE.CacheManager.GetArtworkByRequest(songRequestObject); + Shared.Structure.Artwork.Artwork artworkCache = Core.INSTANCE.CacheManager.GetArtworkByRequest(songRequestObject); if (!DataValidator.ValidateData(artworkCache)) continue; @@ -205,13 +205,13 @@ private async Task ApplyArtworkTask() } } - protected virtual void ArtworkFoundEvent(SongRequestObject songResponseObject, Structure.Artwork.Artwork artwork) + protected virtual void ArtworkFoundEvent(SongRequestObject songResponseObject, Shared.Structure.Artwork.Artwork artwork) { ArtworkFoundEventHandler artworkFound = ArtworkFoundHandler; artworkFound?.Invoke(this, new ArtworkFoundEventArgs(artwork, songResponseObject)); } - protected virtual void ArtworkAppliedEvent(Structure.Artwork.Artwork artwork) + protected virtual void ArtworkAppliedEvent(Shared.Structure.Artwork.Artwork artwork) { ArtworkAppliedEventHandler artworkApplied = ArtworkAppliedHandler; artworkApplied?.Invoke(this, new ArtworkAppliedEventArgs(artwork)); diff --git a/OpenLyricsClient/Backend/Handler/License/LicenseHandler.cs b/OpenLyricsClient/Backend/Handler/License/LicenseHandler.cs index c732132..655ba8f 100644 --- a/OpenLyricsClient/Backend/Handler/License/LicenseHandler.cs +++ b/OpenLyricsClient/Backend/Handler/License/LicenseHandler.cs @@ -3,7 +3,7 @@ using DevBase.Api.Apis.OpenLyricsClient.Structure.Enum; using DevBase.Api.Apis.OpenLyricsClient.Structure.Json; using DevBase.Async.Task; -using OpenLyricsClient.Backend.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Enum; namespace OpenLyricsClient.Backend.Handler.License; diff --git a/OpenLyricsClient/Backend/Handler/Lyrics/LyricHandler.cs b/OpenLyricsClient/Backend/Handler/Lyrics/LyricHandler.cs index b1dcaa5..b8926be 100644 --- a/OpenLyricsClient/Backend/Handler/Lyrics/LyricHandler.cs +++ b/OpenLyricsClient/Backend/Handler/Lyrics/LyricHandler.cs @@ -11,11 +11,11 @@ using OpenLyricsClient.Backend.Events.EventHandler; using OpenLyricsClient.Backend.Handler.Song; using OpenLyricsClient.Backend.Helper; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using Squalr.Engine.Utils.Extensions; namespace OpenLyricsClient.Backend.Handler.Lyrics @@ -68,7 +68,7 @@ public LyricHandler(SongHandler songHandler) private void OnLyricChanged(object sender, LyricChangedEventArgs lyricChangedEventArgs) { - Structure.Song.Song currentSong = this._songHandler.CurrentSong; + Shared.Structure.Song.Song currentSong = this._songHandler.CurrentSong; if (currentSong.Lyrics.LyricParts.IsNullOrEmpty()) return; @@ -111,7 +111,7 @@ private async Task ApplyLyricsToSong() await this._applyLyricSuspensionToken.WaitForRelease(); await Task.Delay(100); - Structure.Song.Song song = _songHandler.CurrentSong; + Shared.Structure.Song.Song song = _songHandler.CurrentSong; if (DataValidator.ValidateData(song) && DataValidator.ValidateData(song.SongMetadata.Name) && @@ -165,7 +165,7 @@ private async Task ManageLyrics() if (DataValidator.ValidateData(this._songHandler)) { - Structure.Song.Song currentSong = this._songHandler.CurrentSong; + Shared.Structure.Song.Song currentSong = this._songHandler.CurrentSong; if (DataValidator.ValidateData(currentSong) && DataValidator.ValidateData(currentSong.Time) && diff --git a/OpenLyricsClient/Backend/Handler/Lyrics/LyricStageChange.cs b/OpenLyricsClient/Backend/Handler/Lyrics/LyricStageChange.cs index 94d84df..fef0ad0 100644 --- a/OpenLyricsClient/Backend/Handler/Lyrics/LyricStageChange.cs +++ b/OpenLyricsClient/Backend/Handler/Lyrics/LyricStageChange.cs @@ -1,6 +1,6 @@ -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Handler.Lyrics { diff --git a/OpenLyricsClient/Backend/Handler/Services/ServiceHandler.cs b/OpenLyricsClient/Backend/Handler/Services/ServiceHandler.cs index 7d2b6b2..309143c 100644 --- a/OpenLyricsClient/Backend/Handler/Services/ServiceHandler.cs +++ b/OpenLyricsClient/Backend/Handler/Services/ServiceHandler.cs @@ -4,7 +4,7 @@ using OpenLyricsClient.Backend.Debugger; using OpenLyricsClient.Backend.Handler.Services.Services; using OpenLyricsClient.Backend.Handler.Services.Services.Spotify; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Handler.Services { diff --git a/OpenLyricsClient/Backend/Handler/Services/Services/Spotify/SpotifyService.cs b/OpenLyricsClient/Backend/Handler/Services/Services/Spotify/SpotifyService.cs index 294ab39..dda86b9 100644 --- a/OpenLyricsClient/Backend/Handler/Services/Services/Spotify/SpotifyService.cs +++ b/OpenLyricsClient/Backend/Handler/Services/Services/Spotify/SpotifyService.cs @@ -10,15 +10,15 @@ using Microsoft.Extensions.Configuration; using OpenLyricsClient.Backend.Debugger; using OpenLyricsClient.Backend.Settings.Sections.Connection.Spotify; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Other; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Other; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient.Frontend.Structure; using OpenLyricsClient.Frontend.View.Windows; using OpenLyricsClient.Frontend.View.Windows.Auth; using SpotifyAPI.Web; -using SimpleArtist = OpenLyricsClient.Backend.Structure.Other.SimpleArtist; -using SimpleTrack = OpenLyricsClient.Backend.Structure.Other.SimpleTrack; +using SimpleArtist = OpenLyricsClient.Shared.Structure.Other.SimpleArtist; +using SimpleTrack = OpenLyricsClient.Shared.Structure.Other.SimpleTrack; namespace OpenLyricsClient.Backend.Handler.Services.Services.Spotify { @@ -115,7 +115,7 @@ public async Task GetStatistics(string accessToken = "") public async Task UpdatePlayback(EnumPlayback playback) { SpotifyClient spotifyClient = new SpotifyClient(GetAccessToken()); - Structure.Song.Song song = Core.INSTANCE.SongHandler?.CurrentSong!; + Shared.Structure.Song.Song song = Core.INSTANCE.SongHandler?.CurrentSong!; switch (playback) { @@ -201,7 +201,7 @@ public async Task StartAuthorization() cefAuthWindow.Close(); } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { ProcessStartInfo processStartInfo = new ProcessStartInfo("https://openlyricsclient.com/api/auth/spotify/begin/listener"); processStartInfo.UseShellExecute = true; diff --git a/OpenLyricsClient/Backend/Handler/Song/SongHandler.cs b/OpenLyricsClient/Backend/Handler/Song/SongHandler.cs index 8896f0d..ca22530 100644 --- a/OpenLyricsClient/Backend/Handler/Song/SongHandler.cs +++ b/OpenLyricsClient/Backend/Handler/Song/SongHandler.cs @@ -12,9 +12,9 @@ using OpenLyricsClient.Backend.Handler.Lyrics; using OpenLyricsClient.Backend.Handler.Song.SongProvider; using OpenLyricsClient.Backend.Handler.Song.SongProvider.Spotify; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Handler.Song { @@ -92,7 +92,7 @@ private async Task ManageCurrentSong() if (DataValidator.ValidateData(this._songStageChange) && DataValidator.ValidateData(this._songProviderChooser)) { - Structure.Song.Song currentSong = GetCurrentSong(); + Shared.Structure.Song.Song currentSong = GetCurrentSong(); //POST WIRD NICHT IMMER AUSGEFÜHRT if (this._songStageChange.HasSongChanged(currentSong)) @@ -104,7 +104,7 @@ private async Task ManageCurrentSong() if (!DataValidator.ValidateData(songProvider)) continue; - Structure.Song.Song song = await songProvider.UpdateCurrentPlaybackTrack(); + Shared.Structure.Song.Song song = await songProvider.UpdateCurrentPlaybackTrack(); Core.INSTANCE.CacheManager.WriteToCache(SongRequestObject.FromSong(song)); // @@ -125,7 +125,7 @@ private async Task SongInformation() } } - private void PrintSongState(Structure.Song.Song song) + private void PrintSongState(Shared.Structure.Song.Song song) { if (DataValidator.ValidateData(song) && DataValidator.ValidateData(song.SongMetadata.Name, song.Time, song.TimeThreshold)) @@ -162,7 +162,7 @@ public EnumSongProvider SongProvider get => this._songProviderChooser.GetSongProvider(); } - private Structure.Song.Song GetCurrentSong() + private Shared.Structure.Song.Song GetCurrentSong() { if (DataValidator.ValidateData(this._songProviderChooser)) { @@ -197,7 +197,7 @@ await Dispatcher.UIThread.InvokeAsync(() => }); } - public Structure.Song.Song CurrentSong + public Shared.Structure.Song.Song CurrentSong { get => GetCurrentSong(); } diff --git a/OpenLyricsClient/Backend/Handler/Song/SongProvider/ISongProvider.cs b/OpenLyricsClient/Backend/Handler/Song/SongProvider/ISongProvider.cs index 5cc9fb5..d9d3be9 100644 --- a/OpenLyricsClient/Backend/Handler/Song/SongProvider/ISongProvider.cs +++ b/OpenLyricsClient/Backend/Handler/Song/SongProvider/ISongProvider.cs @@ -4,9 +4,9 @@ namespace OpenLyricsClient.Backend.Handler.Song.SongProvider { public interface ISongProvider { - Structure.Song.Song GetCurrentSong(); + Shared.Structure.Song.Song GetCurrentSong(); EnumSongProvider GetEnum(); - Task UpdateCurrentPlaybackTrack(); + Task UpdateCurrentPlaybackTrack(); void Dispose(); } } diff --git a/OpenLyricsClient/Backend/Handler/Song/SongProvider/SongProviderChooser.cs b/OpenLyricsClient/Backend/Handler/Song/SongProvider/SongProviderChooser.cs index 87d3275..8aef63a 100644 --- a/OpenLyricsClient/Backend/Handler/Song/SongProvider/SongProviderChooser.cs +++ b/OpenLyricsClient/Backend/Handler/Song/SongProvider/SongProviderChooser.cs @@ -6,8 +6,8 @@ using DevBase.Typography; using OpenLyricsClient.Backend.Debugger; using OpenLyricsClient.Backend.Handler.Services.Services; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Handler.Song.SongProvider { diff --git a/OpenLyricsClient/Backend/Handler/Song/SongProvider/Spotify/SpotifyDataMerger.cs b/OpenLyricsClient/Backend/Handler/Song/SongProvider/Spotify/SpotifyDataMerger.cs index 625e23c..4166dfd 100644 --- a/OpenLyricsClient/Backend/Handler/Song/SongProvider/Spotify/SpotifyDataMerger.cs +++ b/OpenLyricsClient/Backend/Handler/Song/SongProvider/Spotify/SpotifyDataMerger.cs @@ -1,15 +1,15 @@ using System; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using SpotifyAPI.Web; namespace OpenLyricsClient.Backend.Handler.Song.SongProvider.Spotify { class SpotifyDataMerger { - public static Structure.Song.Song ValidateUpdatePlayBack(Structure.Song.Song song, CurrentlyPlayingContext playbackContext) + public static Shared.Structure.Song.Song ValidateUpdatePlayBack(Shared.Structure.Song.Song song, CurrentlyPlayingContext playbackContext) { if (DataValidator.ValidateData(song) && DataValidator.ValidateData(playbackContext) && @@ -22,7 +22,7 @@ public static Structure.Song.Song ValidateUpdatePlayBack(Structure.Song.Song son return song; } - public static Structure.Song.Song UpdatePlayBack(Structure.Song.Song song, CurrentlyPlayingContext playbackContext) + public static Shared.Structure.Song.Song UpdatePlayBack(Shared.Structure.Song.Song song, CurrentlyPlayingContext playbackContext) { song.Paused = !playbackContext.IsPlaying; song.TimeStamp = DateTimeOffset.Now.ToUnixTimeMilliseconds(); @@ -30,7 +30,7 @@ public static Structure.Song.Song UpdatePlayBack(Structure.Song.Song song, Curre return song; } - public static Structure.Song.Song ValidateUpdateAndMerge(Structure.Song.Song song, CurrentlyPlayingContext currentTrack) + public static Shared.Structure.Song.Song ValidateUpdateAndMerge(Shared.Structure.Song.Song song, CurrentlyPlayingContext currentTrack) { if (DataValidator.ValidateData(song) && DataValidator.ValidateData( @@ -54,7 +54,7 @@ public static Structure.Song.Song ValidateUpdateAndMerge(Structure.Song.Song son return song; } - public static Structure.Song.Song UpdateAndMerge(Structure.Song.Song song, CurrentlyPlayingContext currentTrack) + public static Shared.Structure.Song.Song UpdateAndMerge(Shared.Structure.Song.Song song, CurrentlyPlayingContext currentTrack) { if (currentTrack.Item.Type.Equals(ItemType.Track)) { @@ -72,7 +72,7 @@ public static Structure.Song.Song UpdateAndMerge(Structure.Song.Song song, Curre return song; } - public static Structure.Song.Song ValidateConvertAndMerge(CurrentlyPlayingContext currentTrack) + public static Shared.Structure.Song.Song ValidateConvertAndMerge(CurrentlyPlayingContext currentTrack) { if (DataValidator.ValidateData(currentTrack) && DataValidator.ValidateData(currentTrack.Timestamp) && @@ -86,14 +86,14 @@ public static Structure.Song.Song ValidateConvertAndMerge(CurrentlyPlayingContex return null; } - public static Structure.Song.Song ConvertAndMerge(CurrentlyPlayingContext currentTrack) + public static Shared.Structure.Song.Song ConvertAndMerge(CurrentlyPlayingContext currentTrack) { if (currentTrack.Item.Type.Equals(ItemType.Track)) { if (currentTrack.Item is FullTrack) { FullTrack track = (FullTrack)currentTrack.Item; - Structure.Song.Song song = new Structure.Song.Song( + Shared.Structure.Song.Song song = new Shared.Structure.Song.Song( DataOrigin.SPOTIFY, track, track.Name, diff --git a/OpenLyricsClient/Backend/Handler/Song/SongProvider/Spotify/SpotifySongProvider.cs b/OpenLyricsClient/Backend/Handler/Song/SongProvider/Spotify/SpotifySongProvider.cs index 1211434..dd5b812 100644 --- a/OpenLyricsClient/Backend/Handler/Song/SongProvider/Spotify/SpotifySongProvider.cs +++ b/OpenLyricsClient/Backend/Handler/Song/SongProvider/Spotify/SpotifySongProvider.cs @@ -3,8 +3,8 @@ using DevBase.Async.Task; using OpenLyricsClient.Backend.Debugger; using OpenLyricsClient.Backend.Handler.Services.Services; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Utils; using SpotifyAPI.Web; namespace OpenLyricsClient.Backend.Handler.Song.SongProvider.Spotify @@ -12,7 +12,7 @@ namespace OpenLyricsClient.Backend.Handler.Song.SongProvider.Spotify class SpotifySongProvider : ISongProvider { private Debugger _debugger; - private Structure.Song.Song _currentSong; + private Shared.Structure.Song.Song _currentSong; private SpotifyClient _spotifyClient; private string _accessToken; @@ -63,7 +63,7 @@ private async Task TimeSyncTask() { try { - Structure.Song.Song currentSong = this._currentSong; + Shared.Structure.Song.Song currentSong = this._currentSong; lock (currentSong) { @@ -143,7 +143,7 @@ private async Task UpdateSongDataTask() } //Song changed -> get new song - public async Task UpdateCurrentPlaybackTrack() + public async Task UpdateCurrentPlaybackTrack() { if (!this._service.IsConnected()) return null; @@ -157,7 +157,7 @@ private async Task UpdateSongDataTask() if (DataValidator.ValidateData(currentTrack)) { - Structure.Song.Song song = SpotifyDataMerger.ValidateConvertAndMerge(currentTrack); + Shared.Structure.Song.Song song = SpotifyDataMerger.ValidateConvertAndMerge(currentTrack); this._currentSong = song; this._debugger.Write("Song has been changed", DebugType.INFO); return song; @@ -187,7 +187,7 @@ public void Dispose() EnumRegisterTypes.SPOTIFYSONGPROVIDER_UPDATEPLAYBACK); } - public Structure.Song.Song GetCurrentSong() + public Shared.Structure.Song.Song GetCurrentSong() { return this._currentSong; } diff --git a/OpenLyricsClient/Backend/Handler/Song/SongStageChange.cs b/OpenLyricsClient/Backend/Handler/Song/SongStageChange.cs index 4cd1f2d..2b6ba18 100644 --- a/OpenLyricsClient/Backend/Handler/Song/SongStageChange.cs +++ b/OpenLyricsClient/Backend/Handler/Song/SongStageChange.cs @@ -1,10 +1,10 @@ -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Handler.Song { class SongStageChange { - private Structure.Song.Song _lastSong; + private Shared.Structure.Song.Song _lastSong; private bool _timeCheck = false; public SongStageChange() @@ -12,7 +12,7 @@ public SongStageChange() } - public bool HasSongChanged(Structure.Song.Song currentSong) + public bool HasSongChanged(Shared.Structure.Song.Song currentSong) { if (DataValidator.ValidateData(currentSong)) { @@ -90,7 +90,7 @@ public void Reset() this._timeCheck = true; } - public void Update(Structure.Song.Song song) + public void Update(Shared.Structure.Song.Song song) { this._lastSong = song; } diff --git a/OpenLyricsClient/Backend/Helper/RomanizationHelper.cs b/OpenLyricsClient/Backend/Helper/RomanizationHelper.cs index 8c6166d..b4ce670 100644 --- a/OpenLyricsClient/Backend/Helper/RomanizationHelper.cs +++ b/OpenLyricsClient/Backend/Helper/RomanizationHelper.cs @@ -3,8 +3,8 @@ using System.Linq; using System.Text; using System.Threading.Tasks; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Helper { diff --git a/OpenLyricsClient/Backend/Helper/WindowLogger.cs b/OpenLyricsClient/Backend/Helper/WindowLogger.cs index f85ceda..dcf4b0b 100644 --- a/OpenLyricsClient/Backend/Helper/WindowLogger.cs +++ b/OpenLyricsClient/Backend/Helper/WindowLogger.cs @@ -2,8 +2,8 @@ using System.Runtime.InteropServices; using Avalonia; using DevBase.Generics; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Helper { @@ -52,7 +52,7 @@ public bool IsLastWindow(string processName) if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) { - w = Utils.X11.GetFocusedWindow(); + w = Shared.Utils.X11.GetFocusedWindow(); } if (!DataValidator.ValidateData(w)) diff --git a/OpenLyricsClient/Backend/Overwrite/TaskRegister.cs b/OpenLyricsClient/Backend/Overwrite/TaskRegister.cs index eee6cc6..2176b33 100644 --- a/OpenLyricsClient/Backend/Overwrite/TaskRegister.cs +++ b/OpenLyricsClient/Backend/Overwrite/TaskRegister.cs @@ -1,6 +1,6 @@ using System; using DevBase.Async.Task; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Overwrite; diff --git a/OpenLyricsClient/Backend/Plugins/PluginManager.cs b/OpenLyricsClient/Backend/Plugins/PluginManager.cs new file mode 100644 index 0000000..9df8567 --- /dev/null +++ b/OpenLyricsClient/Backend/Plugins/PluginManager.cs @@ -0,0 +1,52 @@ +using OpenLyricsClient.Shared.Plugin; +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace OpenLyricsClient.Shared.Plugin +{ + internal class PluginManager + { + private List _plugins = new List(); + + private readonly string pluginsFolder; + + internal PluginManager(string workingDirectory) + { + pluginsFolder = Path.Join(workingDirectory, "Plugins"); + Directory.CreateDirectory(pluginsFolder); + } + + public void LoadPlugins() + { + _plugins.Clear(); + + DirectoryInfo pluginDirectory = new DirectoryInfo(pluginsFolder); + + if (!pluginDirectory.Exists) + pluginDirectory.Create(); + + var pluginFiles = Directory.GetFiles(pluginsFolder, "*.dll"); + + foreach (var file in pluginFiles) + { + Assembly asm = Assembly.LoadFrom(file); + var types = asm.GetTypes().Where(t => t.GetInterfaces().Where(i => i.FullName == typeof(IPlugin).FullName).Any()); + + foreach (var type in types) + { + if (type.FullName != null && asm.CreateInstance(type.FullName) is IPlugin plugin) + _plugins.Add(plugin); + } + } + } + + public IEnumerable GetPlugins() => _plugins; + + public IEnumerable GetPluginsByScope(PluginScope scope) => GetPlugins().Where((plugin) => plugin.Scope.HasFlag(scope)); + } +} diff --git a/OpenLyricsClient/Backend/Romanization/Romanization.cs b/OpenLyricsClient/Backend/Romanization/Romanization.cs index 6cee0ff..88a624c 100644 --- a/OpenLyricsClient/Backend/Romanization/Romanization.cs +++ b/OpenLyricsClient/Backend/Romanization/Romanization.cs @@ -4,8 +4,8 @@ using HangeulRomanizer; using Kawazu; using OpenLyricsClient.Backend.Settings.Sections.Romanization; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Utils; using Romanization; //using KoreanRomanisation; diff --git a/OpenLyricsClient/Backend/Settings/Sections/Account/AccountSection.cs b/OpenLyricsClient/Backend/Settings/Sections/Account/AccountSection.cs index e67a324..fe15ad5 100644 --- a/OpenLyricsClient/Backend/Settings/Sections/Account/AccountSection.cs +++ b/OpenLyricsClient/Backend/Settings/Sections/Account/AccountSection.cs @@ -9,8 +9,8 @@ using OpenLyricsClient.Backend; using OpenLyricsClient.Backend.Settings; using OpenLyricsClient.Backend.Settings.Sections.Account; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient = DevBase.Api.Apis.OpenLyricsClient.OpenLyricsClient; public class AccountSection : ISettingSection diff --git a/OpenLyricsClient/Backend/Settings/Sections/Connection/Spotify/SpotifySection.cs b/OpenLyricsClient/Backend/Settings/Sections/Connection/Spotify/SpotifySection.cs index 16bb1d7..c082fd3 100644 --- a/OpenLyricsClient/Backend/Settings/Sections/Connection/Spotify/SpotifySection.cs +++ b/OpenLyricsClient/Backend/Settings/Sections/Connection/Spotify/SpotifySection.cs @@ -4,10 +4,10 @@ using System.Threading.Tasks; using DevBase.Generics; using Newtonsoft.Json.Linq; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Other; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Other; +using OpenLyricsClient.Shared.Utils; using SpotifyAPI.Web; using SimpleArtist = SpotifyAPI.Web.SimpleArtist; using SimpleTrack = SpotifyAPI.Web.SimpleTrack; diff --git a/OpenLyricsClient/Backend/Settings/Sections/Lyrics/LyricsSection.cs b/OpenLyricsClient/Backend/Settings/Sections/Lyrics/LyricsSection.cs index c734d2f..eb975f1 100644 --- a/OpenLyricsClient/Backend/Settings/Sections/Lyrics/LyricsSection.cs +++ b/OpenLyricsClient/Backend/Settings/Sections/Lyrics/LyricsSection.cs @@ -6,8 +6,8 @@ using DevBase.Generics; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Settings.Sections.Lyrics; diff --git a/OpenLyricsClient/Backend/Settings/Sections/Lyrics/Structure.cs b/OpenLyricsClient/Backend/Settings/Sections/Lyrics/Structure.cs index 35c49b4..2b53fc0 100644 --- a/OpenLyricsClient/Backend/Settings/Sections/Lyrics/Structure.cs +++ b/OpenLyricsClient/Backend/Settings/Sections/Lyrics/Structure.cs @@ -1,5 +1,5 @@ using Newtonsoft.Json; -using OpenLyricsClient.Backend.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Enum; namespace OpenLyricsClient.Backend.Settings.Sections.Lyrics; diff --git a/OpenLyricsClient/Backend/Settings/Sections/Plugins/PluginsSection.cs b/OpenLyricsClient/Backend/Settings/Sections/Plugins/PluginsSection.cs new file mode 100644 index 0000000..dcb0ac3 --- /dev/null +++ b/OpenLyricsClient/Backend/Settings/Sections/Plugins/PluginsSection.cs @@ -0,0 +1,74 @@ +using System.IO; +using System.Threading.Tasks; +using DevBase.Generics; +using Newtonsoft.Json.Linq; +using OpenLyricsClient.Backend; +using OpenLyricsClient.Backend.Settings; +using OpenLyricsClient.Backend.Settings.Sections.Plugins; +using OpenLyricsClient.Shared.Utils; + +public class PluginsSection : ISettingSection +{ + private FileInfo _file; + private JObject _data; + + public PluginsSection(string filePath) + { + this._file = new FileInfo(filePath); + } + + public async Task WriteToDisk() + { + string encoded = Core.INSTANCE.Sealing.SimpleEncrypt(this._data.ToString()); + await File.WriteAllTextAsync(this._file.FullName, encoded); + } + + public async Task ReadFromDisk() + { + if (!this._file.Exists) + { + this._data = Defaults(); + await WriteToDisk(); + return; + } + + await using FileStream stream = this._file.OpenRead(); + using StreamReader reader = new StreamReader(stream); + + string decoded = Core.INSTANCE.Sealing.SimpleDecrypt(reader.ReadToEnd()); + + this._data = JObject.Parse(decoded); + + await stream.FlushAsync(); + + stream.Close(); + reader.Close(); + } + + public T GetValue(string field) + { + return (T)this._data[field].ToObject(); + } + + public async Task SetValue(string field, T value) + { + this._data[field] = JToken.FromObject(value); + await WriteToDisk(); + } + + public JObject Defaults() + { + Structure structure = new Structure(); // TODO + return new JsonDeserializer().Serialize(structure); + } + + public string[] GetFields() + { + AList fields = new AList(); + + foreach (var pair in this._data) + fields.Add(pair.Key); + + return fields.GetAsArray(); + } +} \ No newline at end of file diff --git a/OpenLyricsClient/Backend/Settings/Sections/Plugins/Structure.cs b/OpenLyricsClient/Backend/Settings/Sections/Plugins/Structure.cs new file mode 100644 index 0000000..6232995 --- /dev/null +++ b/OpenLyricsClient/Backend/Settings/Sections/Plugins/Structure.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace OpenLyricsClient.Backend.Settings.Sections.Plugins +{ + internal class Structure + { + internal class PluginStructure + { + public string Name { get; set; } = ""; + public string Path { get; set; } = ""; + public bool Enabled { get; set; } = false; + public Dictionary Settings { get; set; } = new Dictionary(); + } + + public List Plugins { get; set; } = new List(); + } +} diff --git a/OpenLyricsClient/Backend/Settings/Sections/Romanization/RomanizationSection.cs b/OpenLyricsClient/Backend/Settings/Sections/Romanization/RomanizationSection.cs index ea6fc9a..ff729ef 100644 --- a/OpenLyricsClient/Backend/Settings/Sections/Romanization/RomanizationSection.cs +++ b/OpenLyricsClient/Backend/Settings/Sections/Romanization/RomanizationSection.cs @@ -8,9 +8,9 @@ using Newtonsoft.Json; using Newtonsoft.Json.Linq; using OpenLyricsClient.Backend.Romanization; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Settings.Sections.Romanization; diff --git a/OpenLyricsClient/Backend/Settings/Sections/Tokens/Structure.cs b/OpenLyricsClient/Backend/Settings/Sections/Tokens/Structure.cs index 708ef09..91aa825 100644 --- a/OpenLyricsClient/Backend/Settings/Sections/Tokens/Structure.cs +++ b/OpenLyricsClient/Backend/Settings/Sections/Tokens/Structure.cs @@ -1,5 +1,5 @@ using System.Collections.Generic; -using OpenLyricsClient.Backend.Structure; +using OpenLyricsClient.Shared.Structure; namespace OpenLyricsClient.Backend.Settings.Sections.Tokens; diff --git a/OpenLyricsClient/Backend/Settings/Sections/Tokens/TokenSection.cs b/OpenLyricsClient/Backend/Settings/Sections/Tokens/TokenSection.cs index b5544d8..de2251c 100644 --- a/OpenLyricsClient/Backend/Settings/Sections/Tokens/TokenSection.cs +++ b/OpenLyricsClient/Backend/Settings/Sections/Tokens/TokenSection.cs @@ -8,9 +8,9 @@ using DevBase.Generics; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using OpenLyricsClient.Backend.Structure; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Backend.Settings.Sections.Tokens; diff --git a/OpenLyricsClient/Backend/Settings/SettingsHandler.cs b/OpenLyricsClient/Backend/Settings/SettingsHandler.cs index 66b60f5..9351691 100644 --- a/OpenLyricsClient/Backend/Settings/SettingsHandler.cs +++ b/OpenLyricsClient/Backend/Settings/SettingsHandler.cs @@ -9,7 +9,7 @@ using OpenLyricsClient.Backend.Settings.Sections.Lyrics; using OpenLyricsClient.Backend.Settings.Sections.Romanization; using OpenLyricsClient.Backend.Settings.Sections.Tokens; -using OpenLyricsClient.Backend.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Enum; namespace OpenLyricsClient.Backend.Settings; @@ -40,6 +40,9 @@ public SettingsHandler(string workingDirectory) this._sections.Add(new AccountSection(string.Format("{0}{1}", workingDirectory, "Account.json"))); + this._sections.Add(new PluginsSection(string.Format("{0}{1}", + workingDirectory, "Plugins.json"))); // Path.Join() + Task.Factory.StartNew(Initialize).GetAwaiter().GetResult(); } diff --git a/OpenLyricsClient/Backend/Structure/Enum/DataOrigin.cs b/OpenLyricsClient/Backend/Structure/Enum/DataOrigin.cs deleted file mode 100644 index b705947..0000000 --- a/OpenLyricsClient/Backend/Structure/Enum/DataOrigin.cs +++ /dev/null @@ -1,6 +0,0 @@ -namespace OpenLyricsClient.Backend.Structure.Enum; - -public enum DataOrigin -{ - SPOTIFY, TIDAL -} \ No newline at end of file diff --git a/OpenLyricsClient/Frontend/Models/Custom/LyricsScrollerViewModel.cs b/OpenLyricsClient/Frontend/Models/Custom/LyricsScrollerViewModel.cs index 965adfa..656af90 100644 --- a/OpenLyricsClient/Frontend/Models/Custom/LyricsScrollerViewModel.cs +++ b/OpenLyricsClient/Frontend/Models/Custom/LyricsScrollerViewModel.cs @@ -17,10 +17,10 @@ using OpenLyricsClient.Backend.Events.EventArgs; using OpenLyricsClient.Backend.Helper; using OpenLyricsClient.Backend.Settings.Sections.Lyrics; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient.Frontend.Models.Pages.Settings; using Squalr.Engine.Utils.Extensions; diff --git a/OpenLyricsClient/Frontend/Models/Custom/NewLyricsScrollerViewModel.cs b/OpenLyricsClient/Frontend/Models/Custom/NewLyricsScrollerViewModel.cs index f477887..b14e13a 100644 --- a/OpenLyricsClient/Frontend/Models/Custom/NewLyricsScrollerViewModel.cs +++ b/OpenLyricsClient/Frontend/Models/Custom/NewLyricsScrollerViewModel.cs @@ -3,7 +3,7 @@ using System.Runtime.CompilerServices; using OpenLyricsClient.Backend; using OpenLyricsClient.Backend.Events.EventArgs; -using OpenLyricsClient.Backend.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Lyrics; namespace OpenLyricsClient.Frontend.Models.Custom; diff --git a/OpenLyricsClient/Frontend/Models/Elements/Blur/BlurArea.cs b/OpenLyricsClient/Frontend/Models/Elements/Blur/BlurArea.cs index d008a8b..7c3365b 100644 --- a/OpenLyricsClient/Frontend/Models/Elements/Blur/BlurArea.cs +++ b/OpenLyricsClient/Frontend/Models/Elements/Blur/BlurArea.cs @@ -6,8 +6,8 @@ using Avalonia.Media; using OpenLyricsClient.Backend; using OpenLyricsClient.Backend.Events.EventArgs; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient.Frontend.View.Custom; namespace OpenLyricsClient.Frontend.Models.Elements.Blur; diff --git a/OpenLyricsClient/Frontend/Models/Elements/Blur/BlurBehindRenderOperation.cs b/OpenLyricsClient/Frontend/Models/Elements/Blur/BlurBehindRenderOperation.cs index d27858f..6f4aff8 100644 --- a/OpenLyricsClient/Frontend/Models/Elements/Blur/BlurBehindRenderOperation.cs +++ b/OpenLyricsClient/Frontend/Models/Elements/Blur/BlurBehindRenderOperation.cs @@ -5,7 +5,7 @@ using Avalonia.Platform; using Avalonia.Rendering.SceneGraph; using Avalonia.Skia; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; using SkiaSharp; namespace OpenLyricsClient.Frontend.Models.Elements.Blur; diff --git a/OpenLyricsClient/Frontend/Models/Elements/LyricsCard.cs b/OpenLyricsClient/Frontend/Models/Elements/LyricsCard.cs index da95b55..4df0348 100644 --- a/OpenLyricsClient/Frontend/Models/Elements/LyricsCard.cs +++ b/OpenLyricsClient/Frontend/Models/Elements/LyricsCard.cs @@ -13,9 +13,9 @@ using OpenLyricsClient.Backend; using OpenLyricsClient.Backend.Settings.Sections.Connection.Spotify; using OpenLyricsClient.Backend.Settings.Sections.Lyrics; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient.Frontend.Models.Elements.Blur; using OpenLyricsClient.Frontend.Scaling; using OpenLyricsClient.Frontend.View.Custom; diff --git a/OpenLyricsClient/Frontend/Models/Elements/NoteAnimation.cs b/OpenLyricsClient/Frontend/Models/Elements/NoteAnimation.cs index 95bcfbd..2432c35 100644 --- a/OpenLyricsClient/Frontend/Models/Elements/NoteAnimation.cs +++ b/OpenLyricsClient/Frontend/Models/Elements/NoteAnimation.cs @@ -11,8 +11,8 @@ using OpenLyricsClient.Backend; using OpenLyricsClient.Backend.Settings.Sections.Connection.Spotify; using OpenLyricsClient.Backend.Settings.Sections.Lyrics; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Utils; namespace OpenLyricsClient.Frontend.Models.Elements; diff --git a/OpenLyricsClient/Frontend/Models/Pages/LyricsPageViewModel.cs b/OpenLyricsClient/Frontend/Models/Pages/LyricsPageViewModel.cs index 65dd463..cb31a7b 100644 --- a/OpenLyricsClient/Frontend/Models/Pages/LyricsPageViewModel.cs +++ b/OpenLyricsClient/Frontend/Models/Pages/LyricsPageViewModel.cs @@ -18,10 +18,10 @@ using OpenLyricsClient.Backend.Handler.Song.SongProvider; using OpenLyricsClient.Backend.Settings.Sections.Connection.Spotify; using OpenLyricsClient.Backend.Settings.Sections.Lyrics; -using OpenLyricsClient.Backend.Structure.Artwork; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Song; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Artwork; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Song; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient.Frontend.View.Windows; using ReactiveUI; diff --git a/OpenLyricsClient/Frontend/Models/Pages/Settings/SettingsCreditsViewModel.cs b/OpenLyricsClient/Frontend/Models/Pages/Settings/SettingsCreditsViewModel.cs index 3706efc..8559224 100644 --- a/OpenLyricsClient/Frontend/Models/Pages/Settings/SettingsCreditsViewModel.cs +++ b/OpenLyricsClient/Frontend/Models/Pages/Settings/SettingsCreditsViewModel.cs @@ -1,5 +1,5 @@ using System.Reactive; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; using ReactiveUI; namespace OpenLyricsClient.Frontend.Models.Pages.Settings; diff --git a/OpenLyricsClient/Frontend/Models/Pages/Settings/SettingsLyricsViewModel.cs b/OpenLyricsClient/Frontend/Models/Pages/Settings/SettingsLyricsViewModel.cs index 185f493..42a0067 100644 --- a/OpenLyricsClient/Frontend/Models/Pages/Settings/SettingsLyricsViewModel.cs +++ b/OpenLyricsClient/Frontend/Models/Pages/Settings/SettingsLyricsViewModel.cs @@ -5,7 +5,7 @@ using OpenLyricsClient.Backend; using OpenLyricsClient.Backend.Romanization; using OpenLyricsClient.Backend.Settings.Sections.Lyrics; -using OpenLyricsClient.Backend.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Enum; using ReactiveUI; namespace OpenLyricsClient.Frontend.Models.Pages.Settings; diff --git a/OpenLyricsClient/Frontend/Models/Pages/SubPages/ScrollPreviewSubPageViewModel.cs b/OpenLyricsClient/Frontend/Models/Pages/SubPages/ScrollPreviewSubPageViewModel.cs index 8d82dce..e5568c0 100644 --- a/OpenLyricsClient/Frontend/Models/Pages/SubPages/ScrollPreviewSubPageViewModel.cs +++ b/OpenLyricsClient/Frontend/Models/Pages/SubPages/ScrollPreviewSubPageViewModel.cs @@ -3,7 +3,7 @@ using System.ComponentModel; using System.Runtime.CompilerServices; using DynamicData; -using OpenLyricsClient.Backend.Structure.Lyrics; +using OpenLyricsClient.Shared.Structure.Lyrics; namespace OpenLyricsClient.Frontend.Models.Pages.SubPages; diff --git a/OpenLyricsClient/Frontend/View/Custom/LyricsScroller.axaml b/OpenLyricsClient/Frontend/View/Custom/LyricsScroller.axaml index e65bd0d..1771302 100644 --- a/OpenLyricsClient/Frontend/View/Custom/LyricsScroller.axaml +++ b/OpenLyricsClient/Frontend/View/Custom/LyricsScroller.axaml @@ -5,7 +5,7 @@ xmlns:custom="clr-namespace:OpenLyricsClient.Frontend.View.Custom" xmlns:elements="clr-namespace:OpenLyricsClient.Frontend.Models.Elements" xmlns:romanization="clr-namespace:OpenLyricsClient.Backend.Romanization" - xmlns:converter="clr-namespace:OpenLyricsClient.Backend.Utils.Converter" + xmlns:converter="clr-namespace:OpenLyricsClient.Shared.Utils.Converter" xmlns:custom1="clr-namespace:OpenLyricsClient.Frontend.Models.Custom" mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" LyricPart="{Binding CurrentLyricPart, Mode=TwoWay}" diff --git a/OpenLyricsClient/Frontend/View/Custom/LyricsScroller.axaml.cs b/OpenLyricsClient/Frontend/View/Custom/LyricsScroller.axaml.cs index 1146456..74c104a 100644 --- a/OpenLyricsClient/Frontend/View/Custom/LyricsScroller.axaml.cs +++ b/OpenLyricsClient/Frontend/View/Custom/LyricsScroller.axaml.cs @@ -17,9 +17,9 @@ using OpenLyricsClient.Backend.Events.EventArgs; using OpenLyricsClient.Backend.Events.EventHandler; using OpenLyricsClient.Backend.Settings.Sections.Lyrics; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient.Frontend.Animation; using OpenLyricsClient.Frontend.Models.Custom; using OpenLyricsClient.Frontend.Models.Elements; diff --git a/OpenLyricsClient/Frontend/View/Custom/NewLyricsScroller.axaml.cs b/OpenLyricsClient/Frontend/View/Custom/NewLyricsScroller.axaml.cs index 7138467..859f779 100644 --- a/OpenLyricsClient/Frontend/View/Custom/NewLyricsScroller.axaml.cs +++ b/OpenLyricsClient/Frontend/View/Custom/NewLyricsScroller.axaml.cs @@ -12,9 +12,9 @@ using DynamicData; using OpenLyricsClient.Backend; using OpenLyricsClient.Backend.Events.EventArgs; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient.Frontend.Animation; using OpenLyricsClient.Frontend.Models.Custom; using OpenLyricsClient.Frontend.Utils; diff --git a/OpenLyricsClient/Frontend/View/Pages/LyricsPage.axaml.cs b/OpenLyricsClient/Frontend/View/Pages/LyricsPage.axaml.cs index c275f6e..f84c538 100644 --- a/OpenLyricsClient/Frontend/View/Pages/LyricsPage.axaml.cs +++ b/OpenLyricsClient/Frontend/View/Pages/LyricsPage.axaml.cs @@ -14,7 +14,7 @@ using Material.Styles; using OpenLyricsClient.Backend; using OpenLyricsClient.Backend.Settings.Sections.Lyrics; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient.Frontend.Models.Pages; using OpenLyricsClient.Frontend.View.Custom; using OpenLyricsClient.Frontend.View.Windows; @@ -109,7 +109,7 @@ private void DataContextOnPropertyChanged(object? sender, PropertyChangedEventAr { AsyncImageLoader.ImageLoader.SetSource(this._artworkImage, this._lyricsPageViewModel.Artwork); } - else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux)) + else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) || RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { this._artworkImage.Source = new Bitmap(this._lyricsPageViewModel.Artwork); } diff --git a/OpenLyricsClient/Frontend/View/Pages/Settings/Providers/SettingsSpotify.axaml.cs b/OpenLyricsClient/Frontend/View/Pages/Settings/Providers/SettingsSpotify.axaml.cs index 08efda9..b2418ef 100644 --- a/OpenLyricsClient/Frontend/View/Pages/Settings/Providers/SettingsSpotify.axaml.cs +++ b/OpenLyricsClient/Frontend/View/Pages/Settings/Providers/SettingsSpotify.axaml.cs @@ -18,15 +18,15 @@ using OpenLyricsClient.Backend.Events.EventArgs; using OpenLyricsClient.Backend.Settings.Sections.Connection.Spotify; using OpenLyricsClient.Backend.Settings.Sections.Lyrics; -using OpenLyricsClient.Backend.Structure.Other; +using OpenLyricsClient.Shared.Structure.Other; using OpenLyricsClient.Frontend.Models.Elements; using OpenLyricsClient.Frontend.Structure; using OpenLyricsClient.Frontend.View.Windows; using SpotifyAPI.Web; using Image = Avalonia.Controls.Image; using ResponseData = DevBase.Web.ResponseData.ResponseData; -using SimpleArtist = OpenLyricsClient.Backend.Structure.Other.SimpleArtist; -using SimpleTrack = OpenLyricsClient.Backend.Structure.Other.SimpleTrack; +using SimpleArtist = OpenLyricsClient.Shared.Structure.Other.SimpleArtist; +using SimpleTrack = OpenLyricsClient.Shared.Structure.Other.SimpleTrack; namespace OpenLyricsClient.Frontend.View.Pages.Settings.Providers; diff --git a/OpenLyricsClient/Frontend/View/Pages/SettingsPage.axaml.cs b/OpenLyricsClient/Frontend/View/Pages/SettingsPage.axaml.cs index 12b980e..8b3aed2 100644 --- a/OpenLyricsClient/Frontend/View/Pages/SettingsPage.axaml.cs +++ b/OpenLyricsClient/Frontend/View/Pages/SettingsPage.axaml.cs @@ -12,7 +12,7 @@ using OpenLyricsClient.Backend; using OpenLyricsClient.Backend.Handler.Song; using OpenLyricsClient.Backend.Romanization; -using OpenLyricsClient.Backend.Structure.Song; +using OpenLyricsClient.Shared.Structure.Song; using OpenLyricsClient.Frontend.View.Windows; namespace OpenLyricsClient.Frontend.View.Pages; diff --git a/OpenLyricsClient/Frontend/View/Pages/SubPages/ScrollPreviewSubPage.axaml.cs b/OpenLyricsClient/Frontend/View/Pages/SubPages/ScrollPreviewSubPage.axaml.cs index beefeec..2b1572a 100644 --- a/OpenLyricsClient/Frontend/View/Pages/SubPages/ScrollPreviewSubPage.axaml.cs +++ b/OpenLyricsClient/Frontend/View/Pages/SubPages/ScrollPreviewSubPage.axaml.cs @@ -11,9 +11,9 @@ using DynamicData; using OpenLyricsClient.Backend; using OpenLyricsClient.Backend.Settings.Sections.Lyrics; -using OpenLyricsClient.Backend.Structure.Enum; -using OpenLyricsClient.Backend.Structure.Lyrics; -using OpenLyricsClient.Backend.Utils; +using OpenLyricsClient.Shared.Structure.Enum; +using OpenLyricsClient.Shared.Structure.Lyrics; +using OpenLyricsClient.Shared.Utils; using OpenLyricsClient.Frontend.Models.Elements; namespace OpenLyricsClient.Frontend.View.Pages.SubPages; diff --git a/OpenLyricsClient/Frontend/View/Windows/MainWindow.axaml b/OpenLyricsClient/Frontend/View/Windows/MainWindow.axaml index 51ebe74..d2b8ccc 100644 --- a/OpenLyricsClient/Frontend/View/Windows/MainWindow.axaml +++ b/OpenLyricsClient/Frontend/View/Windows/MainWindow.axaml @@ -8,6 +8,8 @@ xmlns:assists="clr-namespace:Material.Styles.Assists;assembly=Material.Styles" xmlns:windows="clr-namespace:OpenLyricsClient.Frontend.Models.Windows" mc:Ignorable="d" + MinWidth="1200" + MinHeight="600" Width="1500" Height="800" ExtendClientAreaToDecorationsHint="True" @@ -33,6 +35,7 @@ + + +