mirror of
https://github.com/zoriya/Kyoo.git
synced 2026-06-01 19:26:40 +00:00
Removing the suffix -thumb to the episode thumbnail file name
This commit is contained in:
@@ -79,13 +79,11 @@ namespace Kyoo.Controllers
|
||||
if (path == null)
|
||||
return NotFound();
|
||||
|
||||
//string thumb = Path.ChangeExtension(path, "jpg");
|
||||
string thumb = path.Replace(Path.GetExtension(path), "-thumb.jpg");
|
||||
string thumb = Path.ChangeExtension(path, "jpg");
|
||||
|
||||
if (System.IO.File.Exists(thumb))
|
||||
return new PhysicalFileResult(thumb, "image/jpg");
|
||||
else
|
||||
return NotFound();
|
||||
return NotFound();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,10 +29,8 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
|
||||
{
|
||||
try
|
||||
{
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
await client.DownloadFileTaskAsync(new Uri(show.ImgPrimary), localThumb);
|
||||
}
|
||||
using WebClient client = new WebClient();
|
||||
await client.DownloadFileTaskAsync(new Uri(show.ImgPrimary), localThumb);
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
@@ -44,10 +42,8 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
|
||||
{
|
||||
try
|
||||
{
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
await client.DownloadFileTaskAsync(new Uri(show.ImgLogo), localLogo);
|
||||
}
|
||||
using WebClient client = new WebClient();
|
||||
await client.DownloadFileTaskAsync(new Uri(show.ImgLogo), localLogo);
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
@@ -59,10 +55,8 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
|
||||
{
|
||||
try
|
||||
{
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
await client.DownloadFileTaskAsync(new Uri(show.ImgBackdrop), localBackdrop);
|
||||
}
|
||||
using WebClient client = new WebClient();
|
||||
await client.DownloadFileTaskAsync(new Uri(show.ImgBackdrop), localBackdrop);
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
@@ -85,10 +79,8 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
|
||||
{
|
||||
try
|
||||
{
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
await client.DownloadFileTaskAsync(new Uri(people[i].imgPrimary), localThumb);
|
||||
}
|
||||
using WebClient client = new WebClient();
|
||||
await client.DownloadFileTaskAsync(new Uri(people[i].imgPrimary), localThumb);
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
@@ -102,16 +94,13 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
|
||||
|
||||
public async Task<Episode> Validate(Episode episode)
|
||||
{
|
||||
//string localThumb = Path.ChangeExtension(episode.Path, "jpg");
|
||||
string localThumb = episode.Path.Replace(Path.GetExtension(episode.Path), "-thumb.jpg");
|
||||
string localThumb = Path.ChangeExtension(episode.Path, "jpg");
|
||||
if (episode.ImgPrimary != null && !File.Exists(localThumb))
|
||||
{
|
||||
try
|
||||
{
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
await client.DownloadFileTaskAsync(new Uri(episode.ImgPrimary), localThumb);
|
||||
}
|
||||
using WebClient client = new WebClient();
|
||||
await client.DownloadFileTaskAsync(new Uri(episode.ImgPrimary), localThumb);
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
|
||||
+1
-1
Submodule transcoder updated: 3f3ce1d88e...c0d0a8c224
Reference in New Issue
Block a user