? archive/scripts/_ripper.php
? archive/scripts/station-916658-3.patch
Index: archive/station_archive.legacy_pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/archive/station_archive.legacy_pages.inc,v
retrieving revision 1.2
diff -u -p -r1.2 station_archive.legacy_pages.inc
--- archive/station_archive.legacy_pages.inc	28 Nov 2009 22:06:44 -0000	1.2
+++ archive/station_archive.legacy_pages.inc	12 Dec 2010 22:45:29 -0000
@@ -1,6 +1,74 @@
 <?php
 // $Id: station_archive.legacy_pages.inc,v 1.2 2009/11/28 22:06:44 drewish Exp $
 
+/**
+ * Give a string with hours return an array of vocabulary term ids for the
+ * given hours.
+ *
+ * @param $vid
+ *   integer vocabulary id
+ * @param $hour_string
+ *   string with hours values, integers from 1 to 168 separated by spaces
+ */
+function _station_archive_get_hour_tids($vid, $hour_string = '') {
+  $ids = array();
+  foreach (explode(' ', $hour_string) as $id) {
+    $id = (integer) $id;
+    if ($id > 0 && $id <= 24*7) {
+      $ids[] = $id;
+    }
+  }
+  sort($ids);
+
+  $tids = array();
+  foreach ($ids as $id) {
+    $day = (integer) (($id - 1) / 24);
+    $hour = ($id - 1) % 24;
+
+    if ($dayterm = _station_archive_get_day_term($vid, $day)) {
+      if ($hourterm = _station_archive_get_hour_term($dayterm, $hour)) {
+        $tids[] = $hourterm['tid'];
+      }
+    }
+  }
+
+  return $tids;
+}
+
+/**
+ * Find the taxonomy term for a day.
+ *
+ * @param $vid
+ *   Our vocabulary ID.
+ * @param $day
+ *   Integer day between 0 and 6.
+ * @return
+ *   Array with a day's taxonomy term, FALSE if it doesn't exist.
+ */
+function _station_archive_get_day_term($vid, $day) {
+  $dayname = station_day_name($day);
+  $result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE t.vid = %d AND LOWER('%s') LIKE LOWER(name)", 't', 'tid'), array($vid, trim($dayname)));
+  return db_fetch_array($result);
+}
+
+/**
+ * Find or create taxonomy term for a day.
+ *
+ * @param $dayterm
+ *   Array day taxonomy term.
+ * @param $hour
+ *   Integer hour between 0 and 23.
+ * @return
+ *   Array with an hour's taxonomy term, false if it doesn't exist.
+ */
+function _station_archive_get_hour_term($dayterm, $hour) {
+  $minute = station_minute_from_day_hour(0, $hour);
+  $time = station_time_from_minute($minute);
+  $hourname = $time['time'] . $time['a'];
+  $result = db_query(db_rewrite_sql("SELECT d.tid, d.* FROM {term_data} d INNER JOIN {term_hierarchy} h ON d.tid = h.tid WHERE d.vid = %d AND h.parent = %d AND LOWER('%s') LIKE LOWER(name)", 't', 'tid'), array($dayterm['vid'], $dayterm['tid'], trim($hourname)));
+  return db_fetch_array($result);
+}
+
 function station_archive_view_html($dayname = NULL, $hourname = NULL) {
   if (!is_null($dayname)) {
     $day = station_valid_day($dayname);
Index: archive/station_archive.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/archive/station_archive.module,v
retrieving revision 1.51
diff -u -p -r1.51 station_archive.module
--- archive/station_archive.module	13 Sep 2010 18:54:05 -0000	1.51
+++ archive/station_archive.module	12 Dec 2010 22:45:30 -0000
@@ -15,34 +15,37 @@ function station_archive_help($section =
  * Implementation of hook_menu().
  */
 function station_archive_menu() {
-  // Legacy menu items. This functionality is handled by Views now.
-  $items['last'] = array(
-    'title' => 'Show archive',
-    'page callback' => 'station_archive_view_html',
-    'access arguments' => array('access content'),
-    'file' => 'station_archive.legacy_pages.inc',
-    'type' => MENU_CALLBACK,
-  );
-  $items['last/hours'] = array(
-    'page callback' => 'station_archive_view_hours_html',
-    'access arguments' => array('access content'),
-    'file' => 'station_archive.legacy_pages.inc',
-    'type' => MENU_CALLBACK,
-  );
-  $items['rss'] = array(
-    'title' => 'RSS show archive',
-    'page callback' => 'station_archive_view_rss',
-    'access arguments' => array('access content'),
-    'file' => 'station_archive.legacy_pages.inc',
-    'type' => MENU_CALLBACK,
-  );
-  $items['rss/hours'] = array(
-    'page callback' => 'station_archive_view_hours_rss',
-    'access arguments' => array('access content'),
-    'file' => 'station_archive.legacy_pages.inc',
-    'type' => MENU_CALLBACK,
-  );
-  // end legacy menu items
+  // Legacy menu items. This functionality is handled by Views now. These are
+  // disabled by default. If you really need them you'll have to set the 
+  // variable by hand.
+  if (variable_get('station_archive_legacy_urls', false)) {
+    $items['last'] = array(
+      'title' => 'Show archive',
+      'page callback' => 'station_archive_view_html',
+      'access arguments' => array('access content'),
+      'file' => 'station_archive.legacy_pages.inc',
+      'type' => MENU_CALLBACK,
+    );
+    $items['last/hours'] = array(
+      'page callback' => 'station_archive_view_hours_html',
+      'access arguments' => array('access content'),
+      'file' => 'station_archive.legacy_pages.inc',
+      'type' => MENU_CALLBACK,
+    );
+    $items['rss'] = array(
+      'title' => 'RSS show archive',
+      'page callback' => 'station_archive_view_rss',
+      'access arguments' => array('access content'),
+      'file' => 'station_archive.legacy_pages.inc',
+      'type' => MENU_CALLBACK,
+    );
+    $items['rss/hours'] = array(
+      'page callback' => 'station_archive_view_hours_rss',
+      'access arguments' => array('access content'),
+      'file' => 'station_archive.legacy_pages.inc',
+      'type' => MENU_CALLBACK,
+    );
+  }
 
   $items['admin/settings/station/archive'] = array(
     'title' => 'Archive',
@@ -569,28 +572,30 @@ function _station_archive_add_file($file
  */
 function _station_archive_get_taxonomy($local_timestamp) {
   $vid = _station_archive_get_vid();
-  $day = date('w', $local_timestamp);
-  $hour = date('G', $local_timestamp);
-  $minute = station_minute_from_day_hour($day, $hour);
+  $minute = station_minute_from_local_ts($local_timestamp);
   $time = station_time_from_minute($minute);
 
-  $dayterm = _station_archive_get_day_term($vid, $day);
+  $day_name = theme('station_day', $minute);
+  $result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE t.vid = %d AND LOWER('%s') LIKE LOWER(name)", 't', 'tid'), array($vid, $day_name));
+  $dayterm = db_fetch_array($result);
   if (!$dayterm) {
     $dayterm = array(
       'vid' => $vid,
-      'name' => $time['w'],
-      'weight' => $day - 7,
+      'name' => $day_name,
+      'weight' => $time['w'] - 7,
     );
     taxonomy_save_term($dayterm);
   }
 
-  $hourterm = _station_archive_get_hour_term($dayterm, $hour);
+  $hour_name = theme('station_hour', $minute);
+  $result = db_query(db_rewrite_sql("SELECT d.tid, d.* FROM {term_data} d INNER JOIN {term_hierarchy} h ON d.tid = h.tid WHERE d.vid = %d AND h.parent = %d AND LOWER('%s') LIKE LOWER(name)", 't', 'tid'), array($vid, $dayterm['tid'], $hour_name));
+  $hourterm = db_fetch_array($result);  
   if (!$hourterm) {
     $hourterm = array(
-      'vid' => $dayterm['vid'],
+      'vid' => $vid,
       'parent' => $dayterm['tid'],
-      'name' => $time['time'] . $time['a'],
-      'weight' => $hour,
+      'name' => $hour_name,
+      'weight' => $time['G'],
     );
     taxonomy_save_term($hourterm);
   }
@@ -641,74 +646,6 @@ function station_archive_taxonomy($op, $
 }
 
 /**
- * Give a string with hours return an array of vocabulary term ids for the
- * given hours.
- *
- * @param $vid
- *   integer vocabulary id
- * @param $hour_string
- *   string with hours values, integers from 1 to 168 separated by spaces
- */
-function _station_archive_get_hour_tids($vid, $hour_string = '') {
-  $ids = array();
-  foreach (explode(' ', $hour_string) as $id) {
-    $id = (integer) $id;
-    if ($id > 0 && $id <= 24*7) {
-      $ids[] = $id;
-    }
-  }
-  sort($ids);
-
-  $tids = array();
-  foreach ($ids as $id) {
-    $day = (integer) (($id - 1) / 24);
-    $hour = ($id - 1) % 24;
-
-    if ($dayterm = _station_archive_get_day_term($vid, $day)) {
-      if ($hourterm = _station_archive_get_hour_term($dayterm, $hour)) {
-        $tids[] = $hourterm['tid'];
-      }
-    }
-  }
-
-  return $tids;
-}
-
-/**
- * Find the taxonomy term for a day.
- *
- * @param $vid
- *   Our vocabulary ID.
- * @param $day
- *   Integer day between 0 and 6.
- * @return
- *   Array with a day's taxonomy term, FALSE if it doesn't exist.
- */
-function _station_archive_get_day_term($vid, $day) {
-  $dayname = station_day_name($day);
-  $result = db_query(db_rewrite_sql("SELECT t.tid, t.* FROM {term_data} t WHERE t.vid = %d AND LOWER('%s') LIKE LOWER(name)", 't', 'tid'), array($vid, trim($dayname)));
-  return db_fetch_array($result);
-}
-
-/**
- * Find or create taxonomy term for a day.
- *
- * @param $dayterm
- *   Array day taxonomy term.
- * @param $hour
- *   Integer hour between 0 and 23.
- * @return
- *   Array with an hour's taxonomy term, false if it doesn't exist.
- */
-function _station_archive_get_hour_term($dayterm, $hour) {
-  $minute = station_minute_from_day_hour(0, $hour);
-  $time = station_time_from_minute($minute);
-  $hourname = $time['time'] . $time['a'];
-  $result = db_query(db_rewrite_sql("SELECT d.tid, d.* FROM {term_data} d INNER JOIN {term_hierarchy} h ON d.tid = h.tid WHERE d.vid = %d AND h.parent = %d AND LOWER('%s') LIKE LOWER(name)", 't', 'tid'), array($dayterm['vid'], $dayterm['tid'], trim($hourname)));
-  return db_fetch_array($result);
-}
-
-/**
  * Implementation of hook_views_api().
  */
 function station_archive_views_api() {
Index: playlist/station_playlist.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/playlist/station_playlist.admin.inc,v
retrieving revision 1.3
diff -u -p -r1.3 station_playlist.admin.inc
--- playlist/station_playlist.admin.inc	26 Nov 2009 03:55:14 -0000	1.3
+++ playlist/station_playlist.admin.inc	12 Dec 2010 22:45:30 -0000
@@ -35,6 +35,7 @@ function station_playlist_admin_settings
         'playlists' => t('Existing playlists'),
         'catalog'   => t('Albums in the catalog'),
         'both'      => t('Both'),
+        'none'      => t('None'),
       ),
       '#description' => t("When adding playlists the track listings use auto-completing to save typing and provide suggestions. What data source should be used to provide these suggestions?"),
     );
Index: playlist/station_playlist.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/station/playlist/station_playlist.module,v
retrieving revision 1.28
diff -u -p -r1.28 station_playlist.module
--- playlist/station_playlist.module	29 Nov 2010 17:58:20 -0000	1.28
+++ playlist/station_playlist.module	12 Dec 2010 22:45:31 -0000
@@ -261,20 +261,23 @@ function station_playlist_form(&$node, $
     '#tree' => TRUE,
   );
 
+  // Make sure autocomplete hasn't been disabled.
+  $allow_autocomplete = ('none' != variable_get('station_playlist_track_autocomplete_source', 'playlists'));
+
   foreach ($node->tracks as $weight => $track) {
     $form['tracks_wrapper']['tracks'][$weight]['artist'] = array(
       '#type' => 'textfield',
       '#size' => 20,
       '#maxlength' => 255,
       '#default_value' => isset($track['artist']) ? $track['artist'] : '',
-      '#autocomplete_path' => 'station/autocomplete/playlist/artist',
+      '#autocomplete_path' => $allow_autocomplete ? 'station/autocomplete/playlist/artist' : NULL,
     );
     $form['tracks_wrapper']['tracks'][$weight]['album'] = array(
       '#type' => 'textfield',
       '#size' => 20,
       '#maxlength' => 255,
       '#default_value' => isset($track['album']) ? $track['album'] : '',
-      '#autocomplete_path' => 'station/autocomplete/playlist/album',
+      '#autocomplete_path' => $allow_autocomplete ? 'station/autocomplete/playlist/album' : NULL,
     );
     $form['tracks_wrapper']['tracks'][$weight]['title'] = array(
       '#type' => 'textfield',
@@ -287,7 +290,7 @@ function station_playlist_form(&$node, $
       '#size' => 20,
       '#maxlength' => 255,
       '#default_value' => isset($track['label']) ? $track['label'] : '',
-      '#autocomplete_path' => 'station/autocomplete/playlist/label',
+      '#autocomplete_path' => $allow_autocomplete ? 'station/autocomplete/playlist/label' : NULL,
     );
     $form['tracks_wrapper']['tracks'][$weight]['link'] = array(
       '#type' => 'textfield',
