diff --git a/python/podcast/podpost.py b/python/podcast/podpost.py
index 24263dbcc685c9c753a2f791e66aa46b8cac1425..03e9d0768213949ca2a461ebd825cf725e9f21f7 100644
--- a/python/podcast/podpost.py
+++ b/python/podcast/podpost.py
@@ -45,7 +45,7 @@ class Podpost(BaseModel):
guid: str = CharField(index=True)
id: AutoField = AutoField(primary_key=True) # POST_ID_TYPE
author: str = CharField(default="")
- duration: int = IntegerField(null=True)
+ duration: int = IntegerField(null=True,help_text="in ms")
favorite: bool = BooleanField(default=False)
file_path: str = TextField(null=True)
# podcast file url
@@ -64,7 +64,7 @@ class Podpost(BaseModel):
# download percentage
percentage: float = FloatField(default=0)
plainpart: TextField = TextField(default="")
- position: int = IntegerField(default=0)
+ position: int = IntegerField(default=0,help_text="in ms")
podcast = ForeignKeyField(Podcast, null=True, backref='episodes', lazy_load=True, on_delete='CASCADE')
# when the post was published according to feed
published = DateTimeField()
@@ -252,7 +252,7 @@ class Podpost(BaseModel):
"loaded": loaded,
"haschapters": haschapters,
"listened": self.listened or self.position > 0 and (
- self.duration * 1000 - self.position < Constants().markListenedBeforeEndThreshold * 1000)
+ self.duration- self.position < Constants().markListenedBeforeEndThreshold * 1000)
}
def get_image_descriptor(self):
diff --git a/qml/components/PlayerHandler.qml b/qml/components/PlayerHandler.qml
index f97fe200e59fcdb26f9adc95437ef38b42533374..33ba4f10b6b1f9aa20d414d960607c471db5b2ef 100644
--- a/qml/components/PlayerHandler.qml
+++ b/qml/components/PlayerHandler.qml
@@ -4,8 +4,12 @@ import io.thp.pyotherside 1.4
Python {
id: playerHandler
- property var position: mediaplayer.position
- property var duration: mediaplayer.duration
+ property real position: (mediaplayer.position <= 0)?positionFromDb:mediaplayer.position
+ property real duration: (mediaplayer.duration <= 0)?durationFromDb:mediaplayer.duration
+ property real positionSeconds: position / 1000
+ property real durationSeconds: duration / 1000
+ property real durationFromDb: 0
+ property real positionFromDb: 0
property bool isPlaying: false
property string playicon: "../../images/podcast.png"
@@ -27,6 +31,8 @@ Python {
signal downloading(int percent)
signal audioNotExist
+ onDurationChanged: console.log("duration: " + duration)
+
Component.onCompleted: {
setHandler('playing', playing)
setHandler('pausing', pausing)
@@ -82,12 +88,14 @@ Python {
}
function setEpisode(data, chapterlist) {
- console.log("setting episode: " + data.title + " url:" + data.audio_url)
firstid = data.id
firsttitle = data.title
chapters = chapterlist
playicon = data.logo_url
playtext = data.title
+ durationFromDb = data.duration
+ positionFromDb = data.position
+ console.log("setting episode: " + data.title + " url:" + data.audio_url + " duration:"+data.duration+"/"+duration)
}
function getaktchapter() {
@@ -171,9 +179,10 @@ Python {
}
function setDuration() {
- console.log("mediaplayer.duration" + mediaplayer.duration / 1000)
- call("QueueHandler.instance.set_duration",
- [mediaplayer.duration / 1000], function () {})
+ if(mediaplayer.duration > 0){
+ call("QueueHandler.instance.set_duration",
+ [mediaplayer.duration], function () {})
+ }
}
function fast_backward() {
@@ -188,7 +197,7 @@ Python {
function fast_forward() {
var posi = mediaplayer.position
posi = posi + 30 * 1000
- if (posi > mediaplayer.duration) {
+ if (mediaplayer.duration > 0 && posi > mediaplayer.duration) {
posi = mediaplayer.duration
}
seek(posi)
diff --git a/qml/components/PodqastAudioPlayer.qml b/qml/components/PodqastAudioPlayer.qml
index 4947647669deaccfa06fd937841c2259d70370c1..23acfaa26d7d3a5f454b9b9a0d8d0bbd3446c2fb 100644
--- a/qml/components/PodqastAudioPlayer.qml
+++ b/qml/components/PodqastAudioPlayer.qml
@@ -41,6 +41,10 @@ MediaPlayer {
switch (mediaplayer.status) {
case MediaPlayer.EndOfMedia:
console.log("End of media " + mediaplayer.source)
+ if(mediaplayer.duration === -1){
+ console.log("mediaplayer does not even know a duration, do nothing!")
+ break
+ }
queuehandler.queueTopToArchive(autoPlayNextInQueue.value)
break
case MediaPlayer.StoppedState:
diff --git a/qml/cover/CoverPage.qml b/qml/cover/CoverPage.qml
index 3ab6e4bddf9b1fe0a966d05ab07cde7dcb860a63..5f92308f1f9fd71194b707c60d81b9429a45c78b 100644
--- a/qml/cover/CoverPage.qml
+++ b/qml/cover/CoverPage.qml
@@ -45,7 +45,7 @@ CoverBackground {
anchors.top: chaptcount.bottom
anchors.horizontalCenter: parent.horizontalCenter
Label {
- text: to_pos_str(playerHandler.position / 1000)
+ text: to_pos_str(playerHandler.positionSeconds)
font.bold: true
font.pixelSize: Theme.fontSizeLarge
color: Theme.highlightColor
@@ -53,7 +53,7 @@ CoverBackground {
}
Label {
text: to_pos_str(
- (playerHandler.duration - playerHandler.position) / 1000)
+ (playerHandler.durationSeconds - playerHandler.positionSeconds))
font.bold: true
font.pixelSize: Theme.fontSizeLarge
color: Theme.highlightColor
diff --git a/qml/pages/Player.qml b/qml/pages/Player.qml
index e74c28728f93de66e64ba1cd41c7bd4d8786adb1..fbcb8c3e6b386496e32f38ed1820f3a4109758e0 100644
--- a/qml/pages/Player.qml
+++ b/qml/pages/Player.qml
@@ -259,7 +259,7 @@ Page {
handleVisible: false
maximumValue: playerHandler.duration
value: playerHandler.position
- valueText: to_pos_str(playerHandler.position / 1000)
+ valueText: to_pos_str(playerHandler.positionSeconds)
onPressedChanged: {
playerHandler.seek(playSlider.value)
}
diff --git a/translations/harbour-podqast-de.ts b/translations/harbour-podqast-de.ts
index 0fbc614c69ea3b6f73186e5cd9ab1dccca1a45b4..7cd8b9e751c151e51641381fc40f05a2eb6d5574 100644
--- a/translations/harbour-podqast-de.ts
+++ b/translations/harbour-podqast-de.ts
@@ -157,7 +157,7 @@
- <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul>If you want to contribute help translating the app or report issues on gitlab.
+ <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul><br>If you want to contribute to podQast, you can help translating the app or report issues on GitLab.whatsnew section of the migration
diff --git a/translations/harbour-podqast-es.ts b/translations/harbour-podqast-es.ts
index 9186355232553e8737e9631b7cafaec86618eeed..3b6e89ed1b4a126abccf7c1c6a352eabe1c9d131 100644
--- a/translations/harbour-podqast-es.ts
+++ b/translations/harbour-podqast-es.ts
@@ -157,7 +157,7 @@
- <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul>If you want to contribute help translating the app or report issues on gitlab.
+ <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul><br>If you want to contribute to podQast, you can help translating the app or report issues on GitLab.whatsnew section of the migration
diff --git a/translations/harbour-podqast-fr.ts b/translations/harbour-podqast-fr.ts
index f59f959d5184d5f8cecc42a642f944717984eb49..c9a1cc5329008195b49a1cf8327a86c0ced2c2dc 100644
--- a/translations/harbour-podqast-fr.ts
+++ b/translations/harbour-podqast-fr.ts
@@ -157,7 +157,7 @@
- <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul>If you want to contribute help translating the app or report issues on gitlab.
+ <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul><br>If you want to contribute to podQast, you can help translating the app or report issues on GitLab.whatsnew section of the migration
diff --git a/translations/harbour-podqast-sv.ts b/translations/harbour-podqast-sv.ts
index 7e5f84f483eaa7b1786aef98cac5adfb7d3c9984..e9b33b5fab32c403d8cbddce52c6bc1fa54940b8 100644
--- a/translations/harbour-podqast-sv.ts
+++ b/translations/harbour-podqast-sv.ts
@@ -157,7 +157,7 @@
- <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul>If you want to contribute help translating the app or report issues on gitlab.
+ <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul><br>If you want to contribute to podQast, you can help translating the app or report issues on GitLab.whatsnew section of the migration
diff --git a/translations/harbour-podqast-zh_CN.ts b/translations/harbour-podqast-zh_CN.ts
index eb9a6a2acb94ef43c4fc25824c63a395897ac527..a75cfab8156b414050fd1628664914e36759a5a9 100644
--- a/translations/harbour-podqast-zh_CN.ts
+++ b/translations/harbour-podqast-zh_CN.ts
@@ -157,7 +157,7 @@
- <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul>If you want to contribute help translating the app or report issues on gitlab.
+ <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul><br>If you want to contribute to podQast, you can help translating the app or report issues on GitLab.whatsnew section of the migration
diff --git a/translations/harbour-podqast.ts b/translations/harbour-podqast.ts
index f9b5f40ec607450ed546c200002ebf76d3d1837f..bd0fc63916fe69dc24c4786c18c565dd63db4a55 100644
--- a/translations/harbour-podqast.ts
+++ b/translations/harbour-podqast.ts
@@ -157,7 +157,7 @@
- <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul>If you want to contribute help translating the app or report issues on gitlab.
+ <b>Whats New?</b><ul><li>Some of you lost episodes in the last migration. Because we found this pretty sad, we're trying to recover them now.</li><li>If you are missing old episodes of feeds in general and this didn't help, try the force refresh button in the settings (We added support for Pagination).</li><li>Podcasts are now sorted alphabetically, we hope you like that!</li><li>Gpodder should work again.</li><li>Check the new Log Page next to the settings.</li><li>If you're streaming an episode and the download finishes, we're now switching to the downloaded file automatically.</li><li>Also more speed, bugfixes and code cleanups.</li></ul><br>If you want to contribute to podQast, you can help translating the app or report issues on GitLab.whatsnew section of the migration