Kodi Development 22.0
for Binary and Script based Add-Ons
 
Loading...
Searching...
No Matches
InfoTagMusic

Detailed Description

Kodi's music info tag class.

Class: xbmc.InfoTagMusic([offscreen])

Access and / or modify the music metadata of a ListItem.


Example:

...
tag = xbmc.Player().getMusicInfoTag()
title = tag.getTitle()
url = tag.getURL()
...

Function Documentation

◆ InfoTagMusic()

InfoTagMusic ( ...)

Function: xbmc.InfoTagMusic([offscreen])


Create a music info tag.

Parameters
offscreen[opt] bool (default False) - if GUI based locks should be avoided. Most of the times listitems are created offscreen and added later to a container for display (e.g. plugins) or they are not even displayed (e.g. python scrapers). In such cases, there is no need to lock the GUI when creating the items (increasing your addon performance). Note however, that if you are creating listitems and managing the container itself (e.g using WindowXML or WindowXMLDialog classes) subsquent modifications to the item will require locking. Thus, in such cases, use the default value (False).

v20 Python API changes
Added offscreen argument.

Example:

...
musicinfo = xbmc.InfoTagMusic(offscreen=False)
...

◆ getDbId()

getDbId ( )

Function: getDbId()


Get identification number of tag in database.

Returns
[integer] database id.

v18 Python API changes
New function added.

◆ getURL()

getURL ( )

Function: getURL()


Returns url of source as string from music info tag.

Returns
[string] Url of source

◆ getTitle()

getTitle ( )

Function: getTitle()


Returns the title from music as string on info tag.

Returns
[string] Music title

◆ getMediaType()

getMediaType ( )

Function: getMediaType()


Get the media type of the music item.

Returns
[string] media type

Available strings about media type for music:

String Description
artist If it is defined as an artist
album If it is defined as an album
song If it is defined as a song

v18 Python API changes
New function added.

◆ getArtist()

getArtist ( )

Function: getArtist()


Returns the artist from music as string if present.

Returns
[string] Music artist

◆ getAlbum()

getAlbum ( )

Function: getAlbum()


Returns the album from music tag as string if present.

Returns
[string] Music album name

◆ getAlbumArtist()

getAlbumArtist ( )

Function: getAlbumArtist()


Returns the album artist from music tag as string if present.

Returns
[string] Music album artist name

◆ getGenre()

getGenre ( )

Function: getGenre()


Returns the genre name from music tag as string if present.

Returns
[string] Genre name

v20 Python API changes
Deprecated. Use getGenres() instead.

◆ getGenres()

getGenres ( )

Function: getGenres()


Returns the list of genres from music tag if present.

Returns
[list] List of genres

v20 Python API changes
New function added.

◆ getDuration()

getDuration ( )

Function: getDuration()


Returns the duration of music as integer from info tag.

Returns
[integer] Duration

◆ getYear()

getYear ( )

Function: getYear()


Returns the year of music as integer from info tag.

Returns
[integer] Year

v20 Python API changes
New function added.

◆ getRating()

getRating ( )

Function: getRating()


Returns the scraped rating as integer.

Returns
[integer] Rating

◆ getUserRating()

getUserRating ( )

Function: getUserRating()


Returns the user rating as integer (-1 if not existing)

Returns
[integer] User rating

◆ getTrack()

getTrack ( )

Function: getTrack()


Returns the track number (if present) from music info tag as integer.

Returns
[integer] Track number

◆ getDisc()

getDisc ( )

Function: getDisc()


Returns the disk number (if present) from music info tag as integer.

Returns
[integer] Disc number

◆ getReleaseDate()

getReleaseDate ( )

Function: getReleaseDate()


Returns the release date as string from music info tag (if present).

Returns
[string] Release date

◆ getListeners()

getListeners ( )

Function: getListeners()


Returns the listeners as integer from music info tag.

Returns
[integer] Listeners

◆ getPlayCount()

getPlayCount ( )

Function: getPlayCount()


Returns the number of carried out playbacks.

Returns
[integer] Playback count

◆ getLastPlayed()

getLastPlayed ( )

Function: getLastPlayed()


Returns last played time as string from music info tag.

Returns
[string] Last played date / time on tag

v20 Python API changes
Deprecated. Use getLastPlayedAsW3C() instead.

◆ getLastPlayedAsW3C()

getLastPlayedAsW3C ( )

Function: getLastPlayedAsW3C()


Returns last played time as string in W3C format (YYYY-MM-DDThh:mm:ssTZD).

Returns
[string] Last played datetime (W3C)

v20 Python API changes
New function added.

◆ getComment()

getComment ( )

Function: getComment()


Returns comment as string from music info tag.

Returns
[string] Comment on tag

◆ getLyrics()

getLyrics ( )

Function: getLyrics()


Returns a string from lyrics.

Returns
[string] Lyrics on tag

◆ getMusicBrainzTrackID()

getMusicBrainzTrackID ( )

Function: getMusicBrainzTrackID()


Returns the MusicBrainz Recording ID from music info tag (if present).

Returns
[string] MusicBrainz Recording ID

v19 Python API changes
New function added.

◆ getMusicBrainzArtistID()

getMusicBrainzArtistID ( )

Function: getMusicBrainzArtistID()


Returns the MusicBrainz Artist IDs from music info tag (if present).

Returns
[list] MusicBrainz Artist IDs

v19 Python API changes
New function added.

◆ getMusicBrainzAlbumID()

getMusicBrainzAlbumID ( )

Function: getMusicBrainzAlbumID()


Returns the MusicBrainz Release ID from music info tag (if present).

Returns
[string] MusicBrainz Release ID

v19 Python API changes
New function added.

◆ getMusicBrainzReleaseGroupID()

getMusicBrainzReleaseGroupID ( )

Function: getMusicBrainzReleaseGroupID()


Returns the MusicBrainz Release Group ID from music info tag (if present).

Returns
[string] MusicBrainz Release Group ID

v19 Python API changes
New function added.

◆ getMusicBrainzAlbumArtistID()

getMusicBrainzAlbumArtistID ( )

Function: getMusicBrainzAlbumArtistID()


Returns the MusicBrainz Release Artist IDs from music info tag (if present).

Returns
[list] MusicBrainz Release Artist IDs

v19 Python API changes
New function added.

◆ getSongVideoURL()

getSongVideoURL ( )

Function: getSongVideoURL()


Returns the URL to a video of the song from the music tag as a string (if present).

Returns
[string] URL to a video of the song.

v21 Python API changes
New function added.

◆ setDbId()

setDbId ( ...)

Function: setDbId(dbId, type)


Set the database identifier of the music item.

Parameters
dbIdinteger - Database identifier.
typestring - Media type of the item.

v20 Python API changes
New function added.

◆ setURL()

setURL ( ...)

Function: setURL(url)


Set the URL of the music item.

Parameters
urlstring - URL.

v20 Python API changes
New function added.

◆ setMediaType()

setMediaType ( ...)

Function: setMediaType(mediaType)


Set the media type of the music item.

Parameters
mediaTypestring - Media type.

v20 Python API changes
New function added.

◆ setTrack()

setTrack ( ...)

Function: setTrack(track)


Set the track number of the song.

Parameters
trackinteger - Track number.

v20 Python API changes
New function added.

◆ setDisc()

setDisc ( ...)

Function: setDisc(disc)


Set the disc number of the song.

Parameters
discinteger - Disc number.

v20 Python API changes
New function added.

◆ setDuration()

setDuration ( ...)

Function: setDuration(duration)


Set the duration of the song.

Parameters
durationinteger - Duration in seconds.

v20 Python API changes
New function added.

◆ setYear()

setYear ( ...)

Function: setYear(year)


Set the year of the music item.

Parameters
yearinteger - Year.

v20 Python API changes
New function added.

◆ setReleaseDate()

setReleaseDate ( ...)

Function: setReleaseDate(releaseDate)


Set the release date of the music item.

Parameters
releaseDatestring - Release date in ISO8601 format (YYYY, YYYY-MM or YYYY-MM-DD).

v20 Python API changes
New function added.

◆ setListeners()

setListeners ( ...)

Function: setListeners(listeners)


Set the number of listeners of the music item.

Parameters
listenersinteger - Number of listeners.

v20 Python API changes
New function added.

◆ setPlayCount()

setPlayCount ( ...)

Function: setPlayCount(playcount)


Set the playcount of the music item.

Parameters
playcountinteger - Playcount.

v20 Python API changes
New function added.

◆ setGenres()

setGenres ( ...)

Function: setGenres(genres)


Set the genres of the music item.

Parameters
genreslist - Genres.

v20 Python API changes
New function added.

◆ setAlbum()

setAlbum ( ...)

Function: setAlbum(album)


Set the album of the music item.

Parameters
albumstring - Album.

v20 Python API changes
New function added.

◆ setArtist()

setArtist ( ...)

Function: setArtist(artist)


Set the artist(s) of the music item.

Parameters
artiststring - Artist(s).

v20 Python API changes
New function added.

◆ setAlbumArtist()

setAlbumArtist ( ...)

Function: setAlbumArtist(albumArtist)


Set the album artist(s) of the music item.

Parameters
albumArtiststring - Album artist(s).

v20 Python API changes
New function added.

◆ setTitle()

setTitle ( ...)

Function: setTitle(title)


Set the title of the music item.

Parameters
titlestring - Title.

v20 Python API changes
New function added.

◆ setRating()

setRating ( ...)

Function: setRating(rating)


Set the rating of the music item.

Parameters
ratingfloat - Rating.

v20 Python API changes
New function added.

◆ setUserRating()

setUserRating ( ...)

Function: setUserRating(userrating)


Set the user rating of the music item.

Parameters
userratinginteger - User rating.

v20 Python API changes
New function added.

◆ setLyrics()

setLyrics ( ...)

Function: setLyrics(lyrics)


Set the lyrics of the song.

Parameters
lyricsstring - Lyrics.

v20 Python API changes
New function added.

◆ setLastPlayed()

setLastPlayed ( ...)

Function: setLastPlayed(lastPlayed)


Set the last played date of the music item.

Parameters
lastPlayedstring - Last played date (YYYY-MM-DD HH:MM:SS).

v20 Python API changes
New function added.

◆ setMusicBrainzTrackID()

setMusicBrainzTrackID ( ...)

Function: setMusicBrainzTrackID(musicBrainzTrackID)


Set the MusicBrainz track ID of the song.

Parameters
musicBrainzTrackIDstring - MusicBrainz track ID.

v20 Python API changes
New function added.

◆ setMusicBrainzArtistID()

setMusicBrainzArtistID ( ...)

Function: setMusicBrainzArtistID(musicBrainzArtistID)


Set the MusicBrainz artist IDs of the music item.

Parameters
musicBrainzArtistIDlist - MusicBrainz artist IDs.

v20 Python API changes
New function added.

◆ setMusicBrainzAlbumID()

setMusicBrainzAlbumID ( ...)

Function: setMusicBrainzAlbumID(musicBrainzAlbumID)


Set the MusicBrainz album ID of the music item.

Parameters
musicBrainzAlbumIDstring - MusicBrainz album ID.

v20 Python API changes
New function added.

◆ setMusicBrainzReleaseGroupID()

setMusicBrainzReleaseGroupID ( ...)

Function: setMusicBrainzReleaseGroupID(musicBrainzReleaseGroupID)


Set the MusicBrainz release group ID of the music item.

Parameters
musicBrainzReleaseGroupIDstring - MusicBrainz release group ID.

v20 Python API changes
New function added.

◆ setMusicBrainzAlbumArtistID()

setMusicBrainzAlbumArtistID ( ...)

Function: setMusicBrainzAlbumArtistID(musicBrainzAlbumArtistID)


Set the MusicBrainz album artist IDs of the music item.

Parameters
musicBrainzAlbumArtistIDlist - MusicBrainz album artist IDs.

v20 Python API changes
New function added.

◆ setComment()

setComment ( ...)

Function: setComment(comment)


Set the comment of the music item.

Parameters
commentstring - Comment.

v20 Python API changes
New function added.

◆ setSongVideoURL()

setSongVideoURL ( ...)

Function: setSongVideoURL(songVideoURL)


Set the URL of the song to point to a video.

Parameters
songVideoURLstring - URL to a video of the song.

v21 Python API changes
New function added.