[chronojump] import 1.70 to 1.71 improved



commit d752be84a94d5ddfd2d6a36e43b20b0fb1a07127
Author: Xavier de Blas <xaviblas gmail com>
Date:   Tue Sep 17 17:39:36 2019 +0200

    import 1.70 to 1.71 improved

 src/sqlite/runEncoder.cs | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/src/sqlite/runEncoder.cs b/src/sqlite/runEncoder.cs
index 3975b0f9..ce820039 100644
--- a/src/sqlite/runEncoder.cs
+++ b/src/sqlite/runEncoder.cs
@@ -191,6 +191,7 @@ class SqliteRunEncoder : Sqlite
                LogB.Information("at import_from_1_70_to_1_71()");
                //LogB.Information("Sqlite isOpened: " + Sqlite.IsOpened.ToString());
 
+               bool importedSomething = false;
                string raceAnalyzerDir = Util.GetRunEncoderDir();
                DirectoryInfo [] sessions = new DirectoryInfo(raceAnalyzerDir).GetDirectories();
                foreach (DirectoryInfo session in sessions) //session.Name will be the UniqueID
@@ -235,11 +236,18 @@ class SqliteRunEncoder : Sqlite
                                                RunEncoder.Devices.MANUAL, distance, temperature,
                                                myFilename,
                                                
Util.MakeURLrelative(Util.GetRunEncoderSessionDir(Convert.ToInt32(session.Name))),
-                                               parsedDate, relt.Comment, "");
+                                               parsedDate, relt.Comment,
+                                               "", ""); //import without video and without name on comment
+
                                runEncoder.InsertSQL(true);
+                               importedSomething = true;
                        }
                }
 
+               //need to create an exercise to assign to the imported files
+               if(importedSomething)
+                       SqliteRunEncoderExercise.Insert(true, 0, "Sprint", "");
+
                LogB.Information("end of import_from_1_70_to_1_71()");
                LogB.PrintAllThreads = false; //TODO: remove this
        }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]