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-05-18

kvandesteeg Wrote:Got it version 444 working from the command line.

I gave up on the setup script - the filesystem test was failing because of running the script under sudo su
running the diagnostics under sudo, it worked as expected

i also had to add mysql's path to /etc/profile
Code:
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/mysql/bin"
Now that it's working ... how do i change it? Big Grin
specifically for movies, i don't want directory/movie title/movie title(year).mpg i'd rather have directory/movie title (year).mpg

Was that just because i ran it from the command line?

I haven't seen the output from a live recoding from MythTV yet.

I haven't gotten the RSS fixed yet, but i'm using mythweb's rss feed for now.
mythicalSetup will now work just fine. It is set for default now at ~/Episodes ~/Showings and ~/Movies


- outleradam - 2010-05-18

krschuerman Wrote:I just started using mythicalLibrarian and ran into an issue when working with recordings in one particular folder in my MythTV storage group.

Excerpt from the output.log

Code:
MOVING FILE: '/home/shared/media/MythTV.Storage/1065_20100423073000.mp4' to '/home/shared/media/Episodes/Mickey Mouse Clubhouse/Season 1/Mickey Mouse Clubhouse S01E16 (Plutos Puppy-sitting Adventure).Storage/1065_20100423073000.mp4'

PERMISSION ERROR WHILE MOVING
It took me a while to figure out why this was failing, turns out that it didn't like the "." in the folder name. I changed MythTV.Storage to MythTV_Storage and the error went away.

Sherm
Fixed. It will now only check the basename ie.. 1065_20100423073000.mp4 This allows the odd circumstance when the user may have a file named 1065_20100423073000.mp4.part.mp4 or whatever. It will now rename the 1065_20100423073000 part and preserve all after the first "." while ignoring any "."s in the dir names.

It should work just fine now on your folder with a "." in it.

Any more bugs? I'm still working on mac errors with mythtv and stuff.


- kvandesteeg - 2010-05-18

I'm using myth .23 fixes

The User job ought to have this - correct?
/usr/local/bin/mythicalLibrarian "%DIR%/%FILE%"

Myth reported exiting with non zero error, but i didn't get to the myth log file in time.
~/.mythicalLibrarian/output.log had nothing from the run.

i'm trying another recording shortly


- kvandesteeg - 2010-05-18

nothing in output.log - but managed to scrape this out of console

Code:
mythbackend[65]    2010-05-17 22:03:35.668 ProgramInfo(): Updated pathname '':'' -> '1041_20100517214800.mpg'
mythbackend[65]    2010-05-17 22:03:35.677 JobQueue: Started mythicalLibrarian for "CSI: Miami" recorded from channel 1041 at Mon May 17 21:48:00 2010
mythbackend[65]    2010-05-17 22:03:35.727 ProgramInfo(): Updated pathname '':'' -> '1041_20100517214800.mpg'
mythbackend[65]    Revision 445 Sun May 16 20:05:12 CDT 2010
mythbackend[65]    /usr/local/bin/mythicalLibrarian: line 486: mysql: command not found
mythbackend[65]    /usr/local/bin/mythicalLibrarian: line 489: mysql: command not found
mythbackend[65]     mythicalLibrarian --:invalid pattern
mythbackend[65]    usage: mythicalLibrarian 'path/to/file' ['title'] ['subtitle']
mythbackend[65]    usage: mythicalLibrarian --mode [parameter] [parameter]
mythbackend[65]     items in brackets are [context sensitve]
mythbackend[65]     ensure you have set the user settings properly and run
mythbackend[65]     --mythicalDiagnostics before using mythicalLibrarian
mythbackend[65]     in --scan mode or as a UserJob.
mythbackend[65]    2010-05-17 22:03:35.877 JobQueue Error: User Job '/usr/local/bin/mythicalLibrarian "/Volumes/pvr/MythTV/1041_20100517214800.mpg"' failed.
mythbackend[65]    2010-05-17 22:03:35.930 ProgramInfo(): Updated pathname '':'' -> '1041_20100517214800.mpg'

works manually
Code:
$ sudo /usr/local/bin/mythicalLibrarian /Volumes/pvr/MythTV/1041_20100517214800.mpg
Password:
Revision 445 Sun May 16 20:05:12 CDT 2010
Accessing MythTV DataBase:
COMMERCIAL DATA START:19626 STOP:21648
RECSTART:2010-05-17 21:48:00 MOVIEYEAR: SERIESDATE:2010-05-17
PROGRAMID:EP005240610220 ShowCategory:Crime drama STARS:0 RATING:0
PLOT: The team investigates its own department when Horatio's ex-girlfriend is killed in an explosion.
TESTING FOR ZAP2IT SERIES ID MATCH:CSI: Miami
MATCH FOUND BASED ON Zap2itID:CSI: Miami ID:78310
DB ABSOLOUTE Exx NR:191 BASED ON ORIG AIR DATE:2010-05-17
FUZZY Exx NUMBER:191
EPISODE:Time Bomb ABSOLUTE NUMBER:191 S08E23
df: /Volumes/nool/Movies/ota: No such file or directory
UNUSABLE SPACE-CHECK:/Volumes/nool/Movies/ota
JOB: mythicalLibrarian '/Volumes/pvr/MythTV/1041_20100517214800.mpg' 'CSI: Miami' 'Time Bomb'
TARGET SET:/Volumes/pvr/tv/Season 8/CSI Miami S08E23 (Time Bomb)
CREATING SYMLINK IN MOVE MODE
MOVED: /Volumes/pvr/MythTV/1041_20100517214800.mpg
TO: /Volumes/pvr/tv/Season 8/CSI Miami S08E23 (Time Bomb).mpg
RSS generation failed:
Directory not writeable (/var/www/mythical-rss)
SUCCESSFUL COMPLETEION TYPE: MoveModeSuccessful



