public IJSResponse SetGameMusic(IJSRequest request)
 {
     string cacheKey = request.GetParameter("id");
     Uri imageUri = new Uri(request.GetParameter("url"));
     IGameMediaCache gameCache = new GameMediaCache(cacheKey);
     gameCache.SetBoxartBack(imageUri);
     return new JSResponse(request, $"{gameCache.CacheKey}/{gameCache.GameMusicFileName}");
 }
Example #2
0
 private IGameMediaCache DownloadResults(IGameImagesResult imagesResult, string cacheKey)
 {
     IGameMediaCache mediaCache = new GameMediaCache(cacheKey);
     if (imagesResult.Boxarts.ContainsKey(ImagesInfoFields.img_boxart_back))
         mediaCache.SetBoxartBack(new Uri(imagesResult.Boxarts[ImagesInfoFields.img_boxart_back]));
     if (imagesResult.Boxarts.ContainsKey(ImagesInfoFields.img_boxart_front))
         mediaCache.SetBoxartFront(new Uri(imagesResult.Boxarts[ImagesInfoFields.img_boxart_front]));
     if (imagesResult.Boxarts.ContainsKey(ImagesInfoFields.img_boxart_full))
         mediaCache.SetBoxartFull(new Uri(imagesResult.Boxarts[ImagesInfoFields.img_boxart_full]));
     if(imagesResult.Fanarts.Count > 0)
         mediaCache.SetGameFanart(new Uri(imagesResult.Fanarts[0]));
     return mediaCache;
 }