added manual last fm image provider

This commit is contained in:
Luke Pulverenti 2013-11-06 10:46:02 -05:00
parent f775f7c1fa
commit 885287e631
6 changed files with 49 additions and 5 deletions

View file

@ -92,6 +92,7 @@
<Compile Include="Music\AlbumDynamicInfoProvider.cs" /> <Compile Include="Music\AlbumDynamicInfoProvider.cs" />
<Compile Include="Music\ManualFanartAlbumProvider.cs" /> <Compile Include="Music\ManualFanartAlbumProvider.cs" />
<Compile Include="Music\ManualFanartArtistProvider.cs" /> <Compile Include="Music\ManualFanartArtistProvider.cs" />
<Compile Include="Music\ManualLastFmImageProvider.cs" />
<Compile Include="Music\MusicVideoXmlParser.cs" /> <Compile Include="Music\MusicVideoXmlParser.cs" />
<Compile Include="Music\SoundtrackPostScanTask.cs" /> <Compile Include="Music\SoundtrackPostScanTask.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View file

@ -8,17 +8,14 @@ using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Providers; using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities; using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Logging; using MediaBrowser.Model.Logging;
using MediaBrowser.Model.Net;
using MediaBrowser.Model.Providers; using MediaBrowser.Model.Providers;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Net;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Xml;
namespace MediaBrowser.Providers.Music namespace MediaBrowser.Providers.Music
{ {

View file

@ -325,7 +325,7 @@ namespace MediaBrowser.Providers.Music
public int Priority public int Priority
{ {
get { return 0; } get { return 1; }
} }
} }
} }

View file

@ -334,7 +334,7 @@ namespace MediaBrowser.Providers.Music
public int Priority public int Priority
{ {
get { return 0; } get { return 1; }
} }
} }
} }

View file

@ -0,0 +1,45 @@
using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Entities.Audio;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace MediaBrowser.Providers.Music
{
public class ManualLastFmImageProvider : IImageProvider
{
public string Name
{
get { return "last.fm"; }
}
public bool Supports(BaseItem item)
{
return item is MusicAlbum || item is MusicArtist || item is Artist;
}
public async Task<IEnumerable<RemoteImageInfo>> GetImages(BaseItem item, ImageType imageType, CancellationToken cancellationToken)
{
var images = await GetAllImages(item, cancellationToken).ConfigureAwait(false);
return images.Where(i => i.Type == imageType);
}
public async Task<IEnumerable<RemoteImageInfo>> GetAllImages(BaseItem item, CancellationToken cancellationToken)
{
var list = new List<RemoteImageInfo>();
// The only info we have is size
return list.OrderByDescending(i => i.Width ?? 0);
}
public int Priority
{
get { return 0; }
}
}
}

View file

@ -19,6 +19,7 @@
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup> </startup>
<runtime> <runtime>
<gcAllowVeryLargeObjects enabled="true" />
<gcServer enabled="true" /> <gcServer enabled="true" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly> <dependentAssembly>