Skip to content

Commit 71716fe

Browse files
committed
Make kb per second available to lua
1 parent 1b0eca7 commit 71716fe

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/DownloadManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,11 @@ class LunaDownload : public Luna<Download>
11961196
lua_pushnumber(L, p->progress.downloaded);
11971197
return 1;
11981198
}
1199+
static int GetKBPerSecond(T* p, lua_State* L)
1200+
{
1201+
lua_pushnumber(L, atoi(p->speed.c_str()));
1202+
return 1;
1203+
}
11991204
static int GetTotalKB(T* p, lua_State* L)
12001205
{
12011206
lua_pushnumber(L, p->progress.total);
@@ -1210,6 +1215,7 @@ class LunaDownload : public Luna<Download>
12101215
{
12111216
ADD_METHOD(GetTotalKB);
12121217
ADD_METHOD(GetKBDownloaded);
1218+
ADD_METHOD(GetKBPerSecond);
12131219
ADD_METHOD(Stop);
12141220
}
12151221
};

0 commit comments

Comments
 (0)