+  HandyCache форум
|-+  Главная категория» English forum» Extension - Save file priority
Имя пользователя:
Пароль:
Страниц: [1]   Вниз
  Отправить эту тему    Печать  
Автор Тема: Extension - Save file priority  (Прочитано 2234 раз)
0 Пользователей и 1 Гость смотрят эту тему.
truefriend-cz
Постоялец
***

Репутация: +3/-1
Offline Offline

Сообщений: 118


« : 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?
« Последнее редактирование: 07 июля 2017, 12:32:45 от truefriend-cz » Сообщить модератору   Записан
truefriend-cz
Постоялец
***

Репутация: +3/-1
Offline Offline

Сообщений: 118


« Ответ #1 : 13 июля 2017, 19:47:57 »

Mai62 please, do you can help me with this? Any solution?
Сообщить модератору   Записан
mai62
Автор HC
*****

Репутация: +226/-4
Offline Offline

Сообщений: 6383


« Ответ #2 : 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.
Сообщить модератору   Записан
truefriend-cz
Постоялец
***

Репутация: +3/-1
Offline Offline

Сообщений: 118


« Ответ #3 : 14 июля 2017, 10:15:24 »

Thank you very much.  Благодарю

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
Сообщить модератору   Записан
Страниц: [1]   Вверх
  Отправить эту тему    Печать  

 
Перейти в: