From 41e864cb85775c072009b8d9f12858f4ccf1b1f9 Mon Sep 17 00:00:00 2001 From: Maho Pacheco Date: Sat, 24 Feb 2024 08:58:26 -0800 Subject: [PATCH] Fixing broken build --- RaccoonBitsCore/Db.cs | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/RaccoonBitsCore/Db.cs b/RaccoonBitsCore/Db.cs index e594d91..8f970de 100644 --- a/RaccoonBitsCore/Db.cs +++ b/RaccoonBitsCore/Db.cs @@ -187,21 +187,34 @@ public IEnumerable GetPosts( { string uri = reader["uri"]?.ToString() ?? string.Empty; string jsonObject = reader["jsonObject"]?.ToString() ?? string.Empty; - double score = Convert.ToDouble(reader["score"]?.ToString() ?? "0"); - double wordsScore = Convert.ToDouble(reader["wordsScore"]?.ToString() ?? "0"); - double buzzScore = Convert.ToDouble(reader["buzzScore"]?.ToString() ?? "0"); - double fameScore = Convert.ToDouble(reader["fameScore"]?.ToString() ?? "0"); - double hostScore = Convert.ToDouble(reader["hostScore"]?.ToString() ?? "0"); - var post = new Post(uri, jsonObject) + var post = new Post(uri, jsonObject); + + if (!string.IsNullOrEmpty(reader["score"]?.ToString())) { - Score = score, - WordsScore = wordsScore, - BuzzScore = buzzScore, - FameScore = fameScore, - HostScore = hostScore - }; + post.Score = Convert.ToDouble(reader["score"]?.ToString() ?? "0"); + } + + if (!string.IsNullOrEmpty(reader["wordsScore"]?.ToString())) + { + post.WordsScore = Convert.ToDouble(reader["wordsScore"]?.ToString() ?? "0"); + } + + if (!string.IsNullOrEmpty(reader["buzzScore"]?.ToString())) + { + post.BuzzScore = Convert.ToDouble(reader["buzzScore"]?.ToString() ?? "0"); + } + + if (!string.IsNullOrEmpty(reader["fameScore"]?.ToString())) + { + post.FameScore = Convert.ToDouble(reader["fameScore"]?.ToString() ?? "0"); + } + if (!string.IsNullOrEmpty(reader["hostScore"]?.ToString())) + { + post.HostScore = Convert.ToDouble(reader["hostScore"]?.ToString() ?? "0"); + } + if (processor != null) { post = processor.Process(post);