diff --git a/cps/metadata_provider/comicvine.py b/cps/metadata_provider/comicvine.py index 00c34599..45e5f341 100644 --- a/cps/metadata_provider/comicvine.py +++ b/cps/metadata_provider/comicvine.py @@ -36,7 +36,7 @@ class ComicVine(Metadata): result = requests.get("https://comicvine.gamespot.com/api/search?api_key=" + apikey + "&resources=issue&query=" + query + "&sort=name:desc&format=json", headers=headers) - for r in result.json()['results']: + for r in result.json().get('results'): seriesTitle = r['volume'].get('name', "") if r.get('store_date'): dateFomers = r.get('store_date') diff --git a/cps/metadata_provider/google.py b/cps/metadata_provider/google.py index cf166f2e..1bc8185b 100644 --- a/cps/metadata_provider/google.py +++ b/cps/metadata_provider/google.py @@ -30,7 +30,7 @@ class Google(Metadata): if self.active: val = list() result = requests.get("https://www.googleapis.com/books/v1/volumes?q="+query.replace(" ","+")) - for r in result.json()['items']: + for r in result.json().get('items'): v = dict() v['id'] = r['id'] v['title'] = r['volumeInfo'].get('title',"") diff --git a/cps/static/js/get_meta.js b/cps/static/js/get_meta.js index 2ad4d53b..aab767a2 100644 --- a/cps/static/js/get_meta.js +++ b/cps/static/js/get_meta.js @@ -40,7 +40,7 @@ $(function () { $("#book_title").val(book.title); $("#tags").val(uniqueTags.join(", ")); $("#rating").data("rating").setValue(Math.round(book.rating)); - if(book.cover){ + if(book.cover && $("#cover_url").length){ $(".cover img").attr("src", book.cover); $("#cover_url").val(book.cover); } diff --git a/cps/templates/book_edit.html b/cps/templates/book_edit.html index 9d2ac14e..57470858 100644 --- a/cps/templates/book_edit.html +++ b/cps/templates/book_edit.html @@ -247,7 +247,7 @@
@@ -265,17 +265,17 @@ >{{_('Author')}}:<%= authors.join(" & ") %>
+ <% if (publisher) { %> -{{_('Publisher')}}:<%= publisher %>
+ <% } %> <% if (description) { %> -{{_('Description')}}: <%= description %>
+ <% } %>{{_('Source')}}: - <%= source.description %> + <%= source.description %>