[longomatch] Don't recreate thumbnails importing projects



commit 321800ba9ebef2744c877a61fbf01ca32310d030
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Thu Sep 18 14:23:21 2014 +0200

    Don't recreate thumbnails importing projects

 LongoMatch.Services/Services/ProjectsManager.cs |    2 +-
 LongoMatch.Services/Services/ToolsManager.cs    |   13 ++++++++-----
 2 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/LongoMatch.Services/Services/ProjectsManager.cs b/LongoMatch.Services/Services/ProjectsManager.cs
index 77943bb..e9eecf0 100644
--- a/LongoMatch.Services/Services/ProjectsManager.cs
+++ b/LongoMatch.Services/Services/ProjectsManager.cs
@@ -356,7 +356,7 @@ namespace LongoMatch.Services
                                /* If it's a fake live project prompt for a video file and
                                 * create a new PreviewMediaFile for this project and recreate the thumbnails 
*/
                                Log.Debug ("Importing fake live project");
-                               ToolsManager.AddVideoFile (project);
+                               ToolsManager.AddVideoFile (project, true);
                        }
                        SetProject (project, ProjectType.FileProject, new CaptureSettings ());
                }
diff --git a/LongoMatch.Services/Services/ToolsManager.cs b/LongoMatch.Services/Services/ToolsManager.cs
index 225294f..204e5f1 100644
--- a/LongoMatch.Services/Services/ToolsManager.cs
+++ b/LongoMatch.Services/Services/ToolsManager.cs
@@ -87,7 +87,7 @@ namespace LongoMatch.Services
                        ProjectImporters.Add (importer);
                }
 
-               public static void AddVideoFile (Project project)
+               public static void AddVideoFile (Project project, bool createThumbnails)
                {
                        string videofile;
                        IGUIToolkit guiToolkit = Config.GUIToolkit;
@@ -107,7 +107,9 @@ namespace LongoMatch.Services
                                        guiToolkit.ErrorMessage (ex.Message);
                                        return;
                                }
-                               CreateThumbnails (project);
+                               if (createThumbnails) {
+                                       CreateThumbnails (project);
+                               }
                        }
                }
 
@@ -205,9 +207,10 @@ namespace LongoMatch.Services
                        if (importer.NeedsEdition) {
                                Config.EventsBroker.EmitNewProject (project);
                        } else {
-                               if (project.Description.File == null ||
-                                       !File.Exists (project.Description.File.FilePath)) {
-                                       AddVideoFile (project);
+                               if (project.Description.File == null) {
+                                       AddVideoFile (project, true);
+                               } else if (!File.Exists (project.Description.File.FilePath)) {
+                                       AddVideoFile (project, false);
                                }
                                /* If the project exists ask if we want to overwrite it */
                                if (DB.Exists (project)) {


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