From 4be60f2e08e60aeee318c8c45e090041e2dd7e9f Mon Sep 17 00:00:00 2001 From: Kilian von Pflugk Date: Sun, 12 May 2024 20:31:35 +0200 Subject: [PATCH] check that intro.xml/credits.xml exits before moving --- ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs b/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs index 07889f9..c0faf16 100644 --- a/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs +++ b/ConfusedPolarBear.Plugin.IntroSkipper/Plugin.cs @@ -76,9 +76,19 @@ public class Plugin : BasePlugin, IHasWebPages // Check if the old cache directory exists if (Directory.Exists(oldFingerprintCachePath)) { + // move intro.xml if exists + if (File.Exists(oldIntroPath)) + { + File.Move(oldIntroPath, _introPath); + } + + // move credits.xml if exists + if (File.Exists(oldCreditsPath)) + { + File.Move(oldCreditsPath, _creditsPath); + } + // Move the contents from old directory to new directory - File.Move(oldIntroPath, _introPath); - File.Move(oldCreditsPath, _creditsPath); string[] files = Directory.GetFiles(oldFingerprintCachePath); foreach (string file in files) {