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

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



- outleradam - 2010-09-07

The first thing I noticed is that the permissions are wrong in your recordings dir.

Here is my mythtv recordings dir. At a minimum you must have RW access. I have not modified the permissions in this folder at all. This is default and normal. I also noticed that there are no pictures to go with your
Code:
-rw-rw-rw-  1 mythtv mythtv     14731 2010-09-04 18:15 1952_20100903100000.mpg.64.100x75.png
-rw-rw-rw-  1 mythtv mythtv    118677 2010-09-03 10:52 1952_20100903100000.mpg.png
lrwxrwxrwx  1 mythtv mythtv       138 2010-09-06 07:26 1952_20100906063000.mpg -> /home/mythtv/Videos/Episodes/Clifford the Big Red Dog/Season 2/Clifford the Big Red Dog S02E01 (Cliffords Valentines Day Special 2002).mpg
-rw-rw-rw-  1 mythtv mythtv    101323 2010-09-06 07:25 1952_20100906063000.mpg.png
lrwxrwxrwx  1 mythtv mythtv       124 2010-09-06 07:30 1952_20100906070000.mpg -> /home/mythtv/Videos/Episodes/Curious George (2006)/Season 5/Curious George (2006) S05E01 (George and Marco Sound It Out).mpg
-rw-rw-rw-  1 root   root      114387 2010-09-06 07:30 1952_20100906070000.mpg.png
drwxr-xr-x 16 mythtv mythtv      4096 2010-09-06 18:00 Episodes
drwxr-xr-x  2 mythtv mythtv      4096 2010-09-06 18:00 Movies
drwxr-xr-x 13 mythtv mythtv      4096 2010-09-06 18:00 Showings
Your permissions look like you chmod 555'd it. It should be 666'd. There is no write access in that folder, but every file is readable and executable which makes no sense for media files.
Code:
sudo chmod 666 /var/lib/mythtv/recordings
Make sure that mythtv is in the Robot group. I'm actually not sure why, but even the owner isn't allowed to do certain things unless they're a member of a group.
Code:
sudo useradd -G robot mythtv

Is it just that one entry that does not have any "new search initiated"? the next entry has it. It could have been that the updater was activated in the middle of mythtv processing the file so the log was dumped into the old log. Can I see the next entry? I would like to get more information. I'm getting ideas as to how to properly handle this, and I believe this setup issue could be handled autonomously in mythicalSetup.


- thrasherx - 2010-09-07

outleradam Wrote:The first thing I noticed is that the permissions are wrong in your recordings dir.

Here is my mythtv recordings dir. At a minimum you must have RW access. I have not modified the permissions in this folder at all. This is default and normal. I also noticed that there are no pictures to go with your
Code:
-rw-rw-rw-  1 mythtv mythtv     14731 2010-09-04 18:15 1952_20100903100000.mpg.64.100x75.png
-rw-rw-rw-  1 mythtv mythtv    118677 2010-09-03 10:52 1952_20100903100000.mpg.png
lrwxrwxrwx  1 mythtv mythtv       138 2010-09-06 07:26 1952_20100906063000.mpg -> /home/mythtv/Videos/Episodes/Clifford the Big Red Dog/Season 2/Clifford the Big Red Dog S02E01 (Cliffords Valentines Day Special 2002).mpg
-rw-rw-rw-  1 mythtv mythtv    101323 2010-09-06 07:25 1952_20100906063000.mpg.png
lrwxrwxrwx  1 mythtv mythtv       124 2010-09-06 07:30 1952_20100906070000.mpg -> /home/mythtv/Videos/Episodes/Curious George (2006)/Season 5/Curious George (2006) S05E01 (George and Marco Sound It Out).mpg
-rw-rw-rw-  1 root   root      114387 2010-09-06 07:30 1952_20100906070000.mpg.png
drwxr-xr-x 16 mythtv mythtv      4096 2010-09-06 18:00 Episodes
drwxr-xr-x  2 mythtv mythtv      4096 2010-09-06 18:00 Movies
drwxr-xr-x 13 mythtv mythtv      4096 2010-09-06 18:00 Showings
Your permissions look like you chmod 555'd it. It should be 666'd. There is no write access in that folder, but every file is readable and executable which makes no sense for media files.
Code:
sudo chmod 666 /var/lib/mythtv/recordings
Make sure that mythtv is in the Robot group. I'm actually not sure why, but even the owner isn't allowed to do certain things unless they're a member of a group.
Code:
sudo useradd -G robot mythtv

Is it just that one entry that does not have any "new search initiated"? the next entry has it. It could have been that the updater was activated in the middle of mythtv processing the file so the log was dumped into the old log. Can I see the next entry? I would like to get more information. I'm getting ideas as to how to properly handle this, and I believe this setup issue could be handled autonomously in mythicalSetup.

I manually deleted the pictures because they were temporary recordings.

mythtv was already in the robot group.

I have rw access to /var/lib/mythtv/recordings and /home/media-server/Videos/TV-Recorded/ We'll see what difference that makes. More to come tomorrow. Thanks!


- thrasherx - 2010-09-07

Update: Still no luck. My permissions look like this:

Code:
drwxrwxrwx  3 robot mythtv  4096 2010-09-06 22:48 TV-Recorded

For whatever reason if I 666 the folder, it turns into a file and I'm unable to open it using my main user. I've also 'chmod a-x' and get the same result:

Code:
drw-rw-rw-  3 robot mythtv  4096 2010-09-06 22:48 TV-Recorded

When I try and ls -l the contents, it returns:

Code:
/home/media-server/Videos/TV-Recorded:
total 0
d????????? ? ? ? ?                ? Access Hollywood
ls: cannot open directory /home/media-server/Videos/TV-Recorded/Access Hollywood: Permission denied



- outleradam - 2010-09-07

chmod +x on a folder makes the folder a valid system folder. You want
Code:
chmod -R a+r /home/media-server/Videos/TV-Recorded
chmod -R a+w /home/media-server/Videos/TV-Recorded
chmod +x /home/media-server/Videos/TV-Recorded



- thrasherx - 2010-09-08

Still no luck with the above. I messaged you back. Thanks for your patience!


- outleradam - 2010-09-08

Alright, I just figured out why the log is truncating. I will fix that later tonight and post here.


- outleradam - 2010-09-09

I just committed a change that will fix the log problem. Please update then run mythicalLibrarian "/path_to/file.ext"

The results should clear up everything.


- GregoryK - 2010-09-10

Adam:

I'm unclear what the status of stable/SVN is now. Are you still recommending that we go with stable only releases when updating?

mL is working great for me right now, btw, thanks for your continued support of this script. Once Dharma gets final, I hope to wean the family off of mythfrontend.

Thanks,

/Greg


- outleradam - 2010-09-10

Right now, SVN = Stable, with a few minor punctuation changes in the logs.

If Stable is working for you, then SVN will work for you.

I'm working with ThrasherX to find out the problems in the setup. His configuration does not comply with mythicalLibrarian's expected setup. We are working to figure it out. Once the problem is resolved, I will add changes to mythicalLibrarian to account for the issue and then begin mythicalLibrarian's job scheduling routines.

Once the work has begun on the job scheduler, mythicalLibrarian's SVN should be considered "unstable" instead of Latest version. The reason is, since it's inception, mythicalLibrarian has run from start to finish and that was all. The job scheduler will basically create another instance of mythicalLibrarian to be run in the future. This could lead to problems dealing with mythicalLibrarian's database being accessed by two jobs at the same time. So the mythicalLibrarian working folder will have to be reworked based on timestamp and name of the show/channel recorded.

The work has not yet started so feel free to update to SVN. It looks like this project may be pushed toward starting Sunday or later. For now my focus is fixing the issues ThrasherX is experiencing.

BTW.. Thank you for the compliment. It's not often I hear something positive and I appreciate it.


- iscraigh - 2010-09-12

Posting in the correct thread this time.
I am unable to delete files from mythtv, the logs show the failure but no cause.

I seem to have a permissions issue

In the recordings directory things look like this

Code:
-rw-rw-rw-  1 mythtv mythtv      13164 2010-08-21 16:36 2158_20100814040000.mpg.64.100x75.png
-rw-rw-rw-  1 craig  craig      107940 2010-08-14 06:58 2158_20100814040000.mpg.png
lrwxrwxrwx  1 craig  craig         137 2010-09-11 13:54 2158_20100821050000.mpg -> /home/mythtv/recordings/Episodes/The Bachelorette/Season 3/The Bachelorette S03E02 (The Bachelorette After the Final Rose (Season 2)).mpg
-rw-rw-rw-  1 mythtv mythtv      15124 2010-08-21 15:15 2158_20100821050000.mpg.64.100x75.png
-rw-rw-rw-  1 craig  craig      127031 2010-08-21 06:29 2158_20100821050000.mpg.png



In the episodes directory they look like this
Code:
ls -la /home/mythtv/recordings/Episodes/The\ Bachelorette/Season\ 5/
total 6825916
drwxr-xr-x 2 craig  craig        4096 2010-09-11 13:54 .
drwxr-xr-x 5 craig  craig        4096 2010-09-11 13:54 ..
-rw-r--r-- 1 mythtv mythtv 2331160512 2010-08-07 06:00 The Bachelorette S05E10 (The Bachelorette The Men Tell All).mpg
-rw-r--r-- 1 craig  craig         111 2010-09-11 13:53 The Bachelorette S05E10 (The Bachelorette The Men Tell All).txt
-rw-r--r-- 1 mythtv mythtv 4658550720 2010-08-14 06:00 The Bachelorette S05E11 (Episode 11).mpg
-rw-r--r-- 1 craig  craig         154 2010-09-11 13:53 The Bachelorette S05E11 (Episode 11).txt

The renamed files are owned by mythtv but the symlink in the recordings folder is owned by craig

Am I on the right track if so what do I do to correct?

When I ran the setup and it asked who the user running the job was I took the default in the box "craig" , I updated this morning and chose mythtv.

Was choosing craig the root of my issue?


Problem 2

I am not getting program info in xbmc and every episode is not showing up.

I get a fanart background for the series but the individual shows have no info or artwork. I do see notifications of shows being added though.


thanks

Craig


- iscraigh - 2010-09-12

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 [email protected])
FAILSAFE FLAG WAS SET
ATTEPMTING SYMLINK TO FAILSAFE DIR
ln: creating symbolic link `/home/mythtv/FailSafe/AMA Pro Racing S2010E911 (250cc: Pala Recorded [email protected]).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

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

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

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

http://pastebin.com/Tm4c8AWB

That should be what you are looking for