diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-31 03:20:29 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-12-31 03:20:29 +0000 |
commit | 748e50ade1b0c7034eddaadbe2285e5bf3a20fc6 (patch) | |
tree | 759b02a66ea840abc91419c9d7d00a08b2fceb8c /lib/class/song.class.php | |
parent | 4e716204e84fc7546372bdae79121e47b92412bc (diff) | |
download | ampache-748e50ade1b0c7034eddaadbe2285e5bf3a20fc6.tar.gz ampache-748e50ade1b0c7034eddaadbe2285e5bf3a20fc6.tar.bz2 ampache-748e50ade1b0c7034eddaadbe2285e5bf3a20fc6.zip |
added ability to do add new on other elements of song edit (Thx picasso) added export catalog to csv
Diffstat (limited to 'lib/class/song.class.php')
-rw-r--r-- | lib/class/song.class.php | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/class/song.class.php b/lib/class/song.class.php index 19c5c0cf..62054464 100644 --- a/lib/class/song.class.php +++ b/lib/class/song.class.php @@ -395,9 +395,6 @@ class Song { foreach ($data as $key=>$value) { switch ($key) { case 'title': - #case 'album': - case 'artist': - case 'genre': case 'track': // Check to see if it needs to be updated if ($value != $this->$key) { @@ -407,14 +404,18 @@ class Song { $updated = 1; } break; + case 'artist': case 'album': + case 'genre': if ($value != $this->$key) { if ($value == -1) { - // Add new album based on album_name - $value = Catalog::check_album($data['album_name']); + // Add new data + $fn = "check_$key"; + $value = Catalog::$fn($data["{$key}_name"]); } if ($value) { - self::update_album($value, $this->id); + $fn = "update_$key"; + self::$fn($value, $this->id); $this->$key = $value; $updated = 1; } |