return feeds
}
+ public fun getPendingFeeds() : MutableList<Feed> {
+ val feeds = mutableListOf<Feed>()
+
+ dataSource.connection.prepareStatement("""
+ select f.* from feeds f
+ inner join feedcollections c on f.feedcollection_id = c.feedcollection_id
+ where datediff(ss, coalesce(last_update, '1970-01-01'), now()) > case when c.update_interval > 0 then c.update_interval else 60 end
+ """.trimIndent()).use { stmt ->
+ stmt.executeQuery().use { rs ->
+ val id = rs.getInt("feed_id")
+ val feedCollectionId = rs.getInt("feedcollection_id")
+ val url = rs.getString("url")
+ val authUser = rs.getString("auth_user")
+ val authPassword = rs.getString("auth_password")
+ val certPath = rs.getString("certpath")
+ val feed = Feed(id, feedCollectionId, url)
+ feed.user = authUser
+ feed.password = authPassword
+ feed.certpath = certPath
+ feeds.add(feed)
+ }
+ }
+
+ return feeds
+ }
+
public fun addItems(items: Collection<Item>) {
dataSource.connection.use { conn ->
conn.prepareStatement("""