ear9mrn / MythRokuPlayer

mythtv front end for Roku player
tbd
Other
26 stars 23 forks source link

Friendlier error message on video test (patch included) #6

Closed mattsteven closed 13 years ago

mattsteven commented 13 years ago

I'm running schema 1264 with MythTV 0.24.1 from source.

When loading http://192.168.0.35/mythweb/mythroku/mythtv_movies_test.php the failure is the error in the title, "Table 'mythconverg.videometadata' doesn't exist"

You could try this:

--- MythRokuPlayer/mythroku/mythtv_movies_test.php  2011-09-07 07:34:01.815988298 -0500
+++ mythtv_movies_test.php  2011-09-07 11:34:14.641362526 -0500
@@ -21,7 +21,7 @@
        $SQL = "SELECT * FROM videometadata";
    }

-        $result = mysql_query($SQL);
+        $result = mysql_query($SQL) or err(mysql_error());
         $num_rows = mysql_num_rows($result);

 print "
@@ -75,5 +75,11 @@
         mysql_close($db_handle);
 }

-
+function err($code){
+   if(strpos($code,'videometadata') !== false )
+       print "No video metadata found. Did you actually want to test viewing your <a href='mythtv_tv_test.php'>recordings instead</a>?";
+   else
+       print "A SQL error occurred ($code). Did you configure settings.php yet?";
+   exit;   
+}
 ?>
mattsteven commented 13 years ago

Hm, woulda been nice to have a preview, sorry if that was confusing. Here's a better post:

The problem is that I assumed "video" would be the proper test, and that "tv" meant live tv. So having a friendly error message that links to the "tv" script would save someone else the confusion.

ear9mrn commented 13 years ago

Applied patch. Thanks.