XBMC Community Forum
mythicalLibrarian - a tool to build Movie and TV Show library from MythTV recordings - Printable Version

+- XBMC Community Forum (http://forum.xbmc.org)
+-- Forum: Help and Support (/forumdisplay.php?fid=33)
+--- Forum: Supplementary Tools for XBMC (/forumdisplay.php?fid=116)
+--- Thread: mythicalLibrarian - a tool to build Movie and TV Show library from MythTV recordings (/showthread.php?tid=65644)



- iscraigh - 2010-09-12 20:07

More info

running the job from the mythweb interface on a recording came back as failed.

So I ran it from the command line as user craig and it ran fine but what about as user mythtv?

It failed


Code:
craig@myth-hd2:/home/mythtv/recordings/Episodes/AMA Pro Racing$ sudo su mythtv
[sudo] password for craig:
$ /usr/local/bin/mythicalLibrarian /home/mythtv/recordings/1219_20100911170000.mpg
/home/mythtv/recordings/1219_20100911170000.mpg
Revision 568 Sun Sep 12 10:04:35 PDT 2010
Accessing MythTV DataBase:
COMMERCIAL DATA START:21173 STOP:30406
COMMERCIAL DATA START:55780 STOP:63039
COMMERCIAL DATA START:84167 STOP:91591
COMMERCIAL DATA START:112659 STOP:121892
COMMERCIAL DATA START:136651 STOP:143921
COMMERCIAL DATA START:173172 STOP:180432
COMMERCIAL DATA START:195011 STOP:202420
RECSTART:2010-09-11 17:00:00 DATE: 2010-09-11
PROGRAMID:EP010383100342 ShowCategory:Sports event
PLOT: Motocross from Pala Raceway in Calif.
NO ZAP2IT ID FOUND. USING FUZZY LOGIC FOR TITLE RECOGNITION.
Please update TheTvDb.com
FUZZY LOGIC SHOW NAME:  ID:
WARNING: FILE IS A LINK FORCING SYMLINK LINK MODE
/usr/local/bin/mythicalLibrarian: line 268: /home/mythtv/recordings/Episodes/arbitraryfile.ext: Permission denied
mythtv TRIED TO WRITE TO /home/mythtv/recordings/Episodes --FAILED
QUICK FIX: sudo chmod a+w "/home/mythtv/recordings/Episodes"
QUICK FIX: sudo chown mythtv "/home/mythtv/recordings/Episodes"
/usr/local/bin/mythicalLibrarian: line 268: /home/mythtv/recordings/Episodes/arbitraryfile.ext: Permission denied
mythtv TRIED TO WRITE TO /home/mythtv/recordings/Episodes --FAILED
QUICK FIX: sudo chmod a+w "/home/mythtv/recordings/Episodes"
QUICK FIX: sudo chown mythtv "/home/mythtv/recordings/Episodes"
/usr/local/bin/mythicalLibrarian: line 268: /home/mythtv/recordings/Movies/arbitraryfile.ext: Permission denied
mythtv TRIED TO WRITE TO /home/mythtv/recordings/Movies --FAILED
QUICK FIX: sudo chmod a+w "/home/mythtv/recordings/Movies"
QUICK FIX: sudo chown mythtv "/home/mythtv/recordings/Movies"
/usr/local/bin/mythicalLibrarian: line 268: /home/mythtv/recordings/Movies/arbitraryfile.ext: Permission denied
mythtv TRIED TO WRITE TO /home/mythtv/recordings/Movies --FAILED
QUICK FIX: sudo chmod a+w "/home/mythtv/recordings/Movies"
QUICK FIX: sudo chown mythtv "/home/mythtv/recordings/Movies"
/usr/local/bin/mythicalLibrarian: line 268: /home/mythtv/recordings/Showings/arbitraryfile.ext: Permission denied
mythtv TRIED TO WRITE TO /home/mythtv/recordings/Showings --FAILED
QUICK FIX: sudo chmod a+w "/home/mythtv/recordings/Showings"
QUICK FIX: sudo chown mythtv "/home/mythtv/recordings/Showings"
/usr/local/bin/mythicalLibrarian: line 268: /home/mythtv/recordings/Showings/arbitraryfile.ext: Permission denied
mythtv TRIED TO WRITE TO /home/mythtv/recordings/Showings --FAILED
QUICK FIX: sudo chmod a+w "/home/mythtv/recordings/Showings"
QUICK FIX: sudo chown mythtv "/home/mythtv/recordings/Showings"
JOB: mythicalLibrarian '/home/mythtv/recordings/1219_20100911170000.mpg' 'AMA Pro Racing' '250cc: Pala'
WARNING: EPISODE INFORMATION COULD NOT BE OBTAINED
HANDLING AS A GENERAL SHOWING
Please consider helping out and adding to thetvdb.
TARGET SET:/home/mythtv/recordings/Episodes/AMA Pro Racing/AMA Pro Racing S2010E911 (250cc: Pala Recorded 2010-09-11@17.00.00)
FAILSAFE FLAG WAS SET
ATTEPMTING SYMLINK TO FAILSAFE DIR
ln: creating symbolic link `/home/mythtv/FailSafe/AMA Pro Racing S2010E911 (250cc: Pala Recorded 2010-09-11@17.00.00).mpg': No such file or directory
FILE SYSTEM ERROR:FailSafeModeComplete

This is a standard mythbuntu setup, if I stop the mythtbackend I do have to put in my user password to restart but I don't know how to tell what user it is running as? I would guess as mythtv. I don't want to mess around with ownership of folders without making sure. Current setup hasa job running as user mythtv this is failing probably because I originally set it up to run as user craig, but running as this user I cannot delete files and get incomplete (no) episode info

Craig


- outleradam - 2010-09-12 20:29

If mythtv is the desired user running MythTV, then you should always have permissions set for mythtv. User craig should not own anything which is under control of mythtv. Craig owns the files and the permissions are set to write only for the owner, the group and all have no write permissions. Therefore because mythtv cannot write, it cannot delete.

Perform the QUICK FIX actions which mythicalLibrarian suggested, or you can run this which will basically reset everything :

(I just updated the SVN so doMaintenance is automatically executed upon --undo)
Code:
cd ~/.mythicalLibrarian/mythicalSetup
mythicalLibrarian --update
sudo mythicalLibrarian --undo
sudo su mythtv
mythicalLibrarian --scan mpg /home/mythtv/recordings/


As for your other issue, share the /home/mythtv/recordings/ and add it as a source in XBMC. Make sure XBMC has "allow programs" and other machines to control this one.


- iscraigh - 2010-09-13 02:25

I'm gettint closer I had to change owner and group recursively then we were in business. My problem is now on the xbmc end, if I am not in library mode I get no episode information not a big deal I will just use library mode as it makes more sense for tv anyway. In library mode I have a show EG: True Blood
S3E01 it will show up with description nine times then S3E02 wil;l show up 8 times S3E03 seven times, and so on. This holds true for all shows (okay I did not check every show but after 5 or 6 I could see the pattern). Each link seems to work fine. I tried to clean the library it did not make a difference. Is there a mythicalLibrarian, or XBMC, command I can run that will clean this up.

I still have at least 2 episodes of undercover boss not showing up not sure what other shows are missing if any.

Great work though aside from my self inflicted problems this script is awesome.

Craig


- outleradam - 2010-09-13 02:41

Ok.. Let me see your dir structure. do this:
1.
Code:
xbmc@XBMC-live:~$ ls -lR /home/mythtv/recordings/>~/recursiveList
2. then open ~/recursiveList in gedit
3. paste that into http://www.pastebin.com
4. submit and paste the link here
This will be an extremely long list. Mine is about 3000 lines long. So don't paste it in here, just put it on pastebin where it can be seen.

I've seen it once before where the names were copied over and over by XBMC. This problem is an XBMC issue, but it can be fixed by removing the tvshow.nfo file. Are your showings mixed with the Episodes?


- iscraigh - 2010-09-13 04:40

http://pastebin.com/Tm4c8AWB

That should be what you are looking for


- iscraigh - 2010-09-13 06:20

Code:
Are your showings mixed with the Episodes

Not understanding the question?

Code:
locate tvshow
/usr/share/xbmc/web/tvshowepisodes.html
/usr/share/xbmc/web/tvshows.html
/usr/share/xbmc/web/tvshowseasons.html

don't seem to have this file

Sorry

Craig


- Nick8888 - 2010-09-13 08:12

tvshow.nfo is a file which contains information about a particular tvshow. xbmc reads them from your tv shows directory (where you place your tv shows).

It has nothing to do with what you just posted which is part of the xbmc web interface files.

If you look at the log you just posted and ctrl + f "tvshow.nfo" you will see.

eg. /home/mythtv/recordings/Showings/Glee/tvshow.nfo


- outleradam - 2010-09-13 14:42

^^ That's what it is.

iscraigh: you may want to upgrade XBMC. The problem went away a long time ago in the SVN. Dharma is comming out soon so you can grab the beta version or wait for the release.

Also, run
Code:
sudo chown -R mythtv /home/mythtv
to correct the problems created by running mythicalLibrarian on mythtv owned files as user craig.


- iscraigh - 2010-09-13 15:58

Im running the svn version from 1 week ago crystal hd now working with my myth hdpvr recordings got me looking @ your script. I will play with deleting the nfo files when i get home, thanks for your patience.

Craig


- outleradam - 2010-09-13 21:33

Once you delete the files, remove and re-add the source from XBMC to reset everything. If this problem persists, I will look at making a work around.