Skip to content
Snippets Groups Projects
Commit 5604609d authored by onny's avatar onny
Browse files

listening view: show only episodes with playtime

parent 4da89462
No related branches found
No related tags found
No related merge requests found
......@@ -71,6 +71,13 @@ class EpisodeMapper extends QBMapper {
->from('episodes')
->orderBy($sortBy, 'DESC')
->where($qb->expr()->eq('user_id', $qb->createNamedParameter($userId)));
/* For listening view, query only episodes which were already
listened */
if ($sortBy == 'lastplayed') {
$qb->andWhere($qb->expr()->gt('playtime',$qb->createNamedParameter(0)));
};
return $this->findEntities($qb);
}
}
......@@ -20,7 +20,8 @@
-
-->
<template>
<div class="podcastSection">
<div v-show="podcasts.length"
class="podcastSection">
<div class="podcastSliderWrapper">
<div
v-show="showPrev"
......
......@@ -74,6 +74,22 @@ export default {
.then((episode) => {
commit('addEpisode', episode)
})
const testEpisode = {
id: 6461881,
imgURL: 'https://thumborcdn.acast.com/lYYH8lBYyScJ5JcMCkVGdrY1EHg=/3000x3000/https://mediacdn.acast.com/assets/4f71cda1-166c-4604-88a7-bf1e6686c9e9/cover-image-kluot63n-thehistoryofbyzantium_new_.jpg',
title: 'Episode 225 - test episode',
pubdate: '2021-03-04T10:57:48+01:00',
duration: 3834,
playtime: 0,
lastplayed: 1616511062258,
enclosure: 'https://sphinx.acast.com/thehistoryofbyzantium/episode225-belisariusinmetal/media.mp3',
description: 'test test test',
podcast_id: 48700,
}
episodeApiClient.addEpisode(testEpisode)
.then((episode) => {
commit('addEpisode', episode)
})
},
removeEpisode({ commit }, episode) {
episodeApiClient.removeEpisode(episode)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment