Add-on:TV Show - Next Aired: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
m (Addon-Bot Update)
No edit summary
Line 3: Line 3:
|provider-name=Ppic & Frost & ronie & `Black & phil65 & WayneD
|provider-name=Ppic & Frost & ronie & `Black & phil65 & WayneD
|ID=script.tv.show.next.aired
|ID=script.tv.show.next.aired
|latest-version=6.0.4
|latest-version=6.0.5
|extension point=xbmc.python.script
|extension point=xbmc.python.script
|provides=executable
|provides=executable
Line 31: Line 31:
   <requires>
   <requires>
     <import addon="xbmc.gui" version="3.00"/>
     <import addon="xbmc.gui" version="3.00"/>
     <import addon="script.tv.show.next.aired" version="4.1.15"/>
     <import addon="script.tv.show.next.aired" version="6.0.5"/>
   </requires>
   </requires>


Line 65: Line 65:
| NextAired.%d.Library || eg. videodb://2/2/1/ or videodb://tvshows/titles/1/
| NextAired.%d.Library || eg. videodb://2/2/1/ or videodb://tvshows/titles/1/
|-
|-
| NextAired.%d.Status || eg. 'Returning Series'/'Final Season'/'New Series'
| NextAired.%d.Status || eg. 'New Series'/'Returning Series'/'Cancelled/Ended'
|-
| NextAired.%d.StatusID || ID of the Status string
|-
|-
| NextAired.%d.Network || name of the tv network that's airing the show
| NextAired.%d.Network || name of the tv network that's airing the show
|-
|-
| NextAired.%d.Started || airdate of the first episode, eg. 'Mon, Sep 24, 2007'
| NextAired.%d.Started || airdate of the first episode, eg. 09/24/07, 'Mon, Sep 24, 2007', etc.
|-
|-
| NextAired.%d.Classification || type of show; N.B. not currently supported
| NextAired.%d.Classification || type of show, eg. Reality, Mini-Series, etc. Data is also in Genre.
|-
|-
| NextAired.%d.Genre || genre of the show
| NextAired.%d.Genre || genre of the show
Line 86: Line 88:
|-
|-
| NextAired.%d.NextDate || date the next episode will be aired
| NextAired.%d.NextDate || date the next episode will be aired
|-
| NextAired.%d.NextDay || "nice" localized format for NextDate, eg. "Wed, Jun 11" or "Mon, Jan 26, 2015"
|-
|-
| NextAired.%d.NextTitle || name of the next episode
| NextAired.%d.NextTitle || name of the next episode
Line 96: Line 100:
|-
|-
| NextAired.%d.LatestDate || date the last episode was aired
| NextAired.%d.LatestDate || date the last episode was aired
|-
| LatestDay || "nice" localized format for LatestDate, eg. "Wed, Jun 11" or "Mon, Jan 26, 2015"
|-
|-
| NextAired.%d.LatestTitle || name of the last episode
| NextAired.%d.LatestTitle || name of the last episode
Line 107: Line 113:
| NextAired.%d.AirDay || day(s) of the week the show is aired, eg 'Tuesday'
| NextAired.%d.AirDay || day(s) of the week the show is aired, eg 'Tuesday'
|-
|-
| NextAired.%d.ShortTime || time the show is aired, eg. '08:00 PM'
| NextAired.%d.ShortTime || time the show is aired, eg. "20:00" or "08:00 PM"
|-
| SecondWeek || 1 == show is in the second week of the Monday-week Guide, otherwise 0
|-
|-
| NextAired.%d.Art(poster) || tv show poster
| NextAired.%d.Art(poster) || tv show poster
Line 133: Line 141:
== MyVideoNav.xml ==
== MyVideoNav.xml ==


If you want to use this script you must first make sure you start it using:
If you want to use this script you must first make sure you start it using either:
     RunScript(script.tv.show.next.aired,backend=True)
     RunScript(script.tv.show.next.aired,backend=True)
or make a call for each show when the user changes shows:
    RunScript(script.tv.show.next.aired,tvshowtitle=The TvShowTitle Show Name)


The script will run in the background and provide next aired info for the focussed listitem.
The script will run in the background and provide next aired info for the focussed listitem.
Line 165: Line 176:


