Skip to content
Permalink
Browse files

MP1-4982: Remove hard stop when Caching Graphics not found folders

  • Loading branch information
andrewjswan committed Jan 7, 2020
1 parent ac1c928 commit a92d7d711e5262aa0ae0020f33efabd42184e0c8
Showing with 39 additions and 10 deletions.
  1. +37 −9 mediaportal/Core/guilib/TexturePacker.cs
  2. +2 −1 mediaportal/MediaPortal.Application/MediaPortal.cs
@@ -347,17 +347,45 @@ public void PackSkinGraphics(string skinName)
// The themes directory is not required to exist.
}

string[] tvLogos = Directory.GetFiles(Config.GetSubFolder(Config.Dir.Thumbs, @"tv\logos"), "*.png", SearchOption.AllDirectories);
files.AddRange(tvLogos);

string[] radioLogos = Directory.GetFiles(Config.GetSubFolder(Config.Dir.Thumbs, "Radio"), "*.png", SearchOption.AllDirectories);
files.AddRange(radioLogos);
try
{
string[] tvLogos = Directory.GetFiles(Config.GetSubFolder(Config.Dir.Thumbs, @"tv\logos"), "*.png", SearchOption.AllDirectories);
files.AddRange(tvLogos);
}
catch (DirectoryNotFoundException)
{
Log.Warn("TexturePacker: Folder not found: " + Config.GetSubFolder(Config.Dir.Thumbs, @"tv\logos"));
}

string[] weatherFiles = Directory.GetFiles(String.Format(@"{0}\media\weather", skinName), "*.png");
files.AddRange(weatherFiles);
try
{
string[] radioLogos = Directory.GetFiles(Config.GetSubFolder(Config.Dir.Thumbs, "Radio"), "*.png", SearchOption.AllDirectories);
files.AddRange(radioLogos);
}
catch (DirectoryNotFoundException)
{
Log.Warn("TexturePacker: Folder not found: " + Config.GetSubFolder(Config.Dir.Thumbs, "Radio"));
}

string[] tetrisFiles = Directory.GetFiles(String.Format(@"{0}\media\tetris", skinName), "*.png");
files.AddRange(tetrisFiles);
try
{
string[] weatherFiles = Directory.GetFiles(String.Format(@"{0}\media\weather", skinName), "*.png");
files.AddRange(weatherFiles);
}
catch (DirectoryNotFoundException)
{
Log.Warn("TexturePacker: Folder not found: " + String.Format(@"{0}\media\weather", skinName));
}

try
{
string[] tetrisFiles = Directory.GetFiles(String.Format(@"{0}\media\tetris", skinName), "*.png");
files.AddRange(tetrisFiles);
}
catch (DirectoryNotFoundException)
{
Log.Warn("TexturePacker: Folder not found: " + String.Format(@"{0}\media\tetris", skinName));
}

// Determine maximum texture dimensions
try
@@ -3666,7 +3666,8 @@ protected override void InitializeDeviceObjects()
catch (Exception exs)
{
// ReSharper disable LocalizableElement
MessageBox.Show(String.Format("Failed to load your skin! Aborting startup...\n\n{0}", exs.Message), "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
// MessageBox.Show(String.Format("Failed to load your skin! Aborting startup...\n\n{0}", exs.Message), "Critical error", MessageBoxButtons.OK, MessageBoxIcon.Stop);
Log.Error("Startup: Failed to Caching Graphics! {0}", exs.Message);
// ReSharper restore LocalizableElement
Close();
}

0 comments on commit a92d7d7

Please sign in to comment.
You can’t perform that action at this time.