Skip to content

Commit

Permalink
Changed F/E to load gifs locally
Browse files Browse the repository at this point in the history
  • Loading branch information
sourishkrout committed Sep 18, 2018
1 parent 7e9cda9 commit 73aa189
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 7 deletions.
1 change: 0 additions & 1 deletion lib/shortcode.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@
"VoteUniversityofkansasCoolSunglasses": ":universityofkansas-cool-sunglasses-26BGG0Vj4nulivlO8:",
"VoteFunnyGifArtistG": ":funny-gif-artist-g-u0aCCHXiIOXA9fHOEB:",
"VoteNflSmithTrequanTreQuan": ":nfl-smith-trequan-tre-quan-OkjN1aAB7z7njXRLdr:",
"VoteNflBakerMayfield": ":nfl-baker-mayfield-182RV9ta1F6v1iXhHl:",
"VoteLoveKissHeart": ":love-kiss-heart-xUOwGeHJEQ46pdsvWE:",
"VoteStudiosoriginalsValentinesDayHappy": ":studiosoriginals-valentines-day-happy-l3q2LJoEChm4UE7FS:",
"VoteKawaiiDumpsterFire": ":kawaii-dumpster-fire-1wXeLxuTVBZe0Ht7Zu:",
Expand Down
2 changes: 1 addition & 1 deletion proto/Voting.proto
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ service VotingService {
rpc VoteNewGirlNewGirlJessDayNewgirl (VoteRequest) returns (VoteResponse);
rpc VoteNext (VoteRequest) returns (VoteResponse);
rpc VoteNfl (VoteRequest) returns (VoteResponse);
rpc VoteNflBakerMayfield (VoteRequest) returns (VoteResponse);
rpc VoteNflSmithTrequanTreQuan (VoteRequest) returns (VoteResponse);
rpc VoteOscarsAcademyAwards1997 (VoteRequest) returns (VoteResponse);
rpc VoteOxygenmediaSideEyeNoYouDidntDeitrickHaddon (VoteRequest) returns (VoteResponse);
Expand All @@ -98,6 +97,7 @@ service VotingService {
rpc VoteThanksThankyouOmerismos (VoteRequest) returns (VoteResponse);
rpc VoteThebacheloretteDanceKiss (VoteRequest) returns (VoteResponse);
rpc VoteThephizzogs (VoteRequest) returns (VoteResponse);
rpc VoteTheXFiles (VoteRequest) returns (VoteResponse);
rpc VoteThisisgiphyReactionAudience (VoteRequest) returns (VoteResponse);
rpc VoteTommywiseauFootballSuperBowl (VoteRequest) returns (VoteResponse);
rpc VoteUniversityofkansasCoolSunglasses (VoteRequest) returns (VoteResponse);
Expand Down
1 change: 0 additions & 1 deletion services/nodevoto-gif/Gif.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class Gif {
':universityofkansas-cool-sunglasses-26BGG0Vj4nulivlO8:',
':funny-gif-artist-g-u0aCCHXiIOXA9fHOEB:',
':nfl-smith-trequan-tre-quan-OkjN1aAB7z7njXRLdr:',
':nfl-baker-mayfield-182RV9ta1F6v1iXhHl:',
':love-kiss-heart-xUOwGeHJEQ46pdsvWE:',
':studiosoriginals-valentines-day-happy-l3q2LJoEChm4UE7FS:',
':kawaii-dumpster-fire-1wXeLxuTVBZe0Ht7Zu:',
Expand Down
4 changes: 2 additions & 2 deletions services/nodevoto-web/webapp/js/components/Vote.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default class Vote extends React.Component {

renderGifList(gifs) {
return _.map(gifs, (gif, i) => {
let url = gif.url.replace("https://media2.giphy.com/media/", "gifs/");
let url = `gifs/${gif.url.substr(gif.url.indexOf(".giphy.com/media/")+17)}`;
return (
<div
className="gif gif-votable"
Expand Down Expand Up @@ -132,7 +132,7 @@ export default class Vote extends React.Component {
containerClass="background"
/>;
} else {
let url = this.state.selectedGif.url.replace("https://media2.giphy.com/media/", "gifs/");
let url = `gifs/${this.state.selectedGif.url.substr(this.state.selectedGif.url.indexOf(".giphy.com/media/")+17)}`;
let contents = (
<div>
<p>See how you stack up against others</p>
Expand Down
2 changes: 1 addition & 1 deletion test/nodevoto-gif/Gif.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ describe('Gif', () => {
expect(results).not.equal(null);
expect(results[10].url).equal('https://media1.giphy.com/media/3o7absbD7PbTFQa0c8/100w.gif');
expect(results[10].shortcode).equal(':spongebob-cartoon-nickelodeon-thumbs-3o7absbD7PbTFQa0c8:');
expect(results.length).equal(86);
expect(results.length).equal(85);
});

it('should have all gif from the generated code map', async() => {
Expand Down
2 changes: 1 addition & 1 deletion test/nodevoto-gif/api.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('api (gif)', () => {
it('should return all gifs when ListAll is called', async() => {
let response = await wrap(impls.ListAll)();

expect(response.list.length).equals(86);
expect(response.list.length).equals(85);

expect(response.list[5].url).equals('https://media3.giphy.com/media/3oKIPlAKUjRpoc3duw/100w.gif');
expect(response.list[5].shortcode).equals(':gotham-foxtv-fox-broadcasting-3oKIPlAKUjRpoc3duw:');
Expand Down

0 comments on commit 73aa189

Please sign in to comment.