summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xdocs/CHANGELOG2
-rw-r--r--lib/class/album.class.php4
-rw-r--r--lib/class/artist.class.php1
-rw-r--r--lib/class/catalog.class.php2
-rw-r--r--lib/class/song.class.php1
-rw-r--r--play/index.php8
6 files changed, 13 insertions, 5 deletions
diff --git a/docs/CHANGELOG b/docs/CHANGELOG
index d632c31e..319a2e28 100755
--- a/docs/CHANGELOG
+++ b/docs/CHANGELOG
@@ -4,6 +4,8 @@
--------------------------------------------------------------------------
v.3.6-Alpha1
+ - Fixed bug where video was registering as songs for now playing
+ and stats
--------------------------------------------------------------------------
v.3.5 05/05/2009
diff --git a/lib/class/album.class.php b/lib/class/album.class.php
index 017e8147..182d841e 100644
--- a/lib/class/album.class.php
+++ b/lib/class/album.class.php
@@ -33,6 +33,7 @@ class Album extends database_object {
public $disk;
public $year;
public $prefix;
+ public $mbid; // MusicBrainz ID
/* Art Related Fields */
public $art;
@@ -747,6 +748,7 @@ class Album extends database_object {
$artist = $data['artist'];
$name = $data['name'];
$disk = $data['disk'];
+ $mbid = $data['mbid'];
$current_id = $this->id;
@@ -760,7 +762,7 @@ class Album extends database_object {
Catalog::clean_artists();
}
- $album_id = Catalog::check_album($name,$year,$disk);
+ $album_id = Catalog::check_album($name,$year,$disk,$mbid);
if ($album_id != $this->id) {
if (!is_array($songs)) { $songs = $this->get_songs(); }
foreach ($songs as $song_id) {
diff --git a/lib/class/artist.class.php b/lib/class/artist.class.php
index c55b109e..0db622b3 100644
--- a/lib/class/artist.class.php
+++ b/lib/class/artist.class.php
@@ -30,6 +30,7 @@ class Artist extends database_object {
public $songs;
public $albums;
public $prefix;
+ public $mbid; // MusicBrainz ID
// Constructed vars
public $_fake = false; // Set if construct_from_array() used
diff --git a/lib/class/catalog.class.php b/lib/class/catalog.class.php
index 74716b8b..7dee54f2 100644
--- a/lib/class/catalog.class.php
+++ b/lib/class/catalog.class.php
@@ -1590,7 +1590,7 @@ class Catalog extends database_object {
return false;
}
else {
- if count($dead_video)) {
+ if (count($dead_video)) {
$idlist = '(' . implode(',',$dead_video) . ')';
$sql = "DELETE FROM `video` WHERE `id` IN $idlist";
$db_results = Dba::write($sql);
diff --git a/lib/class/song.class.php b/lib/class/song.class.php
index 8690a1fc..2a309d34 100644
--- a/lib/class/song.class.php
+++ b/lib/class/song.class.php
@@ -40,6 +40,7 @@ class Song extends database_object implements media {
public $enabled;
public $addition_time;
public $update_time;
+ public $mbid; // MusicBrainz ID
/* Setting Variables */
public $_transcoded = false;
diff --git a/play/index.php b/play/index.php
index d3596699..b63ba7b6 100644
--- a/play/index.php
+++ b/play/index.php
@@ -317,8 +317,10 @@ else {
}
} // else not downsampling
-// Put this song in the now_playing table
-Stream::insert_now_playing($media->id,$uid,$media->time,$sid,get_class($media));
+// Put this song in the now_playing table only if it's a song for now...
+if (get_class($media) == 'song') {
+ Stream::insert_now_playing($media->id,$uid,$media->time,$sid,get_class($media));
+}
if ($start > 0) {
@@ -371,7 +373,7 @@ if($bytes_streamed < $stream_size AND (connection_status() == 0)) {
}
// Make sure that a good chunk of the song has been played
-if ($bytes_streamed > $min_bytes_streamed) {
+if ($bytes_streamed > $min_bytes_streamed AND get_class($media) == 'song') {
debug_event('Play','Registering stats for ' . $media->title,'5');
$user->update_stats($media->id);