1 from mygpo
.utils
import is_url
2 from mygpo
.data
.feeddownloader
import PodcastUpdater
, NoPodcastCreated
3 from mygpo
.api
.sanitizing
import sanitize_url
4 from mygpo
.cache
import cache_result
5 from mygpo
.db
.couchdb
.podcast
import podcast_for_url
, search
8 @cache_result(timeout
=60*60)
9 def search_podcasts(q
, limit
=20, skip
=0):
14 podcast
= podcast_for_url(url
, create
=False)
16 if not podcast
or not podcast
.title
:
18 updater
= PodcastUpdater()
22 except NoPodcastCreated
as npc
:
25 podcast
= podcast_for_url(url
)
32 return search(q
, skip
, limit
)