[AppleTV2] MySQL database / library support?

  Thread Rating:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
RudolfR Offline
Member
Posts: 60
Joined: May 2011
Reputation: 0
Post: #241
vmsferreira Wrote:Anynone can help? please Sad thanks

Regards

VF

It seems that it's trying to upgrade your database version from 42 to 53, and fails.

What version XBMC are your trying to share with? You need a nightly if you want to be compatible with ATV2.

I suggest you DROP your databases and recreate them with your ATV2.
find quote
vmsferreira Offline
Donor
Posts: 59
Joined: May 2011
Reputation: 0
Post: #242
I'm sharing with my windows PC (10.1). The ATV2 have the last official build.

I did what you suggested, recreate the DB using ATV2, installed the last nightly for windows and now is the xbmc on windows that is not working Sad

appear this error on the log:

16:49:57 T:10464 M:1992003584 ERROR: Error Type: <type 'exceptions.ValueError'>
16:49:57 T:10464 M:1992003584 ERROR: Error Contents: invalid literal for int() with base 10: 'smb://atv2:atv2@NAS/MULTIMEDIA/Movies/123/9'
16:49:57 T:10464 M:1992204288 ERROR: Traceback (most recent call last):
File "C:\Users\VMSFerreira\AppData\Roaming\XBMC\addons\script.recentlyadded\RecentlyAd​ded.py", line 350, in <module>
Main()
File "C:\Users\VMSFerreira\AppData\Roaming\XBMC\addons\script.recentlyadded\RecentlyAd​ded.py", line 106, in __init__
self._fetch_totals()
File "C:\Users\VMSFerreira\AppData\Roaming\XBMC\addons\script.recentlyadded\RecentlyAd​ded.py", line 137, in _fetch_totals
movies_totals[ 6 ] = datetime.date( int( date[ 0 ] ), int( date[ 1 ] ), int( date[ 2 ] ) ).strftime( date_format ) # last played
ValueError: invalid literal for int() with base 10: 'smb://atv2:atv2@NAS/MULTIMEDIA/Movies/123/9'


Anyone can helpConfused

VF
(This post was last modified: 2011-07-01 17:56 by vmsferreira.)
find quote
Blaxxor Offline
Member
Posts: 52
Joined: Oct 2010
Reputation: 0
Post: #243
How do I change advancedsettings.xml to use SQL on an Ipad 2 ?

Where, and how do I find the xml file and edit it ?
find quote
CSB! Offline
Junior Member
Posts: 34
Joined: Jun 2011
Reputation: 0
Post: #244
Blaxxor Wrote:How do I change advancedsettings.xml to use SQL on an Ipad 2 ?

Where, and how do I find the xml file and edit it ?

/private/var/mobile/Libarary/Preferences/XBMC/userdata/advancedsettings.xml

You'll need to have either an ssh daemon or mobile terminal to access it, as well as whatever editor you prefer...

Back up your database first by exporting it on an existing box. Be aware, if your current installations are the stable releases, you're going to hose your database. I just did, and without a back-up!
find quote
Blaxxor Offline
Member
Posts: 52
Joined: Oct 2010
Reputation: 0
Post: #245
CSB! Wrote:/private/var/mobile/Libarary/Preferences/XBMC/userdata/advancedsettings.xml

You'll need to have either an ssh daemon or mobile terminal to access it, as well as whatever editor you prefer...

Back up your database first by exporting it on an existing box. Be aware, if your current installations are the stable releases, you're going to hose your database. I just did, and without a back-up!

That doesn't sound very easy to me. Maybe I should ignore XBMC om my iPad2 and use Air video as I did before.

But it would still be nice using XBMC, it works so well om my HTPC's.
find quote
Duncan Miller Offline
Junior Member
Posts: 27
Joined: Mar 2011
Reputation: 0
Post: #246
lanre Wrote:i have what may be a very simple problem, that, after reading through all 24 pages of this thread, i can't seem to find a solution.

bit of background: i have all my media (and mysql) on a windows home server, i have a HTPC with Windows 7, and atv2 in the bedroom. I have changed advancedsettings.xml to map to mysql and this works fine on both machines.

my atv2 connects fine to the mysql server, but whenever i try to play anything, it says the file no longer exists.

in xbmc.log, i get "permission denied" errors whenever it tries to go get a file.

I'm assuming the problem is that it doesn't have the user/pass combination to gain access to my server, but I've no idea where/how to feed this in.

Would appreciate any help you guys can provide on this.

thanks in advance

EDIT:

Scratch that - all seems to be working now. I set the folder on the server to allow everyone to access, and I made sure that the server folders were in videos as sources.

The problem here is that although your ATV is looking at the database ok you haven't added the sources to the ATV - you still have to do that seperately (i had the same issue)

So add the sources to atv and make sure you give them the same name etc... then you should be fine
find quote
CSB! Offline
Junior Member
Posts: 34
Joined: Jun 2011
Reputation: 0
Post: #247
Blaxxor Wrote:That doesn't sound very easy to me. Maybe I should ignore XBMC om my iPad2 and use Air video as I did before.

