Ejemplo n.º 1
0
 /**
  * -1 == empty similar result
  * -2 == empty result object
  * -3 == not found
  */
 public static int GetIndexOf(MultimediaObject needle, SimilarResult haystack)
 {
     if (haystack.IsEmpty())
     {
         return(-1);
     }
     foreach (ResultObject resultObject in haystack.results)
     {
         if (resultObject.IsEmpty())
         {
             return(-2);
         }
         foreach (ContentObject contentObject in resultObject.content)
         {
             if (contentObject.key.Equals(needle.id + "_1"))// FIX hardcoded segment id
             {
                 return(Array.IndexOf(resultObject.content, contentObject));
             }
         }
     }
     return(-3);
 }
Ejemplo n.º 2
0
 public static ContentObject[] ExtractContentObjects(SimilarResult result)
 {
     return(result.results[0].content); // TODO: Check if not empty?
 }