[longomatch] Fix migration when the fields are empty



commit f5e0c7f78abe6f329a830fafd6ee983889262806
Author: Andoni Morales Alastruey <ylatuya gmail com>
Date:   Fri Dec 5 19:30:45 2014 +0100

    Fix migration when the fields are empty

 LongoMatch.Migration/Converter.cs                |   14 ++++++++++++--
 LongoMatch.Migration/LongoMatch.Migration.csproj |    2 ++
 2 files changed, 14 insertions(+), 2 deletions(-)
---
diff --git a/LongoMatch.Migration/Converter.cs b/LongoMatch.Migration/Converter.cs
index 7394aea..7308c21 100644
--- a/LongoMatch.Migration/Converter.cs
+++ b/LongoMatch.Migration/Converter.cs
@@ -301,6 +301,16 @@ namespace LongoMatch.Migration
                        field = project.Categories.FieldBackground;
                        halffield = project.Categories.HalfFieldBackground;
                        goal = project.Categories.GoalBackground;
+                       
+                       if (field == null) {
+                               field = LongoMatch.Common.Config.FieldBackground;
+                       }
+                       if (halffield == null) {
+                               halffield = LongoMatch.Common.Config.HalfFieldBackground;
+                       }
+                       if (goal == null) {
+                               goal = LongoMatch.Common.Config.GoalBackground;
+                       }
                                
                        foreach (Play play in project.AllPlays ()) {
                                LongoMatch.Core.Common.Coordinates c;
@@ -317,9 +327,9 @@ namespace LongoMatch.Migration
                                newplay.Rate = play.Rate;
                                newplay.Start = ConvertTime (play.Start);
                                newplay.Stop = ConvertTime (play.Stop);
-                               newplay.Team = (LongoMatch.Core.Common.Team) play.Team;
+                               newplay.Team = (LongoMatch.Core.Common.Team)play.Team;
 
-                               newplay.EventType = eventTypesDict[play.Category];
+                               newplay.EventType = eventTypesDict [play.Category];
                                foreach (Player player in play.Players.GetTagsValues()) {
                                        newplay.Players.Add (teamsDict [player]);
                                }
diff --git a/LongoMatch.Migration/LongoMatch.Migration.csproj 
b/LongoMatch.Migration/LongoMatch.Migration.csproj
index 4308ed6..69c16c6 100644
--- a/LongoMatch.Migration/LongoMatch.Migration.csproj
+++ b/LongoMatch.Migration/LongoMatch.Migration.csproj
@@ -81,9 +81,11 @@
     </EmbeddedResource>
     <EmbeddedResource Include="..\data\images\fields\field-half.svg">
       <Link>field-half.svg</Link>
+      <LogicalName>field-half.svg</LogicalName>
     </EmbeddedResource>
     <EmbeddedResource Include="..\data\images\fields\field-goal.svg">
       <Link>field-goal.svg</Link>
+      <LogicalName>field-goal.svg</LogicalName>
     </EmbeddedResource>
     <EmbeddedResource Include="..\data\images\fields\field-full.svg">
       <Link>field-full.svg</Link>


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