Browse Source

Fold in prioritization

Zachary Kotlarek 12 years ago
parent
commit
9789c8c372
3 changed files with 7 additions and 22 deletions
  1. 0 19
      backup/priority.php
  2. 0 3
      backup/scanAll.sh
  3. 7 0
      backup/scanLocal.php

+ 0 - 19
backup/priority.php

@@ -1,19 +0,0 @@
-#!/usr/local/bin/php
-<?php
-
-# Includes
-require_once 'opendrive.php';
-
-# Open the DB connection
-$dbh = dbOpen();
-
-# Prepare statements
-$update = $dbh->prepare('UPDATE files SET priority = :priority WHERE path LIKE :path');
-
-# Set several groups
-$update->execute(array(':priority' => 100,	':path' => 'Movies/%'));
-$update->execute(array(':priority' => 50,	':path' => 'iTunes/%'));
-$update->execute(array(':priority' => -50,	':path' => 'Backups/%'));
-$update->execute(array(':priority' => -100,	':path' => 'TV/%'));
-
-?>

+ 0 - 3
backup/scanAll.sh

@@ -33,9 +33,6 @@ fi
 "${VIDEO_DIR}/backup/scanLocal.php" TV
 "${VIDEO_DIR}/backup/scanLocal.php" YouTube
 
-# Set priorities
-"${VIDEO_DIR}/backup/priority.php"
-
 # Always exit cleanly
 rm -f "${PID_FILE}"
 exit 0

+ 7 - 0
backup/scanLocal.php

@@ -179,4 +179,11 @@ foreach ($FILES as $FILE) {
 }
 unset($FILES);
 
+# Update priorities
+$priority = $dbh->prepare('UPDATE files SET priority = :priority WHERE path LIKE :path');
+$priority->execute(array(':priority' => 100,	':path' => 'Movies/%'));
+$priority->execute(array(':priority' => 50,	':path' => 'iTunes/%'));
+$priority->execute(array(':priority' => -50,	':path' => 'Backups/%'));
+$priority->execute(array(':priority' => -100,	':path' => 'TV/%'));
+
 ?>