) -> AsyncGenerator[PodcastEpisode, None]:
"""Get podcast episodes."""
await self._update_progress()
+ depublished_filter = {"isPublished": {"equalTo": True}}
async with await self.get_client() as session:
- show_length_query.variable_values = {"showId": prov_podcast_id}
+ show_length_query.variable_values = {
+ "showId": prov_podcast_id,
+ "filter": depublished_filter,
+ }
length = await session.execute(show_length_query)
length = length["show"]["items"]["totalCount"]
step_size = 128
"showId": prov_podcast_id,
"first": step_size,
"offset": offset,
+ "filter": depublished_filter,
}
result = (await session.execute(show_query))["show"]
for idx, episode in enumerate(result["items"]["nodes"]):
show_length_query = gql("""
-query Show($showId: ID!) {
+query Show($showId: ID!, $filter: ItemFilter) {
show(id: $showId) {
- items {
+ items(filter: $filter) {
totalCount
}
}
show_query = gql(
"""
-query Show($showId: ID!, $first: Int, $offset: Int) {
+query Show($showId: ID!, $first: Int, $offset: Int, $filter: ItemFilter) {
show(id: $showId) {
synopsis
title
showType
- items(first: $first, offset: $offset) {
- totalCount
+ items(first: $first, offset: $offset, filter: $filter) {
nodes {
duration
title