Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/jangernert/FeedReader.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrendan Long <self@brendanlong.com>2019-05-27 22:15:23 +0300
committerBrendan Long <self@brendanlong.com>2019-05-27 22:57:26 +0300
commit9ea9b37d9077e1abeb00a263ad1bf672e9fe9844 (patch)
tree0542b5a73fe3773378e47a911a4233dcc9e60065
parent297a7d3a0418a72b605685f52515165dcc9bcb00 (diff)
Use DB last modified time for last sync by default
The NextCloud plugin was doing this instead of using last-sync. This way all of the plugins do this behavior.
-rw-r--r--plugins/backend/owncloud/OwncloudNewsInterface.vala8
-rw-r--r--src/Backend/FeedServer.vala16
2 files changed, 16 insertions, 8 deletions
diff --git a/plugins/backend/owncloud/OwncloudNewsInterface.vala b/plugins/backend/owncloud/OwncloudNewsInterface.vala
index 38c0f78e..a4958eb1 100644
--- a/plugins/backend/owncloud/OwncloudNewsInterface.vala
+++ b/plugins/backend/owncloud/OwncloudNewsInterface.vala
@@ -413,12 +413,12 @@ public class FeedReader.OwncloudNewsInterface : FeedServerInterface {
switch(whatToGet)
{
- case ArticleStatus.ALL:
+ case ArticleStatus.ALL:
break;
- case ArticleStatus.UNREAD:
+ case ArticleStatus.UNREAD:
read = false;
break;
- case ArticleStatus.MARKED:
+ case ArticleStatus.MARKED:
type = OwncloudNewsAPI.OwnCloudType.STARRED;
break;
}
@@ -438,7 +438,7 @@ public class FeedReader.OwncloudNewsInterface : FeedServerInterface {
if(count == -1)
{
- m_api.getNewArticles(articles, DataBase.readOnly().getLastModified(), type, id);
+ m_api.getNewArticles(articles, (int)since.to_unix(), type, id);
}
else
{
diff --git a/src/Backend/FeedServer.vala b/src/Backend/FeedServer.vala
index 2e57f12e..f12baa90 100644
--- a/src/Backend/FeedServer.vala
+++ b/src/Backend/FeedServer.vala
@@ -285,8 +285,12 @@ public class FeedReader.FeedServer : GLib.Object {
db.dropOldArticles(-(int)drop_weeks);
}
- var now = new DateTime.now_local();
- Settings.state().set_int("last-sync", (int)now.to_unix());
+ int last_modified = db.getLastModified();
+ if (last_modified == 0)
+ {
+ last_modified = (int)new DateTime.now_local().to_unix();
+ }
+ Settings.state().set_int("last-sync", last_modified);
db.checkpoint();
FeedReaderBackend.get_default().newFeedList();
@@ -383,8 +387,12 @@ public class FeedReader.FeedServer : GLib.Object {
Settings.general().reset("content-grabber");
- var now = new DateTime.now_local();
- Settings.state().set_int("last-sync", (int)now.to_unix());
+ int last_modified = db.getLastModified();
+ if (last_modified == 0)
+ {
+ last_modified = (int)new DateTime.now_local().to_unix();
+ }
+ Settings.state().set_int("last-sync", last_modified);
return;
}