Skip to content

Commit 90609ba

Browse files
committed
adds the SubLastFm project with a get artist result and uses it in the artist details view model
1 parent c0becfa commit 90609ba

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1331
-14
lines changed

Client.Common/Client.Common.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,6 @@
106106
<Compile Include="EventAggregatorMessages\PlaybackMessageBase.cs" />
107107
<Compile Include="EventAggregatorMessages\PlayFailedMessage.cs" />
108108
<Compile Include="EventAggregatorMessages\PlayMessage.cs" />
109-
<Compile Include="Exceptions\ApiException.cs" />
110109
<Compile Include="Models\IMediaModel.cs" />
111110
<Compile Include="Models\ISongModel.cs" />
112111
<Compile Include="Models\Subsonic\SubsonicResponse.cs" />

Client.Common/CommonModule.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ public class CommonModule : MugenModuleWithAutoDiscoveryBase
88

99
protected override void PrepareForLoad()
1010
{
11-
Convetions.Add(new ServiceConvention(Injector));
11+
Conventions.Add(new ServiceConvention(Injector));
1212
}
1313

1414
#endregion

Client.Common/Models/Subsonic/Error.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
namespace Client.Common.Models.Subsonic
22
{
33
using System.Xml.Serialization;
4+
using global::Common.Interfaces;
45

56
[XmlRoot(ElementName = "error", Namespace = "http://subsonic.org/restapi")]
6-
public class Error
7+
public class Error : IError
78
{
89
#region Public Properties
910

Client.Common/Models/Subsonic/SubsonicResponse.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
namespace Client.Common.Models.Subsonic
22
{
3-
using System.Collections.Generic;
43
using System.Xml.Serialization;
54

65
[XmlRoot(ElementName = "subsonic-response", Namespace = "http://subsonic.org/restapi")]

Client/App.xaml.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
using Client.Common;
55
using Client.Common.Services;
66
using MugenInjection;
7+
using SubLastFm;
78
using Subsonic8.Framework;
89
using Subsonic8.Shell;
910
using Windows.ApplicationModel;
@@ -35,6 +36,7 @@ public App()
3536
protected override void Configure()
3637
{
3738
Kernel.Load<CommonModule>();
39+
Kernel.Load<SubLastFmModule>();
3840
Kernel.Load<ClientModule>();
3941
}
4042

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,27 @@
11
namespace Subsonic8.ArtistInfo
22
{
3-
using Subsonic8.Framework.ViewModel;
3+
using System.Threading.Tasks;
4+
using Framework.ViewModel;
5+
using MugenInjection.Attributes;
6+
using SubLastFm;
47

58
public class ArtistInfoViewModel : ViewModelBase, IArtistInfoViewModel
69
{
10+
public string Parameter { get; set; }
11+
12+
[Inject]
13+
public ILastFmService LastFmService { get; set; }
14+
15+
protected override async void OnActivate()
16+
{
17+
base.OnActivate();
18+
await Populate();
19+
}
20+
21+
private async Task Populate()
22+
{
23+
var getArtistDetailsResult = LastFmService.GetArtistDetails(Parameter).WithErrorHandler(ErrorDialogViewModel);
24+
await getArtistDetailsResult.Execute();
25+
}
726
}
827
}

Client/Client.csproj

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@
192192
<Compile Include="Framework\Services\IoCService.cs" />
193193
<Compile Include="Framework\Services\IResourceService.cs" />
194194
<Compile Include="Framework\Services\ITileNotificationService.cs" />
195+
<Compile Include="Framework\Services\LastFMConfigurationProvider.cs" />
195196
<Compile Include="Framework\Services\ResourceService.cs" />
196197
<Compile Include="Framework\Services\TileNotificationService.cs" />
197198
<Compile Include="Framework\SettingsHelper.cs" />
@@ -562,6 +563,10 @@
562563
<Project>{11d7fb8c-1a2c-4d5b-b129-937d76468a78}</Project>
563564
<Name>Common</Name>
564565
</ProjectReference>
566+
<ProjectReference Include="..\SubLastFm\SubLastFm.csproj">
567+
<Project>{4485a175-2491-40dd-a683-9ccf21267c45}</Project>
568+
<Name>SubLastFm</Name>
569+
</ProjectReference>
565570
</ItemGroup>
566571
<ItemGroup>
567572
<Reference Include="BugFreak, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">

Client/ClientModule.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,6 @@ public class ClientModule : MugenModuleWithAutoDiscoveryBase
1818

1919
protected override void PrepareForLoad()
2020
{
21-
Convetions.AddRange(
22-
new MugenConvetion[] { new ServiceConvention(Injector), new ViewModelConvention(Injector) });
23-
2421
Singletons.AddRange(
2522
new[]
2623
{
@@ -51,6 +48,8 @@ protected override void PrepareForLoad()
5148
new Tuple<Type[], Type>(new[] { typeof(ISettingsHelper) }, typeof(SettingsHelper)),
5249
new Tuple<Type[], Type>(new[] { typeof(INotificationsHelper) }, typeof(NotificationsHelper))
5350
});
51+
Conventions.AddRange(
52+
new MugenConvetion[] {new ServiceConvention(Injector), new ViewModelConvention(Injector)});
5453
}
5554

5655
#endregion
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using SubLastFm;
2+
3+
namespace Subsonic8.Framework.Services
4+
{
5+
public class LastFmConfigurationProvider : IConfigurationProvider
6+
{
7+
private IConfiguration _configuration;
8+
9+
public IConfiguration Configuration
10+
{
11+
get
12+
{
13+
return _configuration ?? (_configuration = new Configuration
14+
{
15+
ApiKey = "a7a6e957a0cd7c5e3132a791c8da1f92",
16+
BaseUrl = "http://ws.audioscrobbler.com/2.0/",
17+
});
18+
}
19+
}
20+
}
21+
}

Common/Common.csproj

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,13 @@
107107
<Compile Include="Converters\InvertedBooleanConverter.cs" />
108108
<Compile Include="Converters\InvertedNullToVisibilityConverter.cs" />
109109
<Compile Include="Converters\NullToVisibilityConverter.cs" />
110+
<Compile Include="Exceptions\ApiException.cs" />
110111
<Compile Include="ExtensionsMethods\LambdaExpressionExtensionMethods.cs" />
111112
<Compile Include="ExtensionsMethods\FrameworkElementExtensions.cs" />
112113
<Compile Include="ExtensionsMethods\UriExtensionMethods.cs" />
113114
<Compile Include="FrameworkElementExtensions\DependencyPropertyChangedCallbacks.cs" />
114115
<Compile Include="FrameworkElementExtensions\FrameworkElementAttachedProperties.cs" />
116+
<Compile Include="Interfaces\IError.cs" />
115117
<Compile Include="Interfaces\IErrorHandler.cs" />
116118
<Compile Include="ListCollectionView\DeferNotifications.cs" />
117119
<Compile Include="ListCollectionView\ICollectionViewEx.cs" />

0 commit comments

Comments
 (0)