summaryrefslogtreecommitdiffstats
path: root/lib/class/update.class.php
diff options
context:
space:
mode:
authorKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-23 06:08:14 +0000
committerKarl 'vollmerk' Vollmer <vollmer@ampache.org>2007-07-23 06:08:14 +0000
commit216e691dfa53a28af8beca7aad2bf0ffb71dba2c (patch)
tree8b371e856d8107832a724f1ee0ad42f270435d0a /lib/class/update.class.php
parent84eca6a3d59fc591a7e28b3d7e0c11746dc837fc (diff)
downloadampache-216e691dfa53a28af8beca7aad2bf0ffb71dba2c.tar.gz
ampache-216e691dfa53a28af8beca7aad2bf0ffb71dba2c.tar.bz2
ampache-216e691dfa53a28af8beca7aad2bf0ffb71dba2c.zip
- Added Live Stream (Internet Radio) support
- New Database Update corrects some issues and makes internet radio possible - Fixed ratings - Added new Transcode preference, doesn't do anything yet - New "Radio Stations" browse type
Diffstat (limited to 'lib/class/update.class.php')
-rw-r--r--lib/class/update.class.php43
1 files changed, 42 insertions, 1 deletions
diff --git a/lib/class/update.class.php b/lib/class/update.class.php
index 6b51527c..5f3874d2 100644
--- a/lib/class/update.class.php
+++ b/lib/class/update.class.php
@@ -204,6 +204,12 @@ class Update {
$version[] = array('version' => '340004','description' => $update_string);
+ $update_string = '- Altered Ratings table so the fields make more sense.<br />' .
+ '- Moved Random Method to Playlist catagory.<br />' .
+ '- Added Transcode Method to Streaming.<br />';
+
+ $version[] = array('version' => '340005','description' => $update_string);
+
return $version;
} // populate_version
@@ -710,14 +716,49 @@ class Update {
} // update_340004
-
/**
* update_340005
* This update fixes the preferences types
*/
public static function update_340005() {
+ // Turn user_rating into a tinyint and call it score
+ $sql = "ALTER TABLE `rating` CHANGE `user_rating` `score` TINYINT( 4 ) UNSIGNED NOT NULL DEFAULT '0'";
+ $db_results = Dba::query($sql);
+ $sql = "UPDATE `preference` SET `catagory`='playlist' WHERE `name`='random_method'";
+ $db_results = Dba::query($sql);
+
+ $sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
+ "VALUES ('transcode','default','Transcoding','25','string','streaming')";
+ $db_results = Dba::query($sql);
+
+ /* We need to check for playlist_method here because I fubar'd an earlier update */
+ $sql = "SELECT * FROM `preference` WHERE `name`='playlist_method'";
+ $db_results = Dba::query($sql);
+ if (!Dba::num_rows($db_results)) {
+ /* Add the playlist_method preference and remove it from the user table */
+ $sql = "INSERT INTO `preference` (`name`,`value`,`description`,`level`,`type`,`catagory`) " .
+ "VALUES ('playlist_method','default','Playlist Method','5','string','playlist')";
+ $db_results = Dba::query($sql);
+ }
+
+ // Add in the object_type to the tmpplaylist data table so that we can have non-songs in there
+ $sql = "ALTER TABLE `tmp_playlist_data` ADD `object_type` VARCHAR( 32 ) NULL AFTER `tmp_playlist`";
+ $db_results = Dba::query($sql);
+
+ $sql = "SELECT `id` FROM `user`";
+ $db_results = Dba::query($sql);
+
+ User::fix_preferences('-1');
+
+ while ($r = Dba::fetch_assoc($db_results)) {
+ User::fix_preferences($r['id']);
+ }
+
+ self::set_version('db_version','340005');
+
+ return true;
} // update_340005