Skip to content

Commit

Permalink
Merge pull request #2200 from ardhipoetra/fix_typo_subsribed_channel
Browse files Browse the repository at this point in the history
fix typo includeDispsersy to includeDispersy
  • Loading branch information
whirm committed May 13, 2016
2 parents b60d3b1 + a1c61d0 commit eec02c1
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Tribler/Core/CacheDB/SqliteCacheDBHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -2257,11 +2257,11 @@ def getMostPopularChannels(self, max_nr=20):
"FROM Channels ORDER BY nr_favorite DESC, modified DESC LIMIT ?"
return self._getChannels(sql, (max_nr,), includeSpam=False)

def getMySubscribedChannels(self, includeDispsersy=False):
def getMySubscribedChannels(self, include_dispersy=False):
sql = "SELECT id, name, description, dispersy_cid, modified, nr_torrents, nr_favorite, nr_spam " + \
"FROM Channels, ChannelVotes " + \
"WHERE Channels.id = ChannelVotes.channel_id AND voter_id ISNULL AND vote == 2"
if not includeDispsersy:
if not include_dispersy:
sql += " AND dispersy_cid == -1"

return self._getChannels(sql)
Expand Down
2 changes: 1 addition & 1 deletion Tribler/Core/Modules/restapi/channels_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class ChannelsSubscribedEndpoint(BaseChannelsEndpoint):
"""

def render_GET(self, request):
subscribed_channels_db = self.channel_db_handler.getMySubscribedChannels(includeDispsersy=True)
subscribed_channels_db = self.channel_db_handler.getMySubscribedChannels(include_dispersy=True)
results_json = [self.convert_db_channel_to_json(channel) for channel in subscribed_channels_db]
return json.dumps({"subscribed": results_json})

Expand Down
2 changes: 1 addition & 1 deletion Tribler/Main/vwxGUI/SearchGridManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1005,7 +1005,7 @@ def getAllChannels(self):
return self._createChannels(allchannels)

def getMySubscriptions(self):
subscriptions = self.channelcast_db.getMySubscribedChannels(includeDispsersy=True)
subscriptions = self.channelcast_db.getMySubscribedChannels(include_dispersy=True)
return self._createChannels(subscriptions)

def getPopularChannels(self):
Expand Down
2 changes: 1 addition & 1 deletion Tribler/Test/Core/test_sqlitecachedbhandler_channels.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def test_get_most_popular_channels(self):
self.assertEqual(res[2][0], 8)

def test_get_my_subscribed_channels(self):
res = self.cdb.getMySubscribedChannels(includeDispsersy=True)
res = self.cdb.getMySubscribedChannels(include_dispersy=True)
self.assertEqual(len(res), 1)
res = self.cdb.getMySubscribedChannels()
self.assertEqual(len(res), 0)
Expand Down

0 comments on commit eec02c1

Please sign in to comment.