Skip to content

Commit

Permalink
fixed song request bug
Browse files Browse the repository at this point in the history
after the last song from the queue had been played, the song would not refresh
  • Loading branch information
Cyklan committed Mar 29, 2020
1 parent 0a060eb commit a6b8a92
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 23 deletions.
15 changes: 4 additions & 11 deletions Songify Slim/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@

namespace Songify_Slim
{
public class RequestObject
{
public string TrackID { get; set; }
public string Artists { get; set; }
public string Title { get; set; }
public string Length { get; set; }
public string Requester { get; set; }

}

public partial class MainWindow
{
#region Variables
Expand Down Expand Up @@ -714,7 +704,10 @@ private void WriteSong(string artist, string title, string extra, string cover =
{
int start = CurrSong.IndexOf("{{");
int end = CurrSong.LastIndexOf("}}") + 2;
CurrSong = CurrSong.Remove(start, end - start);
if (start >= 0)
{
CurrSong = CurrSong.Remove(start, end - start);
}
}
}
else
Expand Down
18 changes: 18 additions & 0 deletions Songify Slim/Models/RequestModel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Songify_Slim.Models
{
public class RequestObject
{
public string TrackID { get; set; }
public string Artists { get; set; }
public string Title { get; set; }
public string Length { get; set; }
public string Requester { get; set; }

}
}
1 change: 1 addition & 0 deletions Songify Slim/Songify Slim.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@
<DependentUpon>AboutWindow.xaml</DependentUpon>
</Compile>
<Compile Include="Models\PlayerType.cs" />
<Compile Include="Models\RequestModel.cs" />
<Compile Include="Models\TrackInfo.cs" />
<Compile Include="Util\Songify\Apihandler.cs" />
<Compile Include="Util\Settings\ConfigHandler.cs" />
Expand Down
1 change: 1 addition & 0 deletions Songify Slim/Util/Songify/TwitchHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using TwitchLib.Communication.Clients;
using TwitchLib.Communication.Models;
using System.Linq;
using Songify_Slim.Models;

namespace Songify_Slim
{
Expand Down
13 changes: 1 addition & 12 deletions Songify Slim/Window_Queue.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,16 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Songify_Slim.Models;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Songify_Slim
{
Expand Down

0 comments on commit a6b8a92

Please sign in to comment.