From e2db399a115f5727da5fb85ba7f0806d9c752660 Mon Sep 17 00:00:00 2001 From: Asteriskx Date: Sat, 8 Jul 2023 19:33:46 +0900 Subject: [PATCH] [modify] update README.md --- README.md | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 1cfa7f9..ba0336a 100644 --- a/README.md +++ b/README.md @@ -6,10 +6,11 @@ Let's enjoy! ### ○Features -* ✅ Supports posting current track information at Twitter. -* ✅ Supports `.NET 5. (feature -> .NET 6:-D ) +* ✅ Supports posting current track information at Misskey. +* ✅ Supports .NET 7. * ✅ Logging supported. * ❌ Spotify Control Module UI fixed. +* ❌ Supports posting current track information at Twitter(API-Dead...). ### ○Capture Images @@ -33,23 +34,35 @@ using Sagiri.Services.Spotify.Track; public async void Form1_Load(object sender, EventArgs e) { - SpotifyService spotifyService = new(); - var currentTrackInfo = new CurrentTrackInfo(); + _IMisskeyService = new MisskeyService(); + await _IMisskeyService.InitializeAsync(); - // registar for callback function (getting currentTrackInfo.) - spotifyService.CurrentTrackChanged += _OnSpotifyCurrentlyPlayingChanged; + _ISpotifyService = new SpotifyService(); + _CurrentTrackInfo = new(); + _SpotifyCredentialConfig = SpotifyCredentialConfig.Instance; - if (spotifyService.IsExistCredentialFile()) + _Logger = Logger.GetInstance; + + await _ISpotifyService.InitializeAsync(); + if (_SpotifyCredentialConfig.IsExistCredentialFile()) { - await spotifyService.Initialize(); - await spotifyService.Start().ConfigureAwait(false); + _ISpotifyService.CurrentTrackChanged += _OnSpotifyCurrentlyPlayingChanged; + _ISpotifyService.CurrentTrackErrorDetected += _OnSpotifyCurrentTrackErrorDetected; + + await _ISpotifyService.StartAsync(_CancellationSource.Token).ConfigureAwait(false); + + var accountImageStream = await _ISpotifyService.GetUserImageStream(); + AccountPanel.BackgroundImage = System.Drawing.Image.FromStream(accountImageStream) ?? Resources.account; } + else + { + var message = "[SagiriUI] - Spotify tokens file not found...\r\nClose this app."; + MessageBox.Show(message); + _Logger.WriteLog(message, Logger.LogLevel.Fatal); - // Be sure to explicitly initialize. - _OnSpotifyCurrentlyPlayingChanged(_CurrentTrackInfo); + this.Close(); + } - // Getting and Setting Spotify current playing track albumart. - var accountImageStream = await spotifyService.GetUserImageStream(); - AccountPanel.BackgroundImage = Image.FromStream(accountImageStream) ?? Resources.account; + _Logger.WriteLog("[SagiriUI] - Finished roading Form....", Logger.LogLevel.Info); } ```