From 702e96ddd62f073104a78b70281181eadac97db1 Mon Sep 17 00:00:00 2001 From: Ozzie Isaacs Date: Sat, 31 Jul 2021 09:18:05 +0200 Subject: [PATCH] Update load metadata --- cps/metadata_provider/comicvine.py | 2 +- cps/metadata_provider/google.py | 2 +- cps/metadata_provider/scholar.py | 2 +- cps/static/js/get_meta.js | 2 +- cps/web.py | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cps/metadata_provider/comicvine.py b/cps/metadata_provider/comicvine.py index 633184af..2309fc81 100644 --- a/cps/metadata_provider/comicvine.py +++ b/cps/metadata_provider/comicvine.py @@ -58,7 +58,7 @@ class ComicVine(Metadata): "description": "ComicVine Books", "link": "https://comicvine.gamespot.com/" } - v['url'] = "" + v['url'] = r.get('site_detail_url', "") val.append(v) return val diff --git a/cps/metadata_provider/google.py b/cps/metadata_provider/google.py index b6e4036b..1c26f74c 100644 --- a/cps/metadata_provider/google.py +++ b/cps/metadata_provider/google.py @@ -48,7 +48,7 @@ class Google(Metadata): "id": self.__id__, "description": "Google Books", "link": "https://books.google.com/"} - v['url'] = "" + v['url'] = "https://books.google.com/books?id=" + r['id'] val.append(v) return val diff --git a/cps/metadata_provider/scholar.py b/cps/metadata_provider/scholar.py index 81398840..41a0e7f8 100644 --- a/cps/metadata_provider/scholar.py +++ b/cps/metadata_provider/scholar.py @@ -52,7 +52,7 @@ class scholar(Metadata): v['ratings'] = 0 v['series'] = "" v['cover'] = url_for('static', filename='generic_cover.jpg') - v['url'] = "" + v['url'] = publication.get('pub_url') or publication.get('eprint_url') or "", v['source'] = { "id": self.__id__, "description": "Google Scholar", diff --git a/cps/static/js/get_meta.js b/cps/static/js/get_meta.js index e53104ea..c1d4d5a0 100644 --- a/cps/static/js/get_meta.js +++ b/cps/static/js/get_meta.js @@ -80,7 +80,7 @@ $(function () { type: "get", dataType: "json", success: function success(data) { - console.log(data); + // console.log(data); data.forEach(function(provider) { //$("#metadata_provider").html(""); var checked = ""; diff --git a/cps/web.py b/cps/web.py index 6b98b64e..46897aa9 100644 --- a/cps/web.py +++ b/cps/web.py @@ -84,7 +84,7 @@ except ImportError: @app.after_request def add_security_headers(resp): - # resp.headers['Content-Security-Policy']= "script-src 'self' https://www.googleapis.com https://api.douban.com https://comicvine.gamespot.com;" + resp.headers['Content-Security-Policy']= "script-src 'self'" resp.headers['X-Content-Type-Options'] = 'nosniff' resp.headers['X-Frame-Options'] = 'SAMEORIGIN' resp.headers['X-XSS-Protection'] = '1; mode=block'