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()
...
◆ 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()
Function: getDbId()
Get identification number of tag in database.
- Returns
- [integer] database id.
- v18 Python API changes
- New function added.
◆ getURL()
Function: getURL()
Returns url of source as string from music info tag.
- Returns
- [string] Url of source
◆ getTitle()
Function: getTitle()
Returns the title from music as string on info tag.
- Returns
- [string] Music title
◆ 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()
Function: getArtist()
Returns the artist from music as string if present.
- Returns
- [string] Music artist
◆ getAlbum()
Function: getAlbum()
Returns the album from music tag as string if present.
- Returns
- [string] Music album name
◆ getAlbumArtist()
Function: getAlbumArtist()
Returns the album artist from music tag as string if present.
- Returns
- [string] Music album artist name
◆ 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()
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()
Function: getDuration()
Returns the duration of music as integer from info tag.
- Returns
- [integer] Duration
◆ getYear()
Function: getYear()
Returns the year of music as integer from info tag.
- Returns
- [integer] Year
- v20 Python API changes
- New function added.
◆ getRating()
Function: getRating()
Returns the scraped rating as integer.
- Returns
- [integer] Rating
◆ getUserRating()
Function: getUserRating()
Returns the user rating as integer (-1 if not existing)
- Returns
- [integer] User rating
◆ getTrack()
Function: getTrack()
Returns the track number (if present) from music info tag as integer.
- Returns
- [integer] Track number
◆ getDisc()
Function: getDisc()
Returns the disk number (if present) from music info tag as integer.
- Returns
- [integer] Disc number
◆ getReleaseDate()
Function: getReleaseDate()
Returns the release date as string from music info tag (if present).
- Returns
- [string] Release date
◆ getListeners()
Function: getListeners()
Returns the listeners as integer from music info tag.
- Returns
- [integer] Listeners
◆ getPlayCount()
Function: getPlayCount()
Returns the number of carried out playbacks.
- Returns
- [integer] Playback count
◆ getLastPlayed()
◆ 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()
Function: getComment()
Returns comment as string from music info tag.
- Returns
- [string] Comment on tag
◆ 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()
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()
Function: setDbId(dbId, type)
Set the database identifier of the music item.
- Parameters
-
dbId | integer - Database identifier. |
type | string - Media type of the item. |
- v20 Python API changes
- New function added.
◆ setURL()
◆ setMediaType()
Function: setMediaType(mediaType)
Set the media type of the music item.
- Parameters
-
mediaType | string - Media type. |
- v20 Python API changes
- New function added.
◆ setTrack()
Function: setTrack(track)
Set the track number of the song.
- Parameters
-
track | integer - Track number. |
- v20 Python API changes
- New function added.
◆ setDisc()
Function: setDisc(disc)
Set the disc number of the song.
- Parameters
-
disc | integer - Disc number. |
- v20 Python API changes
- New function added.
◆ setDuration()
Function: setDuration(duration)
Set the duration of the song.
- Parameters
-
duration | integer - Duration in seconds. |
- v20 Python API changes
- New function added.
◆ setYear()
◆ setReleaseDate()
Function: setReleaseDate(releaseDate)
Set the release date of the music item.
- Parameters
-
releaseDate | string - Release date in ISO8601 format (YYYY, YYYY-MM or YYYY-MM-DD). |
- v20 Python API changes
- New function added.
◆ setListeners()
Function: setListeners(listeners)
Set the number of listeners of the music item.
- Parameters
-
listeners | integer - Number of listeners. |
- v20 Python API changes
- New function added.
◆ setPlayCount()
Function: setPlayCount(playcount)
Set the playcount of the music item.
- Parameters
-
playcount | integer - Playcount. |
- v20 Python API changes
- New function added.
◆ setGenres()
Function: setGenres(genres)
Set the genres of the music item.
- Parameters
-
- v20 Python API changes
- New function added.
◆ setAlbum()
Function: setAlbum(album)
Set the album of the music item.
- Parameters
-
- v20 Python API changes
- New function added.
◆ setArtist()
Function: setArtist(artist)
Set the artist(s) of the music item.
- Parameters
-
artist | string - Artist(s). |
- v20 Python API changes
- New function added.
◆ setAlbumArtist()
Function: setAlbumArtist(albumArtist)
Set the album artist(s) of the music item.
- Parameters
-
albumArtist | string - Album artist(s). |
- v20 Python API changes
- New function added.
◆ setTitle()
Function: setTitle(title)
Set the title of the music item.
- Parameters
-
- v20 Python API changes
- New function added.
◆ setRating()
Function: setRating(rating)
Set the rating of the music item.
- Parameters
-
- v20 Python API changes
- New function added.
◆ setUserRating()
Function: setUserRating(userrating)
Set the user rating of the music item.
- Parameters
-
userrating | integer - User rating. |
- v20 Python API changes
- New function added.
◆ setLyrics()
◆ setLastPlayed()
Function: setLastPlayed(lastPlayed)
Set the last played date of the music item.
- Parameters
-
lastPlayed | string - 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
-
musicBrainzTrackID | string - 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
-
musicBrainzArtistID | list - 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
-
musicBrainzAlbumID | string - 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
-
musicBrainzReleaseGroupID | string - 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
-
musicBrainzAlbumArtistID | list - MusicBrainz album artist IDs. |
- v20 Python API changes
- New function added.
◆ setComment()
Function: setComment(comment)
Set the comment of the music item.
- Parameters
-
- v20 Python API changes
- New function added.
◆ setSongVideoURL()
Function: setSongVideoURL(songVideoURL)
Set the URL of the song to point to a video.
- Parameters
-
songVideoURL | string - URL to a video of the song. |
- v21 Python API changes
- New function added.