Skip to content

Commit

Permalink
v3.0.0.48 - Fix for some naming patterns having double file extension
Browse files Browse the repository at this point in the history
  • Loading branch information
e621-ReBot committed Jan 20, 2025
1 parent 30cb331 commit f79b64d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
7 changes: 4 additions & 3 deletions e621 ReBot v3/Modules/Downloader/Module_Downloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ internal static bool ReSaveMedia(DownloadItem DownloadItemRef)
string FolderPath = Path.Combine(AppSettings.Download_FolderLocation, HostString, PurgeArtistName);
Directory.CreateDirectory(FolderPath);

string GetFileNameOnly = MediaFile_GetFileNameOnly(DownloadItemRef.Grab_MediaURL, DownloadItemRef.Grab_MediaFormat);
//string GetFileNameOnly = MediaFile_GetFileNameOnly(DownloadItemRef.Grab_MediaURL, DownloadItemRef.Grab_MediaFormat);
//if (GetFileNameOnly.EndsWith(".", StringComparison.Ordinal))
//{
// GetFileNameOnly += Module_HicceArs.GetHicceArsMediaType((string)DataRowRef["Grab_MediaURL"]);
Expand Down Expand Up @@ -857,6 +857,7 @@ private static void DownloadFrom_e6URL(DownloadItem DownloadItemRef)
string PicURL = DownloadItemRef.Grab_MediaURL;

string GetFileNameOnly = MediaFile_GetFileNameOnly(PicURL);
GetFileNameOnly = GetFileNameOnly.Substring(0, GetFileNameOnly.LastIndexOf('.'));

string DownloadPath = Path.Combine(AppSettings.Download_FolderLocation, @"e621\");
string PoolName = DownloadItemRef.e6_PoolName;
Expand All @@ -867,7 +868,7 @@ private static void DownloadFrom_e6URL(DownloadItem DownloadItemRef)
{
case 0:
{
//GetFileNameOnly is MD5 by default
GetFileNameOnly = $"{GetFileNameOnly}.{DownloadItemRef.Grab_MediaFormat}";
break;
}
case 1:
Expand All @@ -888,7 +889,7 @@ private static void DownloadFrom_e6URL(DownloadItem DownloadItemRef)
}
if (DownloadItemRef.e6_PoolPostIndex != null)
{
GetFileNameOnly = $"{DownloadItemRef.e6_PoolPostIndex}_{GetFileNameOnly}";
GetFileNameOnly = $"{DownloadItemRef.e6_PoolPostIndex}_{GetFileNameOnly}.{DownloadItemRef.Grab_MediaFormat}";
}

string FilePath = Path.Combine(DownloadPath, GetFileNameOnly);
Expand Down
4 changes: 2 additions & 2 deletions e621 ReBot v3/Windows/Window_Preview.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ internal void Nav2URL(MediaItem MediaItemRef)
}

string MediaURL = MediaItemHolder.Grab_MediaURL;
string MediaName = Module_Downloader.MediaFile_GetFileNameOnly(MediaURL);
string MediaName = Module_Downloader.MediaFile_GetFileNameOnly(MediaURL, MediaItemHolder.Grid_MediaFormat);

//if (Form_Loader._FormReference.cTreeView_ConversionQueue.Nodes.ContainsKey(ImageURL))
//{
Expand Down Expand Up @@ -748,7 +748,7 @@ private void PB_Download_Click(object sender, RoutedEventArgs e)
goto DownloadInstead;
}

string MediaName = Module_Downloader.MediaFile_GetFileNameOnly(MediaItemHolder.Grab_MediaURL);
string MediaName = Module_Downloader.MediaFile_GetFileNameOnly(MediaItemHolder.Grab_MediaURL, MediaItemHolder.Grid_MediaFormat);
if (Module_Downloader.MediaBrowser_MediaCache.ContainsKey(MediaName))
{
DownloadItem DownloadItemTemp = new DownloadItem()
Expand Down
2 changes: 1 addition & 1 deletion e621 ReBot v3/e621 ReBot v3.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<ApplicationIcon>Resources\ReBot_Icon.ico</ApplicationIcon>
<Platforms>x64</Platforms>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<FileVersion>3.0.0.47</FileVersion>
<FileVersion>3.0.0.48</FileVersion>
<StartupObject>e621_ReBot_v3.App</StartupObject>
<IsPublishable>False</IsPublishable>
<RepositoryUrl>https://github.com/e621-ReBot/e621-ReBot-v3</RepositoryUrl>
Expand Down

0 comments on commit f79b64d

Please sign in to comment.