File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
7-compute-engine/app/jobs Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change 11
11
# See the License for the specific language governing permissions and
12
12
# limitations under the License.
13
13
14
- # [START lookup_books]
15
14
require "google/apis/books_v1"
16
15
17
16
BooksAPI = Google ::Apis ::BooksV1
@@ -44,8 +43,7 @@ def perform book
44
43
45
44
# List of relevant books
46
45
volumes = results . items
47
- # [END lookup_books]
48
- # [START choose_volume]
46
+
49
47
# To provide the best results, find the first returned book that
50
48
# includes title and author information as well as a book cover image.
51
49
best_match = volumes . find { |volume |
@@ -54,9 +52,7 @@ def perform book
54
52
}
55
53
56
54
volume = best_match || volumes . first
57
- # [END choose_volume]
58
55
59
- # [START update_book]
60
56
if volume
61
57
info = volume . volume_info
62
58
images = info . image_links
@@ -72,10 +68,8 @@ def perform book
72
68
present?
73
69
book . save
74
70
end
75
- # [END update_book]
76
71
77
72
Rails . logger . info "[BookService] (#{ book . id } ) Complete"
78
73
end
79
74
end
80
75
end
81
- # [END book_lookup]
You can’t perform that action at this time.
0 commit comments