summaryrefslogtreecommitdiff
path: root/plugins/Watrack/myshows
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Watrack/myshows')
-rw-r--r--plugins/Watrack/myshows/i_myshows_api.inc16
-rw-r--r--plugins/Watrack/myshows/i_myshows_dlg.inc12
2 files changed, 15 insertions, 13 deletions
diff --git a/plugins/Watrack/myshows/i_myshows_api.inc b/plugins/Watrack/myshows/i_myshows_api.inc
index 6341793016..f753da56f4 100644
--- a/plugins/Watrack/myshows/i_myshows_api.inc
+++ b/plugins/Watrack/myshows/i_myshows_api.inc
@@ -42,7 +42,7 @@ begin
MessageBoxW(0,@buf,'ERROR',MB_ICONERROR)
end;
-function GetMD5Str(digest:TMD5Hash; buf:pAnsiChar):PAnsiChar;
+function GetMD5Str(const digest:TMD5Hash; buf:pAnsiChar):PAnsiChar;
begin
buf[00]:=HexDigitChrLo[digest[00] shr 4]; buf[01]:=HexDigitChrLo[digest[00] and $0F];
buf[02]:=HexDigitChrLo[digest[01] shr 4]; buf[03]:=HexDigitChrLo[digest[01] and $0F];
@@ -189,11 +189,13 @@ begin
// Show mark as "watching"
pc:=StrCopyE(buf,API_URL+'profile/shows/');
FastWideToAnsiBuf(shId,pc);
+ {!!json_free(shId);} mir_free(shId);
StrCat(pc,'/watching');
if SendMSRequest(buf,show) then
begin
// Episode check
StrCopy(StrCopyE(buf,API_URL+'profile/episodes/check/'),epId);
+// json_free(epId); // !! cause memory error (no need for GetName?)
// StrCopy(request,API_URL+'profile/shows/');
if SendMSRequest(buf,show) then
begin
@@ -206,17 +208,16 @@ begin
FastAnsiToWide(img,pSongInfoW(si)^.cover);
json_free(img);
end;
-}
+}
+
//!! add option to show it??
if ServiceExists(MS_POPUP_SHOWMESSAGEW)<>0 then
begin
- json_free(shId);
- json_free(epId);
-
jn:=json_get(jroot,'show');
shId:=json_as_string(json_get(jn,'title'));
jn:=json_get(jn,'episodes');
+ jn:=json_get(jn,'episodes');
pWideChar(epId):=json_as_string(json_get(jn,'title'));
mGetMem(pc,1024);
@@ -231,12 +232,13 @@ begin
'" checked');
CallService(MS_POPUP_SHOWMESSAGEW,TWPARAM(pc),SM_NOTIFY);
mFreeMem(pc);
+
+ {!!json_free(shId);} mir_free(shId);
+ {!!json_free(epId);} mir_free(epId);
end;
result:=true;
end;
end;
- json_free(shId);
- json_free(epId);
json_delete(jroot);
end;
diff --git a/plugins/Watrack/myshows/i_myshows_dlg.inc b/plugins/Watrack/myshows/i_myshows_dlg.inc
index 1f51ed7d11..da128900d9 100644
--- a/plugins/Watrack/myshows/i_myshows_dlg.inc
+++ b/plugins/Watrack/myshows/i_myshows_dlg.inc
@@ -3,13 +3,13 @@
const
kinopoisk_info = 'http://www.kinopoisk.ru/level/1/film/';
-procedure ClearInfo(dlg:HWND);
+procedure ClearInfo(Dlg:HWND);
begin
- SetDlgItemTextW(dlg,IDC_DATA_SERIES ,'');
- SetDlgItemTextW(dlg,IDC_DATA_EPISODE,'');
- SetDlgItemTextW(dlg,IDC_DATA_TAGS ,'');
- SetDlgItemTextW(dlg,IDC_DATA_TAGS ,'');
- SetDlgItemTextW(dlg,IDC_DATA_INFO ,'');
+ SetDlgItemTextW(Dlg,IDC_DATA_SERIES ,'');
+ SetDlgItemTextW(Dlg,IDC_DATA_EPISODE,'');
+ SetDlgItemTextW(Dlg,IDC_DATA_TAGS ,'');
+ SetDlgItemTextW(Dlg,IDC_DATA_TAGS ,'');
+ SetDlgItemTextW(Dlg,IDC_DATA_INFO ,'');
end;
function DlgProcOptions(Dialog:HWND;hMessage:uint;wParam:WPARAM;lParam:LPARAM):LRESULT; stdcall;