Finishing the top design of the show details view.

This commit is contained in:
Zoe Roux
2019-08-31 00:58:21 +02:00
parent e1a92a3d36
commit 352e4cbf7b
8 changed files with 232 additions and 120 deletions
@@ -481,11 +481,14 @@ namespace Kyoo.InternalAPI
cmd.ExecuteNonQuery();
}
cmd.CommandText = "INSERT INTO studiosLinks (studioID, showID) VALUES($studioID, $showID);";
long studioID = GetOrCreateStudio(show.studio);
cmd.Parameters.AddWithValue("$studioID", studioID);
cmd.Parameters.AddWithValue("$showID", showID);
cmd.ExecuteNonQuery();
if(show.studio != null)
{
cmd.CommandText = "INSERT INTO studiosLinks (studioID, showID) VALUES($studioID, $showID);";
long studioID = GetOrCreateStudio(show.studio);
cmd.Parameters.AddWithValue("$studioID", studioID);
cmd.Parameters.AddWithValue("$showID", showID);
cmd.ExecuteNonQuery();
}
return showID;
}
@@ -19,9 +19,13 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
public Show Validate(Show show)
{
string localThumb = Path.Combine(show.Path, "poster.jpg");
string localLogo = Path.Combine(show.Path, "logo.png");
string localBackdrop = Path.Combine(show.Path, "backdrop.jpg");
if (show.ImgPrimary != null)
{
string localThumb = Path.Combine(show.Path, "poster.jpg");
if (!File.Exists(localThumb))
{
using (WebClient client = new WebClient())
@@ -29,12 +33,11 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
client.DownloadFileAsync(new Uri(show.ImgPrimary), localThumb);
}
}
show.ImgPrimary = localThumb;
}
show.ImgPrimary = localThumb;
if (show.ImgLogo != null)
{
string localLogo = Path.Combine(show.Path, "logo.png");
if (!File.Exists(localLogo))
{
using (WebClient client = new WebClient())
@@ -42,12 +45,11 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
client.DownloadFileAsync(new Uri(show.ImgLogo), localLogo);
}
}
show.ImgLogo = localLogo;
}
show.ImgLogo = localLogo;
if (show.ImgBackdrop != null)
{
string localBackdrop = Path.Combine(show.Path, "backdrop.jpg");
if (!File.Exists(localBackdrop))
{
using (WebClient client = new WebClient())
@@ -55,8 +57,8 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
client.DownloadFileAsync(new Uri(show.ImgBackdrop), localBackdrop);
}
}
show.ImgBackdrop = localBackdrop;
}
show.ImgBackdrop = localBackdrop;
return show;
}
@@ -65,7 +67,10 @@ namespace Kyoo.InternalAPI.ThumbnailsManager
{
for (int i = 0; i < people?.Count; i++)
{
string localThumb = config.GetValue<string>("peoplePath") + "/" + people[i].slug + ".jpg";
string root = config.GetValue<string>("peoplePath");
Directory.CreateDirectory(root);
string localThumb = root + "/" + people[i].slug + ".jpg";
if (!File.Exists(localThumb))
{
using (WebClient client = new WebClient())