diff --git a/TwilightBoxart.CLI/Properties/PublishProfiles/MacOS.pubxml b/TwilightBoxart.CLI/Properties/PublishProfiles/MacOS.pubxml index c638cf8..7676a89 100644 --- a/TwilightBoxart.CLI/Properties/PublishProfiles/MacOS.pubxml +++ b/TwilightBoxart.CLI/Properties/PublishProfiles/MacOS.pubxml @@ -8,7 +8,7 @@ https://go.microsoft.com/fwlink/?LinkID=208121. Release Any CPU netcoreapp3.0 - bin\Release\macos-x64 + bin\Release\TwilightBoxart-MacOS.CLI osx-x64 true diff --git a/TwilightBoxart.UX/TwilightBoxart.UX.csproj b/TwilightBoxart.UX/TwilightBoxart.UX.csproj index 38dce01..f9a88d9 100644 --- a/TwilightBoxart.UX/TwilightBoxart.UX.csproj +++ b/TwilightBoxart.UX/TwilightBoxart.UX.csproj @@ -190,12 +190,13 @@ goto :$(ConfigurationName) :Release -echo Cleaning xml/pdb.. -del $(TargetDir)\*.xml /Q -del $(TargetDir)\*.pdb /Q -del $(TargetDir)\*.config /Q -del $(TargetDir)\TwilightBoxart.exe /Q +echo Cleaning.. +IF EXIST $(TargetDir)\TwilightBoxart.exe del $(TargetDir)\TwilightBoxart.exe /Q +IF EXIST $(ProjectDir)\bin\TwilightBoxart-Windows.UX.zip del $(ProjectDir)\bin\TwilightBoxart-Windows.UX.zip /Q +echo Zipping.. ren $(TargetPath) TwilightBoxart.exe +powershell Compress-Archive -Path '$(TargetDir)*.exe','$(TargetDir)*.db','$(TargetDir)*.ini' -DestinationPath '$(ProjectDir)\bin\TwilightBoxart-Windows.UX.zip' -Force +ren $(TargetDir)\TwilightBoxart.exe TwilightBoxart.UX.exe goto :exit :Debug :exit diff --git a/TwilightBoxart/BoxartCrawler.cs b/TwilightBoxart/BoxartCrawler.cs index 027cff5..e2eb9e6 100644 --- a/TwilightBoxart/BoxartCrawler.cs +++ b/TwilightBoxart/BoxartCrawler.cs @@ -68,7 +68,7 @@ public void DownloadArt(string romsPath, string boxArtPath, int defaultWidth, in if (rom.ConsoleType == ConsoleType.SuperNintendoEntertainmentSystem) { if ((rom.NoIntroName?.ToLower().EndsWith("(japan)") ?? false) || - (rom.Name?.ToLower().EndsWith("(japan)") ?? false)) + (rom.SearchName?.ToLower().EndsWith("(japan)") ?? false)) { size = new Size(84, 115); } diff --git a/TwilightBoxart/Models/Base/IRom.cs b/TwilightBoxart/Models/Base/IRom.cs index 3216514..8764a37 100644 --- a/TwilightBoxart/Models/Base/IRom.cs +++ b/TwilightBoxart/Models/Base/IRom.cs @@ -5,7 +5,7 @@ namespace TwilightBoxart.Models.Base public interface IRom { string FileName { get; set; } - string Name { get; } + string SearchName { get; } string Sha1 { get; set; } string Title { get; set; } string TitleId { get; set; } diff --git a/TwilightBoxart/Models/Base/LibRetroRom.cs b/TwilightBoxart/Models/Base/LibRetroRom.cs index b899783..0e13479 100644 --- a/TwilightBoxart/Models/Base/LibRetroRom.cs +++ b/TwilightBoxart/Models/Base/LibRetroRom.cs @@ -34,7 +34,7 @@ private void DownloadByName(string targetFile) try { - DownloadWithRetry(Name, targetFile); + DownloadWithRetry(SearchName, targetFile); } catch { @@ -44,6 +44,11 @@ private void DownloadByName(string targetFile) private void DownloadWithRetry(string name, string targetFile) { + if (string.IsNullOrEmpty(name)) + { + throw new NoMatchException("Invalid filename."); + } + try { Download(ConsoleType, name, targetFile); diff --git a/TwilightBoxart/Models/Base/Rom.cs b/TwilightBoxart/Models/Base/Rom.cs index 4a1b1e4..c95067f 100644 --- a/TwilightBoxart/Models/Base/Rom.cs +++ b/TwilightBoxart/Models/Base/Rom.cs @@ -20,8 +20,8 @@ public class Rom : IRom public virtual ConsoleType ConsoleType { get; set; } public string NoIntroName { get; set; } public ConsoleType NoIntroConsoleType { get; set; } + public string SearchName => !string.IsNullOrEmpty(FileName) ? Path.GetFileNameWithoutExtension(FileName?.Replace(".lz77", "")) : null; internal ImgDownloader ImgDownloader { get; set; } - public string Name => Path.GetFileNameWithoutExtension(FileName.Replace(".lz77", "")); public static IRom FromStream(Stream stream, string filename) {