diff --git a/cleanup/add_volume.py b/cleanup/add_volume.py deleted file mode 100755 index 4aeae0d..0000000 --- a/cleanup/add_volume.py +++ /dev/null @@ -1,33 +0,0 @@ -#!/usr/bin/python3 -import re - -import ox -import ox.api - -site = 'archive.leftove.rs' -api = ox.api.signin('https://%s/api/' % site) - -for regex, fragments in ( - ['Vol. \d+, No. \d+', ['Vol.', 'No.']], - ['Vol \d+ no \d+', [' Vol ', ' no ']], - ['Vol:\d+ #\d+', ['Vol:', '#']], -): - for doc in api.findDocuments({ - 'query': { - 'conditions': [ - {'key': 'title', 'operator': '=', 'value': fragment} - for fragment in fragments - ], - 'operator': '&' - }, - 'keys': ['id', 'title', 'volume'], - 'range': [0, 10000] - })['data']['items']: - if 'Vol' not in doc.get('volume', ''): - m = re.compile(regex).findall(doc['title']) - if m: - print(m[0], doc['id'], doc['title']) - api.editDocument({ - 'id': doc['id'], - 'volume': m[0].strip() - }) diff --git a/static/js/documentInfoView.leftovers.js b/static/js/documentInfoView.leftovers.js index c4c408b..18f8b47 100644 --- a/static/js/documentInfoView.leftovers.js +++ b/static/js/documentInfoView.leftovers.js @@ -303,18 +303,15 @@ pandora.ui.documentInfoView = function(data, isMixed) { } // Preview - if (!isMultiple && data.extension != 'html') { - + if (data.extension == 'pdf' && !isMultiple) { var $div = $('