If you run the script without any options (or if it's started by the user),
If you run the script without any options (or if it's started by the user),
the script will provide a TV Guide window using
the script will provide a TV Guide window using either
     script-NextAired-TVGuide.xml
     script-NextAired-TVGuide.xml
or
    script-NextAired-TVGuide2.xml


This window is fully skinnable.
The former is the Monday-week guide and the latter is the today-week guide.
These windows are fully skinnable.


{| class="wikitable" border="1"
|+ List of required IDs in script-NextAired-TVGuide.xml, which is used if the user has selected the traditional Monday-week guide:
! container !! shows airing on
|-
| 200 || Monday
|-
| 201 || Tuesday
|-
| 202 || Wednesday
|-
| 203 || Thursday
|-
| 204 || Friday
|-
| 205 || Saturday
|-
| 206 || Sunday
|-
| 8 || in case all the containers above are empty, we set focus to this ID, which is usually a settings button.
|}


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|+ List of required id's:
|+ List of required IDs in script-NextAired-TVGuide2.xml, which is used if the user has selected the new Today-week guide:
! container !! shows airing on
! container !! shows aired/airing
|-
| 200 || Yesterday
|-
| 201 || Today
|-
| 202 || Today+1 (Tomorrow)
|-
| 203 || Today+2
|-
| 204 || Today+3
|-
| 205 || Today+4
|-
| 206 || Today+5
|-
| 207 || Today+6
|-
| 208 || Today+7
|-
|-
| 200 || monday
| 209 || Today+8
|-
|-
| 201 || tuesday
| 210 || Today+9
|-
|-
| 202 || wednesday
| 211 || Today+10
|-
|-
| 203 || thursday
| 212 || Today+11
|-
|-
| 204 || friday
| 213 || Today+12
|-
|-
| 205 || saturday
| 214 || Today+13
|-
|-
| 206 || sunday
| 215 || Today+14
|-
|-
| 8 || in case all the containers above are empty, we set focus to this id
| 8 || in case all the containers above are empty, we set focus to this ID.
|}
|}


Line 202: Line 254:
| ListItem.Property(*) || see above
| ListItem.Property(*) || see above
|}
|}


Totals are available using the window properties listed above.
Totals are available using the window properties listed above.
Line 209: Line 260:
! label !! description
! label !! description
|-
|-
| Window(home).Property(NextAired.TodayDate) || todays date
| Window(home).Property(NextAired.TodayDate) || today's date
|-
| Window(home).Property(NextAired.Today) || localized string for "today"
|-
| Window(home).Property(NextAired.YesterdayDate) || yesterday's date
|-
| Window(home).Property(NextAired.Yesterday) || localized string for "yesterday"
|-
| Window(home).Property(NextAired.TomorrowDate) || tomorrow's date
|-
| Window(home).Property(NextAired.Tomorrow) || localized string for "tomorrow"
|-
|-
| Window(home).Property(NextAired.%d.Date) || date for the lists, eg NextAired.1.Date will show the date for monday
| Window(home).Property(NextAired.%d.Date) || 1 - 7 is the date for the Monday-week guide (1 for Monday and 7 for Sunday)
|-
| Window(home).Property(NextAired.%d.Date) || 200 - 215 is the date for either guide (numbered by container)
|-
| Window(home).Property(NextAired.%d.Weekday) || 200 - 215 is the localized weekday name for either guide (numbered by container)
|-
| Window(home).Property(NextAired.%d.Wday) || 200 - 215 is the localized, abbreviated weekday name for either guide (numbered by container)
|}
|}


A list of available infolabels, related to the available add-on settings:
A list of available infolabels, related to the available add-on settings:
Line 224: Line 290:
| Window(home).Property(TVGuide.BackgroundFanart) || 1=user selected to show fanart, empty if disabled
| Window(home).Property(TVGuide.BackgroundFanart) || 1=user selected to show fanart, empty if disabled
|-
|-
| Window(home).Property(TVGuide.PreviewThumbs) || 1=user selected to show 16:9 showthumbs, empty if disabled
| Window(home).Property(TVGuide.PreviewThumbs) || 1=user selected to show 16:9 show-thumbs, empty if disabled
|}
|}


All other id's and properties in the default script window are optional and not required by the script.
All other IDs and properties in the default script window are optional and not required by the script.
 


== Force update ==
== Force update ==


To force an update of the nextaired database ahead of its next scheduled time:
To force an update of the next-aired database ahead of its next scheduled time:
Forcing an update of the nextaired database will rescan your tv shows and re-scrape all nextaired info
Forcing an update of the next-aired database will look for updates related to your shows and grab any changed info.
     RunScript(script.tv.show.next.aired,force=True)
     RunScript(script.tv.show.next.aired,force=True)


Line 240: Line 305:


The force update and reset options are also available in the addon settings.
The force update and reset options are also available in the addon settings.
To force an update of a single show (which always grabs the full data for that show):
    RunScript(script.tv.show.next.aired,updateshow=TvShowTitle Goes Here)
The latter can be achieved with a button like this one:
    <control type="button" id="550">
    <label>$LOCALIZE[24069] $LOCALIZE[4]</label>
    <include>DialogVideoInfoButton</include>
    <onclick>RunScript(script.tv.show.next.aired,updateshow=$INFO[ListItem.Label])</onclick>
    <visible>Container.Content(tvshows)</visible>
    </control>


