rawfilewizard

git clone https://git.clttr.info/rawfilewizard.git
Log (Feed) | Files | Refs (Tags) | README | LICENSE

commit b6e5bf4fa080056fdf850fb793bda82e551365c9
parent 00ee9a7c1e2b7143f86bf42c033d001404f187de
Author: rwa <apollo@rw-net.de>
Date:   Sun, 13 Jan 2019 18:25:32 +0100

disable handling of jpegs which lay aside of the raw file

Diffstat:
MJpegDivider/Program.cs | 2+-
MSilkypixFileMover/Helpers/FileHelpers.cs | 15+++++++++++++--
MSilkypixFileMover/MainForm.cs | 3++-
MSilkypixFileMover/Objects/RawFile.cs | 21+++++++++++----------
MSilkypixFileMover/Properties/AssemblyInfo.cs | 6+++---
5 files changed, 30 insertions(+), 17 deletions(-)

diff --git a/JpegDivider/Program.cs b/JpegDivider/Program.cs @@ -175,7 +175,7 @@ namespace JpegDivider { Console.WriteLine($"{Assembly.GetExecutingAssembly().GetName().Name} - Version {Assembly.GetExecutingAssembly().GetName().Version}"); Console.WriteLine("published under BSD 3 - Clause License"); - Console.WriteLine("Copyright(c) 2018, René Wagner"); + Console.WriteLine("Copyright(c) 2018-2019, René Wagner"); Console.WriteLine("https://gitlab.com/guzzisti1/rawfilewizard"); Console.WriteLine(""); Console.WriteLine("divide jpegs from raw files by moving them to a specified subfolder (default: JPEG)"); diff --git a/SilkypixFileMover/Helpers/FileHelpers.cs b/SilkypixFileMover/Helpers/FileHelpers.cs @@ -38,7 +38,7 @@ namespace SilkypixFileMover.Helpers } } - internal static void MoveAllFilesInList( IEnumerable<string> fileList, string sourceFolder, string destinationFolder ) + internal static void MoveAllFilesInList( IEnumerable<string> fileList, string sourceFolder, string destinationFolder, bool save ) { foreach ( string file in fileList ) { @@ -47,9 +47,20 @@ namespace SilkypixFileMover.Helpers { continue; } + if ( !File.Exists(sourceFullPath)) + { + continue; + } string destFullPath = Path.Combine( destinationFolder, Path.GetFileName( file ) ); - SaveMove( sourceFullPath, destFullPath ); + if (save) + { + SaveMove(sourceFullPath, destFullPath); + } + else + { + File.Move(sourceFullPath, destFullPath); + } } } diff --git a/SilkypixFileMover/MainForm.cs b/SilkypixFileMover/MainForm.cs @@ -580,7 +580,8 @@ namespace SilkypixFileMover { errorCount++; string exceptionText = ex.Message; - statusLabel.Text = exceptionText; + // TODO: ExceptionText is too long for the status label + //statusLabel.Text = exceptionText; ShowBalloonTipText( exceptionText, 2 ); } currentProgress++; diff --git a/SilkypixFileMover/Objects/RawFile.cs b/SilkypixFileMover/Objects/RawFile.cs @@ -56,12 +56,6 @@ namespace SilkypixFileMover.Objects string.Format( "{0}.{1}", Path.GetFileNameWithoutExtension( RawFileName ), fileExt ) ) ); } - // auch JPEGs die direkt neben dem RAW liegen - foreach ( string fileExt in Settings.Default.JpegFileExtensions.Split( '|' ) ) - { - jpegFileList.Add( Path.Combine( string.Format( "{0}.{1}", Path.GetFileNameWithoutExtension( RawFileName ), fileExt ) ) ); - } - // nach "Dateien die so ähnlich heißen" suchen if ( Settings.Default.IncludeSimilarFiles ) { @@ -79,6 +73,13 @@ namespace SilkypixFileMover.Objects } } + // auch JPEGs die direkt neben dem RAW liegen + // TODO: führt zu Problemen wenn schon ein normales JPEG aus dem Unterordner da ist - rename? + //foreach ( string fileExt in Settings.Default.JpegFileExtensions.Split( '|' ) ) + //{ + // jpegFileList.Add( Path.Combine( string.Format( "{0}.{1}", Path.GetFileNameWithoutExtension( RawFileName ), fileExt ) ) ); + //} + return jpegFileList; } } @@ -188,15 +189,15 @@ namespace SilkypixFileMover.Objects { File.Move( RawFileFullPath, rawFileFullDestPath ); - FileHelpers.MoveAllFilesInList( jpegSourceFileNamesWithSubfolder, RawFileSourcePath, jpegDestFolder ); - FileHelpers.MoveAllFilesInList( sidecarFileNamesWithSubfolder, RawFileSourcePath, sidecarFilesDestFolder); + FileHelpers.MoveAllFilesInList( jpegSourceFileNamesWithSubfolder, RawFileSourcePath, jpegDestFolder, false ); + FileHelpers.MoveAllFilesInList( sidecarFileNamesWithSubfolder, RawFileSourcePath, sidecarFilesDestFolder, false); } catch ( Exception ) { FileHelpers.SaveMove( rawFileFullDestPath, RawFileFullPath ); - FileHelpers.MoveAllFilesInList( jpegSourceFileNamesWithSubfolder, jpegDestFolder, RawFileSourcePath ); - FileHelpers.MoveAllFilesInList( sidecarFileNamesWithSubfolder, sidecarFilesDestFolder, RawFileSourcePath ); + FileHelpers.MoveAllFilesInList( jpegSourceFileNamesWithSubfolder, Directory.GetParent(jpegDestFolder).FullName, RawFileSourcePath, true ); + FileHelpers.MoveAllFilesInList( sidecarFileNamesWithSubfolder, sidecarFilesDestFolder, RawFileSourcePath, true ); throw; } diff --git a/SilkypixFileMover/Properties/AssemblyInfo.cs b/SilkypixFileMover/Properties/AssemblyInfo.cs @@ -11,7 +11,7 @@ using System; [assembly: AssemblyConfiguration( "" )] [assembly: AssemblyCompany( "René Wagner" )] [assembly: AssemblyProduct( "RawFileWizard" )] -[assembly: AssemblyCopyright("Copyright © René Wagner 2018")] +[assembly: AssemblyCopyright("Copyright © René Wagner 2018-2019")] [assembly: AssemblyTrademark( "" )] [assembly: AssemblyCulture( "" )] @@ -33,6 +33,6 @@ using System; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.6.2.0")] +[assembly: AssemblyVersion("1.6.3.0")] [assembly: NeutralResourcesLanguage( "de" )] -[assembly: AssemblyFileVersion("1.6.2.0")] +[assembly: AssemblyFileVersion("1.6.3.0")]