From be5c9a8de0efbfef85ff3035bcbffd9ae74d7a2e Mon Sep 17 00:00:00 2001 From: watsonb8 Date: Sun, 2 Feb 2020 17:28:34 -0500 Subject: [PATCH] using new api --- Aurora/App.xaml.cs | 4 ++++ Aurora/Design/Views/Party/PartyViewModel.cs | 8 +++++--- Aurora/Services/Server/Controllers/Constructor.cs | 2 -- Aurora/Services/Server/Controllers/MediaController.cs | 4 +++- 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Aurora/App.xaml.cs b/Aurora/App.xaml.cs index 47ce0e9..487ba7d 100644 --- a/Aurora/App.xaml.cs +++ b/Aurora/App.xaml.cs @@ -7,6 +7,8 @@ using Aurora.Design.Views.Profile; using Aurora.Design.Views.Songs; using Aurora.Design.Views.Stations; using Aurora.Services.EventManager; +using Aurora.Services.Server; +using Aurora.Services.Client; using Autofac; using LibVLCSharp.Shared; using Xamarin.Forms; @@ -31,6 +33,8 @@ namespace Aurora _builder.RegisterType().As().SingleInstance(); _builder.RegisterType().As().SingleInstance(); _builder.RegisterType().As().SingleInstance(); + _builder.RegisterType().As().SingleInstance(); + _builder.RegisterType().As().SingleInstance(); _builder.RegisterType().SingleInstance(); _builder.RegisterType(); _builder.RegisterType(); diff --git a/Aurora/Design/Views/Party/PartyViewModel.cs b/Aurora/Design/Views/Party/PartyViewModel.cs index d775fa1..d047e63 100644 --- a/Aurora/Design/Views/Party/PartyViewModel.cs +++ b/Aurora/Design/Views/Party/PartyViewModel.cs @@ -24,7 +24,7 @@ namespace Aurora.Design.Views.Party Hosting, Connecting, } - public delegate void EventHandler(BaseEvent e); + delegate void EventHandler(BaseEvent e); public class PartyViewModel : BaseViewModel { private PartyState _state; @@ -47,7 +47,8 @@ namespace Aurora.Design.Views.Party public PartyViewModel( ISettingsService settingsService, IServerService serverService, - IEventManager eventManager) + IEventManager eventManager, + IClientService clientService) { _members = new ObservableCollection(); _queue = new ObservableCollection(); @@ -55,6 +56,7 @@ namespace Aurora.Design.Views.Party this._settingsService = settingsService; this._serverService = serverService; this._eventManager = eventManager; + this._clientService = clientService; SetState(PartyState.SelectingHost); @@ -282,7 +284,7 @@ namespace Aurora.Design.Views.Party try { SetState(PartyState.Hosting); - // await _clientService.RemotePartyServiceClient.GetEvents().ConfigureAwait(true); + await GetEvents().ConfigureAwait(false); } catch (Exception ex) { diff --git a/Aurora/Services/Server/Controllers/Constructor.cs b/Aurora/Services/Server/Controllers/Constructor.cs index f22c6a8..2b5e3b2 100644 --- a/Aurora/Services/Server/Controllers/Constructor.cs +++ b/Aurora/Services/Server/Controllers/Constructor.cs @@ -41,8 +41,6 @@ namespace Aurora.Services.Server.Controllers IpAddress = ServerService.GetLocalIPAddress(), }; - this._memberList.Add(_hostMember.Name, _hostMember); - //Add media from library //This will change as queuing operation gets solidified //Simply return the hosts library diff --git a/Aurora/Services/Server/Controllers/MediaController.cs b/Aurora/Services/Server/Controllers/MediaController.cs index 1a49bd7..35ea244 100644 --- a/Aurora/Services/Server/Controllers/MediaController.cs +++ b/Aurora/Services/Server/Controllers/MediaController.cs @@ -67,7 +67,9 @@ namespace Aurora.Services.Server.Controllers { ILibraryService library = scope.Resolve(); - BaseMedia originalSong = library.GetSong(request.Name); + string mediaName = request.Name.Split('/')[1]; + + BaseMedia originalSong = library.GetSong(mediaName); if (!(originalSong is LocalAudio)) { return;