Skip to content

Commit

Permalink
track searches and uploads
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed Oct 16, 2023
1 parent 55fa800 commit aba062a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/replica/logic/api.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,13 @@ class ReplicaApi {
break;
}
logger.v('_search(): uri: ${Uri.parse(s)}');

final resp = await dio.get(s);
if (resp.statusCode == 200) {
logger
.v('Statuscode: ${resp.statusCode} || body: ${resp.data.toString()}');
PlausibleUtils.trackUserAction('User searched for Replica content', {
s: s,
});
return ReplicaSearchItem.fromJson(category, resp.data);
} else {
logger.e(
Expand Down
3 changes: 3 additions & 0 deletions lib/replica/logic/uploader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class ReplicaUploader {
method: UploadMethod.POST,
),
);
PlausibleUtils.trackUserAction('User uploaded Replica content', {
fileTitle: fileTitle,
});
}

// TODO <08-10-22, kalli> Figure out how to query endpoint with infohash (for rendering preview after uploading a file)
Expand Down

0 comments on commit aba062a

Please sign in to comment.