ImageSelection.BuildSourceImagesForHub C# (CSharp) Method

BuildSourceImagesForHub() public static method

public static BuildSourceImagesForHub ( string id ) : void
id string
return void
    public static void BuildSourceImagesForHub(string id)
    {
        var ts = TableStorage.MakeDefaultTableStorage();
        var source_image_results = new ConcurrentDictionary<string, List<Dictionary<string, string>>>();
        var feeds = new List<Dictionary<string, object>>();
        var sources = new List<string>();
        var query = string.Format("$filter=PartitionKey eq '{0}' and feedurl ne ''", id);
        feeds = ts.QueryAllEntitiesAsListDict("metadata", query, 5000).list_dict_obj;
        feeds = feeds.FindAll(x => x["feedurl"].ToString().Contains("eventful.com") == false);
        feeds = feeds.OrderBy(x => x["source"].ToString()).ToList();
        sources = feeds.Select(x => x["source"].ToString()).ToList();
        sources = sources.Select(x => x.Replace("\n", "")).ToList();
        sources.Sort();
        var source_images = GetSourceImages(id);
        var current_selections = GetCurrentImageSelections(id, source_images, sources, "source");
        SaveCategoryOrSourceImages("source", id, current_selections);
    }

Usage Example

Example #1
0
 private static void BuildCategoriesForRegionSourcesForHubs(string region, string where)
 {
     ImageSelection.BuildCategoryImagesForHub(region);
     foreach (var id in Utils.GetIdsForRegion(region))
     {
         ImageSelection.BuildSourceImagesForHub(id);
     }
 }