diff --git a/Source/Utils/Rooms/Search/SearchRoomUtil.cs b/Source/Utils/Rooms/Search/SearchRoomUtil.cs index acde3140..eebf2127 100644 --- a/Source/Utils/Rooms/Search/SearchRoomUtil.cs +++ b/Source/Utils/Rooms/Search/SearchRoomUtil.cs @@ -13,9 +13,10 @@ public static class SearchRoomUtil { hourStop = hourStop?.AddMinutes(-1); + var polimidailysituation = "polimidailysituation://" + sede + "/" + hourStart?.ToString("yyyy-MM-dd"); var q = Database.Database.ExecuteSelect("SELECT * FROM WebCache WHERE url LIKE @url", GlobalVariables.DbConfigVar, new Dictionary { - {"@url", "polimidailysituation://" + hourStart?.ToString("yyyy-MM-dd")} + {"@url", polimidailysituation} } ); @@ -25,8 +26,9 @@ public static class SearchRoomUtil JArray jArray = new JArray(); if (sq != null) jArray = JArray.Parse(sq); List tasks = new List(); - foreach (JObject roomobj in jArray) + foreach (var jToken in jArray) { + var roomobj = (JObject)jToken; tasks.Add(Task.Run(() => { roomobj["occupancy_rate"] = RoomOccupancyReport.GetReportedOccupancyJObject((uint)(roomobj["room_id"] ?? 1))?["occupancy_rate"]; @@ -74,7 +76,7 @@ public static class SearchRoomUtil Database.Database.Execute("INSERT INTO WebCache (url, content, expires_at) VALUES (@url, @content, NOW() + INTERVAL 2 DAYS)", GlobalVariables.DbConfigVar, new Dictionary { - {"@url", "polimidailysituation://" + hourStart?.ToString("yyyy-MM-dd")}, + {"@url", polimidailysituation}, {"@content", results.ToString()} } );