def chapter_info(self, jsoup, **kwargs):

        jsoup = utils.loads(jsoup)

        pages = self._chapter_pages(jsoup['images'])
        # name = self._chapter_name(soup)
        # series_url = self._chapter_series_url(soup)
        # prev, next = self._chapter_prev_next(soup)
        return {
            'name': None,
            'pages': pages,
            'series_url': None,
            'next_chapter_url': None,
            'prev_chapter_url': None,
        }
Beispiel #2
0
    def editable_save(self):
        _ = self.R
        with ResponseHTTP(_.response) as resp:
            _in = u'Success'
            code, status = ResponseHTTP.OK
            qry = Group.query

            rdict = utils.loads(_.params.get("row", None))

            group = qry.get(rdict.get('id', None))
            group.name = rdict.get('name', '')
            group.slug = rdict.get('name', '')

        return resp.to_json(_in,
                            code=code,
                            status=status)
Beispiel #3
0
    def editable_save(self):
        _ = self.R
        with ResponseHTTP(_.response) as resp:
            _in = u'Success'
            code, status = ResponseHTTP.OK
            qry = SliderImage.query

            rdict = utils.loads(_.params.get("row", None))
            slide = Slider.query.get(rdict.get("pid", None))
            sliderimg = qry.get(rdict.get('id', None))
            sliderimg.image = rdict.get('name', '')
            sliderimg.url = rdict.get('name', '')
            sliderimg.sliders = slide

        return resp.to_json(_in,
                            code=code,
                            status=status)
Beispiel #4
0
    def editable_save(self):
        _ = self.R
        with ResponseHTTP(_.response) as resp:
            _in = u'Success'
            code, status = ResponseHTTP.OK
            qry = Slider.query

            rdict = utils.loads(_.params.get("row", None))

            slider = qry.get(rdict.get('id', None))
            slider.name = rdict.get('name', '')
            slider.slug = rdict.get('name', '')
            slider.category = rdict.get('category', 'JD')
            slider.type = rdict.get('type', 'HR')

        return resp.to_json(_in,
                            code=code,
                            status=status)
Beispiel #5
0
    def editable_save(self):
        _ = self.R
        with ResponseHTTP(_.response) as resp:
            _in = u'Success'
            code, status = ResponseHTTP.OK
            qry = Season.query

            rdict = utils.loads(_.params.get("row", None))

            season = qry.get(rdict.get('id', None))
            season.title = rdict.get('title', '')
            season.slug = rdict.get('title', '')
            season.category = rdict.get('category', 'JD')
            season.type = rdict.get('type', 'winter')
            season.year = rdict.get('year', 0)

        return resp.to_json(_in,
                            code=code,
                            status=status)
    def series_info(self, jsonUnparsed):

        jsoup = utils.loads(jsonUnparsed)
        chapters = self._chapters(jsoup)
        thumb_url, tags = self._thumbnail_url_and_tags(jsoup)
        name = self._name(jsoup)
        aka = self._alias(jsoup)
        status = self._status(jsoup)
        description = self._description(jsoup)
        authors = self._authors(jsoup)
        artists = self._artists(jsoup)

        return {
            'chapters': chapters,
            'thumb_url': thumb_url,
            'name': name,
            'aka': aka,
            'tags': tags,
            'status': status,
            'description': description,
            'authors': authors,
            'artists': artists,
            'site': self.netlocs[1]
        }
Beispiel #7
0
    def editable_save(self):
        _ = self.R
        with ResponseHTTP(_.response) as resp:
            _in = u'Failed'
            code, status = ResponseHTTP.BAD_REQUEST
            qry = Manga.query

            rdict = utils.loads(_.params.get("row", None))
            if rdict is not None and len(rdict) > 0:
                series = qry.get(rdict.get('id', None))
                series.title = rdict.get('title', 'no title')
                series.set_authors(rdict.get('authors', ''))
                series.set_artist(rdict.get('artist', ''))
                series.description = rdict.get('description', '')
                series.category = rdict.get('category', 'ja')
                series.released = rdict.get('released', None)
                series.status = rdict.get('status', None)

                _in = u'Success'
                code, status = ResponseHTTP.OK

        return resp.to_json(_in,
                            code=code,
                            status=status)
Beispiel #8
0
    def editable_save(self):
        _ = self.R
        with ResponseHTTP(_.response) as resp:
            _in = u'Failed'
            code, status = ResponseHTTP.BAD_REQUEST
            qry = Chapter.query

            rdict = utils.loads(_.params.get("row", None))
            if rdict is not None and len(rdict) > 0:
                # manga = Manga.query.filter(Manga.id == rdict.get('mangaid', None)).first()
                # manga_title = "-".join([manga.type, manga.title])
                lang = ISOLang.query.filter(ISOLang.iso == rdict.get('lang', 'en')).first()
                chapter = qry.get(rdict.get('id', None))
                chapter.title = rdict.get('title', None)
                chapter.volume = rdict.get('volume', None)
                chapter.chapter = rdict.get('chapter', None)
                chapter.lang = lang

                _in = u'Success'
                code, status = ResponseHTTP.OK

        return resp.to_json(_in,
                            code=code,
                            status=status)