
    M@c                     >    d dl mZ d dlmZmZmZmZ  G d de      Zy)    )LoaderPlugin)PCSTPCST_FIDWFEDWFED_FIDc                   D     e Zd ZdgZdZ fdZd Zd Zd Z fdZ	 xZ
S )Podcastzitunes-podcastzXAdds (or removes) the tags necessary for Apple iTunes to identify the file as a podcast.c                     t         t        |   |       | j                  }|j	                  ddd       |j	                  ddd       y )Nz--add
store_truezAdd the podcast frames.)actionhelpz--removezRemove the podcast frames.)superr	   __init__	arg_groupadd_argument)self
arg_parserg	__class__s      6/usr/lib/python3/dist-packages/eyed3/plugins/itunes.pyr   zPodcast.__init__
   sK    gt%j1NN	w|5 	 	7	z,8 	 	:    c                 P   d}t         |j                  vrt               |j                  t         <   d}t        |j                  vrt	        d      |j                  t        <   d}|rCt        d       |j                  | j                  j                         | j                  |       y y )NFTzhttp://eyeD3.nicfit.net/z
	Adding...backup)
r   	frame_setr   r   r   printsaveargsr   _printStatus)r   tagr   s      r   _addzPodcast._add   s    3==(&*fCMM(#D3==(&*+E&FCMM(#D- HHDII,,H-c" r   c                     d}t         t        fD ]  }	 |j                  |= d} |rCt	        d       |j                  | j                  j                         | j                  |       y y # t        $ r Y fw xY w)NFTz	Removing...r   )	r   r   r   KeyErrorr   r   r   r   r   )r   r    r   fids       r   _removezPodcast._remove    s}    h' 	CMM#&	 /"HHDII,,H-c"   s   A**	A65A6c                 t    d}t         |j                  v rd}t        |j                  v rd}t        d|z         y )Nz:-(z:-/z:-)z	iTunes podcast? %s)r   r   r   r   )r   r    statuss      r   r   zPodcast._printStatus.   s7    s}}$F3==($v-.r   c                    t         t        |   |       | j                  r| j                  j                  rt        |       | j                  j                  }| j                  |       | j                  j                  r&| j                  | j                  j                         y | j                  j                  r&| j                  | j                  j                         y y y y )N)r   r	   
handleFile
audio_filer    r   r   r   remover%   addr!   )r   fr    r   s      r   r)   zPodcast.handleFile6   s    gt'*??t22!H//%%Cc"yyT__001		$//--.   3?r   )__name__
__module____qualname__NAMESSUMMARYr   r!   r%   r   r)   __classcell__)r   s   @r   r	   r	      s0    E0G:##/
/ 
/r   r	   N)eyed3.pluginsr   eyed3.id3.appler   r   r   r   r	    r   r   <module>r7      s    & : :;/l ;/r   