Great idea! I'll get to it.

On 2/24/06, Gorka Olaizola <[EMAIL PROTECTED]> wrote:
On Fri, Feb 24, 2006 at 12:20:28PM -0500, Justin Wetherell wrote:
>    I have done some code fixing and exception handling; if you are using this
>    I would suggest downloading the new version.
>
I have a suggestion.
In the file rssPeriodic.py there is this code.

def createFxd(item,filename):
   if "mp3" in item.url:
       fullFilename= config.RSS_AUDIO+filename
       ofile = re.sub('mp3','fxd',filename)
   else:
       fullFilename=config.RSS_VIDEO+filename
       if "mov" in item.url:
           ofile = re.sub('mov','fxd',filename)
       elif "avi" in item.url:
           ofile = re.sub('avi','fxd',filename)
       elif "mp4" in item.url:
           ofile = re.sub('mp4','fxd',filename)
       elif "m4v" in item.url:
           ofile = re.sub('m4v','fxd',filename)
       else:
           ofile = re.sub('wmv','fxd',filename)


I think it would be better if
it could use the variables VIDEO_MPLAYER_SUFFIX and VIDEO_XINE_SUFFIX that
are in the config file. It seems there are no SUFFIX variables for audio
extensions but I think ogg or spx could be other suffixes for audio.

The code could be something like this (It's not tested):

def createFxd(item,filename):

AUDIO_SUFFIX = ['mp3', 'ogg', 'spx', 'wma']

is_audio = False

fullFilename=config.RSS_AUDIO+filename

for cur_item in AUDIO_SUFFIX:
     if cur_item in item.url:
         ofile = re.sub(cur_item,'fxd',filename)
         item_is_audio = True

if not is_audio:
     fullFilename=config.RSS_VIDEO+filename

     video_suffixes = config.VIDEO_MPLAYER_SUFFIX + config.VIDEO_XINE_SUFFIX
     for cur_item in video_suffixes:
         if cur_item in item.url:
               ofile = re.sub(cur_item,'fxd',filename)

--


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD/3ZHAJWwPWWa2yoRAuhWAKC2sYZ7s/uNZOPXI/ISe5xo7aP1dQCdENuk
xlQbITPs57eHgn2kZ4e9NEM=
=twDh
-----END PGP SIGNATURE-----



Reply via email to