Improve some readability

develop
mj-saunders 2018-05-05 08:00:10 +00:00
parent 8c4ea44725
commit b395930084
2 changed files with 5 additions and 1 deletions

View File

@ -41,12 +41,16 @@ if ($VERBOSE) {print STDOUT "Checking for new entries\n";}
my $new_entries = 0;
my @feeds = RSSTootalizer::Feed->all();
# For each Feed stored in database
FEED: foreach my $feed (@feeds){
next FEED unless $feed;
next FEED unless $feed->{data}->{enabled};
# If enabled, fetch the RSS xml
my $entries = $feed->fetch_entries();
next FEED unless $entries;
# For each entry in the xml file
ENTRY: foreach my $entry ($entries->items){
# Does the entry already exist in the database?
my @seen_entries = $feed->entry_by("entry_link", $entry->link());
next ENTRY if ((scalar @seen_entries) > 0);

View File

@ -27,7 +27,7 @@ binmode STDOUT, ":utf8";
my @migrations = glob ("migrations/*sql");
foreach my $migration (@migrations){
my $sth = RSSTootalizer::DB->doSELECT("SELECT * FROM migrations WHERE name = ?", $migration);
if (scalar(@$sth) == 0){
if ( scalar(@$sth) == 0 ){
print "Running migration $migration\n";
open (M, "<", $migration);
my $sql = "";