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)



- watson540 - 2010-02-04

i tried out the script in depth tonight..it would seem that the script no longer sends the command to update the xbox library, thoough i cannot attribute it solely to that as I just started out with a fresh xbmc, but i did set the port on both ends

anyone else have this issue?


- outleradam - 2010-02-04

Did you enable allow xbmc to be controlled by other computers under settings/network/services?


- outleradam - 2010-02-04

watson540 Wrote:cant you just give it fake/random episode numbers and just keep it in season 99?
Because that's the wrong way to do it. Every output in this program has been either arbitrary, or can be found in the XBMC online manual. There is a proper way to do it. It's found here:http://wiki.xbmc.org/?title=Import_-_Export_Library#TV_Shows

But it didn't work when I tried it. You'll notice that all the "extra" database information you can find in the logs is the same stuff in that NFO file.

I can try again sometime soon, but seriously, I'm not going to go making my own standards of show importation. That's a hack and I'm trying to stay away from hacks. I want standards only.


- outleradam - 2010-02-04

If you seriously want to add uncatagorized files to the library

1.disable database access in mythicalLibrarian.sh
2.run a replace #/ with /
3.run a replace "" with "the"
4.make doover.sh executable
5.run doover.sh
6.reenable database
7.make doover.sh executable again
8.rerun doover.sh
this will force a fuzzy logic match.


- watson540 - 2010-02-04

outleradam Wrote:Did you enable allow xbmc to be controlled by other computers under settings/network/services?

yes. if its obvious ive dopne it..keepp in mind if set this script up countless times, and dotted my r and crossed my t's in xbmc..

thanks for insight on adding generics..gonna tryit


- watson540 - 2010-02-04

maybe its the standard thats the hack. never heard of a public library throwing away books that lost their jacket, or had no name.

starving kids in china could be watching those spongebobs you toss aside like an old chew toy you know


- watson540 - 2010-02-05

about the library not updating, I havent tested it yet but im pretty sure that it's because i had a username set in the network settings menu for the http server. cant blank out the password, but if you blank out the username it should be okay


- outleradam - 2010-02-05

I think you've got to blank out the password and leave the username as xbmc I can't do that from my remote for some reason. It can be done from the keyboard though.


- outleradam - 2010-02-06

I am not currently aware of any issues within mythicalLibrarian.


- watson540 - 2010-02-06

comskip..does your comskip work or no?? dont do jack for me


- outleradam - 2010-02-07

If mythicalLibrarian puts these in place, then there's not much else to be done.

This is mythicalLibrarian's part:
  • Export the mythcommflag data to markupstart and markupstop files from database entries in MythTV
  • Merge those files into a single markupframes.txt
  • Move the markupframes.txt to /newdir/newname.txt
  • Track all comskip files created
  • Remove comskip files once original recording is deleted
While the first 3 steps could have been combined into one, this leaves modularity in the database access step.

This is what a comskip file looks like

FILE:/home/mythtv/NAS/Video/Episodes/Married ... with Children/Married ... with Children.S09E10 (Dud Bowl).txt
Code:
FILE PROCESSING COMPLETE
------------------------
0 192
5421 10560
18576 23416
47506 52973
Let me know if there is a problem with one of the steps. If mythtv-frontend skips commercials, the comskip file should be generated properly.

I'm running XBMC Live. The only problems I'm seeing right now is lack of handling for generic television shows, and MythTV's handling of my 4 tuner cards with 3 separate lineups.


- watson540 - 2010-02-07

my comskip files look like that whever i looked inside of them. thing is, when i use myth:// directly, it has no problems skipping commercials provided i play it with dvdplayer..which i set as default.

but playing thm through the library, no commercials skipped


- outleradam - 2010-02-07

You are using XBMC for XBOX right? Try loading XBMC Live onto a flash stick from this guide and see if they work within live. http://forum.xbmc.org/showthread.php?tid=62488

I'm betting this is a speciffic issue with XBOX that needs to be addressed.


- barney_1 - 2010-02-07

outleradam Wrote:Actually, on seccond thought you could do something like this with a one-liner as a user job to be run after mythicalLibrarian.

Code:
test -L "%DIR%/%FILE%" && mysql -uUSERNAME -pPASSWORD "use 'mythconverg' ; DELETE * from recorded where basename like %FILE%; "; *DO THE SAME FOR EACH OF THE DATABASES*; test -L "%DIR%/%FILE%" && rm "%DIR%/%FILE%"

I took this idea and modified it a bit to work for me. I wrote a comanion script for mythical librarian that will delete symlinks and the database entry that accompanies them:
Code:
#!/bin/sh

### myth-remove-from-library.sh - Use to remove a sym-linked mythtv recording and it's database entries

#Grab command line arguments
VIDEODIR=$1
FILENAME=$2

#Make sure we got command line arguments
if [ -z "${VIDEODIR}" -o -z "${FILENAME}" ]; then
        echo "Usage: $0 <VideoDirectory> <FileName> "
        exit 5
fi

#Test that input files exists and is a symbolic link (we don't want to delete actual recordings)
if [ ! -h "${VIDEODIR}/${FILENAME}" ]; then
        echo "File does not exist or is not a symbolic link: ${VIDEODIR}/${FILENAME}"
        exit 6
fi

#Remove recording entry from 'mythconverg' mysql database
    echo "Removing ${FILENAME} from recorded table"
        cat << EOF | mysql -u mythtv -pmythtv mythconverg
DELETE FROM
        recorded
WHERE
        basename = '${FILENAME}';
EOF

#Remove symblink file and thumbnails
    echo "Removing ${FILENAME} file and thumbnails"
    rm -f ${VIDEODIR}/${FILENAME}
    rm -f ${VIDEODIR}/${FILENAME}.*

exit 0

I then just added a command to execute this script. I added this to mythicalLibrarian.sh in the "MOVE" section, after the Success message is written:
Code:
...
#Send notification to daily report log
            dailyreport "$ShowFileName"
             echo "@@@@@@@@@@@@@OPERATION COMPLETE" `date` "@@@@@@@@@@@@@@@@">>"$mythicalLibrarian"/output.log
            #Use script to remove the sym-link and database entry from mythtv
            /home/mythtv/myth-remove-from-library.sh "`dirname "$3"`" "`basename "$3"`"
               exit 0
...

Works like a charm. Now I know that any videos still hanging out in the mythtv recordings are not being recognized by mythical librarian and need to be moved manually.


- watson540 - 2010-02-08

awesome and let me be the first to say THANK you for CONTRIBUTING. need more knowledgable people like that


outleradam: what about when the xbox is off?? I understand people that want to waste energy running a full fledged pc as a frontend and everything but some of us aren't so rich.

while i leave my pc on all the time because it's a web server email server and mythbackend. I see no reason to put un-necessary hours and everygy charges on my mythfrontend, just so it can be able to update when mythicalLibrarian decides to do its thing

I know its alot to ask, but cant we have some sort of queue for these xbmc library updates to go into until the xbox is powered back on?

can it SENSE if the xbox is off and if so , save those updates for a later time to be scheduled or whenever the xbox starts hitting up the mythbackend again? (For example when i start watching a show, the backend obviously knows the frontend is the n powered on.)

is this feasible?? i sure hope so i dont like keeping this on 24/7 just for libraary updates, and to be honest i dont even use the library still..im finding my modded confluence to show mythbaackends info is a godsend, and the commercial skipping dont hurt either, neither does the fact i can delete the shows directly that way