From 0ebb1294ecaf4d62ad6b3e911be6275248c05354 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 27 Nov 2016 21:02:54 +0300 Subject: correct type for ServiceExists() - bool --- plugins/Watrack/myshows/i_myshows_api.inc | 21 +++------------------ plugins/Watrack/myshows/myshows.pas | 11 ++++------- 2 files changed, 7 insertions(+), 25 deletions(-) (limited to 'plugins/Watrack/myshows') diff --git a/plugins/Watrack/myshows/i_myshows_api.inc b/plugins/Watrack/myshows/i_myshows_api.inc index f753da56f4..25593311d7 100644 --- a/plugins/Watrack/myshows/i_myshows_api.inc +++ b/plugins/Watrack/myshows/i_myshows_api.inc @@ -36,7 +36,7 @@ begin end; StrCopyW(StrCopyEW(buf,'MyShows: '),TranslateW(ppc)); - if ServiceExists(MS_POPUP_SHOWMESSAGEW)<>0 then + if ServiceExists(MS_POPUP_SHOWMESSAGEW) then CallService(MS_POPUP_SHOWMESSAGEW,TWPARAM(@buf),SM_WARNING) else MessageBoxW(0,@buf,'ERROR',MB_ICONERROR) @@ -195,23 +195,11 @@ begin 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 -{ - if si.cover=nil then - begin - jn:=json_get(jroot,'show'); - img:=json_as_string(json_get(jn,'image')); - si:=pointer(CallService(MS_WAT_RETURNGLOBAL,WAT_INF_UNICODE,0)); - FastAnsiToWide(img,pSongInfoW(si)^.cover); - json_free(img); - end; -} - //!! add option to show it?? - if ServiceExists(MS_POPUP_SHOWMESSAGEW)<>0 then + if ServiceExists(MS_POPUP_SHOWMESSAGEW) then begin jn:=json_get(jroot,'show'); shId:=json_as_string(json_get(jn,'title')); @@ -232,9 +220,6 @@ 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; diff --git a/plugins/Watrack/myshows/myshows.pas b/plugins/Watrack/myshows/myshows.pas index 53925f857b..cc89e9be16 100644 --- a/plugins/Watrack/myshows/myshows.pas +++ b/plugins/Watrack/myshows/myshows.pas @@ -109,13 +109,10 @@ begin begin if pSongInfo(lParam).width>0 then // for video only begin -//!! if ServiceExists(MS_JSON_GETINTERFACE)<>0 then - begin - timervalue:=integer(pSongInfo(lParam).total)*10*msh_scrobpos; // 1000(msec) div 100(%) - if timervalue=0 then - timervalue:=DefTimerValue; - hTimer:=SetTimer(0,0,timervalue,@TimerProc); - end; + timervalue:=integer(pSongInfo(lParam).total)*10*msh_scrobpos; // 1000(msec) div 100(%) + if timervalue=0 then + timervalue:=DefTimerValue; + hTimer:=SetTimer(0,0,timervalue,@TimerProc); end; end; end; -- cgit v1.2.3