Basic playlists: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Gamester17
No edit summary
(Updated for v20)
 
(100 intermediate revisions by 14 users not shown)
Line 1: Line 1:
{{XBMC faq toc Inline}}
{{mininav|[[Playlists]] }}
__TOC__
__NOEDITSECTION__A
A Playlist is a normal text file that lists one or more media files (Audio or Video), and plays them in succession.
You can either create your own or use existing playlists from other sources, e.g. Winamp M3U playlists.


==Supported Playlists==
XBMC supports [http://en.wikipedia.org/wiki/PLS_%28file_format%29 PLS], Winamp [http://en.wikipedia.org/wiki/M3U M3U], [[Cue Sheets]], and [[Playlists#Smart Playlists|XBMC Smart Playlist (XSP)]] playlists.


==Playlist Locations==
= Introduction =
Playlists are by default stored in subfolders of the Playlists folder in [[The UserData Folder]].
<section begin="intro" />The Basic Playlist is a user created list of music or video that does not require a correctly scraped library as it uses the folder paths to the media files. As the playlist is based on paths, different classes of media can be mixed, like movies and episodes. The list can be created within {{kodi}} or transferred from another media player.<section end="intro" />
Playlists can be run from anywhere, but the [[Music Library|music]] and [[Music Library|video]] library playlist nodes look in the following folders:
*'''mixed''' - playlists containing both audio and music videos, will show in both the Music and Video Libraries.
*'''music''' - playlists containing audio only, will show in the Music Library.
*'''video''' - playlists containing videos only, will show in the Video Library.


==Working with Playlists==
If your list of music or video has a common theme like genre, year, artist, studio, actor, etc, then you should consider using '''[[Smart playlists]]''' which will automatically generate the playlist based on rules. If the titles are random and there is no similarity between the items you want to group, then a manually created Basic Playlist is the best option.
{|
| valign="top" |
There are two basic ways to create and manipulate playlists in XBMC.
* XBMC has built in powerful playlist editors (both for normal and smart playlists)
* [[The Web Interface]]


To see the currently playing playlist bring up the context menu.  The currently playing playlist is accessible via the [[Now Playing]] item.  If the playlist is currently empty, that option will not be visible in the context menu.


You can add songs or entire folders with the "Queue" action of your control device.   Alternatively, the "Queue Item" option in the context menu can be used.
'''Note:''' Depending on your setup, the m3u file may use relative paths to local content. If you then transfer a playlist file to another media player on different hardware, even though it has access to the same content, the paths may be different and {{kodi}} will be unable to find the media. Use Absolute paths where possible.


While in the "Now Playing" window and pressing the '''Select''' or the '''Play''' button will start playback of your playlist.


Once in The Playlists view, you can save your playlist. Playlists are by default saved in a subfolder  of $HOME\[[The_UserData_Folder|UserData]]\playlists (separate folder for music, video and mixed playlists).
| [[Image:Smartplaylisteditor.jpg|right|360px]]
|}


==Now Playing==
= Playlist Files =
{|
The {{kodi}} generated basic playlist file is in the '''m3u''' format.
| [[Image:Music.now.playing.jpg|right|360px]]
| valign="top" |
Now playing is a special screen for audio and video [[Playlists]] that can be called up via the respective [[Music_Navigation_and_Control#The_Context_Menu|audio]] and [[Videos_Navigation_and_Control#The_Context_Menu|video]] context menus and [[Music#OSD_.28On_Screen_Display.29|OSD]].
;Shuffle
:Shuffles the currently playing playlist
;Repeat
:Repeats the currently playing playlist, options are '''All''' songs, '''One''' song or '''Off'''.
;Save
:Saves the currently playing playlist
;Clear
:Clears the currently playing playlist
|}


==Playlists on Remote Computers==
{|
| valign="top" |
If you use playlists to play files on a remote computer, make sure the contents of the playlist file match the file structure relative to XBMC.---(ie, if your using samba, you'll need to use smb://fullpath/file.mp3).


'''Example:'''
You want to play several files located in C:\music\mp3\ on your PC with XBMC.


"C:\music\mp3s\" is shared out as mp3 on your PC using [[Configuring PC Shares|PC file sharing]]  
== Supported Formats ==
{{kodi}} supports the following playlist files:
* [http://en.wikipedia.org/wiki/Cue_sheet Cue Sheets for music]
* [http://en.wikipedia.org/wiki/M3U m3u] (default)
* m3u8 <small>(added in v21 Omega)</small><ref>https://github.com/xbmc/xbmc/pull/21992</ref>
* [http://en.wikipedia.org/wiki/PLS_%28file_format%29 PLS]
* [[Internet_video_and_audio_streams|Stream files (.strm)]]
* [https://en.wikipedia.org/wiki/Windows_Media_Player_Playlist| Windows Media Player .wpl files]
* [[Smart playlists|Smart playlist .xsp files]]


For that to work each item in your playlist file must be formatted thus:


smb://workgroup;someuser:somepass@computer/mp3/fileN.mp3
== Location of Playlist Files ==
Playlist files are are located in the '''[[userdata]]/playlists''' folder. The location of this folder for each platform is shown in the table below.


Alternatively, there are settings in [[advancedsettings.xml]] for path substitutions in playlists. For instance, by adding
{{#lst:Userdata|location all}}
<xml>
<pathsubstitution>
  <substitute>
    <from>C:\music\mp3s\</from>
    <to>smb://workgroup;someuser:somepass@computer/mp3/</to>
  </substitute>
</pathsubstitution>
</xml>
You could use the same playlist file on your PC and XBMC. That is, anywhere the path c:\music\mp3s\ is found in a playlist, XBMC would substitute smb://workgroup;someuser:somepass@computer/mp3/


|


|}
== Editing m3u Files ==
If you choose to manually create your m3u playlists, then any text editor will suffice, but we recommend using an editor that can parse XML such as [https://code.visualstudio.com/Download Visual Studio Code] or [https://notepad-plus-plus.org/ Notepad++].


==Cue Sheets==
''[[Cue Sheets|Cue Sheet]]'', or a "'''cue'''" file, is a metadata file which describes how the tracks of a AudioCD or AudioDVD are laid out. Cue sheets are stored as plain text files and commonly have a "'''.cue'''" filename extension. CDRWIN first introduced cue sheets, which are now supported by many optical disc authoring applications and media players, including XBMC Media Center.


For an AudioCD, a cue sheet specifies titles and performers for the disc and its tracks as well as the names of one or more audio files to be used. MP3, AAC, FLAC, WAV, and DTS files are often used, although any audio formats is really supported. Cue sheets are especially useful when burning or listening to live sets where all tracks are recorded in one single file.


For more information on ''[[Cue Sheets|Cue Sheet]]'' and "'''cue'''" files please see our main article on [[Cue Sheets]].
= Use External Playlists =
If you have a playlist that you manually created, or one that was created by another media player that:
# Is in a format supported by {{kodi}} as detailed above, and
# The file paths are valid as described in the Introduction note, and
# Is saved in the correct playlist subfolder


==Party Mode Playlists==
Then you can use {{kodi}} to play it.
{|
| valign="top" |
The Party Mode [[Music Library#Party Mode|music]] and [[Video Library#Party Mode|music video]] playlists are the only predefined playlists in XBMC. They can be further configured via the [[partyMode.xsp]] and [[partymode-video.xsp]] files in [[The UserData Folder]]. The Party Mode playlists are smart playlists and can be configured as seen below.
|
|}


==Smart Playlists==
{|
| valign="top" |
XBMC now supports "Smart" playlists for all types of media, which essentially use a set of rules to limit the results from the databases.<br>


Smart playlists can be created either by using the built-in GUI Smart Playlist Editor accessible from the Playlist section, or by creating an xml file with the extension .xsp (XBMC Smart Playlist).
= Playlist Editor =
{{kodi}} has a built in Playlist Editor where playlists can be created and edited.


===Format of a Smart Playlist File===
Smart playlists are plain text files that can be parsed by an xml reader.  Any text editor can be used to create them.<br>
The format is as follows:


<xml>
== Playlist Editor Location ==
  <smartplaylist type="music">
The Playlist Managers are located as follows:
    <name>All U2 from after 1990</name>
    <match>all</match>
    <rule field="artist" operator="is">U2</rule>
    <rule field="year" operator="greaterthan">1990</rule>
    <limit>50</limit>
    <order direction="descending">playcount</order>
  </smartplaylist>
</xml>


Smart playlists can be of type music, video or mixed.  If the type tag is left out, XBMC assumes music.<br>
; Music library
Basically there are 2 header tags, <name> and <match> and then a set of <rule> tags that define the rules to use, along with an <order> tag to allow sorting and a <limit> tag to limit the returned results.  Note that the tags and attributes are all case-sensitive.  The <name> tag is the name of the playlist (currently unused) and the <match> tag indicates how the <rule> tags should be matched.  If <match>all</match> like in the above example, then only songs which satisfy all the <rule>'s will be included.  If <match>one</match> is specified, then songs that satisfy any one (or more) of the <rule>'s will be included.
: From the '''[[Basic_controls#Introduction|Main Menu]]''' navigate to {{highlight|Music > Playlists}}
:* Select ''New Playlist...'' to create a new playlist
:* Highlight an existing Playlist and from the '''[[Basic_controls#Context_Menu|Context menu]]''' select ''Edit playlist'' to edit an existing playlist


The <rule> tags, of which there can be as many as you wish, have 2 attributes (field and operator) and a value (the parameter).  The allowed fields are:


{|
; Video library
| '''album'''
: There is no playlist editor for the Video library. Use the Queue Method (next section) or create the playlist externally.
| Album the song appears on
|-
| '''artist'''
| Artist of the song
|-
| '''albumartist'''
| Artist of the album the song appears on
|-
| '''genre'''
| Genre of the song
|-
| '''title'''
| Title of the song
|-
| '''year'''
| Year of the song
|-
| '''tracknumber'''
| Track number of the song
|-
| '''time'''
| Duration of the song
|-
| '''playcount'''
| Number of times the song has been played
|-
| '''filename'''
| Filename of the song (excluding path)
|-
| '''lastplayed'''
| Date/time of last time the song was played
|-
| '''rating'''
| User rating of the song (from 1-5).  0 signifies no rating.
|-
| '''comment'''
| Comment tag of the song
|-
| '''playlist'''
| Whether the song is in the given playlist
|}


The operator attribute specifies the rule that should be used to match the parameter to the field.  All matching is done case-insensitive.  The allowed operators are


{|
== Using Playlist Editor ==
| '''contains'''
<gallery mode="packed" widths="600px" heights="337px">
| True if the field contains the parameter as a substring
File:Music-Playlist02.jpg|Image 1- Starting a new playlist in Music
|-
File:Music-Playlist03.jpg|Image 2- Adding music items to the playlist
| '''doesnotcontain'''
</gallery>
| True if the field does not contain the parameter as a substring
|-
| '''is'''
| True if the field matches the parameter exactly (case insensitive)
|-
| '''isnot'''
| True if the field does not match the parameter exactly (case insensitive)
|-
| '''startswith'''
| True if the start of the field matches the parameter
|-
| '''endswith'''
| True if the end of the field matches the parameter
|-
| '''lessthan'''
| True if the content of the field is is less than the parameter
|-
| '''greaterthan'''
| True if the content of the field is is greater than the parameter
|-
| '''inthelast'''
| True if the field falls in the last range specified by the parameter. Only applicable for a date field.
|-
| '''notinthelast'''
| True if the field does not fall in the last range specified by the parameter.  Only applicable for a date field.
|}


The <limit> tag simply takes a number of songs as it's limit.  A missing limit tag, or <limit>0</limit> will retrieve all matching songs.  The <order> tag has a direction attribute, the values of which can be "ascending" or "descending", and it's value is a field as above, or can be <order>random</order> if you want a random ordering returned.  Note that random should be used with care - it is quite slow if the returned results from the <rule> sets is large (> 500 items).
; Editor Layout
:* '''Left panel''' contains the Action buttons
:* '''Middle panel''' used to navigate to your music
:* '''Right panel''' contains the songs in the playlist


The above example, therefore selects all songs whose artist field is U2 and whose year field is greater than 1990, orders them by the number of times they've been played (most played first) then limits it to just 50.  Thus, the top 50 songs you've played from all U2 songs published after 1990.
; Create New Playlist
: Decide how to locate your music files to add to the playlist-
:* '''Files'''- Navigate the folder structure of your files
:* '''Library'''- Navigate the library nodes
:* '''Music Videos'''- Also add music videos to the playlist
: Whichever method you choose, the file paths are stored in the playlist.


Smart playlists should be placed in your $HOME\[[The_UserData_Folder|UserData]]\playlists\music folder on the xbox harddisk.  They cannot be read off of remote shares at present.
; What can be added to the Playlist
:* '''Artist'''- Selecting an Artist will add all songs attributed to the Artist
:* '''Album'''- Adding an Album will add all songs in the album
:* '''Song'''- Add an individual song


===Smart Playlist Examples===
; Adding Items
'''Recently played songs'''
: Highlight the item to be added then using one of the following two methods
<xml>
:* Press {{keypress|Q}} on your keyboard, or
<smartplaylist type="music">
:* From the ''[[Basic_controls#Context_Menu|Context Menu]]'' select '''Add'''
  <name>Recently Played Songs</name>
: The items will appear in the right panel in the order they are added.
  <match>all</match>
  <rule field="lastplayed" operator="inthelast">2 weeks</rule>
  <order direction="descending">lastplayed</order>
</smartplaylist>
</xml>


'''Top 100 songs'''
; Reorganise Items
<xml>
: To reorganise the order of the playlist items, move across to the right panel and on a [[Keyboard_controls|keyboard]] select
<smartplaylist type="music">
:* {{keypress|U}} - Move selected up
  <name>Top 100 Songs</name>
:* {{keypress|D}} - Move selected down
  <match>all</match>
:* {{keypress|DEL}} - Remove from playlist.
  <rule field="playcount" operator="greaterthan">0</rule>
: Alternatively, use the ''[[Basic_controls#Context_Menu|Context Menu]]'' which contains the same action options.
  <order direction="descending">playcount</order>
: A remote control with the proper [[keymap]] additions can also use those actions.
  <limit>100</limit>
</smartplaylist>
</xml>


'''Rock music from the 1970s'''
; Save the Playlist
<xml>
: Select '''Save''' from the left panel and enter a playlist name when prompted. The playlist will be accessible from {{highlight|Music > Playlists}}
<smartplaylist type="music">
: A music m3u playlist is always saved in \playlists\music\ even if it contains music videos.
  <name>Rock Music from the 1970s</name>
  <match>all</match>
  <rule field="genre" operator="is">Rock</rule>
  <rule field="year" operator="greaterthan">1969</rule>
  <rule field="year" operator="lessthan">1980</rule>
</smartplaylist>
</xml>


===Combining Playlists===
; Edit Existing Playlist
The "playlist" field can be used to combine several playlists together.  When playlists are combined, the <limit> and <order> tags of the included playlists are ignored; only the <order> and <limit> of the final playlist are used.
: To open and edit an existing playlist, use one of the following methods
:* From the left panel, select '''Open''' and navigate to your playlist
:* In your list of Playlists, highlight the playlist and select '''Edit playlist''' from the ''[[Basic_controls#Context_Menu|Context Menu]]''


As a simple example, lets create a new playlist combining the "Rock Music from the 1970s" and "Recently Played Songs" playlists above, to produce a playlist with the recently played rock songs from the 1970s.
; Delete Playlist
: From your list of Playlists, highlight the playlist and select '''Delete''' from the ''[[Basic_controls#Context_Menu|Context Menu]]''


'''Recently played rock tracks from the 1970s'''
<xml>
<smartplaylist type="music">
  <name>Recently played  Rock Tracks from the 1970s</name>
  <match>all</match>
  <rule field="playlist" operator="is">Rock Music from the 1970s</rule>
  <rule field="playlist" operator="is">Recently Played Songs</rule>
</smartplaylist>
</xml>


Using this system allows very complex queries to be built.  Note that in a single playlist, you can only match ALL of the rules, or ONE (or more) of the rules.  This is basically either ANDing the conditions together, or ORing them together.  You cannot mix AND with OR in a single playlist.  To build up a playlist with both AND and OR operations on the rules, you use multiple playlists to group the AND operations and the OR operations, then combine them as above.


|
= Queue Method =
While browsing your library, you have the ability to queue items for playback. These items are added to a temporary playlist.


|}
This temporary playlist can be accessed from the ''[[Basic_controls#Sideblade_Menu|Sideblade menu]]'' and can be further edited and saved as a Basic playlist.


[[category:Customization]]
Using this method, Basic Playlists can be created for Music and Videos from either the files or library structure.
[[category:Usage]]
 
[[category:User Interface]]
<gallery mode="packed" widths="400px" heights="225px">
[[category:Library]]
File:Music-Playlist04.jpg|Image 3- Browse your library or browse your folder structure
[[category:Video Library]]
File:Music-Playlist05.jpg|Image 4- Select '''Go to playlist''' from the left sideblade menu
[[category:Music Library]]
File:Music-Playlist06.jpg|Image 5- The playlist view. Note the combined Movies and Episodes.
</gallery>
 
; Adding Items
: Highlight the item to be added then using one of the following two methods
:* Press {{keypress|Q}} on your keyboard, or
:* From the ''[[Basic_controls#Context_Menu|Context Menu]]'' select '''Queue item'''
: Repeat as necessary and all items will be added to the temporary playlist.
 
; Accessing the Playlist
: From the ''[[Basic_controls#Sideblade_Menu|Sideblade menu]]'' select '''Go to playlist'''
: Once you enter the playlist, the options for editing and saving are similar to the Playlist Editor detailed above.
 
 
 
= References =
<references />
 
 
 
 
{{top}}
 
{{updated|20}}
[[Category:Karellen]]
[[Category:Video library]]
[[Category:Music library]]

Latest revision as of 00:07, 13 February 2023

Home icon grey.png   ▶ Playlists ▶ Basic playlists


Introduction

The Basic Playlist is a user created list of music or video that does not require a correctly scraped library as it uses the folder paths to the media files. As the playlist is based on paths, different classes of media can be mixed, like movies and episodes. The list can be created within Kodi or transferred from another media player.

If your list of music or video has a common theme like genre, year, artist, studio, actor, etc, then you should consider using Smart playlists which will automatically generate the playlist based on rules. If the titles are random and there is no similarity between the items you want to group, then a manually created Basic Playlist is the best option.


Note: Depending on your setup, the m3u file may use relative paths to local content. If you then transfer a playlist file to another media player on different hardware, even though it has access to the same content, the paths may be different and Kodi will be unable to find the media. Use Absolute paths where possible.


Playlist Files

The Kodi generated basic playlist file is in the m3u format.


Supported Formats

Kodi supports the following playlist files:


Location of Playlist Files

Playlist files are are located in the userdata/playlists folder. The location of this folder for each platform is shown in the table below.


The Userdata folder is a subfolder of the Kodi Data Folder and is located as shown in the table below.

Operating system Userdata Folder
Android Android/data/org.xbmc.kodi/files/.kodi/userdata/ (see note)
iOS /private/var/mobile/Library/Preferences/Kodi/userdata/
LibreELEC /storage/.kodi/userdata/
Linux ~/.kodi/userdata/
macOS /Users/<your_user_name>/Library/Application Support/Kodi/userdata/
Nvidia Shield (SMB) smb://<nvidiashieldurl>/internal/Android/data/org.xbmc.kodi/files/.kodi/userdata
OSMC /home/osmc/.kodi/userdata/
tvOS /private/var/mobile/Library/Preferences/Kodi/userdata/
webOS /media/developer/apps/usr/palm/applications/org.xbmc.kodi/.kodi/userdata/
Windows %APPDATA%\Kodi\userdata
Windows Portable <Install location chosen by you>\portable_data\userdata\
Windows via Microsoft Store %LOCALAPPDATA%\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi\
Windows Xbox %LOCALAPPDATA%\Packages\XBMCFoundation.Kodi_4n2hpmxwrvr6p\LocalCache\Roaming\Kodi\
Note: In some Android setups the path may be slightly different to the one stated above.


Editing m3u Files

If you choose to manually create your m3u playlists, then any text editor will suffice, but we recommend using an editor that can parse XML such as Visual Studio Code or Notepad++.


Use External Playlists

If you have a playlist that you manually created, or one that was created by another media player that:

  1. Is in a format supported by Kodi as detailed above, and
  2. The file paths are valid as described in the Introduction note, and
  3. Is saved in the correct playlist subfolder

Then you can use Kodi to play it.


Playlist Editor

Kodi has a built in Playlist Editor where playlists can be created and edited.


Playlist Editor Location

The Playlist Managers are located as follows:

Music library
From the Main Menu navigate to Music > Playlists
  • Select New Playlist... to create a new playlist
  • Highlight an existing Playlist and from the Context menu select Edit playlist to edit an existing playlist


Video library
There is no playlist editor for the Video library. Use the Queue Method (next section) or create the playlist externally.


Using Playlist Editor

Editor Layout
  • Left panel contains the Action buttons
  • Middle panel used to navigate to your music
  • Right panel contains the songs in the playlist
Create New Playlist
Decide how to locate your music files to add to the playlist-
  • Files- Navigate the folder structure of your files
  • Library- Navigate the library nodes
  • Music Videos- Also add music videos to the playlist
Whichever method you choose, the file paths are stored in the playlist.
What can be added to the Playlist
  • Artist- Selecting an Artist will add all songs attributed to the Artist
  • Album- Adding an Album will add all songs in the album
  • Song- Add an individual song
Adding Items
Highlight the item to be added then using one of the following two methods
  • Press Q on your keyboard, or
  • From the Context Menu select Add
The items will appear in the right panel in the order they are added.
Reorganise Items
To reorganise the order of the playlist items, move across to the right panel and on a keyboard select
  • U - Move selected up
  • D - Move selected down
  • DEL - Remove from playlist.
Alternatively, use the Context Menu which contains the same action options.
A remote control with the proper keymap additions can also use those actions.
Save the Playlist
Select Save from the left panel and enter a playlist name when prompted. The playlist will be accessible from Music > Playlists
A music m3u playlist is always saved in \playlists\music\ even if it contains music videos.
Edit Existing Playlist
To open and edit an existing playlist, use one of the following methods
  • From the left panel, select Open and navigate to your playlist
  • In your list of Playlists, highlight the playlist and select Edit playlist from the Context Menu
Delete Playlist
From your list of Playlists, highlight the playlist and select Delete from the Context Menu


Queue Method

While browsing your library, you have the ability to queue items for playback. These items are added to a temporary playlist.

This temporary playlist can be accessed from the Sideblade menu and can be further edited and saved as a Basic playlist.

Using this method, Basic Playlists can be created for Music and Videos from either the files or library structure.

Adding Items
Highlight the item to be added then using one of the following two methods
  • Press Q on your keyboard, or
  • From the Context Menu select Queue item
Repeat as necessary and all items will be added to the temporary playlist.
Accessing the Playlist
From the Sideblade menu select Go to playlist
Once you enter the playlist, the options for editing and saving are similar to the Playlist Editor detailed above.


References



Return to top