/** * -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); }
public static ContentObject[] ExtractContentObjects(SimilarResult result) { return(result.results[0].content); // TODO: Check if not empty? }