Merge lp:~nik90/podbird/devel-branch-sync-5 into lp:podbird

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Michael Sheldon
Approved revision: 168
Merged at revision: 164
Proposed branch: lp:~nik90/podbird/devel-branch-sync-5
Merge into: lp:podbird
Prerequisite: lp:~nik90/podbird/devel-branch-sync-4
Diff against target: 472 lines (+137/-44)
8 files modified
app/podbird.qml (+36/-11)
app/podcasts.js (+5/-4)
app/ui/EpisodesPage.qml (+7/-2)
app/ui/EpisodesTab.qml (+4/-4)
app/ui/SettingsPage.qml (+19/-2)
app/welcomewizard/Slide5.qml (+1/-1)
manifest.json.in (+1/-1)
po/com.mikeasoft.podbird.pot (+64/-19)
To merge this branch: bzr merge lp:~nik90/podbird/devel-branch-sync-5
Reviewer Review Type Date Requested Status
Michael Sheldon Needs Fixing
Review via email: mp+312418@code.launchpad.net

Commit message

Cherry-pick final fixes from lp:podbird/devel

Description of the change

This MP cherrypicks the following fixes from lp:podbird/devel,
- Add instructions for viewing hidden actions by right clicking for desktop users (rev 148)
- Add missing action text entries (rev 149)
- Fix spelling of ok (rev 151)
- Updated framework to 15.04.5 (rev 152)
- Store download related data that needs to persist across app reboots in that download's custom metadata (rev 154)
- Added settings option to disable downloads over cellular data (rev 155)
- Fix for download duplication when restarting Podbird (rev 156)
- Updated pot file

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

Couple of small string fixes needed (see inline diffs), otherwise this looks good :)

review: Needs Fixing
168. By Nekhelesh Ramananthan

