Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented endpoint to fetch popular channels #2362

Merged
merged 3 commits into from
Jun 30, 2016

Conversation

devos50
Copy link
Contributor

@devos50 devos50 commented Jun 29, 2016

They are displayed on the front page in the new GUI.

@devos50
Copy link
Contributor Author

devos50 commented Jun 29, 2016

Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/Core/Utilities/twisted_thread.py", line 55, in _reactor_runner
    reactor.run(installSignalHandlers=False)
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1194, in run
    self.mainLoop()
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 1203, in mainLoop
    self.runUntilCurrent()
--- <exception caught here> ---
  File "/usr/lib/python2.7/dist-packages/twisted/internet/base.py", line 825, in runUntilCurrent
    call.func(*call.args, **call.kw)
  File "<string>", line 2, in _do_request

  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/Core/RemoteTorrentHandler.py", line 32, in pass_when_stopped
    return f(self, *argv, **kwargs)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/Core/RemoteTorrentHandler.py", line 455, in _do_request
    trackers = self._torrent_db_handler.getTrackerListByInfohash(infohash)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/Core/CacheDB/SqliteCacheDBHandler.py", line 696, in getTrackerListByInfohash
    torrent_id = self.getTorrentID(infohash)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/Core/CacheDB/SqliteCacheDBHandler.py", line 242, in getTorrentID
    return self.getTorrentIDS([infohash, ]).get(infohash)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/Core/CacheDB/SqliteCacheDBHandler.py", line 262, in getTorrentIDS
    torrents = self._db.fetchall(sql_stmt, to_select)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/dispersy/util.py", line 46, in helper
    return blockingCallFromThread(reactor, func, *args, **kargs)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/dispersy/util.py", line 225, in blockingCallFromThread
    return f(*args, **kwargs)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/Core/CacheDB/sqlitecachedb.py", line 401, in fetchall
    res = self.execute_read(sql, args)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/Core/CacheDB/sqlitecachedb.py", line 310, in execute_read
    return self.execute(sql, args)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/dispersy/util.py", line 46, in helper
    return blockingCallFromThread(reactor, func, *args, **kargs)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/dispersy/util.py", line 225, in blockingCallFromThread
    return f(*args, **kwargs)
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/Core/CacheDB/sqlitecachedb.py", line 263, in execute
    cur = self.get_cursor()
  File "/home/jenkins/workspace/GH_Tribler_PR_tests_linux@2/tribler/Tribler/Core/CacheDB/sqlitecachedb.py", line 196, in get_cursor
    self._cursor_table[thread_name] = self._connection.cursor()
exceptions.AttributeError: 'NoneType' object has no attribute 'cursor'

@devos50
Copy link
Contributor Author

devos50 commented Jun 29, 2016

retest this please

@devos50
Copy link
Contributor Author

devos50 commented Jun 29, 2016

Tests on mac timed out (already created an issue for it)

@devos50
Copy link
Contributor Author

devos50 commented Jun 30, 2016

retest this please

@devos50
Copy link
Contributor Author

devos50 commented Jun 30, 2016

@lfdversluis can you review this one? I will add an error when the limit <= 0.

limit_channels = 10

if 'limit' in request.args and len(request.args['limit']) > 0:
limit_channels = request.args['limit'][0]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do not forget to error here on <= 0 as described in the other PR.

@lfdversluis
Copy link
Contributor

Besides my comment, looks good.

@devos50
Copy link
Contributor Author

devos50 commented Jun 30, 2016

@whirm can you review?

@devos50 devos50 changed the title WIP: Implemented endpoint to fetch popular channels READY: Implemented endpoint to fetch popular channels Jun 30, 2016
@whirm whirm changed the title READY: Implemented endpoint to fetch popular channels Implemented endpoint to fetch popular channels Jun 30, 2016
@whirm whirm merged commit 3a8891e into Tribler:devel Jun 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants