aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Providers/Studios
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2017-04-29 02:22:33 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2017-04-29 02:22:33 -0400
commitf53472584eedbf21dfb43902fedda89aff57ff77 (patch)
tree4159db3d3d46e52f4621e784446c9b448688b0d3 /MediaBrowser.Providers/Studios
parentb220e221fa2d370d1c74d07497be1b4d083abef7 (diff)
update environment detection
Diffstat (limited to 'MediaBrowser.Providers/Studios')
-rw-r--r--MediaBrowser.Providers/Studios/StudiosImageProvider.cs17
1 files changed, 6 insertions, 11 deletions
diff --git a/MediaBrowser.Providers/Studios/StudiosImageProvider.cs b/MediaBrowser.Providers/Studios/StudiosImageProvider.cs
index bf017d148..8579bd16b 100644
--- a/MediaBrowser.Providers/Studios/StudiosImageProvider.cs
+++ b/MediaBrowser.Providers/Studios/StudiosImageProvider.cs
@@ -4,15 +4,12 @@ using MediaBrowser.Controller.Entities;
using MediaBrowser.Controller.Providers;
using MediaBrowser.Model.Entities;
using MediaBrowser.Model.Providers;
-using MediaBrowser.Providers.Genres;
using MediaBrowser.Providers.ImagesByName;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-using MediaBrowser.Common.IO;
-using MediaBrowser.Controller.IO;
using MediaBrowser.Model.IO;
namespace MediaBrowser.Providers.Studios
@@ -23,8 +20,6 @@ namespace MediaBrowser.Providers.Studios
private readonly IHttpClient _httpClient;
private readonly IFileSystem _fileSystem;
- private readonly SemaphoreSlim _listResourcePool = new SemaphoreSlim(1, 1);
-
public StudiosImageProvider(IServerConfigurationManager config, IHttpClient httpClient, IFileSystem fileSystem)
{
_config = config;
@@ -69,7 +64,7 @@ namespace MediaBrowser.Providers.Studios
{
var posterPath = Path.Combine(_config.ApplicationPaths.CachePath, "imagesbyname", "remotestudioposters.txt");
- await EnsurePosterList(posterPath, cancellationToken).ConfigureAwait(false);
+ posterPath = await EnsurePosterList(posterPath, cancellationToken).ConfigureAwait(false);
list.Add(GetImage(item, posterPath, ImageType.Primary, "folder"));
}
@@ -80,7 +75,7 @@ namespace MediaBrowser.Providers.Studios
{
var thumbsPath = Path.Combine(_config.ApplicationPaths.CachePath, "imagesbyname", "remotestudiothumbs.txt");
- await EnsureThumbsList(thumbsPath, cancellationToken).ConfigureAwait(false);
+ thumbsPath = await EnsureThumbsList(thumbsPath, cancellationToken).ConfigureAwait(false);
list.Add(GetImage(item, thumbsPath, ImageType.Thumb, "thumb"));
}
@@ -114,18 +109,18 @@ namespace MediaBrowser.Providers.Studios
return string.Format("https://raw.github.com/MediaBrowser/MediaBrowser.Resources/master/images/imagesbyname/studios/{0}/{1}.jpg", image, filename);
}
- private Task EnsureThumbsList(string file, CancellationToken cancellationToken)
+ private Task<string> EnsureThumbsList(string file, CancellationToken cancellationToken)
{
const string url = "https://raw.github.com/MediaBrowser/MediaBrowser.Resources/master/images/imagesbyname/studiothumbs.txt";
- return ImageUtils.EnsureList(url, file, _httpClient, _fileSystem, _listResourcePool, cancellationToken);
+ return ImageUtils.EnsureList(url, file, _httpClient, _fileSystem, cancellationToken);
}
- private Task EnsurePosterList(string file, CancellationToken cancellationToken)
+ private Task<string> EnsurePosterList(string file, CancellationToken cancellationToken)
{
const string url = "https://raw.github.com/MediaBrowser/MediaBrowser.Resources/master/images/imagesbyname/studioposters.txt";
- return ImageUtils.EnsureList(url, file, _httpClient, _fileSystem, _listResourcePool, cancellationToken);
+ return ImageUtils.EnsureList(url, file, _httpClient, _fileSystem, cancellationToken);
}
public int Order