Fixed few strings pointed by Michael for consistency reasons (rev 158)

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Hi Mike, Fixed all the strings as you pointed out. I think this MP is ready. Working to get the prerequisite branch lp:~nik90/podbird/devel-branch-sync-4 ready as well.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/podbird.qml'
2--- app/podbird.qml 2016-12-05 17:43:50 +0000
3+++ app/podbird.qml 2016-12-05 17:43:50 +0000
4@@ -43,7 +43,6 @@
5 : "Ubuntu.Components.Themes.Ambiance"
6
7 Component.onDestruction: {
8- console.log("[LOG]: Download cancelled");
9 var db = Podcasts.init()
10 db.transaction(function (tx) {
11 tx.executeSql('UPDATE Episode SET queued=0 WHERE queued=1');
12@@ -79,12 +78,21 @@
13 settings.lastCheck = today
14 }
15
16- if (!NetworkingStatus.online || settings.maxEpisodeDownload === -1) {
17- console.log("[LOG]: Skipped autodownloading of new episodes...")
18- console.log("[LOG]: Online connectivity: " + NetworkingStatus.online)
19- console.log("[LOG]: User settings (maxEpisodeDownload): " + settings.maxEpisodeDownload)
20- } else {
21- Podcasts.autoDownloadEpisodes(settings.maxEpisodeDownload)
22+ delayStartTimer.start();
23+ }
24+
25+ Timer {
26+ id: delayStartTimer
27+ interval: 500
28+ repeat: false
29+ onTriggered: {
30+ if (!NetworkingStatus.online || podbird.settings.maxEpisodeDownload === -1) {
31+ console.log("[LOG]: Skipped autodownloading of new episodes...")
32+ console.log("[LOG]: Online connectivity: " + NetworkingStatus.online)
33+ console.log("[LOG]: User settings (maxEpisodeDownload): " + podbird.settings.maxEpisodeDownload)
34+ } else {
35+ Podcasts.autoDownloadEpisodes(podbird.settings.maxEpisodeDownload)
36+ }
37 }
38 }
39
40@@ -118,6 +126,7 @@
41 property bool showListView: true
42 property int skipForward: 30
43 property int skipBack: 10
44+ property bool downloadOverWifiOnly: true
45 }
46
47 FileManager {
48@@ -167,27 +176,43 @@
49 metadata: Metadata {
50 showInIndicator: true
51 title: singleDownloadObject.title
52+ custom: {"guid": singleDownloadObject.guid, "image" : singleDownloadObject.image}
53 }
54 }
55 }
56
57- function downloadEpisode(image, title, guid, url) {
58- var singleDownload = singleDownloadComponent.createObject(podbird, {"image": image, "title": title, "guid": guid})
59+ function downloadEpisode(image, title, guid, url, disableMobileDownload) {
60+ if(downloader.isDownloadInQueue(guid)) {
61+ console.log("[LOG]: Download with GUID of :"+guid+ " is already in the download queue.")
62+ return false;
63+ }
64+
65+ var singleDownload = singleDownloadComponent.createObject(podbird, {"image": image, "title": title, "guid": guid, allowMobileDownload : !disableMobileDownload })
66 singleDownload.download(url)
67 }
68
69 DownloadManager {
70 id: downloader
71
72- property string downloadingGuid: downloads.length > 0 ? downloads[0].guid : "NULL"
73+ property string downloadingGuid: downloads.length > 0 ? downloads[0].metadata.custom.guid : "NULL"
74 property int progress: downloads.length > 0 ? downloads[0].progress : 0
75
76 cleanDownloads: true
77+
78+ function isDownloadInQueue ( guid ) {
79+ for( var i=0; i < downloads.length; i++) {
80+ if( downloads[i].metadata.custom.guid && guid === downloads[i].metadata.custom.guid) {
81+ return true ;
82+ }
83+ }
84+ return false;
85+ }
86+
87 onDownloadFinished: {
88 var db = Podcasts.init();
89 var finalLocation = fileManager.saveDownload(path);
90 db.transaction(function (tx) {
91- tx.executeSql("UPDATE Episode SET downloadedfile=?, queued=0 WHERE guid=?", [finalLocation, download.guid]);
92+ tx.executeSql("UPDATE Episode SET downloadedfile=?, queued=0 WHERE guid=?", [finalLocation, download.metadata.custom.guid]);
93 });
94 }
95
96
97=== modified file 'app/podcasts.js'
98--- app/podcasts.js 2016-03-28 22:38:59 +0000
99+++ app/podcasts.js 2016-12-05 17:43:50 +0000
100@@ -356,12 +356,13 @@
101 var rs = tx.executeSql("SELECT rowid, * FROM Podcast ORDER BY name ASC");
102 for (var i=0; i < rs.rows.length; i++) {
103 var podcast = rs.rows.item(i);
104- var rs2 = tx.executeSql("SELECT rowid, * FROM Episode WHERE podcast=? ORDER BY published DESC", [rs.rows.item(i).rowid]);
105+ var rs2 = tx.executeSql("SELECT rowid, * FROM Episode WHERE podcast=? ORDER BY published DESC", [podcast.rowid]);
106 var loopCount = maxEpisodeDownload > rs2.rows.length ? rs2.rows.length : maxEpisodeDownload
107 for (var j=0; j < loopCount; j++) {
108- if (!rs2.rows.item(j).downloadedfile && !rs2.rows.item(j).listened && rs2.rows.item(j).audiourl) {
109- podbird.downloadEpisode(rs.rows.item(i).image, rs2.rows.item(j).name, rs2.rows.item(j).guid, rs2.rows.item(j).audiourl)
110- tx.executeSql("UPDATE Episode SET queued=1 WHERE guid = ?", [rs2.rows.item(j).guid]);
111+ var episode = rs2.rows.item(j);
112+ if ( !episode.downloadedfile && !episode.listened && episode.audiourl && !episode.queued ) {
113+ podbird.downloadEpisode(podcast.image, episode.name, episode.guid, episode.audiourl, podbird.settings.downloadOverWifiOnly)
114+ tx.executeSql("UPDATE Episode SET queued=1 WHERE guid = ?", [episode.guid]);
115 }
116 }
117 }
118
119=== modified file 'app/ui/EpisodesPage.qml'
120--- app/ui/EpisodesPage.qml 2016-03-28 20:51:01 +0000
121+++ app/ui/EpisodesPage.qml 2016-12-05 17:43:50 +0000
122@@ -166,7 +166,7 @@
123 episodeModel.setProperty(index, "queued", 1)
124 tx.executeSql("UPDATE Episode SET queued=1 WHERE guid = ?", [episodeModel.get(index).guid]);
125 if (episodeModel.get(index).audiourl) {
126- podbird.downloadEpisode(episodeModel.get(index).image, episodeModel.get(index).name, episodeModel.get(index).guid, episodeModel.get(index).audiourl)
127+ podbird.downloadEpisode(episodeModel.get(index).image, episodeModel.get(index).name, episodeModel.get(index).guid, episodeModel.get(index).audiourl, false)
128 } else {
129 console.log("[ERROR]: Invalid download url: " + episodeModel.get(index).audiourl)
130 }
131@@ -602,6 +602,7 @@
132 actions: [
133 Action {
134 iconName: model.listened ? "view-collapse" : "select"
135+ text: model.listened ? i18n.tr("Mark as unheard") : i18n.tr("Mark as listened")
136 onTriggered: {
137 var db = Podcasts.init();
138 db.transaction(function (tx) {
139@@ -617,6 +618,7 @@
140 Action {
141 enabled: downloader.downloadingGuid !== model.guid
142 iconName: model.downloadedfile ? "delete" : (model.queued && downloader.downloadingGuid !== model.guid ? "history" : "save")
143+ text: model.downloadedfile ? i18n.tr("Delete downloaded file") : (model.queued && downloader.downloadingGuid !== model.guid ? i18n.tr("Queued") : i18n.tr("Download"))
144 onTriggered: {
145 var db = Podcasts.init();
146 if (model.downloadedfile) {
147@@ -631,7 +633,7 @@
148 });
149 episodeModel.setProperty(model.index, "queued", 1)
150 if (model.audiourl) {
151- podbird.downloadEpisode(model.image, model.name, model.guid, model.audiourl)
152+ podbird.downloadEpisode(model.image, model.name, model.guid, model.audiourl, false)
153 } else {
154 console.log("[ERROR]: Invalid download url: " + model.audiourl)
155 }
156@@ -641,6 +643,7 @@
157
158 Action {
159 iconName: "add-to-playlist"
160+ text: i18n.tr("Add to playlist")
161 onTriggered: {
162 var url = model.downloadedfile ? "file://" + model.downloadedfile : model.audiourl
163 player.addEpisodeToQueue(model.guid, model.image, model.name, model.artist, url)
164@@ -649,6 +652,7 @@
165
166 Action {
167 iconName: model.favourited ? "unlike" : "like"
168+ text: model.favourited ? i18n.tr("Unfavourite") : i18n.tr("Favourite")
169 onTriggered: {
170 var db = Podcasts.init();
171 db.transaction(function (tx) {
172@@ -663,6 +667,7 @@
173
174 Action {
175 iconName: "info"
176+ text: i18n.tr("Show episode description")
177 onTriggered: {
178 var popup = PopupUtils.open(episodeDescriptionDialog, episodesPage);
179 popup.description = model.description
180
181=== modified file 'app/ui/EpisodesTab.qml'
182--- app/ui/EpisodesTab.qml 2016-03-19 13:54:27 +0000
183+++ app/ui/EpisodesTab.qml 2016-12-05 17:43:50 +0000
184@@ -183,7 +183,7 @@
185 episodesModel.setProperty(index, "queued", 1)
186 tx.executeSql("UPDATE Episode SET queued=1 WHERE guid = ?", [episodesModel.get(index).guid]);
187 if (episodesModel.get(index).audiourl) {
188- podbird.downloadEpisode(episodesModel.get(index).image, episodesModel.get(index).name, episodesModel.get(index).guid, episodesModel.get(index).audiourl)
189+ podbird.downloadEpisode(episodesModel.get(index).image, episodesModel.get(index).name, episodesModel.get(index).guid, episodesModel.get(index).audiourl, false)
190 } else {
191 console.log("[ERROR]: Invalid download url: " + episodesModel.get(index).audiourl)
192 }
193@@ -468,7 +468,7 @@
194 Image {
195 height: width
196 width: units.gu(6)
197- source: modelData.image !== undefined ? modelData.image : Qt.resolvedUrl("../graphics/podbird.png")
198+ source: modelData.metadata.custom.image !== undefined ? modelData.metadata.custom.image : Qt.resolvedUrl("../graphics/podbird.png")
199 SlotsLayout.position: SlotsLayout.Leading
200 sourceSize { width: width; height: height }
201 }
202@@ -477,7 +477,7 @@
203 spacing: units.gu(0.5)
204
205 Label {
206- text: modelData.title
207+ text: modelData.metadata.title
208 width: parent.width
209 elide: Text.ElideRight
210 }
211@@ -597,7 +597,7 @@
212 });
213 episodesModel.setProperty(model.index, "queued", 1)
214 if (model.audiourl) {
215- podbird.downloadEpisode(model.image, model.name, model.guid, model.audiourl)
216+ podbird.downloadEpisode(model.image, model.name, model.guid, model.audiourl, false)
217 } else {
218 console.log("[ERROR]: Invalid download url: " + model.audiourl)
219 }
220
221=== modified file 'app/ui/SettingsPage.qml'
222--- app/ui/SettingsPage.qml 2016-12-05 17:43:50 +0000
223+++ app/ui/SettingsPage.qml 2016-12-05 17:43:50 +0000
224@@ -74,7 +74,7 @@
225 }
226
227 Button {
228- text: i18n.tr("Ok")
229+ text: i18n.tr("OK")
230 color: podbird.appTheme.positiveActionButton
231 onClicked: {
232 podbird.settings.skipForward = Math.round(slider.value)
233@@ -109,7 +109,7 @@
234 }
235
236 Button {
237- text: i18n.tr("Ok")
238+ text: i18n.tr("OK")
239 color: podbird.appTheme.positiveActionButton
240 onClicked: {
241 podbird.settings.skipBack = Math.round(slider.value)
242@@ -212,6 +212,23 @@
243 onClicked: mainStack.push(Qt.resolvedUrl("../settings/DownloadSetting.qml"))
244 }
245
246+ ListItem {
247+ ListItemLayout {
248+ id: downloadWifiOnlyLayout
249+ title.text: i18n.tr("Only download over WiFi")
250+ title.color: podbird.appTheme.baseText
251+ summary.text: i18n.tr("Download episodes only when the device is using WiFi")
252+ summary.color: podbird.appTheme.baseSubText
253+ Switch {
254+ SlotsLayout.position: SlotsLayout.Last
255+ checked: podbird.settings.downloadOverWifiOnly
256+ onClicked: podbird.settings.downloadOverWifiOnly = checked
257+ }
258+ }
259+ divider.visible: false
260+ height: downloadWifiOnlyLayout.height
261+ }
262+
263 ListItem {
264 id: refreshArtListItem
265
266
267=== modified file 'app/welcomewizard/Slide5.qml'
268--- app/welcomewizard/Slide5.qml 2016-03-19 13:54:27 +0000
269+++ app/welcomewizard/Slide5.qml 2016-12-05 17:43:50 +0000
270@@ -61,7 +61,7 @@
271 wrapMode: Text.WordWrap
272 horizontalAlignment: Text.AlignHCenter
273 linkColor: podbird.appTheme.linkText
274- text: i18n.tr("Episodes can be swiped left to reveal more actions. You can also multi-select them by long-pressing on an episode.")
275+ text: i18n.tr("Episodes can be swiped left to reveal more actions (or right click if you're using a mouse). You can also multi-select them by long-pressing on an episode.")
276 onLinkActivated: Qt.openUrlExternally(link)
277 }
278 }
279
280=== modified file 'manifest.json.in'
281--- manifest.json.in 2016-02-19 20:58:55 +0000
282+++ manifest.json.in 2016-12-05 17:43:50 +0000
283@@ -11,5 +11,5 @@
284 },
285 "version": "0.7",
286 "maintainer": "Michael Sheldon <mike@mikeasoft.com>",
287- "framework": "ubuntu-sdk-15.04.3"
288+ "framework": "ubuntu-sdk-15.04.5"
289 }
290
291=== modified file 'po/com.mikeasoft.podbird.pot'
292--- po/com.mikeasoft.podbird.pot 2016-12-05 17:43:50 +0000
293+++ po/com.mikeasoft.podbird.pot 2016-12-05 17:43:50 +0000
294@@ -8,7 +8,7 @@
295 msgstr ""
296 "Project-Id-Version: \n"
297 "Report-Msgid-Bugs-To: \n"
298-"POT-Creation-Date: 2016-03-29 16:55+0530\n"
299+"POT-Creation-Date: 2016-12-03 17:04+0000\n"
300 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
301 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
302 "Language-Team: LANGUAGE <LL@li.org>\n"
303@@ -55,7 +55,7 @@
304
305 #. TRANSLATORS: About as in information about the app
306 #: ../app/settings/About.qml:28 ../app/settings/About.qml:46
307-#: ../app/ui/SettingsPage.qml:321
308+#: ../app/ui/SettingsPage.qml:338
309 msgid "About"
310 msgstr ""
311
312@@ -223,7 +223,7 @@
313 msgstr ""
314
315 #: ../app/ui/EpisodesPage.qml:356 ../app/ui/EpisodesTab.qml:418
316-#: ../app/ui/SearchPage.qml:179 ../app/ui/SettingsPage.qml:303
317+#: ../app/ui/SearchPage.qml:179 ../app/ui/SettingsPage.qml:320
318 msgid "Close"
319 msgstr ""
320
321@@ -247,6 +247,42 @@
322 msgid "Downloaded"
323 msgstr ""
324
325+#: ../app/ui/EpisodesPage.qml:605
326+msgid "Make as unheard"
327+msgstr ""
328+
329+#: ../app/ui/EpisodesPage.qml:605
330+msgid "Mark as listened"
331+msgstr ""
332+
333+#: ../app/ui/EpisodesPage.qml:621
334+msgid "Delete downloaded file"
335+msgstr ""
336+
337+#: ../app/ui/EpisodesPage.qml:621
338+msgid "Queued"
339+msgstr ""
340+
341+#: ../app/ui/EpisodesPage.qml:621
342+msgid "Download"
343+msgstr ""
344+
345+#: ../app/ui/EpisodesPage.qml:646
346+msgid "Add to playlist"
347+msgstr ""
348+
349+#: ../app/ui/EpisodesPage.qml:655
350+msgid "Unfavourite"
351+msgstr ""
352+
353+#: ../app/ui/EpisodesPage.qml:655
354+msgid "Favourite"
355+msgstr ""
356+
357+#: ../app/ui/EpisodesPage.qml:670
358+msgid "Show episode description"
359+msgstr ""
360+
361 #: ../app/ui/EpisodesTab.qml:82
362 msgid "Recent"
363 msgstr ""
364@@ -432,7 +468,7 @@
365 msgstr ""
366
367 #: ../app/ui/SettingsPage.qml:77 ../app/ui/SettingsPage.qml:112
368-msgid "Ok"
369+msgid "OK"
370 msgstr ""
371
372 #. TRANSLATORS: This strings refers to the seeking of the episode playback. Users can set how far they
373@@ -476,43 +512,51 @@
374 msgid "Default number of new episodes to download for each podcast"
375 msgstr ""
376
377-#: ../app/ui/SettingsPage.qml:223
378+#: ../app/ui/SettingsPage.qml:218
379+msgid "Only download over wifi"
380+msgstr ""
381+
382+#: ../app/ui/SettingsPage.qml:220
383+msgid "Download episodes only when the device is using WiFi"
384+msgstr ""
385+
386+#: ../app/ui/SettingsPage.qml:240
387 msgid "Refresh podcast artwork"
388 msgstr ""
389
390-#: ../app/ui/SettingsPage.qml:225
391+#: ../app/ui/SettingsPage.qml:242
392 msgid ""
393 "Update all podcasts artwork and fix missing ones (this only works with "
394 "podcasts added via iTunesĀ® search)"
395 msgstr ""
396
397-#: ../app/ui/SettingsPage.qml:254
398+#: ../app/ui/SettingsPage.qml:271
399 msgid "Storage Settings"
400 msgstr ""
401
402-#: ../app/ui/SettingsPage.qml:265
403+#: ../app/ui/SettingsPage.qml:282
404 msgid "Delete orphaned files and links"
405 msgstr ""
406
407-#: ../app/ui/SettingsPage.qml:267
408+#: ../app/ui/SettingsPage.qml:284
409 msgid "Free space by removing orphaned downloaded files and links"
410 msgstr ""
411
412-#: ../app/ui/SettingsPage.qml:297
413+#: ../app/ui/SettingsPage.qml:314
414 msgid "Removed Orphaned files and links"
415 msgstr ""
416
417-#: ../app/ui/SettingsPage.qml:297
418+#: ../app/ui/SettingsPage.qml:314
419 msgid "No Orphans found!"
420 msgstr ""
421
422-#: ../app/ui/SettingsPage.qml:298
423+#: ../app/ui/SettingsPage.qml:315
424 msgid ""
425 "All orphaned files have been deleted to recover disk space. Orphaned links "
426 "pointing at invalid files have also been cleaned up."
427 msgstr ""
428
429-#: ../app/ui/SettingsPage.qml:300
430+#: ../app/ui/SettingsPage.qml:317
431 msgid ""
432 "No orphaned files have been found to recover disk space. Podbird database is "
433 "clean."
434@@ -520,11 +564,11 @@
435
436 #. TRANSLATORS: Shortened form of "Miscellaneous" which is shown to denote other setting options
437 #. that doesn't fit into any other category.
438-#: ../app/ui/SettingsPage.qml:315
439+#: ../app/ui/SettingsPage.qml:332
440 msgid "Misc."
441 msgstr ""
442
443-#: ../app/ui/SettingsPage.qml:331
444+#: ../app/ui/SettingsPage.qml:348
445 msgid "Report Bug"
446 msgstr ""
447
448@@ -584,8 +628,9 @@
449
450 #: ../app/welcomewizard/Slide5.qml:64
451 msgid ""
452-"Episodes can be swiped left to reveal more actions. You can also multi-"
453-"select them by long-pressing on an episode."
454+"Episodes can be swiped left to reveal more actions (or right click if you're "
455+"using a mouse). You can also multi-select them by long-pressing on an "
456+"episode."
457 msgstr ""
458
459 #: ../app/welcomewizard/Slide6.qml:45
460@@ -612,10 +657,10 @@
461 msgid "Finish"
462 msgstr ""
463
464-#: /home/krnekhelesh/Development/devel-branch-sync-4-build/po/Podbird.desktop.in.h:1
465+#: /home/krnekhelesh/Development/build-devel-branch-sync-5-UbuntuSDK_for_desktop_GCC_amd64_ubuntu_sdk_15_04-Default/po/Podbird.desktop.in.h:1
466 msgid "The chirpiest podcast manager for Ubuntu"
467 msgstr ""
468
469-#: /home/krnekhelesh/Development/devel-branch-sync-4-build/po/Podbird.desktop.in.h:2
470+#: /home/krnekhelesh/Development/build-devel-branch-sync-5-UbuntuSDK_for_desktop_GCC_amd64_ubuntu_sdk_15_04-Default/po/Podbird.desktop.in.h:2
471 msgid "podcast;audio;itunes;broadcast;digital;stream;podcatcher;video;vodcast;"
472 msgstr ""

Subscribers

People subscribed via source and target branches