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.
MythSExx is the earlier version of mythicalLibrarian. You should be fine.

Let me know if there are any problems. Report them right away and I can make changes, then you can run mythicalLibrarian --update to apply the changes.
let me explain a bit more what I am looking at doing

I run mythtv on one network
I run xbmc on other network
the networks are connected for 1 to 2 hours every day via the internet

I am using SYMLINK=LINK

on the mythtv side:
the video are moved from 60GB hard drive to 1000 hard drive and are expired when there is a lack of free space

on the XBMC side:
a list of videos that have been watched and X number of days old are deleted (and noted in a exclustion file)
rsync is run with the exclustion file to download the videos from mythtv

the part that is missing is to remove old symbolic links when mythtv expires the videos
You will want to run mythicalLibrarian in MOVE mode. It places a symbolic link in place of the original and lets MythTV control the file by following the symlink to delete or serve the file. MOVE mode is the correct choice in 99.9% of the situations. MOVE mode lets mythtv control the files and XBMC control the content. Link was just added because someone requested it. Move is the all-around supported option.
I dont think move well work in my setup

I think I have found a program witch may be able to remove invalid symbloic links it is called symlinks
here is the man page http://linux.die.net/man/8/symlinks
SVN:496 = symbolic links generated in LINK mode are handled the same as any other file accessory like comskip info or NFO files. Symlinks are now logged in the ~/.mythicalLibrarian/created.tracking and checked for validity on each run of mythicalLibrarian. Invalid created.tracking files are deleted.

tom: please test it and make sure everything works well so it can be committed as stable.
I have no access to my mythtv and its is 11 hours drive away Sad
router headace (failed when I was walking out the door) :mad:

i'll report when and if I get back up there.......
Alright, just let me know.

If your router failed then you may not have internet access Make sure you run the --doover que. This is performed by typing

Code:
mythicalLibrarian --doover

Any shows which cannot be properly named because of missing information like theTvDb is down, get renamed as a generic season 0 showing. They are also added to the doover que. When you run --doover it will undo whatever was done before and then rerun the original file. It should just delete the links, collect data and make a new proper symlinks once the --doover que is run.

I tend to think of mythicalLibrarian more as a media manager daemon because of all the activities it performs when it is run, rather then just a script. It's been running on my media center since November.

Let me know if there are any problems.
outleradam Wrote:Alright, just let me know.

If your router failed then you may not have internet access
<snipped>
I think it may be my dynamic DNS service provider not internet connection
this is getting off-topic......
Just let me know how everything works out so I can update the stable version with new features.
Hey there, it's me again :o)

I think I messed this up. I think I should have ran the --update as mythtv but reviewing everything after the update I see it set the permissions for user strato and I think it caused the folder permissions to fail now can this be fixed without running the update or should I run the update as the user that runs mythtv which is mythtv? Looking at the svn you have been busy.

Thanks Rolleyes

Code:
[font=Courier New]
--You have entered diagnostic mode
mythicalLibrarian will now conduct a series of tests.
press any key to verify installed packages...

package 'curl' is installed
package 'agrep' or 'tre-agrep' is installed
package 'libnotify-bin' is installed
Installed packages check ***PASSED***
Press any key to perform Desktop Message test...

Performing librarian-notify-send test
This test verifies that the message was sent to the DBUS.
This test does not verify the user has a valid desktop open.
Desktop Notifications test ***PASSED***
Press any key to perform XBMC Notification test...

Performing XBMC Notifications test
XBMC Communications ***FAILED***
Press any key to test file system permissions...

