[podcasts] Actually test new lookup method
This commit is contained in:
@ -115,6 +115,12 @@ def mopidy_podcast_request_data():
|
||||
mopidy_uri=mopidy_uri, artist="NPR", album="Up First"
|
||||
).request_json
|
||||
|
||||
@pytest.fixture
|
||||
def mopidy_podcast_https_request_data():
|
||||
mopidy_uri = "podcast+https://feeds.npr.org/510318/podcast.xml#85b9c4c4-ae09-43d9-8853-31ccf43f68e6"
|
||||
return MopidyRequest(
|
||||
mopidy_uri=mopidy_uri, artist="NPR", album="Up First"
|
||||
).request_json
|
||||
|
||||
class JellyfinTrackRequest:
|
||||
name = "Emotion"
|
||||
|
||||
@ -121,14 +121,15 @@ def get_or_create_podcast(post_data: dict) -> PodcastEpisode:
|
||||
run_time_seconds = parsed_data.get("episode_runtime_seconds", post_data.get("run_time", 2700))
|
||||
|
||||
episode_dict = {
|
||||
"title": episode_name,
|
||||
"podcast_name": podcast_name,
|
||||
"podcast_description": parsed_data.get("podcast_description"),
|
||||
"pub_date": parsed_data.get("pub_date"),
|
||||
"number": parsed_data.get("episode_num"),
|
||||
"mopidy_uri": mopidy_uri,
|
||||
"producer_name": producer_name,
|
||||
"run_time_seconds": run_time_seconds,
|
||||
}
|
||||
|
||||
return PodcastEpisode.find_or_create(**episode_dict)
|
||||
return PodcastEpisode.find_or_create(
|
||||
title=episode_name,
|
||||
podcast_name=podcast_name,
|
||||
podcast_description=parsed_data.get("podcast_description", ""),
|
||||
pub_date=parsed_data.get("pub_date", ""),
|
||||
number=parsed_data.get("episode_num", 0),
|
||||
mopidy_uri=mopidy_uri,
|
||||
producer_name=producer_name,
|
||||
run_time_seconds=run_time_seconds
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user