HandyCache форум

Главная категория => English forum => Тема начата: truefriend-cz от 07 июля 2017, 12:10:41



Название: Extension - Save file priority
Отправлено: truefriend-cz от 07 июля 2017, 12:10:41
Hi. I make extension and have problem with this code:
Код:
			if re.match (hc.url, [[\.(jpe?g|bmp|png|webp|gif)(\?|$)]]) then
local fLen = GetContentLength(hc.answer_header) -- for get size from server
if hc.cache_file_name ~= nil and not hc.cache_file_size == fLen then -- check local size and size from server
hc.sleep(300)
hc.action = 'save'
hc.put_msg(1, 'Name: '..hc.cache_file_name) -- For testing for new file names (no show filename)
hc.monitor_string = ', (Image NET)'
do return end
end
hc.action = 'dont_update'
hc.put_msg(1, 'Saved name: '..hc.cache_file_name) -- For testing for saved names (this show OK)
hc.monitor_string = ', (Image)'
end
but do not show file name on Image NET struct. Output is "Name: "
Output on Image struct is normal "Saved name: " CachePath/Subpath/File.jpg

How i can fix code on Image NET struct for show saved new file names from cache?


Название: Re: Extension - Save file priority
Отправлено: truefriend-cz от 13 июля 2017, 19:47:57
Mai62 please, do you can help me with this? Any solution?


Название: Re: Extension - Save file priority
Отправлено: mai62 от 13 июля 2017, 21:12:07
Цитировать
but do not show file name on Image NET struct. Output is "Name: "
It means the file is in the cache at the moment is still not created. Move your code in the handler of another event handler.


Название: Re: Extension - Save file priority
Отправлено: truefriend-cz от 14 июля 2017, 10:15:24
Thank you very much.  :thanks:

I have a question if sorting in the documentation is sorted according to how it goes through processing the program (step by step or something is being processed at the same time (in parallel).).

1.Init
2.Options
3.Timer1s
4.Timer1m
5.URLToFileNameConverting
6.BeforeViewInMonitor
7.RequestHeaderReceived
8.BeforeRequestHeaderSend
9.BeforeRequestBodySend
10.AnswerHeaderReceived
11:BeforeAnswerHeaderSend
12.BeforeAnswerBodySend
13.Destroy