WIP - Bug hunting

This commit is contained in:
Michael Green
2024-10-20 12:14:13 +11:00
parent 48e4f17090
commit 53c79287a9
7 changed files with 16 additions and 39 deletions

View File

@@ -67,11 +67,9 @@ namespace gaseous_server.Classes.Metadata
throw new Exception("How did you get here?");
}
// check for presence of "original" quality file - download if absent or force download is true
string localFile = Path.Combine(ImagePath, Communications.IGDBAPI_ImageSize.original.ToString(), returnValue.ImageId + ".jpg");
if (GetImages == true)
{
if ((!File.Exists(localFile)) || forceImageDownload == true)
if (forceImageDownload == true)
{
Logging.Log(Logging.LogType.Information, "Metadata: " + returnValue.GetType().Name, "Artwork download forced.");

View File

@@ -70,8 +70,8 @@ namespace gaseous_server.Classes.Metadata
case HasheousClient.Models.MetadataModel.MetadataSources.Hasheous:
// set rate limiter avoidance values
RateLimitAvoidanceWait = 250;
RateLimitAvoidanceThreshold = 10;
RateLimitAvoidanceWait = 1500;
RateLimitAvoidanceThreshold = 6;
RateLimitAvoidancePeriod = 1;
// set rate limiter recovery values
@@ -1059,7 +1059,7 @@ namespace gaseous_server.Classes.Metadata
}
if (!Directory.Exists(Path.GetDirectoryName(requestedPath)))
{
Directory.CreateDirectory(Path.GetDirectoryName(originalPath));
Directory.CreateDirectory(Path.GetDirectoryName(requestedPath));
}
// get the resolution attribute for enum size

View File

@@ -69,9 +69,7 @@ namespace gaseous_server.Classes.Metadata
throw new Exception("How did you get here?");
}
// check for presence of "original" quality file - download if absent or force download is true
string localFile = Path.Combine(ImagePath, Communications.IGDBAPI_ImageSize.original.ToString(), returnValue.ImageId + ".jpg");
if ((!File.Exists(localFile)) || forceImageDownload == true)
if (forceImageDownload == true)
{
Logging.Log(Logging.LogType.Information, "Metadata: " + returnValue.GetType().Name, "Company logo download forced.");

View File

@@ -69,29 +69,14 @@ namespace gaseous_server.Classes.Metadata
throw new Exception("How did you get here?");
}
string localFile = Path.Combine(ImagePath, Communications.IGDBAPI_ImageSize.original.ToString(), returnValue.ImageId + ".jpg");
if (GetImages == true)
{
if ((!File.Exists(localFile)) || forceImageDownload == true)
if (forceImageDownload == true)
{
Logging.Log(Logging.LogType.Information, "Metadata: " + returnValue.GetType().Name, "Cover download forced.");
// check for presence of image file - download if absent or force download is true
List<Communications.IGDBAPI_ImageSize> imageSizes = new List<Communications.IGDBAPI_ImageSize>{
Communications.IGDBAPI_ImageSize.cover_big,
Communications.IGDBAPI_ImageSize.cover_small,
Communications.IGDBAPI_ImageSize.original
};
Communications comms = new Communications();
foreach (Communications.IGDBAPI_ImageSize size in imageSizes)
{
localFile = Path.Combine(ImagePath, size.ToString(), returnValue.ImageId + ".jpg");
if ((!File.Exists(localFile)) || forceImageDownload == true)
{
comms.GetSpecificImageFromServer(ImagePath, returnValue.ImageId, size, null);
}
}
comms.GetSpecificImageFromServer(ImagePath, returnValue.ImageId, Communications.IGDBAPI_ImageSize.original, null);
}
}

View File

@@ -243,13 +243,13 @@ namespace gaseous_server.Classes.Metadata
Collection GameCollection = Collections.GetCollections(Game.Collection.Id);
}
if (Game.ExternalGames != null)
{
foreach (long ExternalGameId in Game.ExternalGames.Ids)
{
ExternalGame GameExternalGame = ExternalGames.GetExternalGames(ExternalGameId);
}
}
// if (Game.ExternalGames != null)
// {
// foreach (long ExternalGameId in Game.ExternalGames.Ids)
// {
// ExternalGame GameExternalGame = ExternalGames.GetExternalGames(ExternalGameId);
// }
// }
if (Game.Franchise != null)
{

View File

@@ -71,9 +71,7 @@ namespace gaseous_server.Classes.Metadata
if (returnValue != null)
{
// check for presence of "original" quality file - download if absent or force download is true
string localFile = Path.Combine(ImagePath, Communications.IGDBAPI_ImageSize.original.ToString(), returnValue.ImageId + ".jpg");
if ((!File.Exists(localFile)) || forceImageDownload == true)
if (forceImageDownload == true)
{
Logging.Log(Logging.LogType.Information, "Metadata: " + returnValue.GetType().Name, "Platform logo download forced.");

View File

@@ -67,11 +67,9 @@ namespace gaseous_server.Classes.Metadata
throw new Exception("How did you get here?");
}
// check for presence of "original" quality file - download if absent or force download is true
string localFile = Path.Combine(ImagePath, Communications.IGDBAPI_ImageSize.original.ToString(), returnValue.ImageId + ".jpg");
if (GetImages == true)
{
if ((!File.Exists(localFile)) || forceImageDownload == true)
if (forceImageDownload == true)
{
Logging.Log(Logging.LogType.Information, "Metadata: " + returnValue.GetType().Name, "Screenshot download forced.");