mirror of
https://github.com/zoriya/Kyoo.git
synced 2025-07-08 10:44:20 -04:00
Removing the suffix -thumb to the episode thumbnail file name
This commit is contained in:
parent
7e13e2c5c5
commit
57a34d73ac
@ -79,12 +79,10 @@ 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();
|
||||
}
|
||||
}
|
||||
|
@ -29,11 +29,9 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
|
||||
{
|
||||
try
|
||||
{
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
using WebClient client = new WebClient();
|
||||
await client.DownloadFileTaskAsync(new Uri(show.ImgPrimary), localThumb);
|
||||
}
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
Console.Error.WriteLine("Couldn't download an image.");
|
||||
@ -44,11 +42,9 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
|
||||
{
|
||||
try
|
||||
{
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
using WebClient client = new WebClient();
|
||||
await client.DownloadFileTaskAsync(new Uri(show.ImgLogo), localLogo);
|
||||
}
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
Console.Error.WriteLine("Couldn't download an image.");
|
||||
@ -59,11 +55,9 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
|
||||
{
|
||||
try
|
||||
{
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
using WebClient client = new WebClient();
|
||||
await client.DownloadFileTaskAsync(new Uri(show.ImgBackdrop), localBackdrop);
|
||||
}
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
Console.Error.WriteLine("Couldn't download an image.");
|
||||
@ -85,11 +79,9 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
|
||||
{
|
||||
try
|
||||
{
|
||||
using (WebClient client = new WebClient())
|
||||
{
|
||||
using WebClient client = new WebClient();
|
||||
await client.DownloadFileTaskAsync(new Uri(people[i].imgPrimary), localThumb);
|
||||
}
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
Console.Error.WriteLine("Couldn't download an image.");
|
||||
@ -102,17 +94,14 @@ 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())
|
||||
{
|
||||
using WebClient client = new WebClient();
|
||||
await client.DownloadFileTaskAsync(new Uri(episode.ImgPrimary), localThumb);
|
||||
}
|
||||
}
|
||||
catch (WebException)
|
||||
{
|
||||
Console.Error.WriteLine("Couldn't download an image.");
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 3f3ce1d88e1a146bc304892a7621cf7eb30df29b
|
||||
Subproject commit c0d0a8c2246d8040274d745cbcfa22d366bcef93
|
Loading…
x
Reference in New Issue
Block a user