1 from mygpo
.podcasts
.models
import Podcast
2 from mygpo
.utils
import is_url
, normalize_feed_url
3 from mygpo
.data
.feeddownloader
import PodcastUpdater
, NoPodcastCreated
4 from mygpo
.search
.index
import search_podcasts
as search
7 def search_podcasts(q
):
10 url
= normalize_feed_url(q
)
13 podcast
= Podcast
.objects
.get(urls__url
=url
)
14 except Podcast
.DoesNotExist
:
17 if not podcast
or not podcast
.title
:
19 updater
= PodcastUpdater()
23 except NoPodcastCreated
as npc
:
27 podcast
= Podcast
.objects
.get(urls__url
=url
)
29 except Podcast
.DoesNotExist
: