|
|
|
@ -533,21 +533,36 @@ class PysonicSubsonicApi(object):
|
|
|
|
|
# Podcast related endpoints |
|
|
|
|
@cherrypy.expose |
|
|
|
|
@formatresponse |
|
|
|
|
def getPodcasts_view(self, includeEpisodes=False, **kwargs): |
|
|
|
|
#TODO implement includeEpisodes |
|
|
|
|
def getPodcasts_view(self, id=None, includeEpisodes=True, **kwargs): |
|
|
|
|
#TODO implement includeEpisodes properly |
|
|
|
|
response = ApiResponse() |
|
|
|
|
response.add_child("podcasts") |
|
|
|
|
|
|
|
|
|
for podcast in self.library.get_podcasts(): |
|
|
|
|
response.add_child("channel", |
|
|
|
|
_parent="podcasts", |
|
|
|
|
id=podcast["id"], |
|
|
|
|
title=podcast["title"], |
|
|
|
|
url=podcast["url"], |
|
|
|
|
description=podcast["description"], |
|
|
|
|
# coverArt="pl-1" |
|
|
|
|
# originalImageUrl="", |
|
|
|
|
status="completed" # or "downloading" |
|
|
|
|
) |
|
|
|
|
node = response.add_child("channel", |
|
|
|
|
_parent="podcasts", |
|
|
|
|
id=podcast["id"], |
|
|
|
|
title=podcast["title"], |
|
|
|
|
url=podcast["url"], |
|
|
|
|
description=podcast["description"], |
|
|
|
|
# coverArt="pl-1" |
|
|
|
|
# originalImageUrl="", |
|
|
|
|
status="completed" # or "downloading" |
|
|
|
|
) |
|
|
|
|
if includeEpisodes: |
|
|
|
|
for episode in self.library.db.get_podcast_episodes(podcast_id=podcast['id']): |
|
|
|
|
response.add_child("episode", |
|
|
|
|
_real_parent=node, # what the actual fuck does this do |
|
|
|
|
isDir="false", |
|
|
|
|
title=episode["title"], |
|
|
|
|
id=episode["id"], |
|
|
|
|
duration="420", |
|
|
|
|
description=episode["description"], |
|
|
|
|
status=episode["status"] |
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
# publishDate="2018-03-29T01:00:00.000Z"/> |
|
|
|
|
|
|
|
|
|
return response |
|
|
|
|
|
|
|
|
|
@cherrypy.expose |
|
|
|
|