dont index playlists without videos

This commit is contained in:
simon 2021-11-19 16:57:07 +07:00
parent fef26a06b2
commit 85d12d6c68
No known key found for this signature in database
GPG Key ID: 2C15AA5E89985DD4
2 changed files with 8 additions and 3 deletions

View File

@ -232,6 +232,14 @@ def index_channel_playlists(channel_id):
playlist_id, all_youtube_ids=all_youtube_ids
)
playlist_handler.get_playlist_dict()
# don't add if no videos downloaded
downloaded = [
i
for i in playlist_handler.playlist_dict["playlist_entries"]
if i["downloaded"]
]
if not downloaded:
continue
playlist_handler.upload_to_es()
playlist_handler.add_vids_to_playlist()

View File

@ -782,9 +782,6 @@ class PlaylistView(View):
}
}
],
"filter": [
{"term": {"playlist_entries.downloaded": True}}
],
"minimum_should_match": 1,
}
}