From be41a692ba1d5dd169d15621384b8660554f53d2 Mon Sep 17 00:00:00 2001 From: Tobias Gruetzmacher Date: Tue, 31 Dec 2019 00:50:22 +0100 Subject: [PATCH] Slightly better namer for CloneManga modules --- dosagelib/plugins/clonemanga.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/dosagelib/plugins/clonemanga.py b/dosagelib/plugins/clonemanga.py index e00b167d2..8cafa57e2 100644 --- a/dosagelib/plugins/clonemanga.py +++ b/dosagelib/plugins/clonemanga.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Copyright (C) 2004-2008 Tristan Seligmann and Jonathan Jacobs # Copyright (C) 2012-2014 Bastian Kleineidam -# Copyright (C) 2015-2017 Tobias Gruetzmacher +# Copyright (C) 2015-2019 Tobias Gruetzmacher from __future__ import absolute_import, division, print_function @@ -26,7 +26,12 @@ class CloneManga(_ParserScraper): self.endOfLife = endOfLife def namer(self, image_url, page_url): - return '%03d' % int(getQueryParams(page_url)['page'][0]) + origname = image_url.rsplit('/', 1)[1] + params = getQueryParams(page_url) + if 'page' in params: + return '{:03}_{}'.format(int(params['page'][0]), origname) + else: + return origname @classmethod def getmodules(cls):