5 Commits

Author SHA1 Message Date
Tim Müller
a71f65de55 update package sources 2022-04-06 21:32:43 +02:00
Tim Müller
3fd19eb149 fix playlist playback nicely 2022-04-01 18:53:07 +02:00
Tim Müller
bc7e493e71 fix playlist playback not working 2022-04-01 18:46:03 +02:00
Tim Müller
85dbbd8bfc fix file playback 2022-03-31 18:37:35 +02:00
Tim Müller
e5d3f6935d fix errors 2022-03-29 22:36:46 +02:00
7 changed files with 13 additions and 39 deletions

View File

@@ -46,9 +46,9 @@ namespace TomatenMusic_Api
if (e.Response.IsPlaylist)
{
if (e.Now)
await player.PlayPlaylistNowAsync(e.Response.Playlist);
await player.PlayNowAsync(e.Response.Playlist);
else
await player.PlayPlaylistAsync(e.Response.Playlist);
await player.PlayItemAsync(e.Response.Playlist);
}else
{
if (e.Now)

View File

@@ -5,10 +5,6 @@
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<RootNamespace>TomatenMusic_Api</RootNamespace>
<RestoreAdditionalProjectSources>
https://api.nuget.org/v3/index.json;
https://nuget.emzi0767.com/api/v3/index.json
</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>

View File

@@ -84,7 +84,7 @@ namespace TomatenMusic.Commands
if (response.IsPlaylist)
{
ILavalinkPlaylist playlist = response.Playlist;
await player.PlayPlaylistNowAsync(playlist);
await player.PlayNowAsync(playlist);
_ = ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Now Playing:").AddEmbed(
Common.AsEmbed(playlist)
@@ -237,7 +237,7 @@ namespace TomatenMusic.Commands
if (response.IsPlaylist)
{
ILavalinkPlaylist playlist = response.Playlist;
await player.PlayPlaylistAsync(playlist);
await player.PlayItemAsync(playlist);
await ctx.EditResponseAsync(new DiscordWebhookBuilder().WithContent("Now Playing:").AddEmbed(
Common.AsEmbed(playlist)

View File

@@ -20,7 +20,7 @@ namespace TomatenMusic.Music.Entitites
public IEnumerable<string> YoutubeTags { get; set; }
public ulong YoutubeViews { get; set; }
public ulong YoutubeLikes { get; set; }
public Uri YoutubeThumbnail { get; set; }
public Uri? YoutubeThumbnail { get; set; } = null;
public DateTime YoutubeUploadDate { get; set; }
//
// Summary:

View File

@@ -64,26 +64,6 @@ namespace TomatenMusic.Music
QueuePrompt.UpdateFor(GuildId);
}
public async Task PlayPlaylistAsync(ILavalinkPlaylist playlist)
{
EnsureNotDestroyed();
EnsureConnected();
_logger.LogInformation("Started playing Playlist {0} on Guild {1}", playlist.Title, (await GetGuildAsync()).Name);
QueuePrompt.UpdateFor(GuildId);
}
public async Task PlayPlaylistNowAsync(ILavalinkPlaylist playlist)
{
EnsureConnected();
EnsureNotDestroyed();
QueuePrompt.UpdateFor(GuildId);
}
public async Task RewindAsync()
{
EnsureNotDestroyed();
@@ -109,7 +89,7 @@ namespace TomatenMusic.Music
MusicActionResponse response;
try
{
response = PlayerQueue.(true);
response = PlayerQueue.NextTrack(true);
}catch (Exception ex)
{
if (Autoplay)

View File

@@ -4,17 +4,13 @@
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<RestoreAdditionalProjectSources>
https://api.nuget.org/v3/index.json;
https://nuget.emzi0767.com/api/v3/index.json
</RestoreAdditionalProjectSources>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="DSharpPlus" Version="4.2.0-nightly-01101" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.2.0-nightly-01101" />
<PackageReference Include="DSharpPlus.SlashCommands" Version="4.2.0-nightly-01101" />
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.56.0.2630" />
<PackageReference Include="DSharpPlus" Version="4.2.0-nightly-01107" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.2.0-nightly-01107" />
<PackageReference Include="DSharpPlus.SlashCommands" Version="4.2.0-nightly-01107" />
<PackageReference Include="Google.Apis.YouTube.v3" Version="1.57.0.2637" />
<PackageReference Include="HtmlAgilityPack" Version="1.11.42" />
<PackageReference Include="Lavalink4NET" Version="2.1.1" />
<PackageReference Include="Lavalink4NET.DSharpPlus" Version="2.1.1" />

View File

@@ -32,10 +32,12 @@ namespace TomatenMusic.Util
DiscordEmbedBuilder builder = new DiscordEmbedBuilder()
.WithTitle(track.Title)
.WithUrl(track.Source)
.WithImageUrl(context.YoutubeThumbnail)
.WithDescription(context.YoutubeDescription)
.AddField("Length", Common.GetTimestamp(track.Duration), true);
if (context.YoutubeThumbnail != null)
builder.WithImageUrl(context.YoutubeThumbnail);
if (context.IsFile)
{
builder.WithAuthor(track.Author);