Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 1 addition & 19 deletions Tribler/Core/CacheDB/SqliteCacheDBHandler.py
Original file line number Diff line number Diff line change
Expand Up @@ -1434,7 +1434,7 @@ def __init__(self, session):

self.rlock = threading.RLock()

self.recent_preflist = self.recent_preflist_with_clicklog = self.recent_preflist_with_swarmsize = None
self.recent_preflist = None
self.status_good = None
self._torrent_db = None

Expand Down Expand Up @@ -1501,24 +1501,6 @@ def getRecentLivePrefList(self, num=0):
else:
return self.recent_preflist

def addClicklogToMyPreference(self, infohash, clicklog_data):
torrent_id = self._torrent_db.getTorrentID(infohash)
clicklog_already_stored = False # equivalent to hasMyPreference TODO
if torrent_id is None or clicklog_already_stored:
return False

d = {}
# copy those elements of the clicklog data which are used in the update command
for clicklog_key in ["click_position", "reranking_strategy"]:
if clicklog_key in clicklog_data:
d[clicklog_key] = clicklog_data[clicklog_key]

if d == {}:
self._logger.debug("no updatable information given to addClicklogToMyPreference")
else:
self._logger.debug("addClicklogToMyPreference: updatable clicklog data: %s", d)
self._db.update(self.table_name, 'torrent_id=%d' % torrent_id, **d)

def hasMyPreference(self, torrent_id):
res = self.getOne('torrent_id', torrent_id=torrent_id)
if res is not None:
Expand Down
6 changes: 1 addition & 5 deletions Tribler/Main/vwxGUI/MainFrame.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def startDownloadFromUrl(self, url, destdir=None, cmdline=False, selectedFiles=N
self.guiUtility.Notify("Download from url failed", icon=wx.ART_WARNING)
return False

def startDownload(self, torrentfilename=None, destdir=None, tdef=None, cmdline=False, clicklog=None,
def startDownload(self, torrentfilename=None, destdir=None, tdef=None, cmdline=False,
vodmode=False, hops=0, try_hidden_services=False, fixtorrent=False, selectedFiles=None,
correctedFilename=None, hidden=False):
self._logger.debug(u"startDownload: %s %s %s %s %s", torrentfilename, destdir, tdef, vodmode, selectedFiles)
Expand Down Expand Up @@ -588,10 +588,6 @@ def do_gui():
state_lambda = lambda ds, tdef = orig_tdef, dscfg = dscfg, selectedFiles = selectedFiles: self.monitorHiddenSerivcesProgress(ds, tdef, dscfg, selectedFiles)
result.set_state_callback(state_lambda, delay=40.0)

if clicklog is not None:
mypref = self.utility.session.open_dbhandler(NTFY_MYPREFERENCES)
startWorker(None, mypref.addClicklogToMyPreference, wargs=(tdef.get_infohash(), clicklog))

return result

except DuplicateDownloadException as e:
Expand Down
7 changes: 1 addition & 6 deletions Tribler/Main/vwxGUI/SearchGridManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,18 +197,13 @@ def downloadTorrent(self, torrent, dest=None, secret=False, vodmode=False, selec
torrent_filename = self.getCollectedFilename(torrent)

name = torrent.get('name', torrent.infohash)
clicklog = {'keywords': self.searchkeywords,
'reranking_strategy': self.rerankingStrategy.getID()}

if "click_position" in torrent:
clicklog["click_position"] = torrent["click_position"]

tdef = TorrentDefNoMetainfo(torrent.infohash, torrent.name) \
if not isinstance(torrent_filename, basestring) else None

# Api download
def do_gui():
d = self.guiUtility.frame.startDownload(torrent_filename, tdef=tdef, destdir=dest, clicklog=clicklog,
d = self.guiUtility.frame.startDownload(torrent_filename, tdef=tdef, destdir=dest,
vodmode=vodmode, selectedFiles=selectedFiles)
if d:
if secret:
Expand Down
11 changes: 1 addition & 10 deletions Tribler/schema_sdb_v25.sql
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ CREATE TABLE MyPreference (
torrent_id integer PRIMARY KEY NOT NULL,
destination_path text NOT NULL,
progress numeric,
creation_time integer NOT NULL,
-- V2: Patch for BuddyCast 4
click_position INTEGER DEFAULT -1,
reranking_strategy INTEGER DEFAULT -1
creation_time integer NOT NULL
);

----------------------------------------
Expand Down Expand Up @@ -122,12 +119,6 @@ CREATE VIEW CollectedTorrent AS SELECT * FROM Torrent WHERE torrent_file_name IS
-- for "Network Buzz" feature (removed in v21);
-- Also UserEventLog table for user studies.

CREATE TABLE UserEventLog (
timestamp numeric,
type integer,
message text
);

----------------------------------------
-- v8: BundlerPreference

Expand Down