def get(self): chapter = create_or_get_chapter(self.data['url']) resp = { 'name': chapter.name, 'url': chapter.url, 'pages': chapter.pages, 'series_url': chapter.series_url, 'series_name': chapter.series_name, 'next_chapter_url': chapter.next_chapter_url, 'prev_chapter_url': chapter.prev_chapter_url, } if hasattr(self, 'user'): user = self.user resp['is_bookmarked'] = chapter.is_bookmarked(user) resp['progress'] = self.user.chapter_progress(resp['url']) # Fetch next chapter in background next_url = resp['next_chapter_url'] if next_url is not None: taskqueue.add(queue_name='fetch-chapter', url='/workers/fetch-chapter', params={'url': next_url}) return resp
def get(self): chapters = [create_or_get_chapter(url) for url in self.user.bookmarked_chapters] return [{ 'series_url': chapter.series_url, 'series_name': chapter.series_name, 'name': chapter.name, 'url': chapter.url, } for chapter in chapters]
def get(self): chapters = [ create_or_get_chapter(url) for url in self.user.bookmarked_chapters ] return [{ 'series_url': chapter.series_url, 'series_name': chapter.series_name, 'name': chapter.name, 'url': chapter.url, } for chapter in chapters]
def get(self, query=None): url = unquote(query) chapter = create_or_get_chapter(url) series = create_or_get_series(chapter.series_url) template = jinja.get_template('series.html') self.response.write(template.render({ 'title': '%s - %s' % (chapter.name, chapter.series_name), 'thumb_url': chapter.pages[0], 'descriptions': series.description if series.description else [], }))
def get(self, query=None): url = unquote(query) chapter = create_or_get_chapter(url) series = create_or_get_series(chapter.series_url) template = jinja.get_template('series.html') self.response.write( template.render({ 'title': '%s - %s' % (chapter.name, chapter.series_name), 'thumb_url': chapter.pages[0], 'descriptions': series.description if series.description else [], }))
def get(self): chapter = create_or_get_chapter(self.data['url']) resp = { 'name': chapter.name, 'url': chapter.url, 'pages': chapter.pages, 'series_url': chapter.series_url, 'series_name': chapter.series_name, 'next_chapter_url': chapter.next_chapter_url, 'prev_chapter_url': chapter.prev_chapter_url, } if hasattr(self, 'user'): user = self.user resp['is_bookmarked'] = chapter.is_bookmarked(user) resp['progress'] = self.user.chapter_progress(resp['url']) return resp
def post(self): url = self.request.get('url') create_or_get_chapter(url)