diff options
author | Paul Arthur <paul.arthur@flowerysong.com> | 2012-03-01 14:23:41 -0500 |
---|---|---|
committer | Paul Arthur <paul.arthur@flowerysong.com> | 2012-03-01 14:24:26 -0500 |
commit | dd3d42d644a790afe9368a122e0f7f6b9e60697c (patch) | |
tree | 64e87a3dbfbc88d60d449ace0364734013500cc9 /lib/class/catalog.class.php | |
parent | 40e8484a5794c21abab52fa30a34a2d013769602 (diff) | |
download | ampache-dd3d42d644a790afe9368a122e0f7f6b9e60697c.tar.gz ampache-dd3d42d644a790afe9368a122e0f7f6b9e60697c.tar.bz2 ampache-dd3d42d644a790afe9368a122e0f7f6b9e60697c.zip |
FS#198 - Export To CSV - Blank Genre
Clean up Catalog->export. Genre doesn't exist any more.
Diffstat (limited to 'lib/class/catalog.class.php')
-rw-r--r-- | lib/class/catalog.class.php | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php index f4ff7be7..5874863e 100644 --- a/lib/class/catalog.class.php +++ b/lib/class/catalog.class.php @@ -2376,10 +2376,12 @@ class Catalog extends database_object { // Select all songs in catalog if($this->id) { - $sql = "SELECT id FROM song WHERE catalog = '$this->id' ORDER BY album,track"; + $sql = 'SELECT `id` FROM `song` ' . + "WHERE `catalog`='$this->id' " . + 'ORDER BY `album`, `track`'; } else { - $sql = "SELECT id FROM song ORDER BY album,track"; + $sql = 'SELECT `id` FROM `song` ORDER BY `album`, `track`'; } $db_results = Dba::read($sql); @@ -2396,7 +2398,6 @@ class Catalog extends database_object { $xml['dict']['Name'] = $song->title; $xml['dict']['Artist'] = $song->f_artist_full; $xml['dict']['Album'] = $song->f_album_full; - $xml['dict']['Genre'] = $song->f_genre; // FIXME $xml['dict']['Total Time'] = intval($song->time) * 1000; // iTunes uses milliseconds $xml['dict']['Track Number'] = intval($song->track); $xml['dict']['Year'] = intval($song->year); @@ -2406,21 +2407,28 @@ class Catalog extends database_object { $xml['dict']['Play Count'] = intval($song->played); $xml['dict']['Track Type'] = "URL"; $xml['dict']['Location'] = Song::play_url($song->id); - echo xml_from_array($xml,1,'itunes'); + echo xml_from_array($xml, 1, 'itunes'); // flush output buffer } // while result echo xml_get_footer('itunes'); break; case 'csv': - echo "ID,Title,Artist,Album,Genre,Length,Track,Year,Date Added,Bitrate,Played,File\n"; + echo "ID,Title,Artist,Album,Length,Track,Year,Date Added,Bitrate,Played,File\n"; while ($results = Dba::fetch_assoc($db_results)) { $song = new Song($results['id']); $song->format(); - echo '"' . $song->id . '","' . $song->title . '","' . $song->f_artist_full . '","' . $song->f_album_full . - '","' . $song->f_genre . '","' . $song->f_time . '","' . $song->f_track . '","' . $song->year . - '","' . date("Y-m-d\TH:i:s\Z",$song->addition_time) . '","' . $song->f_bitrate . - '","' . $song->played . '","' . $song->file . "\n"; + echo '"' . $song->id . '","' . + $song->title . '","' . + $song->f_artist_full . '","' . + $song->f_album_full .'","' . + $song->f_time . '","' . + $song->f_track . '","' . + $song->year .'","' . + date("Y-m-d\TH:i:s\Z", $song->addition_time) . '","' . + $song->f_bitrate .'","' . + $song->played . '","' . + $song->file . "\n"; } break; } // end switch |