summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/class/catalog.class.php15
-rw-r--r--lib/class/vainfo.class.php36
2 files changed, 45 insertions, 6 deletions
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 63ed3816..c4754cd0 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -1776,7 +1776,7 @@ class Catalog extends database_object {
$catalog = new Catalog($catalog_id);
/* First get the filenames for the catalog */
- $sql = "SELECT `id`,`file` FROM `song` WHERE `catalog`='$catalog_id'";
+ $sql = "SELECT `id`,`file` FROM `song` WHERE `catalog`='$catalog_id'";
$db_results = Dba::query($sql);
$number = Dba::num_rows($db_results);
@@ -1897,12 +1897,12 @@ class Catalog extends database_object {
$sql = "OPTIMIZE TABLE `song_data`,`song`,`rating`,`catalog`,`session`,`object_count`,`album`,`album_data`" .
",`artist`,`ip_history`,`flagged`,`now_playing`,`user_preference`,`tag`,`tag_map`,`tmp_playlist`" .
- ",`tmp_playlist_data`,`playlist`,`playlist_data`,`session_stream`";
+ ",`tmp_playlist_data`,`playlist`,`playlist_data`,`session_stream`,`video`";
$db_results = Dba::query($sql);
$sql = "ANALYZE TABLE `song_data`,`song`,`rating`,`catalog`,`session`,`object_count`,`album`,`album_data`" .
",`artist`,`ip_history`,`flagged`,`now_playing`,`user_preference`,`tag`,`tag_map`,`tmp_playlist`" .
- ",`tmp_playlist_data`,`playlist`,`playlist_data`,`session_stream`";
+ ",`tmp_playlist_data`,`playlist`,`playlist_data`,`session_stream`,`video`";
$db_results = Dba::query($sql);
} // optimize_tables;
@@ -2401,14 +2401,19 @@ class Catalog extends database_object {
// First remove the songs in this catalog
$sql = "DELETE FROM `song` WHERE `catalog` = '$catalog_id'";
- $db_results = Dba::query($sql);
+ $db_results = Dba::write($sql);
// Only if the previous one works do we go on
if (!$db_results) { return false; }
+ $sql = "DELETE FROM `video` WHERE `catalog` = '$catalog_id'";
+ $db_results = Dba::write($sql);
+
+ if (!$db_results) { return false; }
+
// Next Remove the Catalog Entry it's self
$sql = "DELETE FROM `catalog` WHERE `id` = '$catalog_id'";
- $db_results = Dba::query($sql);
+ $db_results = Dba::write($sql);
// Run the Aritst/Album Cleaners...
self::clean($catalog_id);
diff --git a/lib/class/vainfo.class.php b/lib/class/vainfo.class.php
index ffbd1b92..0ce1f44a 100644
--- a/lib/class/vainfo.class.php
+++ b/lib/class/vainfo.class.php
@@ -266,7 +266,12 @@ class vainfo {
*/
if ($type = $this->_raw['video']['dataformat']) {
// Manually set the tag information
- $this->_raw['tags']['avi'] = array();
+ if ($type == 'flv') {
+ $this->_raw['tags']['flv'] = array();
+ }
+ else {
+ $this->_raw['tags']['avi'] = array();
+ }
$this->_clean_type($type);
return $type;
}
@@ -330,6 +335,9 @@ class vainfo {
case 'riff':
$results[$key] = $this->_parse_riff($tag_array);
break;
+ case 'flv':
+ $results[$key] = $this->_parse_flv($this->_raw2);
+ break;
case 'avi':
$results[$key] = $this->_parse_avi($this->_raw2);
break;
@@ -408,6 +416,9 @@ class vainfo {
case 'vorbis':
return 'ogg';
break;
+ case 'flv':
+ return 'flv';
+ break;
case 'avi':
return 'avi';
break;
@@ -623,6 +634,29 @@ class vainfo {
} // _parse_avi
/**
+ * _parse_flv
+ * This attempts to parse our the information on an flv file and present it in some
+ * kind of sane format, this is a little hard as these files don't have tags
+ */
+ private function _parse_flv($tags) {
+
+ $array = array();
+
+ $info = pathinfo($this->filename);
+
+ $array['title'] = $info['filename'];
+ $array['video_codec'] = $tags['video']['codec'];
+ $array['audio_codec'] = $tags['audio']['dataformat'];
+ $array['resolution_x'] = $tags['video']['resolution_x'];
+ $array['resolution_y'] = $tags['video']['resolution_y'];
+ $array['mime'] = $tags['mime_type'];
+ $array['comment'] = $tags['video']['codec'];
+
+ return $array;
+
+ } // _parse_flv
+
+ /**
* _parse_filename
* This function uses the passed file and dir patterns
* To pull out extra tag information and populate it into