- outleradam - 2010-05-18

Hrm mythtv user does not have access to the mysql command. I will search on how to resolve that tomorrow. Try editing the ~.profile to see if there is anything about it in there. I cannot seem to get mysql to work on my mac.

So... Wow! That's my first confirmation it works on OS X. Please let me know if it does movies and showings properly.

I'm still squeeling my wheels in 2nd gear. You have pulled out ahead of me on this one.


- outleradam - 2010-05-18

Oh yeah. Add yourself to the mythtv group instead of using sudo. Sudo will cause problems with permissions in your home dir. Files will be owned by root.


- outleradam - 2010-05-18

Note to self for tomorrow: must change so that when original airdate is matched, fuzzy does not make an attempt.


- kvandesteeg - 2010-05-18

Couldn't get any further from getting it to run from MythTV.

Synched with SVN, and ran into an issue with the update script
had to remove
Code:
"$LinuxDep" = "1" &&
from line 123 of mythicalSetup, so it would update in OSX


- outleradam - 2010-05-19

Try changing the user job in mythtv setup to:
Code:
bash  /usr/local/bin/mythicalLibrarian "%DIR%/%FILE%"
it may not be loading /bin/bash on the she-bang at the top. It could be trying to run mythicalLibrarian in SH mode (scripting host). Try that out. Let me know if it works. I'll change it perminantly.


- kvandesteeg - 2010-05-21

outleradam Wrote:
Code:
bash  /usr/local/bin/mythicalLibrarian "%DIR%/%FILE%"

no luck with that.


- outleradam - 2010-05-21

I'm working on it now. I've almost installed mysql. I'm having problems.


- outleradam - 2010-05-21

try this:
Code:
echo PATH="$PATH:/usr/local/mysql:/usr/local/mysql/bin"|sudo tee ~/../mythtv/.profile
then reboot.


- outleradam - 2010-05-21

What is the username running mythtv? Can I see your debug log? ~.mythicalLibrarian/output.log


- kvandesteeg - 2010-05-21

it runs under the username 'htpc'

the only thing in the ~/.myticalLibrarian/output.log is from the manual runs, it doesn't even look like the User Job is being kicked off

Code:
###################DEBUG MODE ENABLED####################
MY USER NAME:root-
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:-
USE ORIGINAL DIR:Disabled NOTIFICATIONS:Disabled DEBUG MODE:Enabled-
INPUT SHOW NAME:Castle- LOCAL SHOW NAME TRANSLATION:- ShowName:Castle
DATABASE UPDATED:- TVDB LAST UPDATED:1274209120- CURRENT:1274230064-
RESOLVED SERIES ID:83462- RESOVED SHOW NAME:Castle (2009)-
INPUT EPISODE NAME:A Deadly Game- ABSOLOUTE EPISODE NUMBER:34- RESOLVED EPISODE NAME:A Deadly Game-
SEASON:S02- EPISODE:E24- SYMLINK MODE:MOVE- FILESIZE: 0kB-
CREATE AND DELETE FLAGS: ORIGINALDIR:1- FREE:526183200kB- WORKINGDIR:1 FREE:224417800kB-
MOVEDIRWRITABLE:1- FREE:526183200kB- ALTERNATEMOVEDIR:0- FREE:kB-
PRIMARYSHOWDIRWRITABLE:1-  FREE:526183200kB-ALTERNATESHOWDIRWRITABLE:1- FREE:526183200kB-
PRIMARYMOVIEDIRWRITABLE:1- FREE:224417800kB- ALTERNATEMOVIEDIR:0- FREE:224417800kB-
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:83462-
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#####################

i have mythtv running as a User Daemon as i wasn't able to run it w/o sudo


- outleradam - 2010-05-22

Ok, now I've got mythtv up and running in mac OS X... I have a much better understanding of what's going on.

Your user htpc has a separate home dir. His log file will be in that folder not your ~/.mythicalLibrarian. It will probly be ~/../htpc/.mythicalLibrarian

There's many ways around it. Here is the simplest:
You can change the ownership of the folder and all sub-folders.
Code:
sudo chown -R htpc "/path/to/recordings"
where "/path/to/recordings" is your recording dir or where the files are moved if you chose folders in mythicalSetup.

see here for more information http://osxdaily.com/2007/10/29/how-to-add-a-user-from-the-os-x-command-line-works-with-leopard/