WIP Web-based XBMC Database Manager - HTML/JS/PHP - Updated 2012-07-26
#61
It would be great if you could try it out on windows, I reckon there's plenty of work to be done on file paths etc since I'm developing on linux.

(2012-07-26, 12:26)kaffekask Wrote: Ok, I'll have to install MySQL first and set up a test database for XBMC, so it will have to wait for a while.

I must often prefer to install things manual so I know what's going on, espacially since I run PHP on Windows and things are a little different then, but an installer sounds promising.

A simple installer is available via /install subfolder in www-root. It will create a new settings database with new user and db connection settings. I added some of the CodeIgniter database drivers as valid options for db type.
In the future I will make some sort of validation feature in the installer to check for dependencies etc but this should be enough for now.

The code is somewhat messy now since I had a 6 month break in development and got some perspective. Most of the code is in the process of being changed or removed Tongue
Reply
#62
Firstly, Thanks for writing this app. I have spent ages looking for a web interface to my xbmc video database that doesn't run on my xbmc box.
Secondly, I am not sure what distro you developed on but I can confirm that it (mostly) works on Fedora 17. I haven't got the thumbnails or fanart figured out yet.

There were a few tweaks I had to make on my system. I'll include them here in case anyone else runs into them

There's no way it would run from my NFS mount. I think this is a PHP limitation rather than anything to do with your app

I had to set my timezone in php.ini to avoid getting the error:
Message: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set()

Finally, I think line 192 of /var/www/xbmcdm/application/controllers/movies.php
Should be: $this->db->close();
Rather than: $this->db->close;
Reply
#63
That's nice to read Blush

The thumbnails folder needs to be in a subdirectory of www-root called thumbs. A symbolic link is fine. 0-1, a-f, generated and Music folders should then be directly inside www-root/thumbs/ folder. A mount -bind should be fine as well but not tested. Webserver user needs apropriate permissions.
This is required for the poster(/picture) change function to work at the moment.

The NFS mount problem could be because of how the app is set up, you should be able to get it to work. I will test this on suitable occasion.
I have edited the code and change to "$this->db->close();" well spotted Wink
The date() problem seems to be CodeIgniter related, I will see if I can find a suitable fix.

I am developing on Ubuntu/Arch linux but right now I don't have time for much deleopment since I just switched employer.
Reply
#64
:-) I felt bad pointing out missing parentheses. I only noticed because I was trying to clean up the error logs to help debug my thumbnail problem.

It turns out that I'm running 64bit fedora and I'm guessing you're 32bit so your hash code wasn't working for me.
Fortunately, (very fortunate because I'm not much of a coder) I was able to copy the relevant sample code from the xbmc wiki (http://wiki.xbmc.org/index.php?title=Thumbnails#PHP) and it is working for me now

Here's a patch file that shows the changes I had to make to get it working on 64 bit

Code:
--- ConfigDB.orig    2012-08-08 18:35:50.007240246 -0700
+++ ConfigDB.php    2012-08-08 18:54:34.365437525 -0700
@@ -81,14 +81,40 @@
                    }
                }
                }
-                if ($crc>=0)
+
+            if (strpos(php_uname('m'), '_64') !== false)
            {
-                return sprintf("%08s",sprintf("%x",sprintf("%u",$crc)));
-                }
+                //Formatting the output in a 8 character hex
+                if ($crc>=0)
+                {
+                    $hash = sprintf("%16s",sprintf("%x",sprintf("%u",$crc)));
+                }
+                else
+                {
+                    $source = sprintf('%b', $crc);
+                    $hash = "";
+                    while ($source <> "")
+                    {
+                        $digit = substr($source, -4);
+                        $hash = dechex(bindec($digit)) . $hash;
+                        $source = substr($source, 0, -4);
+                    }
+                }
+                $hash = substr($hash, 8);
+                return $hash;
+            }
            else
            {
-                return sprintf("%08s",base_convert(sprintf("%u",$crc),10,16));
-                }
+                //Formatting the output in a 8 character hex
+                    if ($crc>=0)
+                {
+                    return sprintf("%08s",sprintf("%x",sprintf("%u",$crc)));
+                    }
+                else
+                {
+                    return sprintf("%08s",base_convert(sprintf("%u",$crc),10,16));
+                    }
+            }
        }
        
        public function __destruct()
Reply
#65
(2012-08-09, 04:33)fugspit Wrote: :-) I felt bad pointing out missing parentheses. I only noticed because I was trying to clean up the error logs to help debug my thumbnail problem.

It turns out that I'm running 64bit fedora and I'm guessing you're 32bit so your hash code wasn't working for me.
Fortunately, (very fortunate because I'm not much of a coder) I was able to copy the relevant sample code from the xbmc wiki (http://wiki.xbmc.org/index.php?title=Thumbnails#PHP) and it is working for me now

Here's a patch file that shows the changes I had to make to get it working on 64 bit

Code:
--- ConfigDB.orig    2012-08-08 18:35:50.007240246 -0700
+++ ConfigDB.php    2012-08-08 18:54:34.365437525 -0700
@@ -81,14 +81,40 @@
                    }
                }
                }
