Feature Request: Remote Database and/or Movie List Export (1 Viewer)

Status
Not open for further replies.

shackrock

Portal Pro
December 27, 2008
291
12
Raleigh, NC
Home Country
United States of America United States of America
So another thread prompted me to think about this, and the more I think about it the more I think it should exist! haha.

Every time Moving Pictures adds a movie to the database, it also adds it to a remote database:
For example:
* Updates the movie info/list in an html file on a server somewhere
* Updates the database in another location (maybe on a remote computer), maybe a locally networked computer

Or even the ability to export the data from the database would be nice... Just to have a list.
 

marvenius

Portal Pro
September 3, 2008
523
47
Belgium
Home Country
Netherlands Netherlands
the ability to export is on the list of todo's, together with the possibility to create a missing nfo file.
 

LRFalk01

Portal Pro
August 27, 2007
257
92
36
Home Country
United States of America United States of America
This is all stored on a local sqlite database. You can install an ODBC driver and open this up in excel. I have made a php page the display my Moving-Pictures movies so people at work quit asking me what movies I have:

MediaPortal Movies

PHP uses the PDO driver for its sqlite3 connection.

-LRFalk01
 

shackrock

Portal Pro
December 27, 2008
291
12
Raleigh, NC
Home Country
United States of America United States of America
LRfalk .... HOW did you do that?? hahaha. I really think you should create a tutorial of sorts, because that is just perfect!! You could post it up on media portal's site as a tutorial.

I'd also like to figure out:
Add another feild for "My Rating" (or something else, perhaps).
Ability to sort by a different field on the php doc.

So..if you have the time, please share more details!
 

fforde

Community Plugin Dev
June 7, 2007
2,666
1,699
40
Texas
Home Country
United States of America United States of America
Wow, very nice LRFalk01. I too would not mind seeing your PHP code for that little setup. :p
 

LRFalk01

Portal Pro
August 27, 2007
257
92
36
Home Country
United States of America United States of America
At the moment all this does is display the movies in descending order by the sortable field. This could very easily be made into a lot more if there is interest in it. I know a bit of C# if it needs to be an aspx page . . . but asp.net is a lot of hassle IMO. This is running on XAMPP (apache/PHP) you have to enable the PHP PDO and the SQLite extension. The same effect can be made by setting up IIS / PHP. Please do not make fun of my code : )

Here is the php code. I used javascript for the nifty hover effect (eye candy), and CSS for the looks.

Code:
<?php

try {
    /*** connect to SQLite database ***/
    $dbh = new PDO("sqlite:C:\Documents and Settings\All Users\Application Data\Team MediaPortal\MediaPortal\database\movingpictures.db3");
    }
catch(PDOException $e){
    echo $e->getMessage();
    }

$queryStatement = 'SELECT id, sortby, year, genres, score, imdb_id, certification, runtime FROM movie_info ORDER BY sortby ASC';

//Query results
$stmt = $dbh->query($queryStatement);

?>
        <table border='1'>
            <thead>
                <tr>
                    <td>Title</td>
                    <td>Year</td>
                    <td>Genres</td>
                    <td>Score</td>
                    <td>Rating</td>
                    <td>Runtime</td>
                    <td>IMDB</td>
                </tr>
            </thead>
        <?php
        //loop through results to make table
while($next_row = $stmt->fetch(PDO::FETCH_ASSOC))
    {
        ?>
<tr class="movieRow" id="<?php print($next_row["id"]);?>">
                <td class="movieTitle"><?php print($next_row["sortby"]); ?></td>
                <td class="movieYear"><?php print($next_row["year"]); ?></td>
                <td class="movieGenres"><?php print(str_replace('|', ' | ', $next_row["genres"])); ?></td>
                <td class="movieScore"><?php print($next_row["score"]); ?></td>
                <td class="movieRating"><?php print($next_row["certification"]); ?></td>
                <td class="movieLength"><?php print($next_row["runtime"]); ?></td>
                <td class="movieImdb"><a href="http://www.imdb.com/title/<?php print($next_row["imdb_id"]); ?>">IMDB</a></td>    
            </tr>
        <?php
        }
        ?>
        </table>

?>
 

shackrock

Portal Pro
December 27, 2008
291
12
Raleigh, NC
Home Country
United States of America United States of America
Well this business is a bit over my head lrfalk, haha.

Maybe somebody can make a plugin or something to do this? Or at least some more defined processes/tutorial? it IS open source....! haha.
 

LRFalk01

Portal Pro
August 27, 2007
257
92
36
Home Country
United States of America United States of America
Well this business is a bit over my head lrfalk, haha.

Maybe somebody can make a plugin or something to do this? Or at least some more defined processes/tutorial? it IS open source....! haha.

Please check out this site:
apache friends - xampp for windows

This is not something that one can just copy to a folder and have work. One needs to have a web server installed for this to work. the Default installation for xampp can accommodate you for this need; however, it does open you up to some security issues. (only need to install apache)

C:\xampp\apache\bin\php.ini

in this file you will need to take the ';' out of these two lines:

extension=php_pdo.dll
extension=php_sqlite.dll

C:\xampp\htdocs

This is the root of your web server.

You can add a 'Movies' folder to this and make a file named 'index.php'. In this file you can copy paste the code above. from your MP PC you should be able to bring up a web browser and go to 'localhost/movies' and see the list of movies.

If you want to be able to see this from outside of your network, you will need to forward port 80 from your router to your MP PC. Otherwise only computers on your local network can go to <compName/IP>/movies in a web browser to see your list of movies. I highly recommend you correct the default install of xampp (as far as the security issues) before you make anything available over port 80. Another note: some ISPs do not let you host port 80.

-LRFalk01
 

shackrock

Portal Pro
December 27, 2008
291
12
Raleigh, NC
Home Country
United States of America United States of America
Hmmm...this makes more sense (at least it's starting to).

I do have 3rd party webspace and a domain name (dreamhost.com is the host).... and i the interest of security (as you rightly stated).... can I use xampp to update files on my dreamhost account (perhaps, by FTP), and then just put that PHP file on there as well?

In other words, do what you described on a remote copmuter over the net, instead of ON my HTPC. ?

Thanks.
 
Status
Not open for further replies.

Users who are viewing this thread

Similar threads

Sad to see you replied so late, I've long since moved from 32bit to 64bit, so you've gone through all that trouble to help me for nothing. Thanks anyway. Emph
Sad to see you replied so late, I've long since moved from 32bit to 64bit, so you've gone through all that trouble to help me for...
************************************************* EDIT 2019-04-29: New version, see Gitlad for change log. Thank you SINCowboy So...
Replies
25
Views
9K
Would have been cool, but no. For this, and a few other reasons, I moved on to Channels DVR. More or less the same idea though, as I'm using Channels as a backend for Plex with xTeVe as a virtual tuner. I've lost touch somewhat with what's going on with MePo, but Channels is being very actively developed (which is key, as there's a...
Would have been cool, but no. For this, and a few other reasons, I moved on to Channels DVR. More or less the same idea though...
Love MediaPortal 1! I've been using it for years, originally with the MePo client and for the last few years as a backend for...
Replies
6
Views
2K
Good work guys!
Good work guys!
We are proud to present MediaPortal 2.2.1 After the release of MediaPortal 2.2 Final the team focussed on improving usability and...
Replies
1
Views
3K
OK, this is specifically for people in Belgium (Vlaanderen) who are using Telenet Cable with MediaPortal 2. Next year (Edit: this year, in march 2020) the Telenet provider will stop broadcasting Analog TV and Radio signals on their cable, and make the switch to Digital (DVB-C). The radio signals will disappear completely, so you'll...
OK, this is specifically for people in Belgium (Vlaanderen) who are using Telenet Cable with MediaPortal 2. Next year (Edit: this...
OK, this is specifically for people in Belgium (Vlaanderen) who are using Telenet Cable with MediaPortal 2. Next year (Edit: this...
Replies
0
Views
906
EPG Collector can grab the DVB EPG and save it as an XMLTV file, which both TVServer and many other TV backends can import. EPG Collector can also extract episode and season info from titles and descriptions for OpenTV (maybe MHEG5 too) and place them into the episode num tag. Perhaps you could contact Steve Bickell to see if you...
EPG Collector can grab the DVB EPG and save it as an XMLTV file, which both TVServer and many other TV backends can import. EPG...
Hi, I know this post is very long, so I have highlighted some parts of the text as a TL;DR version. I have been using MP 1 since...
Replies
2
Views
2K
Top Bottom