[[Category:Frodo add-on repository]]
[[Category:Frodo add-on repository]]
[[Category:Gotham add-on repository]]
[[Category:Gotham add-on repository]]

Revision as of 15:46, 22 March 2014

TV Show - Next Aired
http://mirrors.xbmc.org/addons/frodo/script.tv.show.next.aired/icon.png

See this add-on on the kodi.tv showcase

Author: Ppic & Frost & ronie & `Black & phil65 & WayneD

Type: Program
Repo:

Source: Source code
Summary: Get info for TV Shows Next Aired.
Home icon grey.png   ▶ Add-ons ▶ TV Show - Next Aired
Attention talk.png Need help with this add-on? See here.

Get info for TV Shows Next Aired. You'll never miss one again.

Installing

This add-on is installed from the Add-on browser located in Kodi as follows:

  1. Settings
  2. Add-ons
  3. Install from repository
  4. Program Add-ons
  5. TV Show - Next Aired
  6. Install

Introduction

The script will scan your library and tries to fetch next aired info for every show. There is no need to specify an alarm -- the script will will run a background update at regular intervals.

Skin integration

Dependency

Add this to your addon.xml to make it install along with your skin.

 <requires>
   <import addon="xbmc.gui" version="3.00"/>
   <import addon="script.tv.show.next.aired" version="6.0.5"/>
 </requires>

Note: Please check on what minimum version you need and change it accordingly

Run at startup

To make sure the script updates on starting XBMC add code below to Startup.xml

   RunScript(script.tv.show.next.aired,silent=True)


Available infolabels

Airing today

For shows that are airing today, the script will set the window properties listed below.

  • Window(Home).Property(*)


Available labels
Property Description
NextAired.%d.Label tv show name
NextAired.%d.Thumb tv show icon
NextAired.%d.AirTime eg. 'Wednesday, Thursday: 09:00 PM'
NextAired.%d.Path tv show path
NextAired.%d.Library eg. videodb://2/2/1/ or videodb://tvshows/titles/1/
NextAired.%d.Status eg. 'New Series'/'Returning Series'/'Cancelled/Ended'
NextAired.%d.StatusID ID of the Status string
NextAired.%d.Network name of the tv network that's airing the show
NextAired.%d.Started airdate of the first episode, eg. 09/24/07, 'Mon, Sep 24, 2007', etc.
NextAired.%d.Classification type of show, eg. Reality, Mini-Series, etc. Data is also in Genre.
NextAired.%d.Genre genre of the show
NextAired.%d.Premiered year the first episode was aired, eg. '1999'
NextAired.%d.Country production country of the tv show, eg. 'USA'
NextAired.%d.Runtime duration of the episode in minutes
NextAired.%d.Fanart tv show fanart
NextAired.%d.Today will return 'True' if the show is aired today, otherwise 'False'
NextAired.%d.NextDate date the next episode will be aired
NextAired.%d.NextDay "nice" localized format for NextDate, eg. "Wed, Jun 11" or "Mon, Jan 26, 2015"
NextAired.%d.NextTitle name of the next episode
NextAired.%d.NextNumber season/episode number of the next episode, eg. '04x01'
NextAired.%d.NextEpisodeNumber episode number of the next episode, eg. '04'
NextAired.%d.NextSeasonNumber season number of the next episode, eg. '01'
NextAired.%d.LatestDate date the last episode was aired
LatestDay "nice" localized format for LatestDate, eg. "Wed, Jun 11" or "Mon, Jan 26, 2015"
NextAired.%d.LatestTitle name of the last episode
NextAired.%d.LatestNumber season/episode number of the last episode
NextAired.%d.LatestEpisodeNumber episode number of the last episode
NextAired.%d.LatestSeasonNumber season number of the last episode
NextAired.%d.AirDay day(s) of the week the show is aired, eg 'Tuesday'
NextAired.%d.ShortTime time the show is aired, eg. "20:00" or "08:00 PM"
SecondWeek 1 == show is in the second week of the Monday-week Guide, otherwise 0
NextAired.%d.Art(poster) tv show poster
NextAired.%d.Art(banner) tv show banner
NextAired.%d.Art(fanart) tv show fanart
NextAired.%d.Art(landscape) tv show landscape - artwork downloader required
NextAired.%d.Art(clearlogo) tv show logo - artwork downloader required
NextAired.%d.Art(clearart) tv show clearart - artwork downloader required
NextAired.%d.Art(characterart) tv show characterart - artwork downloader required
NextAired.Total number of running shows
NextAired.TodayTotal number of shows aired today
NextAired.TodayShow list of shows aired today

MyVideoNav.xml

If you want to use this script you must first make sure you start it using either:

   RunScript(script.tv.show.next.aired,backend=True)

or make a call for each show when the user changes shows:

   RunScript(script.tv.show.next.aired,tvshowtitle=The TvShowTitle Show Name)

The script will run in the background and provide next aired info for the focussed listitem. The infolabels listed above are available, using this format:

   Window(Home).Property(*)

Use code below as a visible condition!

   !IsEmpty(Window(Home).Property(NextAired.NextDate))

example code:

   <control type="group">
       <visible>!IsEmpty(Window(Home).Property(NextAired.NextDate))</visible>
       <control type="label">
           <posx>0</posx>
           <posy>0</posy>
           <width>800</width>
           <height>20</height>
           <label>$INFO[Window(Home).Property(NextAired.NextTitle)]</label>
       </control>
       <control type="label">
           <posx>0</posx>
           <posy>20</posy>
           <width>800</width>
           <height>20</height>
           <label>$INFO[Window(Home).Property(NextAired.NextDate)]</label>
       </control>
   </control>

TV Guide

If you run the script without any options (or if it's started by the user), the script will provide a TV Guide window using either

   script-NextAired-TVGuide.xml

or

   script-NextAired-TVGuide2.xml

The former is the Monday-week guide and the latter is the today-week guide. These windows are fully skinnable.

List of required IDs in script-NextAired-TVGuide.xml, which is used if the user has selected the traditional Monday-week guide:
container shows airing on
200 Monday
201 Tuesday
202 Wednesday
203 Thursday
204 Friday
205 Saturday
206 Sunday
8 in case all the containers above are empty, we set focus to this ID, which is usually a settings button.
List of required IDs in script-NextAired-TVGuide2.xml, which is used if the user has selected the new Today-week guide:
container shows aired/airing
200 Yesterday
201 Today
202 Today+1 (Tomorrow)
203 Today+2
204 Today+3
205 Today+4
206 Today+5
207 Today+6
208 Today+7
209 Today+8
210 Today+9
211 Today+10
212 Today+11
213 Today+12
214 Today+13
215 Today+14
8 in case all the containers above are empty, we set focus to this ID.
List of available infolabels:
label description
ListItem.Label tv show name
ListItem.Thumb tv show thumb
ListItem.Property(*) see above

Totals are available using the window properties listed above.

label description
Window(home).Property(NextAired.TodayDate) today's date
Window(home).Property(NextAired.Today) localized string for "today"
Window(home).Property(NextAired.YesterdayDate) yesterday's date
Window(home).Property(NextAired.Yesterday) localized string for "yesterday"
Window(home).Property(NextAired.TomorrowDate) tomorrow's date
Window(home).Property(NextAired.Tomorrow) localized string for "tomorrow"
Window(home).Property(NextAired.%d.Date) 1 - 7 is the date for the Monday-week guide (1 for Monday and 7 for Sunday)
Window(home).Property(NextAired.%d.Date) 200 - 215 is the date for either guide (numbered by container)
Window(home).Property(NextAired.%d.Weekday) 200 - 215 is the localized weekday name for either guide (numbered by container)
Window(home).Property(NextAired.%d.Wday) 200 - 215 is the localized, abbreviated weekday name for either guide (numbered by container)

A list of available infolabels, related to the available add-on settings:

label description
Window(home).Property(TVGuide.ThumbType) thumb type selected by the user: 0=poster, 1=banner, 2=logo
Window(home).Property(TVGuide.BackgroundFanart) 1=user selected to show fanart, empty if disabled
Window(home).Property(TVGuide.PreviewThumbs) 1=user selected to show 16:9 show-thumbs, empty if disabled

All other IDs and properties in the default script window are optional and not required by the script.

Force update

To force an update of the next-aired database ahead of its next scheduled time: Forcing an update of the next-aired database will look for updates related to your shows and grab any changed info.

   RunScript(script.tv.show.next.aired,force=True)

To force an update as well as reset all the existing data (forcing a fresh scan of everything) use the reset option:

   RunScript(script.tv.show.next.aired,reset=True)

The force update and reset options are also available in the addon settings.

To force an update of a single show (which always grabs the full data for that show):

   RunScript(script.tv.show.next.aired,updateshow=TvShowTitle Goes Here)

The latter can be achieved with a button like this one:

   <control type="button" id="550">
   <label>$LOCALIZE[24069] $LOCALIZE[4]</label>
   <include>DialogVideoInfoButton</include>
   <onclick>RunScript(script.tv.show.next.aired,updateshow=$INFO[ListItem.Label])</onclick>
   <visible>Container.Content(tvshows)</visible>
   </control>