Changeset 186

Show
Ignore:
Timestamp:
10/24/08 01:57:52 (3 months ago)
Author:
drarok
Message:

* Improved manual checking of feeds using php manage.php update <feed name> by giving feedback.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • hellaworld/branches/autonzb/manage.php

    r185 r186  
    2121// Give the user some help. 
    2222if (in_array('--help', $args)) { 
    23         die("Usage:\n\tphp manage.php remove <show name> [show name] ...\n" 
    24                 ."OR\n" 
     23        die("Usage:\n" 
    2524                ."\tphp manage.php add <url>\n" 
     25                ."OR\n"          
     26                ."\tphp manage.php remove <show name> [show name] ...\n" 
    2627                ."OR\n" 
    2728                ."\tphp manage.php list\n" 
    2829                ."OR\n" 
    29                 ."\tphp manage.php latest <show name> [episode number]" 
     30                ."\tphp manage.php latest <show name> [episode number]\n" 
    3031                ."OR\n" 
    31                 ."\tphp manage.php [-v] cron [show name] [show name]"); 
     32                ."\tphp manage.php [-v] update [show name] [show name]\n"); 
    3233} 
    3334 
     
    9798                // Loop over each feed, parse it, see if the latest episode has changed. 
    9899                foreach ($manager->feeds(TRUE) as $feed) { 
     100                        // Keep track if this feed was specifically requested. 
     101                        $specified = FALSE; 
     102                         
    99103                        // Only fetch the ones specified, if any. 
    100104                        if ((bool) count($args)) { 
     
    102106                                        $verbose AND printf("Skipping %s\n", $feed['name']); 
    103107                                        continue; 
     108                                } else { 
     109                                        $specified = TRUE; 
     110                                        $verbose OR printf('Checking %s... ', $feed['name']); 
    104111                                }; 
    105112                        }; 
     
    130137                                } 
    131138                        } else { 
    132                                 $verbose AND printf("No new episode (%d)\n", $parsed->episode); 
     139                                ($specified OR $verbose) AND printf("No new episode (%d)\n", $parsed->episode); 
    133140                        } 
    134141                }