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

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



- outleradam - 2010-02-09 07:33

Code:
#####REMOVE ENTRIES FROM LIBRARY#####
#remove mythtv recording's pictures and database entries.  Thanks to barney_1.
SYMLINKDisabled () {

#Make sure we got input arguments and file is valid
     if [ ! -f "$3" ]; then
    
#Remove recording entry from mysql database
         echo "REMOVING - $FileBaseName - THUMBNAILS - DATABASE ENTRIES">>"$mythicalLibrarian"/output.log
          echo "REMOVING - $FileBaseName - THUMBNAILS - DATABASE ENTRIES"
        mysql -u$MySQLuser -p$MySQLpass -e "use '$MySQLMythDb' ; delete from recorded where basename like '$FileBaseName'; "

#Remove thumbnails
         rm -f "$originaldirname/$FileBaseName".*    
     fi
}
since there was some testing before the file was moved, there is no reason to have a message that it was not moved. Just verify that it is moved before executing the function.

Just did another revision update removed some randomness from that last one. Gee, I wish I could test this before uploading, but if I did, then I'd loose data.


- barney_1 - 2010-02-10 00:41

Sorry, haven't tested the new version yet. I've hammer-out a proof of concept RSS builder. It uses the DailyLogs and for now, just makes an entry for each line and makes that line a title.

Questions:
-Is this something that will be useful?
-If we want to implement this can failure info be added as part of these reports?
-Links are required in RSS feeds... what would these items link to?

Anyway, let me know and I can do some work on limiting the number of days that are included in the RSS and using the data at hand in a better way.
Code:
#!/bin/sh

reportDIR="/home/mythtv/mythicalLibrarian/DailyReport/"
rssFile="/var/www/mythical-rss/rss.xml"

#Setup the rss file
echo '<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">

<channel>
  <title>Myhtical Librarian</title>
  <link>http://xbmc.org</link>
  <description>Mythical Library Daily Report Information</description>' > $rssFile

for thisReport in $(ls -l $reportDIR | awk '{print $8}')
do
    echo "$(awk '{ print "  <item>\n    <title>" $0 "</title>\n    <link>http://xbmc.org</link>\n    <description>Put description here</description>\n  </item>"}' $reportDIR/$thisReport)" >> $rssFile
done
echo '</channel>

</rss>' >> $rssFile

Here's part of a sample output. Please note that I didn't to anything to include or control chronology but that's pretty easy to add later.
Code:
<?xml version="1.0" encoding="ISO-8859-1" ?>
<rss version="2.0">

<channel>
  <title>Myhtical Librarian</title>
  <link>http://xbmc.org</link>
  <description>Mythical Library Daily Report Information</description>
  <item>
    <title>16:00:09 How I Met Your Mother.S05E14 (The Perfect Week)</title>
    <link>http://xbmc.org</link>
    <description>Put description here</description>
  </item>
  <item>
    <title>22:20:58 NOVA.S37E12 (Ghosts of Machu Picchu)</title>
    <link>http://xbmc.org</link>
    <description>Put description here</description>
  </item>
  <item>
    <title>23:49:04 Frontline PBS.S2010E01 (Digital Nation)</title>
    <link>http://xbmc.org</link>
    <description>Put description here</description>
  </item>



- outleradam - 2010-02-10 04:40

barney_1 Wrote:Sorry, haven't tested the new version yet. I've hammer-out a proof of concept RSS builder. It uses the DailyLogs and for now, just makes an entry for each line and makes that line a title.

Questions:
-Is this something that will be useful?
-If we want to implement this can failure info be added as part of these reports?
-Links are required in RSS feeds... what would these items link to?

Anyway, let me know and I can do some work on limiting the number of days that are included in the RSS and using the data at hand in a better way.

First off, I'm feeling a bit off right now, so if this does not make sense, then please let me know.

1. Yes this would be very useful. It should be possible to use the new RSS tool with XBMC to change the RSS feed to the one generated by mythicalLibrarian.

2. Yes This would be great to add, assuming the list can be made to rotate efficiently.

hrm...
numberofentries=grep -c "</item>" /thelist
cat /thelist itemdelete=grep -m1 <item>
...
...
...
and then cat /thelist with a tr -d itemdelete ... ... ... grep match.

