|
25 | 25 | from . import musicbrainz as mb |
26 | 26 | from . import imagehosting |
27 | 27 | from . import goodreads |
28 | | -from .googlebooks import find_cover |
| 28 | +from .googlebooks import find_cover, find_categories |
29 | 29 | from .ffmpeg import FFMpeg |
30 | 30 | from . import templating as bb |
31 | 31 | from .submission import (Submission, form_field, finalize, cat_map, |
@@ -934,8 +934,10 @@ def _render_form_description(self): |
934 | 934 |
|
935 | 935 |
|
936 | 936 | class BookSubmission(BbSubmission): |
937 | | - default_fields = BbSubmission.default_fields + ("isbn", "format", "title", "author", "publisher", "language", "description", "year", "cover", |
938 | | - "title") |
| 937 | + default_fields = BbSubmission.default_fields + ("isbn", "format", "title", |
| 938 | + "author", "publisher", |
| 939 | + "language", "description", |
| 940 | + "year", "cover", "title") |
939 | 941 |
|
940 | 942 | _cat_id = 'book' |
941 | 943 | _form_type = 'E-Books' |
@@ -1003,8 +1005,10 @@ def _render_summary(self): |
1003 | 1005 |
|
1004 | 1006 | @form_field('tags') |
1005 | 1007 | def _render_tags(self): |
| 1008 | + categories = find_categories(self['book']['isbn']) |
1006 | 1009 | authors = self['book']['authors'] |
1007 | | - return uniq(list(format_tag(a['name']) for a in authors)) |
| 1010 | + return uniq(list(format_tag(a['name']) for a in authors) + |
| 1011 | + list(format_tag(a) for a in categories)) |
1008 | 1012 |
|
1009 | 1013 | def _render_section_information(self): |
1010 | 1014 | def gr_author_link(gra): |
@@ -1046,6 +1050,8 @@ def _render_description(self): |
1046 | 1050 | @finalize |
1047 | 1051 | @form_field('image') |
1048 | 1052 | def _render_cover(self): |
| 1053 | + # Goodreads usually won't give you a cover image as they don't have the |
| 1054 | + # the right to distribute them |
1049 | 1055 | if "nophoto" in self['book']['image_url']: |
1050 | 1056 | return find_cover(self['book']['isbn']) |
1051 | 1057 | else: |
|
0 commit comments