But it would still be nice using XBMC, it works so well om my HTPC's.

It's pretty simple if you have any experience administering a posix box through the CLI... the only dicey part is porting all your other installs to a newer version. I opted to run a local library on the iPad, instead.
find quote
Blaxxor Offline
Member
Posts: 52
Joined: Oct 2010
Reputation: 0
Post: #248
CSB! Wrote:It's pretty simple if you have any experience administering a posix box through the CLI... the only dicey part is porting all your other installs to a newer version. I opted to run a local library on the iPad, instead.

My other installations are all the most recent offical.

But I have nog previous experience of what you asking. Too bad. Would really like to have XBMC connected to SQL, but I have no clue how to fix it Smile

//Stellan
find quote
Ned Scott Offline
Team-Kodi Wiki Guy
Posts: 20,576
Joined: Jan 2011
Reputation: 265
Location: Arizona, USA
Post: #249
Blaxxor Wrote:That doesn't sound very easy to me. Maybe I should ignore XBMC om my iPad2 and use Air video as I did before.

But it would still be nice using XBMC, it works so well om my HTPC's.

That's only if you want to use a shared library feature (keeping movie info and what you watched and didn't watch in sync with other XBMC copies). The single individual library feature on the iPad itself will work just fine without messing with any of this. Using it just in plain old file mode (which now is just not "scrapping") works too. AirVideo doesn't show any of this data either.
find quote
Blaxxor Offline
Member
Posts: 52
Joined: Oct 2010
Reputation: 0
Post: #250
Ned Scott Wrote:That's only if you want to use a shared library feature (keeping movie info and what you watched and didn't watch in sync with other XBMC copies). The single individual library feature on the iPad itself will work just fine without messing with any of this. Using it just in plain old file mode (which now is just not "scrapping") works too. AirVideo doesn't show any of this data either.

No i know. But the main reason for me to use XBMC was that I should be connected to my SQL.

I'm not stupid so i might be able to change the xmlfile if there was a guide around that told me step by step how to fix it Laugh

//Stellan
find quote
joshua.lyon Offline
Donor
Posts: 87
Joined: Dec 2009
Reputation: 1
Location: North Texas
Post: #251
Blaxxor Wrote:My other installations are all the most recent offical.

But I have nog previous experience of what you asking. Too bad. Would really like to have XBMC connected to SQL, but I have no clue how to fix it Smile

//Stellan

As far as I'm aware, the most recent officials are running on older code (and older databases) than the latest iOS builds. I ended up upgrading my main HTPC to an unstable (Linux) build so the database version between it and my AppleTV 2 would be in sync.
find quote
urbanracer34 Offline
Junior Member
Posts: 19
Joined: May 2011
Reputation: 2
Location: Canada
Post: #252
I set this up with a Mac OS X server 10.6.8 running on a mac mini with MYSQL and the content held on a Drobo. 2 ATV2s jailbroken and everything (ATV version 4.2.1)

I passworded the shares, for my TV and Movies along with the thumbnail share.

Got mysql library functioning no problem, but no thumbnails for ANYTHING!

What was the problem? I forgot to give XBMC the user/pass for the thumbnails! Did that, wiped the DB, re-ran the library scan, and everything appears to work perfectly!

Just a heads up for anyone with this kind of problem.
find quote
adsharp Offline
Junior Member
Posts: 3
Joined: Jan 2010
Reputation: 0
Post: #253
(2011-02-28 00:57)TheRealDL Wrote:  This is my first post.

I wanted to be able to share my video library across our private network. I purchased two AppleTV2's for just the airplay functionality. I was happy to find a couple of better solutions than Apples iTunes Home Sharing for my 500 Movies and TV Shows. I tried the first one, easy setup, but slow performance. Found out they forked XBMC and bounced away.

Then I bit the bullet and began the journey called XBMC.

I've started a OS X Server with the native MySQL Server running and created the database and advancedsettings.zml outlined in the LifeHacker post. This was pretty good... until I changed the title or artwork of a movie from an AppleTV or MAC OS X Client. POOF. Database gone from view. Run a nightly build? POOF! database gone.

DROP database, CREATE database... I'd say half a dozen times over 2 weeks until I concluded that it was the Apple TV's having WRITE access to xbmc_video!!!!! Oooooo.

Without fanfair, and purely for myself should I ever need it, here is how I'm set up today.

First, The MySQL 'my.cnf' needs a few performance tweeks.


Code:
[client]
socket = /var/mysql/mysql.sock
        
[mysqld]
skip-sync-frm
skip-thread-priority
skip-name-resolve

Second, Need to create the database users. We need a read/write and read only user.

Code:
CREATE USER 'xbmc' IDENTIFIED BY 'yourpassword';
CREATE USER 'xbmcadmin' IDENTIFIED BY 'adminpassword';

...and the databases.

Code:
CREATE database xbmc_video;
CREATE database xbmc_music;

...and grant the rights allowing the Server to write and the Apple TV's read only.

