From 3d62973634da77007c437ccc3605328f2a64f497 Mon Sep 17 00:00:00 2001 From: Yohann D'ANELLO Date: Mon, 10 Feb 2020 04:16:07 +0100 Subject: [PATCH] Generate side identifier --- media/scraper.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/media/scraper.py b/media/scraper.py index 02e8057..931f2c6 100644 --- a/media/scraper.py +++ b/media/scraper.py @@ -99,6 +99,12 @@ class BedetequeScraper: if illustrator: data['author'].append(illustrator.group(1)) - print(data) + side_identifier = "{:.3} {:.3}".format(data['author'][0].upper(), data['title'].upper(),) + if data['subtitle']: + start = data['subtitle'].split(' ')[0].replace('.', '') + print("start:", start) + if start.isnumeric(): + side_identifier += " {:0>2}".format(start,) + data['side_identifier'] = side_identifier return data