From b5922fc2f6c3d117cab964951748be93f399d025 Mon Sep 17 00:00:00 2001 From: Thilo Kogge Date: Wed, 23 Nov 2022 09:55:47 +0100 Subject: [PATCH 1/2] renamed variable to prevent name collision --- qml/components/PlayerHandler.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/qml/components/PlayerHandler.qml b/qml/components/PlayerHandler.qml index 6ce8a9a..f75a4db 100644 --- a/qml/components/PlayerHandler.qml +++ b/qml/components/PlayerHandler.qml @@ -32,7 +32,7 @@ Python { property bool streaming: mediaplayer.source && !/^file:/.test( mediaplayer.source) - signal playing(string audio_url, int position, bool only_start_if_playing) + signal playing(string audio_url, int positionToPlayFrom, bool only_start_if_playing) signal pausing signal stopping signal downloading(int percent) @@ -59,8 +59,8 @@ Python { onPlaying: { console.info("Playing audio_url: " + audio_url + " @ rate " + playrate - + "@ position " + position) - positionFromDb = position + + "@ position " + positionToPlayFrom) + positionFromDb = positionToPlayFrom if (audio_url != "") { if (mediaplayer.source != audio_url) { mediaplayer.source = audio_url -- GitLab From e77679f011dbf3ba9c5609f16207fd0707fd8d0a Mon Sep 17 00:00:00 2001 From: Thilo Kogge Date: Mon, 28 Nov 2022 21:40:49 +0100 Subject: [PATCH 2/2] binding setting the duration to the episodeid --- qml/components/PlayerHandler.qml | 4 ++-- qml/components/QueueHandler.py | 6 ++++-- qml/pages/DataMigration.qml | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/qml/components/PlayerHandler.qml b/qml/components/PlayerHandler.qml index f75a4db..77d9975 100644 --- a/qml/components/PlayerHandler.qml +++ b/qml/components/PlayerHandler.qml @@ -203,8 +203,8 @@ Python { function setDuration() { if (mediaplayer.duration > 0) { - call("QueueHandler.instance.set_duration", [mediaplayer.duration], - function () { + call("QueueHandler.instance.set_duration", + [lastPlayedId, mediaplayer.duration], function () { durationFromDb = mediaplayer.duration }) } diff --git a/qml/components/QueueHandler.py b/qml/components/QueueHandler.py index b1a99dc..55e6896 100644 --- a/qml/components/QueueHandler.py +++ b/qml/components/QueueHandler.py @@ -202,12 +202,14 @@ class QueueHandler(object): logger.info("setting position of podpost %s %s to %s", podpost.id, podpost.title, position) podpost.update_position(position=position) - async def set_duration(self, duration): + async def set_duration(self, episode_id, duration): """ Set podposts duration if not set """ - QueueFactory().get_queue().set_duration(duration) + podpost = PodpostFactory().get_podpost(episode_id) + podpost.set_duration(duration) + PodpostFactory().persist(podpost) await self.get_queue_posts() async def get_episode_chapters(self, id): diff --git a/qml/pages/DataMigration.qml b/qml/pages/DataMigration.qml index b8499cc..ca24226 100644 --- a/qml/pages/DataMigration.qml +++ b/qml/pages/DataMigration.qml @@ -77,7 +77,7 @@ Page { width: parent.width wrapMode: Text.WordWrap //: whatsnew section of the migration - text: qsTr("Whats New?
If you want to contribute to podQast, you can help translating the app or report issues on GitLab.") + text: qsTr("whatsnew text") } Label { -- GitLab