Skip to content
This repository was archived by the owner on Feb 19, 2021. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Audio/WebStreamPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void Play()
if (visualiser != null)
visualiser.AddSamples(rawBuffer);
}
catch (Concentus.OpusException)
catch (Exception)
{
//Skip this frame
}
Expand Down
29 changes: 19 additions & 10 deletions MainForm.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 17 additions & 2 deletions MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@ private void Form1_MouseUp(object sender, MouseEventArgs e)
const string KPOP_STREAM = "https://listen.moe/kpop/opus";
const string DISCORD_PRESENCE_CLIENT_ID = "383375119827075072";
const string CDN_COVER = "https://cdn.listen.moe/covers/";
const string MUSIC_LINK = "https://listen.moe/music/albums/";
const string CDN_COVER_NULL = "https://listen.moe/_nuxt/img/cd1c044.png";
const string MUSIC_LINK = "https://listen.moe/albums/";

Font titleFont;
Font artistFont;
Expand Down Expand Up @@ -356,6 +357,7 @@ public void ReloadScale()
public void ReloadSettings()
{
this.TopMost = Settings.Get<bool>(Setting.TopMost);
menuItemTopMost.Checked = Settings.Get<bool>(Setting.TopMost);

this.Location = new Point(Settings.Get<int>(Setting.LocationX), Settings.Get<int>(Setting.LocationY));
this.Size = new Size(Settings.Get<int>(Setting.SizeX), Settings.Get<int>(Setting.SizeY));
Expand Down Expand Up @@ -663,6 +665,11 @@ void ProcessSongInfo(SongInfoResponseData songInfo)
coverImage.Load(CDN_COVER + songInfo.song.albums[0].image);
coverImage.Visible = true;
}
else if (songInfo.song.albums.Length != 0)
{
coverImage.Load(CDN_COVER_NULL);
coverImage.Visible = true;
}
else
{
coverImage.Visible = false;
Expand Down Expand Up @@ -722,6 +729,14 @@ private void SetPlayPauseSize(bool bigger)
picPlayPause.Location = new Point(x, y);
}

private void menuItemTopMost_Click(object sender, EventArgs e)
{
TopMost = !TopMost;
Settings.Set(Setting.TopMost, TopMost);
Settings.WriteSettings();
menuItemTopMost.Checked = TopMost;
}

private void menuItemCopySongInfo_Click(object sender, EventArgs e)
{
SongInfoResponseData info = songInfoStream.currentInfo;
Expand Down Expand Up @@ -798,7 +813,7 @@ private void coverImage_Click(object sender, EventArgs e)
{
SongInfoResponseData info = songInfoStream.currentInfo;
if (info != null)
if (info.song.albums[0].image != null)
if (info.song.albums.Length != 0)
Process.Start(MUSIC_LINK + songInfoStream.currentInfo.song.albums[0].id);
}

Expand Down
4 changes: 2 additions & 2 deletions Web/SongInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public class SongInfoStream
public event StatsReceived OnSongInfoReceived;
public SongInfoResponseData currentInfo;

private const string JPOP_SOCKET_ADDR = "wss://listen.moe/gateway";
private const string KPOP_SOCKET_ADDR = "wss://listen.moe/kpop/gateway";
private const string JPOP_SOCKET_ADDR = "wss://listen.moe/gateway_v2";
private const string KPOP_SOCKET_ADDR = "wss://listen.moe/kpop/gateway_v2";

private Thread heartbeatThread;
private CancellationTokenSource cts;
Expand Down