feat: added support for platform logos
This commit is contained in:
@@ -96,19 +96,7 @@ namespace gaseous_server.Classes.Metadata
|
||||
// get platform logo
|
||||
if (result.PlatformLogo != null)
|
||||
{
|
||||
var logo_results = await igdb.QueryAsync<PlatformLogo>(IGDBClient.Endpoints.PlatformLogos, query: "fields alpha_channel,animated,checksum,height,image_id,url,width; where id = " + result.PlatformLogo.Id + ";");
|
||||
var logo_result = logo_results.First();
|
||||
|
||||
using (var client = new HttpClient())
|
||||
{
|
||||
using (var s = client.GetStreamAsync("https:" + logo_result.Url))
|
||||
{
|
||||
using (var fs = new FileStream(Path.Combine(Config.LibraryConfiguration.LibraryMetadataDirectory_Platform(result), "platform_logo.jpg"), FileMode.OpenOrCreate))
|
||||
{
|
||||
s.Result.CopyTo(fs);
|
||||
}
|
||||
}
|
||||
}
|
||||
PlatformLogos.GetPlatformLogo((long)result.PlatformLogo.Id, Path.Combine(Config.LibraryConfiguration.LibraryMetadataDirectory_Platform(result), "platform_logo.jpg"));
|
||||
}
|
||||
|
||||
return result;
|
||||
|
Reference in New Issue
Block a user