{"action":"created","comment":{"url":"https://api.github.com/repos/newtheatre/history-project/pulls/comments/43426494","id":43426494,"diff_hunk":"@@ -93,67 +160,50 @@ def generate(site)\n           [show.data[\"year_page\"].data[\"sort\"], 1000]\n         end\n       end\n+    end\n \n-      for show, index in sorted_shows.each_with_index do\n-        # Put show into an array as a member of the shows_byt_year hash\n-        # Create that array if this is the first time we've touched this year\n-        (shows_by_year[show.data[\"year\"]] ||= []) << show\n-\n-        # Set sort dependant attributes\n-        show.data[\"index\"] = index\n-        show.data[\"next\"] = sorted_shows[index + 1]\n-        show.data[\"previous\"] = sorted_shows[index - 1]\n-\n-        # Extract cast/crew data for reverse indexing\n-        if show.data.has_key?(\"cast\") and show.data[\"cast\"].class == Array\n-          fill_people_reverse_index(show, show.data[\"cast\"], \"people_ri_shows\", site) end\n-        if show.data.has_key?(\"crew\") and show.data[\"crew\"].class == Array\n-          fill_people_reverse_index(show, show.data[\"crew\"], \"people_ri_shows\", site) end\n-\n-        # Set the show poster attribute, see #117\n-        if show.data[\"assets\"]\n-\n-          # Find assets that fit the criteria for being a display image\n-          override_assets = show.data[\"assets\"].select { |i| i[\"display_image\"] == true }\n-          posters = show.data[\"assets\"].select { |i| i[\"type\"] == \"poster\" }\n-          flyers = show.data[\"assets\"].select { |i|\n-            if i.has_key?(\"page\")\n-              i[\"type\"] == \"flyer\" and not i[\"page\"] > 1\n-            else\n-              i[\"type\"] == \"flyer\"\n-            end\n-          }\n-          programmes = show.data[\"assets\"].select { |i|\n-            if i.has_key?(\"page\")\n-              i[\"type\"] == \"programme\" and not i[\"page\"] > 1\n-            else\n-              i[\"type\"] == \"programme\"\n-            end\n-          }\n-\n-          # Pick one in this order of precedence\n-          if override_assets.size > 0\n-            display_image = override_assets[0]\n-          elsif posters.size > 0\n-            display_image = posters[0]\n-          elsif flyers.size > 0\n-            display_image = flyers[0]\n-          elsif programmes.size > 0\n-            display_image = programmes[0]\n-          end\n-\n-          # Set attrs\n-          if display_image\n-            show.data[\"poster\"] = display_image\n-            show.data[\"display_image\"] = display_image\n-          end\n+    def generate_show_with_index(show, index)\n+      # Set sort dependant attributes\n+      show.data[\"index\"] = index\n+      show.data[\"next\"] = @shows[index + 1]\n+      show.data[\"previous\"] = @shows[index - 1]\n \n-        end\n-      end\n+      # Extract cast/crew data for reverse indexing, this wants to happen to\n+      # the sorted shows so lists on people records are in order\n+      send_people(show, \"cast\")\n+      send_people(show, \"crew\")\n+    end\n+\n+    def sort_shows_by_year(shows)\n+      \"\"\"Returns a hash of shows by year\"\"\"","path":"_plugins/show.rb","position":277,"original_position":277,"commit_id":"f81a7e747a1bd67919b09b98e4be5097163f5b60","original_commit_id":"f81a7e747a1bd67919b09b98e4be5097163f5b60","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Literal `\"\"\"Returns a hash of shows by year\"\"\"` used in void context.","created_at":"2015-10-29T18:34:20Z","updated_at":"2015-10-29T18:34:20Z","html_url":"https://github.com/newtheatre/history-project/pull/118#discussion_r43426494","pull_request_url":"https://api.github.com/repos/newtheatre/history-project/pulls/118","_links":{"self":{"href":"https://api.github.com/repos/newtheatre/history-project/pulls/comments/43426494"},"html":{"href":"https://github.com/newtheatre/history-project/pull/118#discussion_r43426494"},"pull_request":{"href":"https://api.github.com/repos/newtheatre/history-project/pulls/118"}}},"pull_request":{"url":"https://api.github.com/repos/newtheatre/history-project/pulls/118","id":36867879,"html_url":"https://github.com/newtheatre/history-project/pull/118","diff_url":"https://github.com/newtheatre/history-project/pull/118.diff","patch_url":"https://github.com/newtheatre/history-project/pull/118.patch","issue_url":"https://api.github.com/repos/newtheatre/history-project/issues/118","number":118,"state":"open","locked":false,"title":"[WIP] Upgrade to Jekyll3","user":{"login":"wjdp","id":1690934,"avatar_url":"https://avatars.githubusercontent.com/u/1690934?v=3","gravatar_id":"","url":"https://api.github.com/users/wjdp","html_url":"https://github.com/wjdp","followers_url":"https://api.github.com/users/wjdp/followers","following_url":"https://api.github.com/users/wjdp/following{/other_user}","gists_url":"https://api.github.com/users/wjdp/gists{/gist_id}","starred_url":"https://api.github.com/users/wjdp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjdp/subscriptions","organizations_url":"https://api.github.com/users/wjdp/orgs","repos_url":"https://api.github.com/users/wjdp/repos","events_url":"https://api.github.com/users/wjdp/events{/privacy}","received_events_url":"https://api.github.com/users/wjdp/received_events","type":"User","site_admin":false},"body":"Jekyll3 is pre-release but has some pretty nice features including faster build times, incremental builds and hooks.\r\n\r\nSee issues under: https://github.com/newtheatre/history-project/labels/Jekyll3","created_at":"2015-06-03T19:20:20Z","updated_at":"2015-10-29T18:34:20Z","closed_at":null,"merged_at":null,"merge_commit_sha":"200eb0ebb1223c1d9c409e7801dbbf71e2afe13e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/newtheatre/history-project/pulls/118/commits","review_comments_url":"https://api.github.com/repos/newtheatre/history-project/pulls/118/comments","review_comment_url":"https://api.github.com/repos/newtheatre/history-project/pulls/comments{/number}","comments_url":"https://api.github.com/repos/newtheatre/history-project/issues/118/comments","statuses_url":"https://api.github.com/repos/newtheatre/history-project/statuses/f81a7e747a1bd67919b09b98e4be5097163f5b60","head":{"label":"newtheatre:jekyll3","ref":"jekyll3","sha":"f81a7e747a1bd67919b09b98e4be5097163f5b60","user":{"login":"newtheatre","id":11930721,"avatar_url":"https://avatars.githubusercontent.com/u/11930721?v=3","gravatar_id":"","url":"https://api.github.com/users/newtheatre","html_url":"https://github.com/newtheatre","followers_url":"https://api.github.com/users/newtheatre/followers","following_url":"https://api.github.com/users/newtheatre/following{/other_user}","gists_url":"https://api.github.com/users/newtheatre/gists{/gist_id}","starred_url":"https://api.github.com/users/newtheatre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newtheatre/subscriptions","organizations_url":"https://api.github.com/users/newtheatre/orgs","repos_url":"https://api.github.com/users/newtheatre/repos","events_url":"https://api.github.com/users/newtheatre/events{/privacy}","received_events_url":"https://api.github.com/users/newtheatre/received_events","type":"Organization","site_admin":false},"repo":{"id":33888697,"name":"history-project","full_name":"newtheatre/history-project","owner":{"login":"newtheatre","id":11930721,"avatar_url":"https://avatars.githubusercontent.com/u/11930721?v=3","gravatar_id":"","url":"https://api.github.com/users/newtheatre","html_url":"https://github.com/newtheatre","followers_url":"https://api.github.com/users/newtheatre/followers","following_url":"https://api.github.com/users/newtheatre/following{/other_user}","gists_url":"https://api.github.com/users/newtheatre/gists{/gist_id}","starred_url":"https://api.github.com/users/newtheatre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newtheatre/subscriptions","organizations_url":"https://api.github.com/users/newtheatre/orgs","repos_url":"https://api.github.com/users/newtheatre/repos","events_url":"https://api.github.com/users/newtheatre/events{/privacy}","received_events_url":"https://api.github.com/users/newtheatre/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/newtheatre/history-project","description":"Historical record of happenings at the Nottingham New Theatre.","fork":false,"url":"https://api.github.com/repos/newtheatre/history-project","forks_url":"https://api.github.com/repos/newtheatre/history-project/forks","keys_url":"https://api.github.com/repos/newtheatre/history-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/newtheatre/history-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/newtheatre/history-project/teams","hooks_url":"https://api.github.com/repos/newtheatre/history-project/hooks","issue_events_url":"https://api.github.com/repos/newtheatre/history-project/issues/events{/number}","events_url":"https://api.github.com/repos/newtheatre/history-project/events","assignees_url":"https://api.github.com/repos/newtheatre/history-project/assignees{/user}","branches_url":"https://api.github.com/repos/newtheatre/history-project/branches{/branch}","tags_url":"https://api.github.com/repos/newtheatre/history-project/tags","blobs_url":"https://api.github.com/repos/newtheatre/history-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/newtheatre/history-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/newtheatre/history-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/newtheatre/history-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/newtheatre/history-project/statuses/{sha}","languages_url":"https://api.github.com/repos/newtheatre/history-project/languages","stargazers_url":"https://api.github.com/repos/newtheatre/history-project/stargazers","contributors_url":"https://api.github.com/repos/newtheatre/history-project/contributors","subscribers_url":"https://api.github.com/repos/newtheatre/history-project/subscribers","subscription_url":"https://api.github.com/repos/newtheatre/history-project/subscription","commits_url":"https://api.github.com/repos/newtheatre/history-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/newtheatre/history-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/newtheatre/history-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/newtheatre/history-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/newtheatre/history-project/contents/{+path}","compare_url":"https://api.github.com/repos/newtheatre/history-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/newtheatre/history-project/merges","archive_url":"https://api.github.com/repos/newtheatre/history-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/newtheatre/history-project/downloads","issues_url":"https://api.github.com/repos/newtheatre/history-project/issues{/number}","pulls_url":"https://api.github.com/repos/newtheatre/history-project/pulls{/number}","milestones_url":"https://api.github.com/repos/newtheatre/history-project/milestones{/number}","notifications_url":"https://api.github.com/repos/newtheatre/history-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/newtheatre/history-project/labels{/name}","releases_url":"https://api.github.com/repos/newtheatre/history-project/releases{/id}","created_at":"2015-04-13T19:20:13Z","updated_at":"2015-10-26T00:58:07Z","pushed_at":"2015-10-29T18:34:13Z","git_url":"git://github.com/newtheatre/history-project.git","ssh_url":"git@github.com:newtheatre/history-project.git","clone_url":"https://github.com/newtheatre/history-project.git","svn_url":"https://github.com/newtheatre/history-project","homepage":"http://history.newtheatre.org.uk","size":223415,"stargazers_count":8,"watchers_count":8,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":86,"forks":3,"open_issues":86,"watchers":8,"default_branch":"master"}},"base":{"label":"newtheatre:master","ref":"master","sha":"e8485dac051ecf33a9f3ed851e8cf696fb73205d","user":{"login":"newtheatre","id":11930721,"avatar_url":"https://avatars.githubusercontent.com/u/11930721?v=3","gravatar_id":"","url":"https://api.github.com/users/newtheatre","html_url":"https://github.com/newtheatre","followers_url":"https://api.github.com/users/newtheatre/followers","following_url":"https://api.github.com/users/newtheatre/following{/other_user}","gists_url":"https://api.github.com/users/newtheatre/gists{/gist_id}","starred_url":"https://api.github.com/users/newtheatre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newtheatre/subscriptions","organizations_url":"https://api.github.com/users/newtheatre/orgs","repos_url":"https://api.github.com/users/newtheatre/repos","events_url":"https://api.github.com/users/newtheatre/events{/privacy}","received_events_url":"https://api.github.com/users/newtheatre/received_events","type":"Organization","site_admin":false},"repo":{"id":33888697,"name":"history-project","full_name":"newtheatre/history-project","owner":{"login":"newtheatre","id":11930721,"avatar_url":"https://avatars.githubusercontent.com/u/11930721?v=3","gravatar_id":"","url":"https://api.github.com/users/newtheatre","html_url":"https://github.com/newtheatre","followers_url":"https://api.github.com/users/newtheatre/followers","following_url":"https://api.github.com/users/newtheatre/following{/other_user}","gists_url":"https://api.github.com/users/newtheatre/gists{/gist_id}","starred_url":"https://api.github.com/users/newtheatre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/newtheatre/subscriptions","organizations_url":"https://api.github.com/users/newtheatre/orgs","repos_url":"https://api.github.com/users/newtheatre/repos","events_url":"https://api.github.com/users/newtheatre/events{/privacy}","received_events_url":"https://api.github.com/users/newtheatre/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/newtheatre/history-project","description":"Historical record of happenings at the Nottingham New Theatre.","fork":false,"url":"https://api.github.com/repos/newtheatre/history-project","forks_url":"https://api.github.com/repos/newtheatre/history-project/forks","keys_url":"https://api.github.com/repos/newtheatre/history-project/keys{/key_id}","collaborators_url":"https://api.github.com/repos/newtheatre/history-project/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/newtheatre/history-project/teams","hooks_url":"https://api.github.com/repos/newtheatre/history-project/hooks","issue_events_url":"https://api.github.com/repos/newtheatre/history-project/issues/events{/number}","events_url":"https://api.github.com/repos/newtheatre/history-project/events","assignees_url":"https://api.github.com/repos/newtheatre/history-project/assignees{/user}","branches_url":"https://api.github.com/repos/newtheatre/history-project/branches{/branch}","tags_url":"https://api.github.com/repos/newtheatre/history-project/tags","blobs_url":"https://api.github.com/repos/newtheatre/history-project/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/newtheatre/history-project/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/newtheatre/history-project/git/refs{/sha}","trees_url":"https://api.github.com/repos/newtheatre/history-project/git/trees{/sha}","statuses_url":"https://api.github.com/repos/newtheatre/history-project/statuses/{sha}","languages_url":"https://api.github.com/repos/newtheatre/history-project/languages","stargazers_url":"https://api.github.com/repos/newtheatre/history-project/stargazers","contributors_url":"https://api.github.com/repos/newtheatre/history-project/contributors","subscribers_url":"https://api.github.com/repos/newtheatre/history-project/subscribers","subscription_url":"https://api.github.com/repos/newtheatre/history-project/subscription","commits_url":"https://api.github.com/repos/newtheatre/history-project/commits{/sha}","git_commits_url":"https://api.github.com/repos/newtheatre/history-project/git/commits{/sha}","comments_url":"https://api.github.com/repos/newtheatre/history-project/comments{/number}","issue_comment_url":"https://api.github.com/repos/newtheatre/history-project/issues/comments{/number}","contents_url":"https://api.github.com/repos/newtheatre/history-project/contents/{+path}","compare_url":"https://api.github.com/repos/newtheatre/history-project/compare/{base}...{head}","merges_url":"https://api.github.com/repos/newtheatre/history-project/merges","archive_url":"https://api.github.com/repos/newtheatre/history-project/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/newtheatre/history-project/downloads","issues_url":"https://api.github.com/repos/newtheatre/history-project/issues{/number}","pulls_url":"https://api.github.com/repos/newtheatre/history-project/pulls{/number}","milestones_url":"https://api.github.com/repos/newtheatre/history-project/milestones{/number}","notifications_url":"https://api.github.com/repos/newtheatre/history-project/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/newtheatre/history-project/labels{/name}","releases_url":"https://api.github.com/repos/newtheatre/history-project/releases{/id}","created_at":"2015-04-13T19:20:13Z","updated_at":"2015-10-26T00:58:07Z","pushed_at":"2015-10-29T18:34:13Z","git_url":"git://github.com/newtheatre/history-project.git","ssh_url":"git@github.com:newtheatre/history-project.git","clone_url":"https://github.com/newtheatre/history-project.git","svn_url":"https://github.com/newtheatre/history-project","homepage":"http://history.newtheatre.org.uk","size":223415,"stargazers_count":8,"watchers_count":8,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":86,"forks":3,"open_issues":86,"watchers":8,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/newtheatre/history-project/pulls/118"},"html":{"href":"https://github.com/newtheatre/history-project/pull/118"},"issue":{"href":"https://api.github.com/repos/newtheatre/history-project/issues/118"},"comments":{"href":"https://api.github.com/repos/newtheatre/history-project/issues/118/comments"},"review_comments":{"href":"https://api.github.com/repos/newtheatre/history-project/pulls/118/comments"},"review_comment":{"href":"https://api.github.com/repos/newtheatre/history-project/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/newtheatre/history-project/pulls/118/commits"},"statuses":{"href":"https://api.github.com/repos/newtheatre/history-project/statuses/f81a7e747a1bd67919b09b98e4be5097163f5b60"}}}}