Readded total playtime

This commit is contained in:
Master Kwoth 2017-07-04 15:42:07 +02:00
parent d5903a1e25
commit c33c2bce60

View File

@ -114,7 +114,17 @@ namespace NadekoBot.Services.Music
private readonly IGoogleApiService _google; private readonly IGoogleApiService _google;
private ConcurrentHashSet<string> RecentlyPlayedUsers { get; } = new ConcurrentHashSet<string>(); private ConcurrentHashSet<string> RecentlyPlayedUsers { get; } = new ConcurrentHashSet<string>();
public TimeSpan TotalPlaytime => TimeSpan.MaxValue; public TimeSpan TotalPlaytime
{
get
{
var songs = Queue.ToArray().Songs;
return songs.Any(s => s.TotalTime == TimeSpan.MaxValue)
? TimeSpan.MaxValue
: new TimeSpan(songs.Sum(s => s.TotalTime.Ticks));
}
}
public MusicPlayer(MusicService musicService, IGoogleApiService google, IVoiceChannel vch, ITextChannel output, float volume) public MusicPlayer(MusicService musicService, IGoogleApiService google, IVoiceChannel vch, ITextChannel output, float volume)
{ {