1 from mygpo
.utils
import is_url
, normalize_feed_url
2 from mygpo
.data
.feeddownloader
import PodcastUpdater
, NoPodcastCreated
3 from mygpo
.cache
import cache_result
4 from mygpo
.db
.couchdb
.podcast
import podcast_for_url
, search
7 @cache_result(timeout
=60*60)
8 def search_podcasts(q
, limit
=20, skip
=0):
11 url
= normalize_feed_url(q
)
13 podcast
= podcast_for_url(url
, create
=False)
15 if not podcast
or not podcast
.title
:
17 updater
= PodcastUpdater()
21 except NoPodcastCreated
as npc
:
24 podcast
= podcast_for_url(url
)
31 return search(q
, skip
, limit
)