@@ -24,6 +24,7 @@ import Qt.labs.settings 1.0
2424import Ubuntu.Components 1.3
2525import QtQuick.LocalStorage 2.0
2626import Ubuntu.DownloadManager 1.2
27+import QtSystemInfo 5.5
2728import "ui"
2829import "themes" as Themes
2930import "podcasts.js" as Podcasts
@@ -42,6 +43,12 @@ MainView {
4243 theme.name: settings.themeName == "Dark.qml" ? "Ubuntu.Components.Themes.SuruDark"
4344 : "Ubuntu.Components.Themes.Ambiance"
4445
46+ property bool episodesUpdating: false;
47+
48+ ScreenSaver {
49+ id: screenSaver
50+ screenSaverEnabled: !episodesUpdating
51+ }
4552
4653 // RefreshModel function to call refreshModel() function of the tab currently
4754 // visible on application start.
@@ -51,6 +58,7 @@ MainView {
5158 } else if (tabs.selectedTab === podcastTab) {
5259 podcastPage.item.refreshModel()
5360 }
61+ episodesUpdating = false;
5462 }
5563
5664 Component.onCompleted: {
@@ -58,7 +66,8 @@ MainView {
5866
5967 var today = new Date()
6068 // Only automatically check for podcasts on launch once every 12 hours
61− if (Math.floor((today - settings.lastUpdate)/86400000) >= 0.5) {
69+ if (Math.floor((today - settings.lastUpdate)/86400000) >= settings.refreshEpisodes/24.0) {
70+ episodesUpdating = true;
6271 Podcasts.updateEpisodes(refreshModels)
6372 }
6473 loadingIndicator.opacity = 0
@@ -116,6 +125,7 @@ MainView {
116125 property bool showListView: true
117126 property int skipForward: 30
118127 property int skipBack: 10
128+ property int refreshEpisodes: 12
119129 property bool continueWhereStopped: true
120130 property int playlistIndex: -1
121131 property bool downloadOverWifiOnly: true