Archive:MythicalLibrarian UserJobs: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Outleradam
>Outleradam
No edit summary
Line 1: Line 1:
== mythicalLibrarian UserJobs ==
== mythicalLibrarian UserJobs ==
[[mythicalLibrarian]] has incorporated user jobs to allow users to expand mythcialLibrarian to suit their needs without having to worry about loosing their changes when upgrading.  User jobs are bash code which run at the end of mythicalLibrarian.  ''Everything'' which mythicalLibrarian does can be undone or redone using user jobs and a bit of wit.
[[mythicalLibrarian]] has incorporated user jobs to allow users to expand mythcialLibrarian to suit their needs without having to worry about loosing their changes when upgrading.  User jobs are bash code which run at the end of mythicalLibrarian.  ''Everything'' which mythicalLibrarian does can be undone or redone using user jobs and a bit of wit.
Line 18: Line 17:
Only one of these jobs will be run by mythicalLibrarian before it exits.  
Only one of these jobs will be run by mythicalLibrarian before it exits.  


=== Variables for use ===


=== Example ===
=== Example ===

Revision as of 02:59, 19 September 2010

mythicalLibrarian UserJobs

mythicalLibrarian has incorporated user jobs to allow users to expand mythcialLibrarian to suit their needs without having to worry about loosing their changes when upgrading. User jobs are bash code which run at the end of mythicalLibrarian. Everything which mythicalLibrarian does can be undone or redone using user jobs and a bit of wit.

user jobs are a part of mythicalLibrarian

during mythicalSetup (aka mythicalLibrarian --update), the latest version of mythicalLibrarian is downloaded. mythicalSetup separates the code portion of the script from the user portion of the script. Think of the code portion as unmaintainable and dynamic from a user perspective, that is, it will change frequently. mythicalSetup then asks a series of questions and makes decisions based on your computer's setup. The final step before actually inserting the code into your user portion is to insert the user jobs.

Job Files

You will normally only want to script the JobSucessful job. However, the user jobs are as follows

  • /etc/mythicalLibrarian/JobSucessful -Is run when mythicalLibrarian completes in the most appropriate manner
  • /etc/mythicalLibrarian/JobInformationNotComplete -Is run when mythcalLibrarian determines there was not sufficient information to name the file according to standards. This type of job occurs when mythicalLibrarian attempts to rename by season and episode, but cannot obtain the information from TheTvDb. This is also accompanied by a spot in the --doover job file.
  • /etc/mythicalLibrarian/JobFilesystemError - Is run when mythcialLibrarian detects that it does not have proper permissions on one or more of the required folders.
  • /etc/mythicalLibrarian/JobInsufficientData - Is run in place of JobInformationNotComplete when the user elects not to process shows without required information. AKA. Showstopper.
  • /etc/mythicalLibrarian/JobIgnoreList - Is run when the user elects to ignore a show based on category or Title.
  • /etc/mythicalLibrarian/JobGenericError - Is run when mythicalLibrarian is not given enough information and has no TV Recording database to work with
  • /etc/mythicalLibrarian/JobUnspecified - This job should never be run unless you are debugging. It is called when RunJob is called in mythicalLibrarian and there is no JobType variable set.

Only one of these jobs will be run by mythicalLibrarian before it exits.

Variables for use

Example

The following is an example which transcodes a file


/etc/mythicalLibrarian/JobSucessful

#Run a transcoding program on the file
ffmpeg -i S:"$MoveDir/$ShowFileName.$originalext" -target ntsc-svcds:"$MoveDir/$ShowFileName.mp4"

#Write the new file extension over the old extension for logging
originalext=mp4 

#Run logging for the new file extension so mythicalLibrarian can keep track of files it created.
performLoggingForMoveMode #or performLoggingForLinkMode
 
#remove the mythicalLibrarian symlink
rm "$InputPath"

#make a new symlink
ln -s  "$MoveDir/$ShowFileName.originalext" "$InputPath"

#Enable XBMC Communications which were disabled so mythicalLibrarian did not communicate when the command was called before
XBMCUpdate=Enabled
XBMCClean=Enabled
XBMCNotify=Enabled

#Tell mythicalLibrarian to send a message to XBMC and update the library
XBMCAutomate

#Don't exit, just let mythicalLibrarian take back over.

See Also