diff --git a/lib/Core/EpisodeAction/EpisodeActionExtraData.php b/lib/Core/EpisodeAction/EpisodeActionExtraData.php
index 9439536..ed0bff3 100644
--- a/lib/Core/EpisodeAction/EpisodeActionExtraData.php
+++ b/lib/Core/EpisodeAction/EpisodeActionExtraData.php
@@ -24,7 +24,7 @@ use OCA\GPodderSync\Core\EpisodeAction\EpisodeAction;
* type: ?string,
* size: ?int,
* pubDate: ?\DateTime,
- * duration: ?int,
+ * duration: ?string,
* action: ?EpisodeActionType
* }
*/
@@ -42,7 +42,7 @@ class EpisodeActionExtraData implements \JsonSerializable
private ?string $type,
private ?int $size,
private ?\DateTime $pubDate,
- private ?int $duration,
+ private ?string $duration,
private ?EpisodeAction $action
) {}
@@ -94,7 +94,7 @@ class EpisodeActionExtraData implements \JsonSerializable
return $this->pubDate;
}
- public function getDuration(): ?int {
+ public function getDuration(): ?string {
return $this->duration;
}
diff --git a/lib/Core/EpisodeAction/EpisodeActionReader.php b/lib/Core/EpisodeAction/EpisodeActionReader.php
index e217677..755b8f1 100644
--- a/lib/Core/EpisodeAction/EpisodeActionReader.php
+++ b/lib/Core/EpisodeAction/EpisodeActionReader.php
@@ -93,16 +93,11 @@ class EpisodeActionReader extends CoreEpisodeActionReader
// Get episode duration
if ($iTunesItemChildren) {
- $rawDuration = $this->stringOrNull($iTunesItemChildren->duration);
+ $duration = $this->stringOrNull($iTunesItemChildren->duration);
} else {
- $rawDuration = $this->stringOrNull($item->duration);
+ $duration = $this->stringOrNull($item->duration);
}
- $splitDuration = array_reverse(explode(':', $rawDuration ?? ''));
- $duration = (int) $splitDuration[0];
- $duration += !empty($splitDuration[1]) ? (int) $splitDuration[1] * 60 : 0;
- $duration += !empty($splitDuration[2]) ? (int) $splitDuration[2] * 60 : 0;
-
// Get episode pubDate
$rawPubDate = $this->stringOrNull($item->pubDate);
$pubDate = $rawPubDate ? new \DateTime($rawPubDate) : null;
diff --git a/src/components/Feed/Episodes.vue b/src/components/Feed/Episodes.vue
index 0944fb8..233641e 100644
--- a/src/components/Feed/Episodes.vue
+++ b/src/components/Feed/Episodes.vue
@@ -17,7 +17,7 @@
:url="episode.image" />
- {{ episode.duration > 0 ? formatTimer(new Date(episode.duration*1000)) : '' }}
+ {{ episode.duration }}
@@ -56,7 +56,6 @@ import Modal from './Modal.vue'
import PlayButton from 'vue-material-design-icons/Play.vue'
import StopButton from 'vue-material-design-icons/Stop.vue'
import axios from '@nextcloud/axios'
-import { formatTimer } from '../../utils/time.js'
import { generateUrl } from '@nextcloud/router'
import moment from '@nextcloud/moment'
import { showError } from '@nextcloud/dialogs'
@@ -102,7 +101,6 @@ export default {
}
},
methods: {
- formatTimer,
moment,
hasEnded(episode) {
return episode.action