Skip to content

Commit

Permalink
stream notification fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ndragomirov committed Aug 21, 2014
1 parent fcf0d2f commit 86ac209
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions chrome/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "Twitch Now",
"version" : "1.1.110",
"version" : "1.1.111",
"default_locale" : "en",
"manifest_version" : 2,
"description" : "Explore games & track your favorite streams on Twitch",
Expand All @@ -20,7 +20,7 @@
"common/lib/app.js"
]
},
"minimum_chrome_version" : "1.1.110",
"minimum_chrome_version" : "1.1.111",
"content_security_policy" : "script-src 'self' https://connect.facebook.net https://ssl.google-analytics.com https://platform.twitter.com; object-src 'self'",
"icons" : {
"16" : "common/icons/32_1.png",
Expand Down
20 changes: 11 additions & 9 deletions common/lib/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,9 +375,7 @@
});

twitchApi.on("authorize", function (){
self.populateUserInfo(function (){

});
self.populateUserInfo(function (){});
self.set("authenticated", true);
});

Expand Down Expand Up @@ -550,7 +548,7 @@
clearTimeout(this.timeout);
twitchApi.send("gamesTop", {}, function (err, res){
this.timeout = setTimeout(this.updateData.bind(this), 5 * 60 * 1000);
if ( err ) {
if ( err || !res.top ) {
return this.trigger("apierror");
}
res.top.forEach(function (g){
Expand All @@ -569,7 +567,11 @@
},

initialize: function (){

var channelName = this.get("channel").name;
this.set({
name: channelName
},
{silent: true});
},

follow: function (cb){
Expand Down Expand Up @@ -679,14 +681,14 @@
getNewStreams: function (){
var ids = this.addedStreams;
return this.filter(function (stream){
return ~ids.indexOf(stream.get("name"));
return ~ids.indexOf(stream.get("_id"));
});
},

addedStreams: [],
notified : [], //store notified streams id here
updateData : function (){
var idsBeforeUpdate = this.pluck("name");
var idsBeforeUpdate = this.pluck("_id");
var idsAfterUpdate;

clearTimeout(this.timeout);
Expand All @@ -703,7 +705,7 @@
}
this.set(res.streams, {silent: true});

idsAfterUpdate = this.pluck("name");
idsAfterUpdate = this.pluck("_id");
this.addedStreams = _.difference(idsAfterUpdate, idsBeforeUpdate, this.notified);
this.notified = _.union(this.addedStreams, this.notified);
this.trigger("update");
Expand Down Expand Up @@ -851,7 +853,7 @@

var addToFollowing = function (stream){
following.add(stream);
following.addedStreams = [stream.name];
following.addedStreams = [stream._id];
notify();
}

Expand Down
2 changes: 1 addition & 1 deletion firefox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Explore games & track your favorite streams on Twitch",
"author" : "Ndragomirov<[email protected]>",
"license" : "MIT",
"version" : "1.1.110",
"version" : "1.1.111",
"permissions": {
"private-browsing" : true,
"unsafe-content-script": true
Expand Down
4 changes: 2 additions & 2 deletions opera/manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name" : "Twitch Now",
"version" : "1.1.110",
"version" : "1.1.111",
"default_locale" : "en",
"manifest_version" : 2,
"description" : "Explore games & track your favorite streams on Twitch",
Expand All @@ -20,7 +20,7 @@
"common/lib/app.js"
]
},
"minimum_chrome_version" : "1.1.110",
"minimum_chrome_version" : "1.1.111",
"content_security_policy" : "script-src 'self' https://connect.facebook.net https://ssl.google-analytics.com https://platform.twitter.com; object-src 'self'",
"icons" : {
"16" : "common/icons/32_1.png",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "twitch-now",
"version": "1.1.110",
"version": "1.1.111",
"description": "Twitch Now",
"devDependencies": {
"grunt": "^0.4.5",
Expand Down
6 changes: 3 additions & 3 deletions templates/gameextended.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<div class="game-preview">
<img class="lazy" data-original="{{game.box.medium}}" alt=""/>
<span class="js-tab" data-href="https://www.g2a.com/r/jdavid214">
<span>buy</span>
</span>
<!--<span class="js-tab" data-href="https://www.g2a.com/r/jdavid214">-->
<!--<span>buy</span>-->
<!--</span>-->
</div>
<span class="stream-info stream-title">
{{game.name}}
Expand Down

0 comments on commit 86ac209

Please sign in to comment.