
    *bi(                         S SK JrJrJrJrJrJr  S SKJr  S SK	J
r
  S SKJr  S SKJr  S SKJr  S SKJrJr  \
S 5       rg	)
   )	task_dicttask_dict_lock	user_data	queued_up	queued_dlqueue_dict_lock)Config)new_task)get_task_by_gid)BotCommands)send_message)start_dl_from_queuedstart_up_from_queuedc                   #    UR                   (       a  UR                   R                  OUR                  R                  nUR                  R	                  5       n[        U5      S:  a  US   S;   a  US   OSnU(       a  [        U5      S:  d  U(       dP  [        U5      S:  aA  U(       a  US   OUS   n[        U5      I S h  vN nUc  [        USU S35      I S h  vN   g OUR                  =n(       aN  [         IS h  vN   [        R                  " U5      nS S S 5      IS h  vN   Wc  [        US5      I S h  vN   g O[        U5      S;   a  S	[        R                  S
    S[        R                  S
    S[        R                  S    S[        R                  S    S[        R                  S    S[        R                  S    S3n[        X5      I S h  vN   g [        R                  U:w  aV  WR                   R"                  U:w  a<  U[$        ;  d  [$        U   R                  S5      (       d  [        US5      I S h  vN   g WR                   nSn[&         IS h  vN   US:X  a>  SUl        UR*                  [,        ;   a   [/        UR*                  5      I S h  vN   SnOSnOUS:X  a>  SUl        UR*                  [2        ;   a   [5        UR*                  5      I S h  vN   SnO{SnOxSUl        SUl        UR*                  [,        ;   a   [/        UR*                  5      I S h  vN   SnO6UR*                  [2        ;   a   [5        UR*                  5      I S h  vN   SnOSnS S S 5      IS h  vN   U(       a  [        X5      I S h  vN   g g  GN GN GN GNx! , IS h  vN  (       d  f       GN= f GN GN GN| GNa GN& N N No N\! , IS h  vN  (       d  f       Nq= f N^7f)N   )fdfu r   zGID: <code>z</code> Not Found.zThis is not an active task!>   r   r   zWReply to an active Command message which was used to start the download/upload.
<code>/    z</code> fd (to remove it from download queue) or fu (to remove it from upload queue) or nothing to start remove it from both download and upload queue.
Also send <code>/z^ GID</code> fu|fd or obly gid to force start by removing the task rom queue!
Examples:
<code>/z%</code> GID fu (force upload)
<code>/zE</code> GID (force download and upload)
By reply to task cmd:
<code>/z+</code> (force download and upload)
<code>/z</code> fd (force download)
SUDOzThis task is not for you!r   Tz'Task have been force started to upload!z#Force upload enabled for this task!r   z.Task have been force started to download only!z This task not in download queue!zTTask have been force started to download and upload will start once download finish!zThis task not in queue!)	from_useridsender_chattextsplitlenr   r   reply_to_message_idr   r   getr   ForceStartCommandr	   OWNER_IDlisteneruser_idr   r   force_uploadmidr   r   force_downloadr   r   )	_messager"   msgstatusgidtaskreply_to_idr!   s	            /app/bot/modules/force_start.pyremove_from_queuer.      sR    &-&7&7g""W=P=P=S=SG
,,


C3x!|A,(>SVBF#c(Q,fSAc!fCF$S))<w+cU:L(MNNN   33	3	3!>==-D "><w(EFFF  
SV	%%a() *//23 4%%a() *%%a() *%%a() *%%a() *	 7(((7"MM!!W,I%Yw-?-C-CF-K-K7$?@@@}}H
CT>$(H!||y(*8<<888?;t^&*H#||y(*8<<888F8&*H#$(H!||y(*8<<888?**8<<888l/3 4 7((( u *N ">>> G 	) 	A  9 9 9 9- 6 	)s<  CO2NO2N #O2NO2N$O2)N!*O2 N?BO2O A)O2	O
O2'O(O2+:O%O&AO)O*AO.O/3O"O#	O,O27O8O2O0O2O2O2!O2$N<*N-+N<7	O2O2O2O2OOOOO2O-OO-)O2N)r   r   r   r   r   r   r   core.config_managerr	   helper.ext_utils.bot_utilsr
   helper.ext_utils.status_utilsr   #helper.telegram_helper.bot_commandsr   $helper.telegram_helper.message_utilsr   helper.ext_utils.task_managerr   r   r.        r-   <module>r7      s9     ) 1 ; = ? V 
A) 
A)r6   