diff --git a/FoliCon/Modules/IGDB/IgdbDataTransformer.cs b/FoliCon/Modules/IGDB/IgdbDataTransformer.cs index b6b0bec..0bb9925 100644 --- a/FoliCon/Modules/IGDB/IgdbDataTransformer.cs +++ b/FoliCon/Modules/IGDB/IgdbDataTransformer.cs @@ -45,7 +45,7 @@ public void ResultPicked(Game game, string fullFolderPath, string rating = "") { ValidateGamePoster(game); var folderName = Path.GetFileName(fullFolderPath); - var localPosterPath = $@"{fullFolderPath}\{folderName}.png"; + var localPosterPath = $@"{fullFolderPath}\{IconUtils.GetImageName()}.png"; HandleGamePosterPath(game, fullFolderPath, localPosterPath, rating, folderName); } diff --git a/FoliCon/Modules/TMDB/TmdbDataTransformer.cs b/FoliCon/Modules/TMDB/TmdbDataTransformer.cs index a127bea..4967ec2 100644 --- a/FoliCon/Modules/TMDB/TmdbDataTransformer.cs +++ b/FoliCon/Modules/TMDB/TmdbDataTransformer.cs @@ -203,7 +203,7 @@ public void ResultPicked(dynamic result, string resultType, string fullFolderPat } var folderName = Path.GetFileName(fullFolderPath); - var localPosterPath = fullFolderPath + @"\" + folderName + ".png"; + var localPosterPath = $@"{fullFolderPath}\{IconUtils.GetImageName()}.png"; string posterUrl = string.Concat(PosterBase, result.PosterPath.Replace("http://image.tmdb.org/t/p/w500","")); diff --git a/FoliCon/Modules/utils/FileUtils.cs b/FoliCon/Modules/utils/FileUtils.cs index 8be42e3..c8ebf59 100644 --- a/FoliCon/Modules/utils/FileUtils.cs +++ b/FoliCon/Modules/utils/FileUtils.cs @@ -49,8 +49,8 @@ public static void DeleteIconsFromSubfolders(string folderPath) public static void DeleteIconsFromFolder(string folderPath) { Logger.Debug("Deleting Icons from: {FolderPath}", folderPath); - var folderName = Path.GetFileName(folderPath); - var icoFile = Path.Combine(folderPath, $"{folderName}.ico"); + + var icoFile = Path.Combine(folderPath, $"{IconUtils.GetImageName()}.ico"); var iniFile = Path.Combine(folderPath, "desktop.ini"); try { @@ -94,7 +94,7 @@ public static List GetFolderNames(string folderPath) if (!string.IsNullOrEmpty(folderPath)) { folderNames.AddRange(from folder in Directory.GetDirectories(folderPath) - where !File.Exists(folder + @"\" + Path.GetFileName(folder) + ".ico") + where !File.Exists($@"{folder}\{IconUtils.GetImageName()}.ico") select Path.GetFileName(folder)); } diff --git a/FoliCon/Modules/utils/IconUtils.cs b/FoliCon/Modules/utils/IconUtils.cs index f778b38..c463480 100644 --- a/FoliCon/Modules/utils/IconUtils.cs +++ b/FoliCon/Modules/utils/IconUtils.cs @@ -10,7 +10,12 @@ namespace FoliCon.Modules.utils; public static class IconUtils { private static readonly NLog.Logger Logger = LogManager.GetCurrentClassLogger(); - + private const string ImageName = "folicon"; + + public static string GetImageName() + { + return ImageName; + } /// /// Creates Icons from PNG /// @@ -28,8 +33,8 @@ public static int MakeIco(string iconMode, string selectedFolder, List