3. I was looking at that.. Recognized episodes could go to
I have no idea about shows, but Episodes:
Code:
http://thetvdb.com/?tab=series&id=$seriesid
where $seriesid is defined in mythicalLibrarian
Movies:
Code:
moviename=`echo $NewShowName |tr -d :punct:|tr -d " "
http://www.imdb.com/find?s=all&q=$moviename

I'll try to think of something for shows. They will be comming after I finish the easy installer.


- outleradam - 2010-03-17 16:39

ok, due to the XBMC crash, we have lost alot of data in this thread. If anyone recalls anything important, please post it up.

Easy installation instructions:
Code:
sudo apt-get install curl && mkdir ~/.mythicalLibrarian && mkdir ~/.mythicalLibrarian/mythicalSetup && cd ~/.mythicalLibrarian/mythicalSetup
curl http://mythicallibrarian.googlecode.com/svn/trunk/mythicalSetup.sh>./mythicalSetup.sh
sudo chmod +x ./mythicalSetup.sh && sudo ./mythicalSetup.sh
I am not working on anything having to do with mythicalLibrarian right now, so please submit bug reports.


- djroketboy - 2010-03-17 16:45

yikes... I got pretty much erased...

SVN 256 is stable; There was a guy who was asking if he should update his MythTV to the latest 0.22+fixes I believe...


- outleradam - 2010-03-17 17:30

mythicalLibrarian is tested using MythTV's head SVN revision. There was a stable past 256. Generic programming is now supported. Sports Events are supported.
Full list of functionality:
  • Renames Episodes to Title S##E## (Subtitle)
  • Renames Generic Programming to Title S0E0 (Subtitle)
  • Renames Movies to Movie (Year)
  • Generates RSS feeds to keep you up to date
  • Will render your files still human readable in the event you loose your database
  • Maintains consistancy by symlinking back to original file
  • Allows mythtv to serve files
  • Allows mythtv to delete files
  • Provides Ubuntu desktop notifications upon completed jobs
  • Provides episode lookups based upon zap2it ids referenced to thetvdb
  • Provides episode lookup based upon subtitle or original airdate
  • Optional primary and secondary Episodes, Movies, and Shows folders for NAS users
  • Creates COMSKIP files from mythcommflag
  • Creates NFO files for generic programming
  • Tracks and deletes created helper files if main video file is deleted
  • Sends notifications to XBMC
  • Updates XBMC's library
  • Provides detailed logs and daily report in the /daily report folder
  • Showtranslations allows for title renaming if guide data is incorrect
mythicalLibrarian has been tested and is running on my computer with MythTV head revision.


- GregoryK - 2010-03-17 22:38

Like djroketboy, none of my posts survived the lightning strike, either Sad

Can you give a bit more detail on how the Sports Events are now supported? I am using svn 256 and I see that there is a "Cycling" subdirectory in my "Episodes" directory, but when I point XBMC to the "Cycling" Subdirectory and mark it as type=TV shows, it shows "zero episodes" in the TV Shows area of XBMC.

Keep in mind that I am also relatively new to XBMC so I may be missing something on that end.

/Greg


- outleradam - 2010-03-18 00:25

sports events should be handled using season (year) and episode (MonthDay). Can you post a debug log on your cycling dir? There should be a tvshow.nfo file in the folder as well as a nfo file that specifies the information for XBMC .


- GregoryK - 2010-03-18 01:44

Upon some further investigation, it looks like the last time mythicalLibrarian tagged a Sports Event, it did in fact place it into an Episodes rather than Showings directory. So the earlier S0E0 files in my /Showings/Cycling subdirectory are probably artifacts of earlier versions of the script.

Is there an easy way to re-run just those files? Can I do a --scan mpg on the files that have been renamed to Cycling S0E0 [...] without messing up mythtv's database?

/Greg


- outleradam - 2010-03-18 03:22

for now all episodes which are tagged with the sports event label can be redone with --doover. I would like some feed back before I remove that --doover option from categoric handling files..

I need to know it works before they get dumped into showings. For now they are still handled pretty much the same way as a episode which did not get scraped and was handled like a generic show. Until I can get confirmation that everything works, it will stay the same way. Once I'm sure everything works I want to move sports events into the /showings folder and remove their --doover option.