-                if ($crc>=0)
+
+            if (strpos(php_uname('m'), '_64') !== false)
            {
-                return sprintf("%08s",sprintf("%x",sprintf("%u",$crc)));
-                }
+                //Formatting the output in a 8 character hex
+                if ($crc>=0)
+                {
+                    $hash = sprintf("%16s",sprintf("%x",sprintf("%u",$crc)));
+                }
+                else
+                {
+                    $source = sprintf('%b', $crc);
+                    $hash = "";
+                    while ($source <> "")
+                    {
+                        $digit = substr($source, -4);
+                        $hash = dechex(bindec($digit)) . $hash;
+                        $source = substr($source, 0, -4);
+                    }
+                }
+                $hash = substr($hash, 8);
+                return $hash;
+            }
            else
            {
-                return sprintf("%08s",base_convert(sprintf("%u",$crc),10,16));
-                }
+                //Formatting the output in a 8 character hex
+                    if ($crc>=0)
+                {
+                    return sprintf("%08s",sprintf("%x",sprintf("%u",$crc)));
+                    }
+                else
+                {
+                    return sprintf("%08s",base_convert(sprintf("%u",$crc),10,16));
+                    }
+            }
        }
        
        public function __destruct()

I have implemented the fix for 64-bit systems and setup a separate 64-bit machine for testing.
Hopefully I will be able to work on the codebase this week to cleanup the code somewhat..
Reply
#66
I got this installed, but the username and password I created just does not work. Keeps coming back "invalid username or password" and this time around I kept it simple with admin/admin

Also, it would be nice to know what Database should be chosen in "Database Details." should it be a new database for This app, should it be the Videos database created by XBMC?

I would like to get this fired up to play with it a bit.
Reply
#67
Yes it's the database that XBMC uses, the one you have specified in your advancedsettings.xml, the video database.
I was working on an installer but I have had 0 motivation for working on this so I have only made some minor commits since august Sad
Reply
#68
Well, I am using Frodo (12) from Openelec (on a Raspberry Pi) and in advancesettings.xml all I have set is the database server, user and password. Never asks to define the Table that XBMC creates (MyVideos75 in this case) so that is handled by XBMC. That will be easy enough to fix in configuration.

Still cannot log in Sad

And I understand the lack of motivation. I should be working...
Reply
#69
Is it a problem loging in to the web page or the database?
After a quick check at github I can see that the documents aren't updated, I kinda stopped in the middle of something Huh
The crude "installer" can be accessed from http://webroot/install, did you use this one? In that case you should have gotten a simple verification that it has created the settings db and connects OK to the database.
There was a typo in the installer so it always created the user with usernam 'xbmc'. Fixed now and a commit coming soon.

I haven't tried running it on Frodo yet so it could be that the database structure has changed.
Reply
#70
Just stumbled upon this thread. Wanted to know can you use this for modifying movie sets. its a real pain to do withing XBMC (changing poster and Fanart) when you have like 30+ to change. Seems every time a media manager comes along this feature is neglected Sad
Image

If my replies help you, please click on my reputation Image below :) thanks :)
Reply
#71
(2013-01-11, 19:59)saitoh183 Wrote: Just stumbled upon this thread. Wanted to know can you use this for modifying movie sets. its a real pain to do withing XBMC (changing poster and Fanart) when you have like 30+ to change. Seems every time a media manager comes along this feature is neglected Sad

No it doesn't yet and I'm not actively developing at the moment since I have too much of everything else and not enough motivation.
I took a quick look however and the sets have an own table in the database so developing the function shouldn't be that hard.
Reply
#72
Sets are supported by Ember and Mediaelch and also some XBMC web interface (forgot the name).
Kodi 17.x running on Nvidia Shield, 1x KODIbuntu
mySQL hosted on WHS 2011
Reply
#73
(2013-01-11, 23:41)Vicious Wrote:
(2013-01-11, 19:59)saitoh183 Wrote: Just stumbled upon this thread. Wanted to know can you use this for modifying movie sets. its a real pain to do withing XBMC (changing poster and Fanart) when you have like 30+ to change. Seems every time a media manager comes along this feature is neglected Sad

No it doesn't yet and I'm not actively developing at the moment since I have too much of everything else and not enough motivation.
I took a quick look however and the sets have an own table in the database so developing the function shouldn't be that hard.

All is handled through JSONRPC so no direct db editing needed
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#74
(2013-01-12, 02:05)Martijn Wrote: All is handled through JSONRPC so no direct db editing needed
Only if you have xbmc running. This is a standalone application that allows access to the xbmc library if you have an external database.
So database editing is required with this approach.
Reply
#75
(2013-01-12, 02:05)Martijn Wrote:
(2013-01-11, 23:41)Vicious Wrote:
(2013-01-11, 19:59)saitoh183 Wrote: Just stumbled upon this thread. Wanted to know can you use this for modifying movie sets. its a real pain to do withing XBMC (changing poster and Fanart) when you have like 30+ to change. Seems every time a media manager comes along this feature is neglected Sad

No it doesn't yet and I'm not actively developing at the moment since I have too much of everything else and not enough motivation.
I took a quick look however and the sets have an own table in the database so developing the function shouldn't be that hard.

All is handled through JSONRPC so no direct db editing needed

The editing of movies set is more about changing the Fanart and Poster of collection because what XBMC puts as default is never what most people want. So how does JSONRPC come into play?
Image

If my replies help you, please click on my reputation Image below :) thanks :)
Reply

Logout Mark Read Team Forum Stats Members Help
Web-based XBMC Database Manager - HTML/JS/PHP - Updated 2012-07-260