diff --git a/qml/components/PlayerHandler.qml b/qml/components/PlayerHandler.qml index 6ce8a9a903947ab812b07308a207a13409a781df..77d997577fb91546f37faaea8a30b9c8672af29e 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 @@ -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 b1a99dc6127d2918620cd131adb483614b946a4d..55e68961f7427e67df874fa37a53536d95d319a4 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 b8499ccfd6a585c46a7021d58627916414fa2e95..ca2422638baca1d0dd6699144fbd3e5847540dcc 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?