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\ManualFanartAlbumProvider.cs" />
<Compile Include="Music\ManualFanartArtistProvider.cs" />
<Compile Include="Music\ManualLastFmImageProvider.cs" />
<Compile Include="Music\MusicVideoXmlParser.cs" />
<Compile Include="Music\SoundtrackPostScanTask.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />

View File

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

View File

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

View File

@ -334,7 +334,7 @@ namespace MediaBrowser.Providers.Music
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" />
</startup>
<runtime>
<gcAllowVeryLargeObjects enabled="true" />
<gcServer enabled="true" />
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>