added manual last fm image provider
This commit is contained in:
parent
f775f7c1fa
commit
885287e631
|
@ -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" />
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -325,7 +325,7 @@ namespace MediaBrowser.Providers.Music
|
|||
|
||||
public int Priority
|
||||
{
|
||||
get { return 0; }
|
||||
get { return 1; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -334,7 +334,7 @@ namespace MediaBrowser.Providers.Music
|
|||
|
||||
public int Priority
|
||||
{
|
||||
get { return 0; }
|
||||
get { return 1; }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
45
MediaBrowser.Providers/Music/ManualLastFmImageProvider.cs
Normal file
45
MediaBrowser.Providers/Music/ManualLastFmImageProvider.cs
Normal 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; }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user