Music current time fixed if goto is used

This commit is contained in:
Kwoth 2016-12-21 13:15:23 +01:00
parent a69d26abd0
commit f86b1234ac

View File

@ -24,22 +24,22 @@ namespace NadekoBot.Modules.Music.Classes
public string Query { get; set; }
public string Title { get; set; }
public string Uri { get; set; }
public string AlbumArt { get; set; }
public string AlbumArt { get; set; }
}
public class Song
{
public StreamState State { get; set; }
public StreamState State { get; set; }
public string PrettyName =>
$"**{SongInfo.Title.TrimTo(55)} `{(SongInfo.Provider ?? "-")} by {QueuerName}`**";
//$"{SongInfo.Title.TrimTo(70)}";
//$"{SongInfo.Title.TrimTo(70)}";
public SongInfo SongInfo { get; }
public MusicPlayer MusicPlayer { get; set; }
public string PrettyUser =>
public string PrettyUser =>
$"{QueuerName}";
public string QueuerName { get; set; }
public string PrettyProvider =>
public string PrettyProvider =>
$"{(SongInfo.Provider ?? "No Provider")}";
public string PrettyCurrentTime()
@ -103,8 +103,6 @@ namespace NadekoBot.Modules.Music.Classes
SongBuffer inStream = new SongBuffer(MusicPlayer, filename, SongInfo, skipTo, frameBytes * 100);
var bufferTask = inStream.BufferSong(cancelToken).ConfigureAwait(false);
bytesSent = 0;
try
{
var attempt = 0;
@ -320,7 +318,7 @@ namespace NadekoBot.Modules.Music.Classes
Uri = svideo.StreamLink,
ProviderType = musicType,
Query = svideo.TrackLink,
AlbumArt = svideo.artwork_url,
AlbumArt = svideo.artwork_url,
})
{ TotalLength = TimeSpan.FromMilliseconds(svideo.Duration) };
}
@ -335,7 +333,7 @@ namespace NadekoBot.Modules.Music.Classes
Uri = svideo.StreamLink,
ProviderType = MusicType.Normal,
Query = svideo.TrackLink,
AlbumArt = svideo.artwork_url,
AlbumArt = svideo.artwork_url,
})
{ TotalLength = TimeSpan.FromMilliseconds(svideo.Duration) };
}