Sfoglia il codice sorgente

Check for local update scripts before executing remote updates

Zachary Kotlarek 11 anni fa
parent
commit
99407ad71a
1 ha cambiato i file con 20 aggiunte e 9 eliminazioni
  1. 20 9
      yt/subscribe.pl

+ 20 - 9
yt/subscribe.pl

@@ -214,15 +214,6 @@ if ($DEBUG > 1) {
 	push(@YTDL_ARGS, @YTDL_QUIET);
 }
 
-# Disable channel fetching if the ID channel is "None"
-if ($ID =~ /^\s*None\s*$/i) {
-	if ($DEBUG) {
-		print STDERR 'Channel features disabled for: ' . $NAME . "\n";
-	}
-	$NO_CHANNEL = 1;
-	$NO_SEARCH  = 1;
-}
-
 # Allow use as a subscription manager
 if ($SUBSCRIPTIONS) {
 	my %subs = ();
@@ -236,6 +227,26 @@ if ($SUBSCRIPTIONS) {
 	exit(0);
 }
 
+# Disable channel fetching if the ID channel is "None"
+if ($ID =~ /^\s*None\s*$/i) {
+	if ($DEBUG) {
+		print STDERR 'Channel features disabled for: ' . $NAME . "\n";
+	}
+	$NO_CHANNEL = 1;
+	$NO_SEARCH  = 1;
+}
+
+# Run the local "update" script if any
+{
+	my @update = ($DIR . '/update', '');
+	if (-x $update[0]) {
+		if ($DEBUG) {
+			print STDERR "Executing local update script...\n";
+		}
+		system(@update);
+	}
+}
+
 # Grab the channel data
 my $channel = {};
 if (!$NO_CHANNEL) {