Media Companion

Discussion and development board for the program Media Companion.
 
HomeHome  FAQFAQ  SearchSearch  RegisterRegister  Log inLog in  

Share | 
 

 List Latest Episodes in a HTML file

View previous topic View next topic Go down 
AuthorMessage
StormyKnight
VIP
VIP


Posts : 556
Join date : 2008-10-08
Location : Australia

PostSubject: List Latest Episodes in a HTML file   Fri Feb 18, 2011 2:50 pm

TV Episode HTML list creator for MC
I have created a program to list TV shows & episodes added to Media Companion & output them in reverse date order to a HTML file.

How Does it work?
Firstly the program is wrtten as an AutoHotKey Script. See here for futher information about AutoHotKey. http://www.autohotkey.com/

The script can be opened in notepad for editing. This will allow anyone to modify it as they see fit & perhaps expand it capabilities if required.
I have also included an exe file which is the script converted to an executable.

The program scans through a folder you provide, looking for .nfo files in that directory & any sub directories.
It gets the creation date of those files & creates a reverse sorted list so that the latest ones are at the top.

The program then outputs this information to a HTML file you specify & then asks if you want to view it. This is similar in behaviour to the current Movie to html feature of MC.

A html table is created which looks a bit like this....

File Date AddedTVShowEpsiodeAge
18/02/2011Mork & MindyS02E16 - Exidor's WeddingTODAY
17/02/2011OutcastsS01E04 - Episode 4Yesterday
16/02/2011OutcastsS01E03 - Episode 32 days
8/02/2011Outcasts10 days
example only to show different age values, normally you would have all of the outcast episodes listed.
episode naming relies on the actual nfo filename i.e. turn on the autorename function of episodes in the MC preferences.

New shows are shown in a colour of your choice too.

Note that the age in days is calculated by javascript when the html page is opened. That way the age is always correct even if the html is viewed days or weeks after it was actually created.

The idea is that you can add a link to the program in the Tools menu of MC & run it from there once you have updated your TV episodes.
If you set the html output file to a shared location, anyone on the network can then access the html file & know whats been newly added.

Setup..
There are two ways to set the parameters for the script

1. Pass them as parameters
i.e.

As a script --> c:\programs\autohotkey\autohotkey.exe "Script filename" "Search Directory" "Output Filename" "Colour for New Shows in RGB hex" "Number of days to show" "Quite Mode"
As an exe --> program.exe "Search Directory" "Output Filename" "Colour for New Shows in RGB hex" "Number of days to show" "Quite Mode"

e.g.

As a script --> c:\programs\autohotkey\autohotkey.exe "Create Sorted TV List.ahk" "T:\Videos\TV\" "T:\Videos\TV List.html" "FF0000" "14"
As an exe --> c:\Programs\TVListCreator\Create Sorted TV List.exe" "T:\Videos\TV\" "T:\Videos\TV List.html" "FF0000" "14"

Note that the quotes "" are necessary for any parameter with spaces in it - If you use them anyway it still works.

I have left the quite mode parameter off so in my example it will display progress information & ask to show the outputted HTML.
If I want the program to run invisable add "Q" or "Quite" as the last parameter.

Advantages: If using the exe version you don't need Autohotkey installed. You can call the program from a batch file or another program if required directly.
Disadvantages: MC cannot pass parameters using the tool menu but you can run a batch file which then calls this program. Unfortunately the batch file is visable until the program has ended.

2. Edit the script directly

If the program detects that less than 4 parameters are supplied when run, it will assign some default parameters. Those parameters can be edited in the script to suit your particular system setup & preferences.

Just change these parameter lines at the top of the script.

1:="T:\Videos\TV"
2:="T:\Videos\TV.html"
3:="FF0000"
4:="14"
5:=""

Advantages: The program (script OR exe) can be called directly from MC without needing a batch file
Disadvantages: You need autohotkey loaded to run the script.

PS Hardly any (...read as 'none at all'...) checking of inputs are done. If you supply an invalid path or invalid color you won't be told about it Smile

Download the script,exe,help file & icon file here (skip past the ad page...)
mediafire.com ?6umxkr95xmhji1y

This project started as a need for myself. In time I would hope this functionality can be put directly into MC. Please play with the code &/or suggest changes, fixes etc.

Enjoy! Very Happy
Back to top Go down
View user profile
 
List Latest Episodes in a HTML file
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» HTML Alone
» Sample UI Element file for google site.
» Need a custom html page?
» How to store a HTML comment in selenium
» selecting dropdown list using selenium

Permissions in this forum:You cannot reply to topics in this forum
Media Companion :: Media Companion :: General Discussion-
Jump to: