Kodi Community Forum

Full Version: mythicalLibrarian - a tool to build Movie and TV Show library from MythTV recordings
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have not figured out a POSIX way to change permissions yet from mythicalSetup. If anyone can tell me how to go about getting the name of my group from the terminal that would be great.
Here is the state of mythicalLibrarian as of right now:

linux - I am aware of no errors.

Darwin/Mac OS X- I am aware of no hard errors/show stoppers. mythicalSetup needs some work to make sure that the user only needs to run mythicalSetup. There are a few small errors relating to features which cannot be used on darwin platform such as Desktop Notifications and setting folder permissions.

Instructions for Mac: Always run mythicalSetup as the user who will be running mythBackend, and make sure you verify that the user running mythicalLibrarian has permissions to the folders you've selected or choose use original DIR.

SVN 476 to stable

Just to let everyone know, I will be here to answer questions for a bit tomorrow morning, then I'm on vacation until Thursday.


<---see that scales button down there? use it please! Gosh, I do this for free for you guys.
I'm not sure how it happened but when I looked on my backend setup there were two entries for mythicalLibrarian. Once possibility is if I renamed the user job then your setup might not realize it's already there and added user job #2.
If the user job does not match perfectly, then it will create a new user job. The user jobs are not enabled on the recordings by default. You have to specify that you want them run on each recording in the recordings manager. mythcialSetup will only input the job title, the job command and make it available to you in mythtv.

Open source is about software freedom, enabling is one thing, but making it manditory is something else. I thought it would be a bit "controlling" if I were to make the job run automatically by default.

So, just specify within mythtv frontend that you want mythicalLibrarian job run on each recording in the recording setup.
getting closer..
but i think something's confusing it. it's resolving everything to Glee. my wife is going to be confused when she goes to watch it..
Code:
MY USER NAME:htpc-
LISTING INTERNAL VARIABLES USED BY mythicalLibrarian.
INTERNET TIMEOUT:50- TVDB API KEY:6DF511BB2A64E0E9- mythicalLibrarian WORKING DIR:/Users/htpc/.mythicalLibrarian-
MOVE DIR:/Volumes/pvr/tv- USING SHOWNAME AS FOLDER:Enabled-
FAILSAFE MODE:Enabled- FAILSAFE DIR:/home/mythtv/FailSafe- ALTERNATE MOVE DIR:/Users/htpc/Episodes-
USE ORIGINAL DIR:Disabled NOTIFICATIONS:Disabled DEBUG MODE:Enabled-
INPUT SHOW NAME:Castle- LOCAL SHOW NAME TRANSLATION:- ShowName:Castle
DATABASE UPDATED:- TVDB LAST UPDATED:1274306618- CURRENT:1274236618-
RESOLVED SERIES ID:83610- RESOVED SHOW NAME:Glee-
INPUT EPISODE NAME:A Deadly Game- ABSOLOUTE EPISODE NUMBER:10- RESOLVED EPISODE NAME:Jane Lynch A to Glee-
SEASON:S00- EPISODE:E10- SYMLINK MODE:MOVE- FILESIZE: 0kB-
CREATE AND DELETE FLAGS: ORIGINALDIR:1- FREE:572746128kB- WORKINGDIR:1 FREE:139223920kB-
MOVEDIRWRITABLE:1- FREE:572746128kB- ALTERNATEMOVEDIR:0- FREE:kB-
PRIMARYSHOWDIRWRITABLE:1-  FREE:572746128kB-ALTERNATESHOWDIRWRITABLE:1- FREE:572746128kB-
PRIMARYMOVIEDIRWRITABLE:1- FREE:139223920kB- ALTERNATEMOVIEDIR:0- FREE:139223920kB-
DATABASE TYPE:schedulesdirect1-
RECSTART:2010-05-17 21:00:00- MOVIE YEAR:- ORIGINAL SERIES DATE:2010-05-17-
PROGRAMID:EP010855880034- CHANNEL ID:1301- CATEGORY:Crime- GOFORDOOVER:1-
EXTRAPOLATED DATA DETERMINED THIS RECORDING AS A:Series With Episode Data- STARS:0 RATING:0
ZAP2IT SERIES ID:1085588- MATCHED TVDB SERIES ID:-
PLOT: Castle and Beckett investigate what seems to be an intelligence operative's assassination; Beckett's relationship with Demming strains her relationship with Castle.
####################END OF DEBUG LOG#####################
MOVING FILE: '1301_20100517210000.mpg' to '/Volumes/pvr/tv/Glee/Season 0/Glee S00E10 (Jane Lynch A to Glee).mpg'
Log on to thetvdb and add a zap2it I'd for castle. That makes no sense though. Try running
sudo su htpc
mythicalLibrarian --doMaintenance
mythicalLibrarian --update


I cannot account for glee at all.
Then do a --undo and a --scan on that dir.
Is everything working properly?
I've been distracted with work.


did a clean install of latest this morning, and this was the log after a myth scheduled job execution

Code:
@@@@@@@@@@@NEW SEARCH INITIATED AT Sat May 29 10:00:39 CDT [email protected]@@@@@@@@@@@@@
Revision 476 Sat May 29 09:23:37 CDT 2010

here's the console log
Code:
mythbackend[169]    2010-05-29 10:00:39.058 ProgramInfo(): Updated pathname '':'' -> '1041_20100529093000.mpg'
mythbackend[169]    Revision 476 Sat May 29 09:23:37 CDT 2010
mythbackend[169]    /usr/local/bin/mythicalLibrarian: line 486: mysql: command not found
mythbackend[169]    /usr/local/bin/mythicalLibrarian: line 489: mysql: command not found
mythbackend[169]     mythicalLibrarian --:invalid pattern
mythbackend[169]    usage: mythicalLibrarian 'path/to/file' ['title'] ['subtitle']
mythbackend[169]    usage: mythicalLibrarian --mode [parameter] [parameter]
mythbackend[169]     items in brackets are [context sensitve]
mythbackend[169]     ensure you have set the user settings properly and run
mythbackend[169]     --mythicalDiagnostics before using mythicalLibrarian
mythbackend[169]     in --scan mode or as a UserJob.
mythbackend[169]    2010-05-29 10:00:39.208 JobQueue Error: User Job 'bash /usr/local/bin/mythicalLibrarian "/Volumes/pvr/MythTV/1041_20100529093000.mpg"' failed.

mysql is on the path, and is accessible by user htpc (which runs mythBackend)

Running from command line works
Code:
mini:.mythicalLibrarian htpc$ /usr/local/bin/mythicalLibrarian /Volumes/pvr/MythTV/1041_20100529093000.mpg
Revision 476 Sat May 29 09:23:37 CDT 2010
Accessing MythTV DataBase:
COMMERCIAL DATA START:0 STOP:179
COMMERCIAL DATA START:13831 STOP:17496
COMMERCIAL DATA START:25403 STOP:29386
COMMERCIAL DATA START:44146 STOP:46454
RECSTART:2010-05-29 09:30:00 MOVIEYEAR: SERIESDATE:2009-11-21
PROGRAMID:EP000237290028 ShowCategory:Children STARS:0 RATING:0
PLOT: The gang is determined to find out why coupons for free cookies fail to arrive in the mail; a model boat is mysteriously broken.
TESTING FOR ZAP2IT SERIES ID MATCH:Busytown Mysteries
USING FUZZY LOGIC FOR EPISODE RECOGNITION Please update TheTvDb.com
FUZZY LOGIC SHOW NAME: Busytown Mysteries ID: 146811
DATABASE IS MAINTAINED. TIME IS:1275160031 NEXT UPDATE IS:1275230031
DB ABSOLOUTE Exx NR:-1 BASED ON ORIG AIR DATE:2009-11-21
FUZZY Exx NUMBER:1
TOTAL MATCHES:2 TOTAL VERIFIED FUZZY ERRORS:0
EPISODE:The Falling Fruit Mystery; The Dragon Hunters ABSOLUTE NUMBER:1 S01E19
df: /Users/htpc/Episodes: No such file or directory
UNUSABLE SPACE-CHECK:/Users/htpc/Episodes
JOB: mythicalLibrarian '/Volumes/pvr/MythTV/1041_20100529093000.mpg' 'Busytown Mysteries' 'Missing Cookie Coupon Mystery; Mystery of the Broken Boat'
TARGET SET:/Volumes/pvr/tv/Busytown Mysteries/Season 1/Busytown Mysteries S01E19 (The Falling Fruit Mystery; The Dragon Hunters)
CREATING SYMLINK IN MOVE MODE
MOVED: /Volumes/pvr/MythTV/1041_20100529093000.mpg
TO: /Volumes/pvr/tv/Busytown Mysteries/Season 1/Busytown Mysteries S01E19 (The Falling Fruit Mystery; The Dragon Hunters).mpg
RSS generation failed:
Directory not writeable (/var/www/mythical-rss)
SUCCESSFUL COMPLETEION TYPE: MoveModeSuccessful
^^ I'm working on it. I had some recordings set to run last night, but unfortunately I didn't set the user job in mythtv under my OSX VM. I am recording shows right now with the proper settings.

I was just reviewing my logs on my end. I set up mythicalLibrarian to do some statistical research. Here are some very interesting findings. If you do a search through your logs for the word "JIVE" you can see where Fuzzy Logic does not jive with the actual air date. When given the choice, mythicalLibrarian will ALWAYS choose original airdate over fuzzy logic Here's my results so far...


Fuzzy Logic was incorrect because of duplicate subtitles:
INPUT EPISODE NAMEBig Grinora Had a Little Lamb- ABSOLOUTE EPISODE NUMBER:177- RESOLVED EPISODE NAMEBig Grinora Had a Little Lamb-


Title was not given with guide data, defaulted to airdate
:
RESOLVED SERIES ID:97731- RESOVED SHOW NAME:Tosh.0-
INPUT EPISODE NAME:- ABSOLOUTE EPISODE NUMBER:22- RESOLVED EPISODE NAME:Web Redemption Prom Girl-

RESOLVED SERIES ID:97731- RESOVED SHOW NAME:Tosh.0-
INPUT EPISODE NAME:- ABSOLOUTE EPISODE NUMBER:25- RESOLVED EPISODE NAME:Web Redemption Phillies Fan's Daughter-




Fuzzy Logic was correct airdate was incorrect/duplicate:
RESOLVED SERIES ID:75397- RESOVED SHOW NAME:My Name Is Earl-
INPUT EPISODE NAME:Monkeys Take a Bath- ABSOLOUTE EPISODE NUMBER:86- RESOLVED EPISODE NAME:The Magic Hour-

RESOLVED SERIES ID:75397- RESOVED SHOW NAME:My Name Is Earl-
INPUT EPISODE NAME:Stole an RV- ABSOLOUTE EPISODE NUMBER:88- RESOLVED EPISODE NAME:Joy In A Bubble-


I'm considering reverting back to fuzzy logic naming as default with a backup of original airdate.
I was not able to reproduce the problem on my mac.

Code:
Revision 476 Sat May 29 17:25:54 CDT 2010
Accessing MythTV DataBase:
COMMERCIAL DATA START:0 STOP:1249
COMMERCIAL DATA START:13831 STOP:18919
COMMERCIAL DATA START:38308 STOP:44142
RECSTART:2010-05-30 07:05:00 MOVIEYEAR: SERIESDATE:2001-03-13
PROGRAMID:EP002775980073 ShowCategory:Sitcom STARS:0 RATING:0
PLOT: Jackie tests Kelso on maturity, parenting and fidelity.
TESTING FOR ZAP2IT SERIES ID MATCH:That '70s Show
MATCH FOUND BASED ON Zap2itID:That '70s Show ID:73787
DB ABSOLOUTE Exx NR:84 BASED ON ORIG AIR DATE:2001-03-13
TOTAL MATCHES:8 TOTAL VERIFIED FUZZY ERRORS:0
EPISODE:The Trials Of Michael Kelso ABSOLUTE NUMBER:84 S03E18
JOB: mythicalLibrarian '/new/1020_20100530070500.mpg' 'That '70s Show' 'The Trials of Michael Kelso'
TARGET SET:/new/Episodes/That 70s Show/Season 3/That 70s Show S03E18 (The Trials Of Michael Kelso)
sudo: /usr/local/bin/librarian-notify-send: command not found
CREATING SYMLINK IN MOVE MODE
MOVED: /new/1020_20100530070500.mpg
TO: /new/Episodes/That 70s Show/Season 3/That 70s Show S03E18 (The Trials Of Michael Kelso).mpg
sudo: /usr/local/bin/librarian-notify-send: command not found
SENDING REQUESTED COMMANDS TO:192.168.1.110:8080

Here is the results from my cat ~/.profile
Code:
PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin:/usr/local/bin:/usr/local/bin:/usr/local/mysql:/usr/local/mysql/bin:/usr/local/mysql
Make sure you have the proper /usr/local/mysql lines in there
here is my user job in mythtv:
Code:
/usr/local/bin/mythicalLibrarian "%DIR%/%FILE%"
Make sure you have the job set up to run under mythtv

I will work on automating more of the setup if there is interest displayed.
I cannot think of what would be the difference. There must be a configuration issue. You should check with the distributor to find out the problem.

This issue is a mac issue right? How do they distribute mythtv on a mac? Which disribution are you using and how did you configure it?
distros are linked on here
http://www.mythtv.org/wiki/MythTV_on_Mac...nd_Install

I'm using the latest psychosis build (r24875).

I confirmed my ~/.profile and user job matched your latest. client/server are running on the same box, as user htpc. It works when I log in as user htpc, just not from mythbackend.

Any way to do more verbose logging at line 486? I want to check on my users table in mysql later, and make sure that connecting @ localhost/ip/machine.local are all allowed for user mythtv. I believe they are; but I can't think of any other reason the script would fail to find mysql.
added an account for the loopback ip, but that didn't fix it

Code:
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]    Revision 476 Sat May 29 09:23:37 CDT 2010
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]    /usr/local/bin/mythicalLibrarian: line 486: mysql: command not found
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]    /usr/local/bin/mythicalLibrarian: line 489: mysql: command not found
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]     mythicalLibrarian --:invalid pattern
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]    usage: mythicalLibrarian 'path/to/file' ['title'] ['subtitle']
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]    usage: mythicalLibrarian --mode [parameter] [parameter]
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]     items in brackets are [context sensitve]
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]     ensure you have set the user settings properly and run
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]     --mythicalDiagnostics before using mythicalLibrarian
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]     in --scan mode or as a UserJob.
6/1/10 9:00:43 PM    com.kwv.mythbackend[175]    2010-06-01 21:00:43.555 JobQueue Error: User Job '/usr/local/bin/mythicalLibrarian "/Volumes/pvr/MythTV/1301_20100601202200.mpg"' failed.

and yet again nothing in output.log
Code:
@@@@@@@@@@@NEW SEARCH INITIATED AT Tue Jun  1 21:00:43 CDT [email protected]@@@@@@@@@@@@@
Revision 476 Sat May 29 09:23:37 CDT 2010

i'm going to try mythlink.pl and see if i can get that to execute
please run the following and tell me the output.
Code:
sudo su htpc
cat ~/.profile
mysql
/bin/sh
mysql
exit
/bin/bash
mysql
exit
Help me make mythicalLibrarian better
For one reason or another, the user htpc cannot find or run the command mysql. This is the root of the problem