Compare commits

..

2 Commits

Author SHA1 Message Date
EkiciLP
f14eb8a263 Merge branch 'master' into features/panel 2022-04-15 13:42:38 +02:00
Tim Müller
97b9514c42 first 2022-04-06 21:22:24 +02:00
10 changed files with 40 additions and 19 deletions

View File

@ -13,6 +13,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TomatenMusic", "TomatenMusi
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TomatenMusicCore", "TomatenMusicCore\TomatenMusicCore.csproj", "{40B1E82B-656D-413B-B636-EB0AE84391E2}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TomatenMusic.Panel", "TomatenMusic.Panel\TomatenMusic.Panel.csproj", "{D138639E-0D85-4D04-99A8-1C14A550C65B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -27,6 +29,10 @@ Global
{40B1E82B-656D-413B-B636-EB0AE84391E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{40B1E82B-656D-413B-B636-EB0AE84391E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{40B1E82B-656D-413B-B636-EB0AE84391E2}.Release|Any CPU.Build.0 = Release|Any CPU
{D138639E-0D85-4D04-99A8-1C14A550C65B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D138639E-0D85-4D04-99A8-1C14A550C65B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D138639E-0D85-4D04-99A8-1C14A550C65B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D138639E-0D85-4D04-99A8-1C14A550C65B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View File

@ -0,0 +1,7 @@
namespace TomatenMusic.Panel
{
public class ServerPanel
{
}
}

View File

@ -0,0 +1,13 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\TomatenMusicCore\TomatenMusicCore.csproj" />
</ItemGroup>
</Project>

View File

@ -44,9 +44,7 @@ namespace TomatenMusic.Music.Entitites
if (!player.PlayerQueue.Queue.Any())
player.PlayerQueue.CurrentPlaylist = this;
if (!withoutQueuePrepend && player.State == PlayerState.Playing)
player.PlayerQueue.Queue = new Queue<TomatenMusicTrack>(player.PlayerQueue.Queue.Prepend(new TomatenMusicTrack(player.PlayerQueue.LastTrack.WithPosition(player.TrackPosition))));
player.PlayerQueue.Queue = new Queue<TomatenMusicTrack>(player.PlayerQueue.Queue.Prepend(new TomatenMusicTrack(player.PlayerQueue.LastTrack.WithPosition(player.TrackPosition))));
Queue<TomatenMusicTrack> reversedTracks = new Queue<TomatenMusicTrack>(Tracks);

View File

@ -38,7 +38,7 @@ namespace TomatenMusicCore.Music.Entities
public async Task PlayNow(GuildPlayer player, TimeSpan? startTime = null, TimeSpan? endTime = null, bool withoutQueuePrepend = false)
{
if (!withoutQueuePrepend && player.State == PlayerState.Playing)
if (!withoutQueuePrepend)
player.PlayerQueue.Queue = new Queue<TomatenMusicTrack>(player.PlayerQueue.Queue.Prepend(new TomatenMusicTrack(player.PlayerQueue.LastTrack.WithPosition(player.TrackPosition))));

View File

@ -57,9 +57,7 @@ namespace TomatenMusic.Music.Entitites
if (!player.PlayerQueue.Queue.Any())
player.PlayerQueue.CurrentPlaylist = this;
if (!withoutQueuePrepend && player.State == PlayerState.Playing)
player.PlayerQueue.Queue = new Queue<TomatenMusicTrack>(player.PlayerQueue.Queue.Prepend(new TomatenMusicTrack(player.PlayerQueue.LastTrack.WithPosition(player.TrackPosition))));
player.PlayerQueue.Queue = new Queue<TomatenMusicTrack>(player.PlayerQueue.Queue.Prepend(new TomatenMusicTrack(player.PlayerQueue.LastTrack.WithPosition(player.TrackPosition))));
Queue<TomatenMusicTrack> reversedTracks = new Queue<TomatenMusicTrack>(Tracks);

View File

@ -101,7 +101,7 @@ namespace TomatenMusic.Music
}
_logger.LogInformation($"Skipped Track {CurrentTrack.Title} for Track {response.Track.Title}");
await PlayNowAsync(response.Track, withoutQueuePrepend: true);
await base.PlayAsync(response.Track);
QueuePrompt.UpdateFor(GuildId);
}

View File

@ -26,7 +26,7 @@ namespace TomatenMusic.Music
public TomatenMusicTrack LastTrack { get; set; }
public List<TomatenMusicTrack> QueueLoopList { get; private set; } = new List<TomatenMusicTrack>();
public List<TomatenMusicTrack> QueueLoopList { get; private set; }
public void QueueTrack(TomatenMusicTrack track)
{
@ -95,7 +95,7 @@ namespace TomatenMusic.Music
public MusicActionResponse NextTrack(bool ignoreLoop = false, bool autoplay = false)
{
if (LastTrack != null)
if (LoopType != LoopType.TRACK || (ignoreLoop && (Queue.Any() || autoplay)))
if (LoopType != LoopType.NONE && Queue.Count == 0 || autoplay)
PlayedTracks = new Queue<TomatenMusicTrack>(PlayedTracks.Prepend(new TomatenMusicTrack(LastTrack.WithPosition(TimeSpan.Zero))));
switch (LoopType)
@ -158,7 +158,7 @@ namespace TomatenMusic.Music
if (type == LoopType.QUEUE)
{
QueueLoopList = new List<TomatenMusicTrack>(Queue.Prepend(LastTrack));
QueueLoopList = new List<TomatenMusicTrack>(QueueLoopList.Prepend(LastTrack));
}
}
}

View File

@ -93,16 +93,15 @@ namespace TomatenMusic.Prompt.Implementation
_ = args.Interaction.EditOriginalResponseAsync(new DiscordWebhookBuilder().WithContent("Please connect to the bots Channel to use this Interaction"));
return;
}
try
{
await Player.RewindAsync();
}
catch (Exception ex)
}catch (Exception ex)
{
Console.WriteLine(ex);
_ = args.Interaction.CreateResponseAsync(
DSharpPlus.InteractionResponseType.ChannelMessageWithSource,
new DiscordInteractionResponseBuilder()
.WithContent($"An Error occurred during this Interaction {ex.Message}"));
}
}
}

View File

@ -87,9 +87,9 @@ namespace TomatenMusic
.AddSingleton(
new LavalinkNodeOptions
{
RestUri = "http://127.0.0.1:2333",
RestUri = "http://116.202.92.16:2333",
Password = config.LavaLinkPassword,
WebSocketUri = "ws://127.0.0.1:2333",
WebSocketUri = "ws://116.202.92.16:2333",
AllowResuming = true
})