Testing file system permissions
df: `/home/strato/Episodes': No such file or directory
df: no file systems processed
/usr/local/bin/mythicalLibrarian: line 262: /mnt/showtime/mythtv/Episodes/arbitraryfile.ext: Permission denied
CHECK PERMISSIONS ON /mnt/showtime/mythtv/Episodes
UNUSABLE SPACE-CHECK:/home/strato/Episodes
/usr/local/bin/mythicalLibrarian: line 262: /mnt/showtime/mythtv/Movies/arbitraryfile.ext: Permission denied
CHECK PERMISSIONS ON /mnt/showtime/mythtv/Episodes
UNUSABLE SPACE-CHECK:/home/strato/Movies
USER SETTING     |FLAG|Folder name
MoveDir          |0   |/mnt/showtime/mythtv/Episodes
AlternateMoveDir |0   |/home/strato/Episodes
PrimaryMovieDir  |0   |/mnt/showtime/mythtv/Movies
AlternateMovieDir|0   |/home/strato/Movies
PrimaryShowDir   |1   |/mnt/showtime/mythtv/Showings
AlternateShowDir |1   |/mnt/showtime/mythtv/Showings
mythicalLibrarian|1   |/home/strato/.mythicalLibrarian
Critical Filesystem checks ***FAILED***
OVERALL FAILURE
press any key to continue on to the final results...

  All tests complete            RESULTS
  Installed Packages:        ***PASSED***
  Notifications Test:        ***PASSED***
  XBMC Communications:       ***FAILED***
  File System Checks:        ***FAILED***
  mythicalTesting:           COULD NOT COMPLETE
  Overall mythicalReadiness: ***FAILURE***
-----End of diagnostics-----
Please try again.  If problem persists, please post here: http://forum.xbmc.org/showthread.php?tid=65644
MythTV job not added because mythicalLibrarian already exists in slot 1
permissions were set for user: strato
RSS Feed will be located at http://192.168.128.27/mythical-rss/rss.xml
mythicalLibrarian is located in /usr/local/bin
log is located in ~/.mythicalLibrarian/output.log
'mythicalLibrarian --help' for more information
Done.
[/font]
Code:
df: `/home/strato/Episodes': No such file or directory
df: no file systems processed
/usr/local/bin/mythicalLibrarian: line 262: /mnt/showtime/mythtv/Episodes/arbitraryfile.ext: Permission denied
CHECK PERMISSIONS ON /mnt/showtime/mythtv/Episodes
UNUSABLE SPACE-CHECK:/home/strato/Episodes
/usr/local/bin/mythicalLibrarian: line 262: /mnt/showtime/mythtv/Movies/arbitraryfile.ext: Permission denied
CHECK PERMISSIONS ON /mnt/showtime/mythtv/Episodes

It looks like the folder /home/strato/Episodes folder does not exist.

Also, permissions in /mnt/showtime/mythtv/Episodes/ are not proper.

Code:
sudo su mythtv
mkdir  /home/strato/Episodes
mkdir /mnt/showtime/mythtv/Episodes/
mkdir /home/strato/Movies
sudo chown $SUDO_USER  /home/strato/Episodes /mnt/showtime/mythtv/Episodes/ /home/strato/Movies
cd ~/.mythicalLibrarian/mythicalSetup
sudo mythicalLibrarian --update
let me know if that works for you.

Although.. It would be a better idea to keep mythtv files in the mythtv home dir.. unless user Strato is running mythtvbackend
Also, make sure you add mythtv to the Strato group and Strato to the mythtv group

Code:
sudo adduser mythtv strato
sudo adduser strato mythtv
I increased logging on SVN 503. This makes the problems more apparent and will give you a starting point when an error occurs in mythicalDiagnostics instead of just saying that one of these failed:

Code:
All tests complete            RESULTS
  Installed Packages:        ***PASSED***
  Notifications Test:        ***PASSED***
  XBMC Communications:       ***PASSED***
  File System Checks:        ***PASSED***
  mythicalTesting:           ***PASSED***
  Overall mythicalReadiness: ***PASSED***
-----End of diagnostics-----
Installation and tests completed successfully

It will give a message detailing why it failed and what can possibly be done about it.
outleradam Wrote:It will give a message detailing why it failed and what can possibly be done about it.

Adam,

the evolution of your --mythicalDiagnostics process is jaw dropping, wow. I have been away most of the summer from the project, as there is not much for me to watch over the summer but your work on this since the last time I saw it is really something, it has really matured.

The addition of help and the suggestions "likely causes" is awesome and providing sample of "possible fix" is VERY VERY much appreciated. I am a Linux novice and it has always sucked having to go learn more about the OS before you could resolve an issue. I learn from example!

just wanted to say thanks for your work on mythicalLibrarian and for patients supporting all us noobs Big Grin
I this clasification made by tvlisting source such as schedulesdirect or by theTVdb site where the info is looked up?

My question is I still have a hit and miss problem over the summer with mythicalLibrarian and how it deals with reality shows. some weeks it will identify a show

/Episodes
Big Brother S12E09 (Episode 9) or
Big Brother S12E10 (Eviction #3)

which I guess is ok but (don't understand the title)

or
/Showings
Big Brother S0E0 (Recorded [email protected] on 2091)

It's like the first part of the season was in showings and recently something changed and it started correctly doing episodes info. I have like 10 or these Big Brother showings like this and 2 which are the recent one in the episodes folder.

this problem for me usually shows up with reality shows but does crop up specials