play episodes even if not downloaded

pull/52/head
Akhil Gupta 4 years ago
parent 5abbc80120
commit 099a443394

@ -142,18 +142,7 @@
title="Delete Podcast Episode File"
><i class="fas fa-trash"></i
></a>
<a
class="button button"
onclick="openPlayer('{{.ID}}')"
title="Play Episode"
><i class="fas fa-play"></i
></a>
<a
class="button button-enqueue"
onclick="enqueueEpisode('{{.ID}}')"
title="Add Episode to existing player playlist"
><i class="fas fa-plus"></i
></a>
{{else}} {{if not $setting.AutoDownload}}
<a
@ -172,6 +161,18 @@
><i class="fas fa-cloud-download-alt"></i
></a>
{{end}} {{end}} {{end }}
<a
class="button button"
onclick="openPlayer('{{.ID}}')"
title="Play Episode"
><i class="fas fa-play"></i
></a>
<a
class="button button-enqueue"
onclick="enqueueEpisode('{{.ID}}')"
title="Add Episode to existing player playlist"
><i class="fas fa-plus"></i
></a>
</div>
<div class="columns one"></div>
</div>

@ -169,8 +169,7 @@
<button
class="button"
title="Play all downloaded episodes"
v-if="podcast.DownloadedEpisodesCount>0"
title="Play all episodes"
@click="playPodcast(podcast.ID)"
>
<i class="fas fa-play"></i>
@ -178,8 +177,8 @@
<button
class="button"
title="Add all downloaded episodes to existing player playlist"
v-if="podcast.DownloadedEpisodesCount>0 && playerExists"
title="Add all episodes to existing player playlist"
v-if="playerExists"
@click="enquePodcast(podcast.ID)"
>
<i class="fas fa-plus"></i>

@ -776,7 +776,7 @@ div#large-visualization{
methods:{
getSongsFromItems(items){
return items.map(x=>{
return {
let toReturn= {
id:x.ID,
name:x.Title,
url:x.DownloadPath,
@ -784,6 +784,10 @@ div#large-visualization{
artist:x.Podcast.Title,
album: new Date(x.PubDate.substr(0,10)).toDateString()
}
if(!toReturn.url){
toReturn.url=x.FileURL;
}
return toReturn;
});
},
getFormattedLastEpisodeDate(item){
@ -838,6 +842,7 @@ div#large-visualization{
});
},
mounted(){
Amplitude.init({
"songs": this.songs,
"start_song":0,

@ -102,11 +102,12 @@ func getItemsToPlay(itemId, podcastId string) []db.PodcastItem {
} else if podcastId != "" {
pod := service.GetPodcastById(podcastId)
for _, item := range pod.PodcastItems {
if item.DownloadStatus == db.Downloaded {
items = append(items, item)
}
}
// for _, item := range pod.PodcastItems {
// if item.DownloadStatus == db.Downloaded {
// items = append(items, item)
// }
// }
items = pod.PodcastItems
}
return items
}
@ -124,16 +125,17 @@ func PlayerPage(c *gin.Context) {
totalCount = 1
} else if hasPodcastId {
pod := service.GetPodcastById(podcastId)
for _, item := range pod.PodcastItems {
if item.DownloadStatus == db.Downloaded {
items = append(items, item)
}
}
// for _, item := range pod.PodcastItems {
// if item.DownloadStatus == db.Downloaded {
// items = append(items, item)
// }
// }
items = pod.PodcastItems
title = "Playing: " + pod.Title
totalCount = int64(len(items))
} else {
title = "Playing Latest Episodes"
if err := db.GetPaginatedPodcastItems(1, 10, true, &items, &totalCount); err != nil {
if err := db.GetPaginatedPodcastItems(1, 20, false, &items, &totalCount); err != nil {
fmt.Println(err.Error())
}
}

Loading…
Cancel
Save