@@ -184,7 +184,7 @@ function updateEpisodes(refreshModel) {
184184 var db = Podcasts.init();
185185 db.transaction(function(tx) {
186186 var rs = tx.executeSql("SELECT rowid, feed FROM Podcast");
187− tx.executeSql("UPDATE Podcast SET lastupdate=CURRENT_TIMESTAMP");
187+ var rs_timestamp = tx.executeSql("SELECT lastupdate FROM Podcast");
188188 var xhr = [];
189189 var xhrComplete = [];
190190 for(var i = 0; i < rs.rows.length; i++) {
@@ -236,7 +236,8 @@ function updateEpisodes(refreshModel) {
236236 if (!track.hasOwnProperty("guid")) {
237237 track['guid'] = track.audiourl;
238238 }
239−
239+ //do not check every episode in database, just ~11.5 days before last update
240+ if(new Date(rs_timestamp.rows.item(i).lastupdate).getTime()<(track['published']+1000000000))
240241 db.transaction(function(tx2) {
241242 var ers = tx2.executeSql("SELECT rowid FROM Episode WHERE guid=?", [track.guid]);
242243 if (ers.rows.length === 0) {
@@ -257,6 +258,7 @@ function updateEpisodes(refreshModel) {
257258 }
258259 }
259260 } catch (error) {
261+ console.log("[LOG]: Response: " + xhr[i].response)
260262 console.log("[WARNING]: Failed to parse " + rs.rows.item(i).feed + ": " + error);
261263 }
262264 }
@@ -268,6 +270,9 @@ function updateEpisodes(refreshModel) {
268270 }
269271 }
270272 if(allComplete) {
273+ db.transaction(function(tx) {
274+ tx.executeSql("UPDATE Podcast SET lastupdate=CURRENT_TIMESTAMP");
275+ })
271276 console.log("[LOG]: Finished checking for new episodes..")
272277 podbird.settings.lastUpdate = new Date();
273278 refreshModel();