diff --git a/move_keywords.py b/move_keywords.py deleted file mode 100755 index 50c43f2..0000000 --- a/move_keywords.py +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/python3 - -import getpass -import json -import sys - -import ox -import ox.web.auth - -site = 'pandora.cinemusespace.com' -api = ox.API('https://%s/api/' % site) -update = False -try: - credentials = ox.web.auth.get(site) -except: - credentials = {} - print('Please provide your username and password for %s:' % site) - credentials['username'] = input('Username: ') - credentials['password'] = getpass.getpass('Password: ') - update = True -r = api.signin(**credentials) -if 'errors' in r.get('data', {}): - for kv in r['data']['errors'].items(): - print('%s: %s' % kv) - sys.exit(1) -if update: - ox.web.auth.update(site, credentials) - -rename = json.load(open(sys.argv[1])) - -for old, new in rename.items(): - for annotation in api.findAnnotations({ - 'query': { - 'conditions': [{ - 'key': 'value', - 'value': old, - 'operator': '==' - }, - { - 'key': 'layer', - 'value': 'keywords', - 'operator': '==' - }], - 'operator': '&' - }, - 'keys': ['id', 'in', 'out', 'value', 'user', 'created'], - 'range': [0, 500000] - })['data']['items']: - print(annotation['id'], annotation['value'], '->', new) - r = api.editAnnotation({'id': annotation['id'], 'value': new}) - print(r.get('status')) diff --git a/split_keywords.py b/split_keywords.py index 13447b7..a84f273 100755 --- a/split_keywords.py +++ b/split_keywords.py @@ -1,15 +1,15 @@ #!/usr/bin/python3 -import getpass -import json -import sys - import ox import ox.web.auth +import json +import sys + +url = 'http://131.111.144.26/api/' + +api = ox.API(url) +site = '131.111.144.26' -site = 'pandora.cinemusespace.com' -api = ox.API('https://%s/api/' % site) -update = False try: credentials = ox.web.auth.get(site) except: @@ -26,7 +26,6 @@ if 'errors' in r.get('data', {}): if update: ox.web.auth.update(site, credentials) - old = [] for annotation in api.findAnnotations({ 'query': { diff --git a/static/html/print.html b/static/html/print.html deleted file mode 100644 index 3587154..0000000 --- a/static/html/print.html +++ /dev/null @@ -1,52 +0,0 @@ - - - diff --git a/static/js/infoView.cms.js b/static/js/infoView.cms.js index 0694293..c7e0fce 100644 --- a/static/js/infoView.cms.js +++ b/static/js/infoView.cms.js @@ -449,7 +449,7 @@ pandora.ui.infoView = function(data) { var $rightsLevel = $('
'); var $div = $('
') .css({marginBottom: '4px'}) - .append(formatKey('Rights Level', 'statistics')) + .append('Rights Level') .append($rightsLevel) .appendTo($statistics); pandora.createLinks($div); @@ -562,10 +562,10 @@ pandora.ui.infoView = function(data) { key = Ox._('Alternative Title' + ( data.alternativeTitles && data.alternativeTitles.length == 1 ? '' : 's' )); - } else if (key == 'Topic') { - key = 'Topics' - } else if (key == 'Actor') { - key = 'Actors' + } else if (key == 'topic') { + key = 'topics' + } else if (key == 'actor') { + key = 'actors' } var value = Ox.toTitleCase(key) .replace(' Of ', ' of ')