Code:
GRANT ALL ON *.* TO 'xbmcadmin';
GRANT ALL ON *.* TO 'xbmcadmin'@'localhost';
GRANT SELECT ON *.* TO 'xbmc';

Everything is cool at this point EXCEPT my Wife says that she can't stop watching in one room and resume from where she left off in the other room. In other words, a showstopper Smile

So I investigated this a bit and came up with another GRANT...

Code:
GRANT ALL ON [b]xbmc_video.bookmark[/b] TO 'xbmc';

and another for Watched/Unwatched.

Code:
GRANT ALL ON xbmc_video.files to 'xbmc';

I then setup 2 SAMBA sharepoints with guest access on the OS X Server, 'Movies' and 'TV'.

During earlier setups I ran into mongo issues with thumbnails. After resolving that I wanted them outside the /Library, I put them on another drive and setup a SAMBA share point with guest access.

To get XBMC on the server pointed where I wanted it to go, I created a symbolic link in /XBMC to my chosen thumbnail folder.

Code:
ln -s /YourDesiredLocation/thumbnails/ /Users/USERNAME/Library/Application\ Support/XBMC/Thumbnails

Then I setup the advancedsettings.xml on SERVERNAME

Code:
<advancedsettings>

    <videodatabase>
        <type>mysql</type>
        <host>SERVERNAME</host>
        <port>3306</port>
        <user>xbmcadmin</user>
        <pass>ADMINPASSWORD</pass>
        <name>xbmc_video</name>
    </videodatabase>

    <musicdatabase>
        <type>mysql</type>
        <host>SERVERNAME</host>
        <port>3306</port>
        <user>xbmcadmin</user>
        <pass>ADMINPASSWORD</pass>
        <name>xbmc_music</name>
    </musicdatabase>

</advancedsettings>

... And the Apple TV's.

Code:
    <videodatabase>
        <type>mysql</type>
        <host>SERVERNAME</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>YOURPASSWORD</pass>
        <name>xbmc_video</name>
    </videodatabase>

    <musicdatabase>
        <type>mysql</type>
        <host>SERVERNAME</host>
        <port>3306</port>
        <user>xbmc</user>
        <pass>YOURPASSWORD</pass>
        <name>xbmc_music</name>
    </musicdatabase>

    <pathsubstitution>
        <substitute>        
            <from>special://thumbnails</from>
            <to>smb://SERVERNAME/xbmc.thumbnails/</to>
        </substitute>
    </pathsubstitution>
  
</advancedsettings>

I then used XBMC on the Server with this Sources.xml

Code:
<sources>
    <programs>
        <default pathversion="1"></default>
    </programs>
    <video>
        <default pathversion="1"></default>
        <source>
            <name>Movies</name>
            <path pathversion="1">smb://USERNAME:PASSWORD@SERVERNAME/Movies/</path>
        </source>
        <source>
            <name>TV</name>
            <path pathversion="1">smb://USERNAME:PASSWORD@SERVERNAME/TV/</path>
        </source>
    </video>
    <music>
        <default pathversion="1"></default>
    </music>
    <pictures>
        <default pathversion="1"></default>
    </pictures>
    <files>
        <default pathversion="1"></default>
    </files>
</sources>

Using XBMC, I added the 'Movie' and 'TV" as Sources and scraped the database. Reviewing and correcting the scraping errors over a day cleaned up the database and I exported from XBMC incase it went POOF again.

I'm glad to say it's ROCKING!!! The Apple TV's have "Movies" and "TV" with all artwork and resumability.

I wanted to say THANK YOU to anyone having to do with this project and kindly answering questions to those that ask.

TheRealDL

For anyone using this setup, (as I have been for the last year or so), Eden changes the name of the databases, requiring permissions to be added for the new database names to effectively use the "watched flag" and "stop position". Essentially, open a query window and execute:
Code:
    GRANT ALL ON xbmc_video57.bookmark TO 'atv2';
    GRANT ALL ON xbmc_video57.files to 'atv2';    
    GRANT ALL ON xbmc_video58.bookmark TO 'atv2';
    GRANT ALL ON xbmc_video58.files to 'atv2';
    GRANT ALL ON xbmc_video60.bookmark TO 'atv2';
    GRANT ALL ON xbmc_video60.files to 'atv2'
or whatever version has been added to your essential libraries.
Big Grin
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 26,228
Joined: Oct 2003
Reputation: 177
Post: #254
Read the wiki. XBMC need permissions to create databases.

Never, ever, create databases yourself.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
acyclovir Offline
Junior Member
Posts: 1
Joined: Oct 2012
Reputation: 0
Post: #255
Hi, i have made a pathsubstitution, advancedsettings.xml etc.. to share databases between my atv2, and my mac mini, mysql database is located in my synology ds, every thing works perfectly except for: logos, clear arts, same as all artwork downloader´s stuff; there is no skin capable of read any of them, i have given the needed permissions, i am using protected smb, but artwork downloader seems not to like protected smb, is there any one could help me

Thanks in advance (sorry about my poor english)
find quote
Post Reply