--------------------------------------------------------------------
--установите 0 , если не хотите диалога в настройках
local ShowConfigDialog=1  
--установите 0 , если не хотите добавления горячих клавиш
local AddHotKeys=1  
--------------------------------------------------------------------

m_simpleTV.Defines.ID_EXT_TORRENTTV_AUTOREFRESH  = m_simpleTV.Defines.ID_EXT_TORRENTTV_HDGROUP+3
m_simpleTV.Defines.ID_EXT_TORRENTTV_NOTADDMENU   = m_simpleTV.Defines.ID_EXT_TORRENTTV_HDGROUP+4
m_simpleTV.Defines.ID_EXT_TORRENTTV_NOT_USE_TVS  = m_simpleTV.Defines.ID_EXT_TORRENTTV_HDGROUP+5

m_simpleTV.Defines.ID_EXT_TORRENTTV_VIP_USE       = m_simpleTV.Defines.ID_EXT_TORRENTTV_HDGROUP+6
m_simpleTV.Defines.ID_EXT_TORRENTTV_VIP_LQGROUP   = m_simpleTV.Defines.ID_EXT_TORRENTTV_HDGROUP+7
m_simpleTV.Defines.ID_EXT_TORRENTTV_VIP_USELQ  = m_simpleTV.Defines.ID_EXT_TORRENTTV_HDGROUP+8

if not string.match(package.path,'user\\TorrentTV\\core' , 0)  then
	package.path = package.path .. ';' .. m_simpleTV.MainScriptDir .. 'user\\TorrentTV\\core\\?.lua'
end

if m_simpleTV.User==nil then m_simpleTV.User={} end
m_simpleTV.User.TorrentTV = {}

require('ttvcore')

AddFileToExecute('getaddress',m_simpleTV.MainScriptDir .. "user/torrentTV/getaddress.lua")
if ShowConfigDialog==1 then
   AddFileToExecute('onconfig',m_simpleTV.MainScriptDir .. "user\\torrentTV\\initconfig.lua")
end   

if AddHotKeys==1 then
  local value=m_simpleTV.Config.GetConfigInt(m_simpleTV.Defines.ID_EXT_TORRENTTV_NOTADDMENU)
  if value~=1 then 
      local zz = m_simpleTV.Interface.GetLanguage() 
      local xx = ''
      if zz =='ru' or zz =='uk' then xx='Обновить плейлист TorrentTV'
      else xx='Update playlist TorrentTV'
      end
	  m_simpleTV.Interface.AddExtMenu_UTF8(xx,'user\\TorrentTV\\TorrentTVRefreshPls.lua',string.byte('T'),3,0,1251)
  end	
end  

value=m_simpleTV.Config.GetConfigInt(m_simpleTV.Defines.ID_EXT_TORRENTTV_UPDATEPLSONREFRESH)
if value==1 then 
   AddFileToExecute('refreshplst',m_simpleTV.MainScriptDir .. "user\\torrentTV\\TorrentTVRefreshPls.lua")
end

value=m_simpleTV.Config.GetConfigInt(m_simpleTV.Defines.ID_EXT_TORRENTTV_UPDATEPLSONSTART)
if value==1 then 
   dofile(m_simpleTV.MainScriptDir .. 'user\\TorrentTV\\TorrentTVRefreshPls.lua')
end 
