Listitem Class

From DevWiki

Jump to: navigation, search

Applications,Python API,MC Module

Contents


ListItem

ListItem(type:ListItem::MediaType):ListItem
This class represents an item that is displayed in a user interface or part of a playlist. It contains a long site of properties that are common for media items. Additional custom properties can be used as well. Most of the properties are optional. Required properties for all listitems:

  1. item = mc.ListItem(mc.ListItem.MEDIA_VIDEO_CLIP)


MediaType

MediaType
Media type constant. Used to hint boxee on the type of media in the list item.

  1. item = mc.ListItem(mc.ListItem.MEDIA_VIDEO_CLIP)


AddAlternativePath

AddAlternativePath(label:String, path:String, type:String, thumbnail:String):Void
Adds an alternative path for playing the media. When the user clicks on the item, additional Play options will be listed. This is useful to supporting playback of both SD and HD content.

  1. item.AddAlternatePath("Play 720p", "http://mysite/hd?video=6376", "text/html", "http://mysite/img/720p.png")


AddCast

AddCast(name:String):Void
Adds a cast to the list of cast members

  1. item.AddCast("John Doe")


AddCastAndRole

AddCastAndRole(name:String, role:String):Void
Adds a cast with role to the list of cast.

  1. item.AddCastAndRole("Al Pacino", "actor")


ClearCastAndRole

ClearCastAndRole():Void
Clears the list of cast members.

  1. item.ClearCastAndRole()


Dump

Dump():Void
Dumps the content of the list item to the boxee log. This is useful for debugging purposes.

  1. item.Dump()


GetAlbum

GetAlbum():String
Returns the album.

  1. album = item.GetAlbum()


GetArtist

GetArtist():String
Returns the artist.

  1. artist = item.GetArtist()


GetAuthor

GetAuthor():String
Returns the author.

  1. author = item.GetAuthor()


GetCast

GetCast():String
Returns the cast.

  1. cast = item.GetCast()


GetCastAndRole

GetCastAndRole():String
Returns the cast and role.

  1. cast_role = item.GetCastAndRole()


GetComment

GetComment():String
Returns the comment.

  1. comment = item.GetComment()


GetContentRating

GetContentRating():String
Returns the content rating.

  1. rating = item.GetContentRating()


GetContentType

GetContentType():String
Returns the content type.

  1. type = item.GetContentType()


GetDate

GetDate():String
Returns the release date.

  1. date = item.GetDate()


GetDescription

GetDescription():String
Returns the description.

  1. desc = item.GetDescription()


GetDirector

GetDirector():String
Returns the director.

  1. director = item.GetDirector()


GetDuration

GetDuration():Integer
Returns the duration in seconds.

  1. runtime = item.GetDuration()


GetDurationFormatted

GetDurationFormatted():String
Returns the duration formatted as HH:MM:SS.

  1. runtime = item.GetDurationFormatted()


GetEpisode

GetEpisode():Integer
Returns the episode number for tv shows.

  1. episode = item.GetEpisode()


GetGenre

GetGenre():String
Returns the genre.

  1. genre = item.GetGenre()


GetIcon

GetIcon():String
Returns the icon.

  1. icon = item.GetIcon()


GetImage

GetImage(id:Integer):String
Gets additional (non thumbnail) image. This image is not scaled and loaded in the background. There can be up to 10 images per item.

  1. item.GetImage(0)


GetKeywords

GetKeywords():String
Returns the keywords.

  1. keywords = item.GetKeywords()


GetLabel

GetLabel():String
Returns the label.

  1. label = item.GetLabel()


GetMediaType

GetMediaType():ListItem::MediaType
Get the media type.

  1. type = item.getMediaType()


GetPath

GetPath():String
Returns the path.

  1. path = item.GetPath()


GetProperty

GetProperty(key:String):String
Returns a custom property from rss.

  1. digg_count = item.GetProperty("diggs")
  2. digg_comment = item.GetProperty("diggcomments")


GetProviderSource

GetProviderSource():String
Returns the provider source.

  1. source = item.GetProviderSource()


GetReportToServer

GetReportToServer():Boolean
Returns true if playing the item will be reported to boxee.

  1. if item.GetReportToServer():
  2.    ...


GetSeason

GetSeason():Integer
Returns the season number for tv shows.

  1. season = item.GetSeason()


GetSize

GetSize():Integer
Returns the size.

  1. size = item.GetSize()


GetSizeFormatted

GetSizeFormatted():String
Returns the size, formatted with commas.

  1. size = item.GetSizeFormatted()


GetStarRating

GetStarRating():float
Returns the star rating.

  1. stars = item.GetStarRating()


GetStudio

GetStudio():String
Returns the studio.

  1. studio = item.GetStudio()


GetTagLine

GetTagLine():String
Returns the tag line.

  1. tagline = item.GetTagLine()


GetThumbnail

GetThumbnail():String
Returns the thumbnail.

  1. thumb = item.GetThumbnail()


GetTitle

GetTitle():String
Returns the title.

  1. title = item.GetTitle()


GetTrackNumber

GetTrackNumber():Integer
Returns the track number.

  1. track = item.GetTrackNumber()


GetTVShowTitle

GetTVShowTitle():String
Returns the tv show title.

  1. series = item.GetTVShowTitle()


GetViewCount

GetViewCount():Integer
Returns the view count.

  1. views = item.GetViewCount()


GetViewCountFormatted

GetViewCountFormatted():String
Returns the view count formatted with commas.

  1. views = item.GetViewCountFormatted()


GetWriter

GetWriter():String
Returns the writer.

  1. writer = item.GetWriter()


GetYear

GetYear():Integer
Returns the release year.

  1. year = item.GetYear()


SetAddToHistory

SetAddToHistory(addToHistory:Boolean):Void
Boolean flag that defines whether boxee will add this list item to the history when it is played. By default items are not added to history. If the played content is inappropriate, it should not be added to history.

  1. item.SetAddToHistory(True)


SetAlbum

SetAlbum(album:String):Void
Sets the album name.

  1. item.SetAlbum("The Division Bell")


SetArtist

SetArtist(artist:String):Void
Sets the arist name.

  1. item.SetArtist("Pink Floyd")


SetAuthor

SetAuthor(author:String):Void
Sets the author.

  1. item.SetAuthor("Avner Ronen")


SetComment

SetComment(comment:String):Void
Sets the comment.

  1. item.SetComment("The Greatest Film Ever Made")


SetContentRating

SetContentRating(rating:String):Void
Sets the content rating (mpaa, tv).

  1. item.SetContentRating("R")


SetContentType

SetContentType(contentType:String):Void
Sets the content type.

  1. Item.SetContentType("application/x-shockwave-flash")


SetDate

SetDate(year:Integer, month:Integer, day:Integer):Void
Sets the release date.

  1. item.SetDate(1974, 12, 20)


SetDescription

SetDescription(plotOutline[:String, ishtml]:Boolean):Void
Sets the description.

  1. item.SetDescription("The early life and career of Vito Corleone in 1920s New York is...", False)


SetDirector

SetDirector(director:String):Void
Sets the director for video media.

  1. item.SetDirector("Francis Ford Coppola")


SetDuration

SetDuration(seconds:Integer):Void
Sets the duration in seconds.

  1. item.SetDuration(12000)


SetEpisode

SetEpisode(episode:Integer):Void
Sets the episode number for TV show.

  1. item.SetEpisode(2)


SetExternalItem

SetExternalItem(ListItem externalItem):Void
In some (rare) cases you would like the application to play this item but when reporting to the server or updating the history, you would like to use another list item. In that case, create another list item and set it to be the external item of this one. List item properties will not be copied over to the external one. They will have to be recreated separately.

  1. externalItem = mc.ListItem(mc.ListItem.MEDIA_VIDEO_CLIP)
  2. externalItem.SetTitle("The Godfather: Part II")
  3. item.SetExternalItem(externalItem)


SetGenre

SetGenre(genre:String):Void
Sets the genre.

  1. item.SetGenre("Crime, Drama")


SetIcon

SetIcon(thumbnail:String):Void
Sets the icon. Could be either a local file or a URL with the protocol The icon will be scaled to 200×200, so it can not be used for displaying large images.

  1. item.SetIcon("http://media.boxee.tv/movies/thumbs/185477854.png")


SetImage

SetImage(id:Integer, url:String):Void
Sets additional (non thumbnail) image. This image is not scaled and loaded in the background. There could be up to 10 images per item.

  1. item.SetImage(0, "http://fc02.deviantart.com/fs41/f/2009/039/2/5/The_Godfather_Wallpaper_by_LegendaryRonin.jpg")


SetKeywords

SetKeywords(keywords:String):Void
Sets the key words.

  1. item.SetKeywords("Cuba, New York, 1950s, 1920s, 1910s, Crime Epic, Lake Tahoe Nevada")


SetLabel

SetLabel(label:String):Void
Sets the label.

  1. item.SetLabel("The Godfather: Part II")


SetPath

SetPath(path:String):Void
Sets the path. It could be either a local file or a URL with the protocols: mms:// or flash:// (flash is described in the RSS specification).

  1. item.SetPath("http://media.boxee.tv/movies/flash/875442")


SetProperty

SetProperty(key:String, value:String):Void
Sets custom properties to the item.

  1. item.SetProperty("foo", "bar")


SetProviderSource

SetProviderSource(provider:String):Void
Sets the provider source, the "Play On " label in Boxee. Should be the name of the application or site from which the feed content originates to.

  1. item.SetProviderSource("FOX")


SetReportToServer

SetReportToServer(reportToServer:Boolean):Void
Boolean flag that defines whether boxee will report to the server that this item was played. By default every played content is reported to boxee. If the played content is inappropriate, it should not be reported to boxee.

  1. item.SetReportToServer(Flase)


SetSeason

SetSeason(season:Integer):Void
Sets the season number for TV show.

  1. item.SetSeason(5)


SetSize

SetSize(size:Integer):Void
Sets the file size.

  1. item.SetSize(125485658)


SetStarRating

SetStarRating(rating:float):Void
Sets the star rating for the content. Should be a value between 0 and 10.

  1. item.SetStarRating(10)


SetStudio

SetStudio(studio:String):Void
Sets the studio or network.

  1. item.SetStudio("Paramount Pictures")


SetTagLine

SetTagLine(tagline:String):Void
Sets the tag line.

  1. item.SetTagLine("An offer you can't refuse.")


SetThumbnail

SetThumbnail(thumbnail:String):Void
Sets the thumbnail. Could be either a local file or link. The thumbnail will be scaled to 200×200 (keeping aspect), so it can not be used for displaying large images.

  1. item.SetThumbnail("http://media.boxee.tv/movies/thumbs/185477854.png")


SetTitle

SetTitle(title:String):Void
Sets the title.

  1. item.SetTitle("The Godfather: Part II")


SetTrackNumber

SetTrackNumber(tracknumber:Integer):Void
Sets the track number for audio CDs.

  1. item.SetTrackNumber(4)


SetTVShowTitle

SetTVShowTitle(title:String):Void
Sets the TV show title (different than the title which is the episode title).

  1. item.SetTVShowTitle("Seinfeld")


SetViewCount

SetViewCount(viewcount:Integer):Void
Sets the number of views.

  1. item.SetViewCount(7859652)


SetWriter

SetWriter(writer:String):Void
Sets the writer.

  1. item.SetWriter("Mario Puzo")


SetYear

SetYear(year:Integer):Void
Sets the release year.

  1. item.SetYear(1974)
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox