Merge lp:~dano6/podbird/podbird into lp:podbird

Proposed by Daniel Kutka
Status: Merged
Merged at revision: 215
Proposed branch: lp:~dano6/podbird/podbird
Merge into: lp:podbird
Diff against target: 162 lines (+55/-7)
6 files modified
Podbird.apparmor (+2/-1)
app/podbird.qml (+11/-1)
app/ui/EpisodesPage.qml (+0/-2)
app/ui/EpisodesTab.qml (+0/-1)
app/ui/PodcastsTab.qml (+0/-2)
app/ui/SettingsPage.qml (+42/-0)
To merge this branch: bzr merge lp:~dano6/podbird/podbird
Reviewer Review Type Date Requested Status
Michael Sheldon Approve
Review via email: mp+396207@code.launchpad.net

Commit message

Do not turn off display during getting new episodes and add settings to adjust interval of autorefreshing podcasts

Description of the change

This MR should help with https://forums.ubports.com/topic/5138/podbird-freezing-on-start-for-about-1-minute
Getting new episodes with a lot of podcasts added it sometimes takes a minute or more. During that screen turns off, and it suspends the app. This MR should avoid suspending the app during getting new episodes.

To post a comment you must log in.
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Looks good, thanks!

review: Approve
lp:~dano6/podbird/podbird updated
215. By Michael Sheldon

Do not turn off display during getting new episodes and add settings to adjust interval of autorefreshing podcasts

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Podbird.apparmor'
--- Podbird.apparmor 2020-04-04 17:20:08 +0000
+++ Podbird.apparmor 2021-01-12 21:27:54 +0000
@@ -4,7 +4,8 @@
4 "audio",4 "audio",
5 "connectivity",5 "connectivity",
6 "usermetrics",6 "usermetrics",
7 "content_exchange"7 "content_exchange",
8 "keep-display-on"
8 ],9 ],
9 "policy_version": 16.0410 "policy_version": 16.04
10}11}
1112
=== modified file 'app/podbird.qml'
--- app/podbird.qml 2020-07-09 11:20:15 +0000
+++ app/podbird.qml 2021-01-12 21:27:54 +0000
@@ -24,6 +24,7 @@
24import Ubuntu.Components 1.324import Ubuntu.Components 1.3
25import QtQuick.LocalStorage 2.025import QtQuick.LocalStorage 2.0
26import Ubuntu.DownloadManager 1.226import Ubuntu.DownloadManager 1.2
27import QtSystemInfo 5.5
27import "ui"28import "ui"
28import "themes" as Themes29import "themes" as Themes
29import "podcasts.js" as Podcasts30import "podcasts.js" as Podcasts
@@ -42,6 +43,12 @@
42 theme.name: settings.themeName == "Dark.qml" ? "Ubuntu.Components.Themes.SuruDark"43 theme.name: settings.themeName == "Dark.qml" ? "Ubuntu.Components.Themes.SuruDark"
43 : "Ubuntu.Components.Themes.Ambiance"44 : "Ubuntu.Components.Themes.Ambiance"
4445
46 property bool episodesUpdating: false;
47
48 ScreenSaver {
49 id: screenSaver
50 screenSaverEnabled: !episodesUpdating
51 }
4552
46 // RefreshModel function to call refreshModel() function of the tab currently53 // RefreshModel function to call refreshModel() function of the tab currently
47 // visible on application start.54 // visible on application start.
@@ -51,6 +58,7 @@
51 } else if (tabs.selectedTab === podcastTab) {58 } else if (tabs.selectedTab === podcastTab) {
52 podcastPage.item.refreshModel()59 podcastPage.item.refreshModel()
53 }60 }
61 episodesUpdating = false;
54 }62 }
5563
56 Component.onCompleted: {64 Component.onCompleted: {
@@ -58,7 +66,8 @@
5866
59 var today = new Date()67 var today = new Date()
60 // Only automatically check for podcasts on launch once every 12 hours68 // 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;
62 Podcasts.updateEpisodes(refreshModels)71 Podcasts.updateEpisodes(refreshModels)
63 }72 }
64 loadingIndicator.opacity = 073 loadingIndicator.opacity = 0
@@ -116,6 +125,7 @@
116 property bool showListView: true125 property bool showListView: true
117 property int skipForward: 30126 property int skipForward: 30
118 property int skipBack: 10127 property int skipBack: 10
128 property int refreshEpisodes: 12
119 property bool continueWhereStopped: true129 property bool continueWhereStopped: true
120 property int playlistIndex: -1130 property int playlistIndex: -1
121 property bool downloadOverWifiOnly: true131 property bool downloadOverWifiOnly: true
122132
=== modified file 'app/ui/EpisodesPage.qml'
--- app/ui/EpisodesPage.qml 2020-07-09 11:20:15 +0000
+++ app/ui/EpisodesPage.qml 2021-01-12 21:27:54 +0000
@@ -37,8 +37,6 @@
37 property string tempGuid: "NULL"37 property string tempGuid: "NULL"
38 property string mode: "listened"38 property string mode: "listened"
3939
40 property bool episodesUpdating: false;
41
42 Component.onCompleted: {40 Component.onCompleted: {
43 loadEpisodes(episodeId, episodeArtist, episodeImage)41 loadEpisodes(episodeId, episodeArtist, episodeImage)
44 if (downloader.downloadingGuid != "")42 if (downloader.downloadingGuid != "")
4543
=== modified file 'app/ui/EpisodesTab.qml'
--- app/ui/EpisodesTab.qml 2020-07-09 11:20:15 +0000
+++ app/ui/EpisodesTab.qml 2021-01-12 21:27:54 +0000
@@ -31,7 +31,6 @@
31 property var today: new Date()31 property var today: new Date()
32 property int dayToMs: 8640000032 property int dayToMs: 86400000
33 property string tempGuid: "NULL"33 property string tempGuid: "NULL"
34 property bool episodesUpdating: false
3534
36 TabsList {35 TabsList {
37 id: tabsList36 id: tabsList
3837
=== modified file 'app/ui/PodcastsTab.qml'
--- app/ui/PodcastsTab.qml 2016-03-29 11:30:03 +0000
+++ app/ui/PodcastsTab.qml 2021-01-12 21:27:54 +0000
@@ -28,8 +28,6 @@
28Page {28Page {
29 id: podcastPage29 id: podcastPage
3030
31 property bool episodesUpdating: false;
32
33 TabsList {31 TabsList {
34 id: tabsList32 id: tabsList
35 }33 }
3634
=== modified file 'app/ui/SettingsPage.qml'
--- app/ui/SettingsPage.qml 2020-07-08 19:32:20 +0000
+++ app/ui/SettingsPage.qml 2021-01-12 21:27:54 +0000
@@ -126,6 +126,41 @@
126 }126 }
127 }127 }
128128
129 Component {
130 id: refreshDialog
131 Dialog {
132 id: dialogInternal
133 // TRANSLATORS: This strings refers to refreshing podcasts. Users can set how often they
134 // want to check for new episodes.
135 title: i18n.tr("Refresh podcasts after")
136 Slider {
137 id: slider
138 width: parent.width
139 minimumValue: 0
140 maximumValue: 72
141 value: podbird.settings.refreshEpisodes
142 function formatValue(v) { return i18n.tr("%1 hours").arg(Math.round(v)) }
143 StyleHints { foregroundColor: podbird.appTheme.focusText }
144 }
145
146 Button {
147 text: i18n.tr("OK")
148 color: podbird.appTheme.positiveActionButton
149 onClicked: {
150 podbird.settings.refreshEpisodes = Math.round(slider.value)
151 PopupUtils.close(dialogInternal)
152 }
153 }
154 Button {
155 text: i18n.tr("Cancel")
156 color: podbird.appTheme.neutralActionButton
157 onClicked: {
158 PopupUtils.close(dialogInternal)
159 }
160 }
161 }
162 }
163
129 Column {164 Column {
130 id: settingsColumn165 id: settingsColumn
131166
@@ -198,6 +233,13 @@
198 title.text: i18n.tr("Podcast Episode Settings")233 title.text: i18n.tr("Podcast Episode Settings")
199 }234 }
200235
236 SingleValueListItem {
237 divider.visible: false
238 title.text: i18n.tr("Refresh podcasts after")
239 value: i18n.tr("%1 hours").arg(podbird.settings.refreshEpisodes)
240 onClicked: PopupUtils.open(refreshDialog, settingsPage);
241 }
242
201 ListItem {243 ListItem {
202 ListItemLayout {244 ListItemLayout {
203 id: deleteLayout245 id: deleteLayout

Subscribers

People subscribed via source and target branches

to status/vote changes: