From c522a2c1e97518d21e351821c27a9188e0cb3a1d Mon Sep 17 00:00:00 2001 From: Karl 'vollmerk' Vollmer Date: Fri, 17 Nov 2006 06:30:36 +0000 Subject: some bug fixes and tweaks --- bin/print_tags.php.inc | 20 ++++++++++++-------- config/ampache.cfg.php.dist | 14 +++++++------- docs/CHANGELOG | 7 +++++-- docs/README | 1 + lib/class/stream.class.php | 17 ++++++++++++++--- lib/preferences.php | 2 +- lib/ui.lib.php | 4 ++++ modules/id3/vainfo.class.php | 2 +- templates/show_add_catalog.inc.php | 8 ++++---- templates/show_edit_catalog.inc.php | 29 +++++++++++++++-------------- templates/show_install_lang.inc.php | 3 ++- templates/show_tv_adminctl.inc.php | 18 +++++++++++++++--- tv.php | 13 ++++++++++--- 13 files changed, 91 insertions(+), 47 deletions(-) diff --git a/bin/print_tags.php.inc b/bin/print_tags.php.inc index 9ef62f18..f6c03195 100644 --- a/bin/print_tags.php.inc +++ b/bin/print_tags.php.inc @@ -22,18 +22,22 @@ $no_session = '1'; require ("../lib/init.php"); -/** - * Set this to true if you want it to e-mail a report - * to tags@ampache.org (usefull for troubleshooting - */ -//$send_mail = true; - if (count($GLOBALS['argv']) == '1') { $filename = usage(); } -else { $filename = $GLOBALS['argv']['1']; } +else { + $filename = $GLOBALS['argv']['1']; + $send_mail = $GLOBALS['argv']['2']; +} echo "Reading: $filename\n"; -$info = new vainfo($filename); +/* Attempt to figure out what catalog it comes from */ +$sql = "SELECT catalog.id FROM song LEFT JOIN catalog ON song.catalog=catalog.id WHERE song.file='" . sql_escape($filename) . "'"; +$db_results = mysql_query($sql,dbh()); +$results = mysql_fetch_assoc($db_results); + +$catalog = new Catalog($results['id']); + +$info = new vainfo($filename,'',$catalog->sort_pattern,$catalog->rename_pattern); $info->get_info(); $results = $info->tags; $results['file'] = $filename; diff --git a/config/ampache.cfg.php.dist b/config/ampache.cfg.php.dist index 0eec2c02..83dc56df 100644 --- a/config/ampache.cfg.php.dist +++ b/config/ampache.cfg.php.dist @@ -139,12 +139,12 @@ require_session = "true" # POSSIBLE VALUES: id3v1 id3v2 file vorbiscomment # quicktime ape # DEFAULT: id3v2,id3v1 -tag_order = "id3v2" -tag_order = "id3v1" +tag_order = id3v2 +tag_order = id3v1 tag_order = vorbiscomment tag_order = quicktime tag_order = ape -#tag_order = "file" +#tag_order = file # Un comment if don't want ampache to follow symlinks # DEFAULT: false @@ -465,7 +465,7 @@ search_type = fuzzy # %OFFSET% = offset # %SAMPLE% = sample rate # %EOF% = end of file in min.sec -# DEFAULT: mp3splt -qnf "%FILE%" %OFFSET% %EOF% -o - | lame --mp3input -q 3 -b %SAMPLE% -S - - +# DEFAULT: mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -q 3 -b %SAMPLE% -S - - downsample_cmd = mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -q 3 -b %SAMPLE% -S - - ####################################################### @@ -476,12 +476,12 @@ downsample_cmd = mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -q 3 # List of filetypes to transcode transcode_m4a = true -#transcode_flac = false +transcode_flac = true #transcode_mpc = false # These are the commands that will be run to transcode the file -#stream_cmd_flac = flac -dc %FILE% | lame -r -b 128 -S - - -stream_cmd_m4a = faad -f 2 -w "%FILE%" | lame -r -b 128 -S - - +stream_cmd_flac = flac -dc %FILE% | lame -r -b 128 -S - - +stream_cmd_m4a = faad -f 2 -w %FILE% | lame -r -b 128 -S - - #stream_cmd_mpc = ####################################################### diff --git a/docs/CHANGELOG b/docs/CHANGELOG index def60c4e..cedbe60a 100755 --- a/docs/CHANGELOG +++ b/docs/CHANGELOG @@ -4,6 +4,11 @@ -------------------------------------------------------------------------- v.3.3.3-Beta1 + - Added the ability to Upload a M3u and have it attempt to build + a playlist based on the filenames + - Added the ability for admins to 'Push' the democratic link + to a play method/localplay instance + - Fixed a bug with the File tag_order method - Fixed a problem with Localplay Skip to song and added highlighting of currently playing song - Added new Flash Player with full support for Non-US Char and @@ -15,7 +20,6 @@ -------------------------------------------------------------------------- v.3.3.3-Alpha2 11/12/2006 - Added Export to Itunes DB function (Thx PB1DFT) - - Added New XSPF Player that's solves all the UTF8 encoding problems (Thx Enrico Lai) - Fixed some Ajax Issues, added Now Playing to TV page - Fixed album art search on every Catalog Add - Added exception to MPD controller, forces HTTP play regardless @@ -25,7 +29,6 @@ - Added Genre link on show_songs along with some other minor UI improvements - Added Export to Itunes DB function (Thx PB1DFT) - - Added New XSPF Player that's solves all the UTF8 encoding problems (Thx Enrico Lai) - Fixed Show All of Song Titles not having any data - Fixed override of local_length to 9000 regardless of config file - Tweaked Remeber Me Checkbox to be disabled if remember_length diff --git a/docs/README b/docs/README index 4b68dab6..e8f235d9 100755 --- a/docs/README +++ b/docs/README @@ -44,6 +44,7 @@ Contents: - RM - AAC/M4A - MPC + - WV B) Supported Stream Methods diff --git a/lib/class/stream.class.php b/lib/class/stream.class.php index 503fd9bf..6a5599a2 100644 --- a/lib/class/stream.class.php +++ b/lib/class/stream.class.php @@ -5,9 +5,8 @@ All rights reserved. This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -77,6 +76,18 @@ class Stream { } // start + /** + * manual_url_add + * This manually adds a URL to the stream object for passing + * to whatever, this is an exception for when we don't actually + * have a object_id but instead a weird or special URL + */ + function manual_url_add($url) { + + + + } // manual_url_add + /*! @function create_simplem3u @discussion this creates a simple m3u diff --git a/lib/preferences.php b/lib/preferences.php index e46ad8e0..39755735 100644 --- a/lib/preferences.php +++ b/lib/preferences.php @@ -323,7 +323,7 @@ function create_preference_input($name,$value) { echo "\n"; break; case 'theme_name': diff --git a/lib/ui.lib.php b/lib/ui.lib.php index 6a20f387..c1f676ee 100644 --- a/lib/ui.lib.php +++ b/lib/ui.lib.php @@ -330,6 +330,10 @@ function get_now_playing($filter='') { $sql = "SELECT song_id,user FROM now_playing ORDER BY start_time DESC"; $db_results = mysql_query($sql, dbh()); + + $results = array(); + + /* While we've got stuff playing */ while ($r = mysql_fetch_assoc($db_results)) { $song = new Song($r['song_id']); $song->format_song(); diff --git a/modules/id3/vainfo.class.php b/modules/id3/vainfo.class.php index c6192ded..a19fdf96 100755 --- a/modules/id3/vainfo.class.php +++ b/modules/id3/vainfo.class.php @@ -437,7 +437,7 @@ class vainfo { $results = array(); - $pattern = $this->_dir_pattern . $this->_file_pattern; + $pattern = $this->_dir_pattern . '/' . $this->_file_pattern; preg_match_all("/\%\w/",$pattern,$elements); $preg_pattern = preg_quote($pattern); diff --git a/templates/show_add_catalog.inc.php b/templates/show_add_catalog.inc.php index 2bf02283..a58d3a37 100644 --- a/templates/show_add_catalog.inc.php +++ b/templates/show_add_catalog.inc.php @@ -79,15 +79,15 @@ $default_sort = "%a/%A";
- + - + - +
::
::
::
@@ -95,7 +95,7 @@ $default_sort = "%a/%A"; - : + : diff --git a/templates/show_edit_catalog.inc.php b/templates/show_edit_catalog.inc.php index 7a31de6a..aaa3e950 100644 --- a/templates/show_edit_catalog.inc.php +++ b/templates/show_edit_catalog.inc.php @@ -5,9 +5,8 @@ All rights reserved. This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -27,18 +26,20 @@ : - :
- %A =
- %a =
- %C =
- %c =
- %g =
- %T =
- %t =
- %y =
- %o =
+ :
+ %A =
+ %a =
+ %c =
+ %g =
+ %T =
+ %t =
+ %y =
+ %o =
+ + + catalog_type)); ?> : @@ -62,7 +63,7 @@   - + diff --git a/templates/show_install_lang.inc.php b/templates/show_install_lang.inc.php index 253dee6e..330560a7 100644 --- a/templates/show_install_lang.inc.php +++ b/templates/show_install_lang.inc.php @@ -1,4 +1,5 @@ - + + Ampache :: Pour l'Amour de la Musique - Install diff --git a/templates/show_tv_adminctl.inc.php b/templates/show_tv_adminctl.inc.php index 10dd004a..b71c82fc 100644 --- a/templates/show_tv_adminctl.inc.php +++ b/templates/show_tv_adminctl.inc.php @@ -5,9 +5,8 @@ All rights reserved. This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License - as published by the Free Software Foundation; either version 2 - of the License, or (at your option) any later version. + modify it under the terms of the GNU General Public License v2 + as published by the Free Software Foundation. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -34,6 +33,19 @@ else { ?>   +
+ + +

:
diff --git a/tv.php b/tv.php index ecd2c066..1b232897 100644 --- a/tv.php +++ b/tv.php @@ -50,9 +50,16 @@ switch ($action) { break; /* This sends the playlist to the 'method' of their chosing */ case 'send_playlist': - - - + /* Only Admins Here */ + if (!$GLOBALS['user']->has_access(100)) { + access_denied(); + break; + } + $stream_type = scrub_in($_REQUEST['play_type']); + $tmp_playlist = new tmpPlaylist($_REQUEST['tmp_playlist_id']); + $stream = new Stream($stream_type,array()); + $stream->manual_url_add($tmp_playlist->get_vote_url()); + $stream->start(); break; case 'update_playlist': /* Only Admins Here */ -- cgit