Browse code

disable handling of jpegs which lay aside of the raw file

rwa authored on 13.01.2019 18:25:32
Showing 5 changed files

... ...
@@ -175,7 +175,7 @@ namespace JpegDivider
175 175
         {
176 176
             Console.WriteLine($"{Assembly.GetExecutingAssembly().GetName().Name} - Version {Assembly.GetExecutingAssembly().GetName().Version}");
177 177
             Console.WriteLine("published under BSD 3 - Clause License");
178
-            Console.WriteLine("Copyright(c) 2018, René Wagner");
178
+            Console.WriteLine("Copyright(c) 2018-2019, René Wagner");
179 179
             Console.WriteLine("https://gitlab.com/guzzisti1/rawfilewizard");
180 180
             Console.WriteLine("");
181 181
             Console.WriteLine("divide jpegs from raw files by moving them to a specified subfolder (default: JPEG)");
... ...
@@ -38,7 +38,7 @@ namespace SilkypixFileMover.Helpers
38 38
             }
39 39
         }
40 40
 
41
-        internal static void MoveAllFilesInList( IEnumerable<string> fileList, string sourceFolder, string destinationFolder )
41
+        internal static void MoveAllFilesInList( IEnumerable<string> fileList, string sourceFolder, string destinationFolder, bool save )
42 42
         {
43 43
             foreach ( string file in fileList )
44 44
             {
... ...
@@ -47,9 +47,20 @@ namespace SilkypixFileMover.Helpers
47 47
                 {
48 48
                     continue;
49 49
                 }
50
+                if ( !File.Exists(sourceFullPath))
51
+                {
52
+                    continue;
53
+                }
50 54
                 string destFullPath = Path.Combine( destinationFolder, Path.GetFileName( file ) );
51 55
 
52
-                SaveMove( sourceFullPath, destFullPath );
56
+                if (save)
57
+                {
58
+                    SaveMove(sourceFullPath, destFullPath);
59
+                }
60
+                else
61
+                {
62
+                    File.Move(sourceFullPath, destFullPath);
63
+                }
53 64
             }
54 65
         }
55 66
 
... ...
@@ -580,7 +580,8 @@ namespace SilkypixFileMover
580 580
                     {
581 581
                         errorCount++;
582 582
                         string exceptionText = ex.Message;
583
-                        statusLabel.Text = exceptionText;
583
+                        // TODO: ExceptionText is too long for the status label
584
+                        //statusLabel.Text = exceptionText;
584 585
                         ShowBalloonTipText( exceptionText, 2 );
585 586
                     }
586 587
                     currentProgress++;
... ...
@@ -56,12 +56,6 @@ namespace SilkypixFileMover.Objects
56 56
                         string.Format( "{0}.{1}", Path.GetFileNameWithoutExtension( RawFileName ), fileExt ) ) );
57 57
                 }
58 58
 
59
-                // auch JPEGs die direkt neben dem RAW liegen
60
-                foreach ( string fileExt in Settings.Default.JpegFileExtensions.Split( '|' ) )
61
-                {
62
-                    jpegFileList.Add( Path.Combine( string.Format( "{0}.{1}", Path.GetFileNameWithoutExtension( RawFileName ), fileExt ) ) );
63
-                }
64
-
65 59
                 // nach "Dateien die so ähnlich heißen" suchen
66 60
                 if ( Settings.Default.IncludeSimilarFiles )
67 61
                 {
... ...
@@ -79,6 +73,13 @@ namespace SilkypixFileMover.Objects
79 73
                     }
80 74
                 }
81 75
 
76
+                // auch JPEGs die direkt neben dem RAW liegen
77
+                // TODO: führt zu Problemen wenn schon ein normales JPEG aus dem Unterordner da ist - rename?
78
+                //foreach ( string fileExt in Settings.Default.JpegFileExtensions.Split( '|' ) )
79
+                //{
80
+                //    jpegFileList.Add( Path.Combine( string.Format( "{0}.{1}", Path.GetFileNameWithoutExtension( RawFileName ), fileExt ) ) );
81
+                //}
82
+
82 83
                 return jpegFileList;
83 84
             }
84 85
         }
... ...
@@ -188,15 +189,15 @@ namespace SilkypixFileMover.Objects
188 189
             {
189 190
                 File.Move( RawFileFullPath, rawFileFullDestPath );
190 191
 
191
-                FileHelpers.MoveAllFilesInList( jpegSourceFileNamesWithSubfolder, RawFileSourcePath, jpegDestFolder );
192
-                FileHelpers.MoveAllFilesInList( sidecarFileNamesWithSubfolder, RawFileSourcePath, sidecarFilesDestFolder);
192
+                FileHelpers.MoveAllFilesInList( jpegSourceFileNamesWithSubfolder, RawFileSourcePath, jpegDestFolder, false );
193
+                FileHelpers.MoveAllFilesInList( sidecarFileNamesWithSubfolder, RawFileSourcePath, sidecarFilesDestFolder, false);
193 194
             }
194 195
             catch ( Exception )
195 196
             {
196 197
                 FileHelpers.SaveMove( rawFileFullDestPath, RawFileFullPath );
197 198
 
198
-                FileHelpers.MoveAllFilesInList( jpegSourceFileNamesWithSubfolder, jpegDestFolder, RawFileSourcePath );
199
-                FileHelpers.MoveAllFilesInList( sidecarFileNamesWithSubfolder, sidecarFilesDestFolder, RawFileSourcePath );
199
+                FileHelpers.MoveAllFilesInList( jpegSourceFileNamesWithSubfolder, Directory.GetParent(jpegDestFolder).FullName, RawFileSourcePath, true );
200
+                FileHelpers.MoveAllFilesInList( sidecarFileNamesWithSubfolder, sidecarFilesDestFolder, RawFileSourcePath, true );
200 201
 
201 202
                 throw;
202 203
             }
... ...
@@ -11,7 +11,7 @@ using System;
11 11
 [assembly: AssemblyConfiguration( "" )]
12 12
 [assembly: AssemblyCompany( "René Wagner" )]
13 13
 [assembly: AssemblyProduct( "RawFileWizard" )]
14
-[assembly: AssemblyCopyright("Copyright © René Wagner 2018")]
14
+[assembly: AssemblyCopyright("Copyright © René Wagner 2018-2019")]
15 15
 [assembly: AssemblyTrademark( "" )]
16 16
 [assembly: AssemblyCulture( "" )]
17 17
 
... ...
@@ -33,6 +33,6 @@ using System;
33 33
 // You can specify all the values or you can default the Build and Revision Numbers 
34 34
 // by using the '*' as shown below:
35 35
 // [assembly: AssemblyVersion("1.0.*")]
36
-[assembly: AssemblyVersion("1.6.2.0")]
36
+[assembly: AssemblyVersion("1.6.3.0")]
37 37
 [assembly: NeutralResourcesLanguage( "de" )]
38
-[assembly: AssemblyFileVersion("1.6.2.0")]
38
+[assembly: AssemblyFileVersion("1.6.3.0")]