diff --git a/ttrss/ApiClient.cs b/ttrss/ApiClient.cs
index 6d03a37..512d6b0 100644
--- a/ttrss/ApiClient.cs
+++ b/ttrss/ApiClient.cs
@@ -505,15 +505,44 @@ namespace ttrss_co_client.ttrss
///
///tell the feed to update. As opposed to updating our configuration of the feed.
///
- public async Task UpdateFeed(int feed_id)
+ public async Task UpdateFeed(int feed_id)
{
assertInitialized();
- throw new NotImplementedException();
+
+ var json = JsonContent.Create(new
+ {
+ op = "updateFeed",
+ sid = this.SessionId,
+ feed_id = feed_id
+ });
+ var apiResponse = await get>(json);
+
+ return apiResponse.ContainsKey("status") && apiResponse["status"]?.ToLower() == "ok";
}
- public async Task GetPref(string key)
+ public async Task GetPref(string pref)
{
assertInitialized();
- throw new NotImplementedException();
+
+ var json = JsonContent.Create(new
+ {
+ op = "getPref",
+ sid = this.SessionId,
+ pref_name = pref
+ });
+ var apiResponse = await get>(json);
+ try
+ {
+ var converter = TypeDescriptor.GetConverter(typeof(T));
+ if (converter != null)
+ {
+ return (T)converter.ConvertFromString(apiResponse["value"]);
+ }
+ return default(T);
+ }
+ catch (NotSupportedException)
+ {
+ return default(T);
+ }
}
public enum CATCHUPMODE { All, OneDay, OneWeek, TwoWeeks }
public async Task CatchupFeed(int feed_id, bool is_cat, CATCHUPMODE mode = CATCHUPMODE.All)