Author: tkoomzaaskz
Date: 2010-02-07 12:25:37 +0100 (Sun, 07 Feb 2010)
New Revision: 27635

Modified:
   plugins/tdVideoPlugin/trunk/lib/model/doctrine/PlugintdVideoTable.class.php
   plugins/tdVideoPlugin/trunk/package.xml
Log:
[td][video] random videos bug fixed

Modified: 
plugins/tdVideoPlugin/trunk/lib/model/doctrine/PlugintdVideoTable.class.php
===================================================================
--- plugins/tdVideoPlugin/trunk/lib/model/doctrine/PlugintdVideoTable.class.php 
2010-02-07 11:24:01 UTC (rev 27634)
+++ plugins/tdVideoPlugin/trunk/lib/model/doctrine/PlugintdVideoTable.class.php 
2010-02-07 11:25:37 UTC (rev 27635)
@@ -57,7 +57,7 @@
    * @param Array $ids - Identifiers of active videos.
    * @return Array
    */
-  static protected function getActiveVideosIds()
+  static public function getActiveVideosIds()
   {
     $query = self::getActiveVideosQuery()
       ->select('v.id');
@@ -80,7 +80,9 @@
   static public function getRandomActiveVideosQuery($count)
   {
     $ids = self::getActiveVideosIds();
-    
+    // if less videos available than expected
+    if ($count > count($ids)) $count = count($ids);
+
     $selected = array();
     for ($i = 0; $i < $count; $i++)
     {
@@ -91,6 +93,6 @@
       unset($ids[$id]);
     }
 
-    return self::getSelectedVideosQuery($selected);
+    return empty($selected) ? null : self::getSelectedVideosQuery($selected);
   }
 }
\ No newline at end of file

Modified: plugins/tdVideoPlugin/trunk/package.xml
===================================================================
--- plugins/tdVideoPlugin/trunk/package.xml     2010-02-07 11:24:01 UTC (rev 
27634)
+++ plugins/tdVideoPlugin/trunk/package.xml     2010-02-07 11:25:37 UTC (rev 
27635)
@@ -10,10 +10,10 @@
   <email>[email protected]</email>
   <active>yes</active>
  </lead>
- <date>2010-01-24</date>
+ <date>2010-02-07</date>
  <time>11:00:00</time>
  <version>
-   <release>0.1.4</release>
+   <release>0.1.5</release>
    <api>0.1.0</api>
  </version>
  <stability>
@@ -152,6 +152,24 @@
 
    <release>
     <version>
+     <release>0.1.5</release>
+     <api>0.1.0</api>
+    </version>
+    <stability>
+     <release>beta</release>
+     <api>beta</api>
+    </stability>
+    <license uri="http://www.symfony-project.org/license";>MIT license</license>
+    <date>2010-02-07</date>
+    <license>MIT</license>
+    <notes>
+     * NOT RELEASED YET
+     * updated random videos - fixed blocked website bug
+    </notes>
+   </release>
+
+   <release>
+    <version>
      <release>0.1.4</release>
      <api>0.1.0</api>
     </version>

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to