<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic A better random play in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/A-better-random-play/m-p/5575239#M9079</link>
    <description>&lt;P&gt;My frustration is I want Spotify to play my playlist randomly but not play a track more than once. I work in IT but not a developer but can code simply for Systems tasks in Powershell. This below does what I am after - maybe it could be adapted to work in Spotify ?&lt;/P&gt;&lt;DIV&gt;cls&lt;/DIV&gt;&lt;DIV&gt;$tunes = New-Object System.Collections.ArrayList&lt;/DIV&gt;&lt;DIV&gt;$tracks = 24&lt;/DIV&gt;&lt;DIV&gt;#populate&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;For ($i=1;$i -le $tracks;$i++)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$out = "tune " + $i&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$tunes.add($out)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;#"play" then remove from list&lt;/DIV&gt;&lt;DIV&gt;For ($i=1;$i -le $tracks;$i++)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$index = Get-Random -Maximum $tunes.Count &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$tunes[$index]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$tunes.Remove($tunes[$index])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;"End = " + $tunes&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 04 May 2023 12:27:35 GMT</pubDate>
    <dc:creator>surfboy36</dc:creator>
    <dc:date>2023-05-04T12:27:35Z</dc:date>
    <item>
      <title>A better random play</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/A-better-random-play/m-p/5575239#M9079</link>
      <description>&lt;P&gt;My frustration is I want Spotify to play my playlist randomly but not play a track more than once. I work in IT but not a developer but can code simply for Systems tasks in Powershell. This below does what I am after - maybe it could be adapted to work in Spotify ?&lt;/P&gt;&lt;DIV&gt;cls&lt;/DIV&gt;&lt;DIV&gt;$tunes = New-Object System.Collections.ArrayList&lt;/DIV&gt;&lt;DIV&gt;$tracks = 24&lt;/DIV&gt;&lt;DIV&gt;#populate&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;For ($i=1;$i -le $tracks;$i++)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$out = "tune " + $i&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$tunes.add($out)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;}&lt;/DIV&gt;&lt;DIV&gt;#"play" then remove from list&lt;/DIV&gt;&lt;DIV&gt;For ($i=1;$i -le $tracks;$i++)&lt;/DIV&gt;&lt;DIV&gt;{&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$index = Get-Random -Maximum $tunes.Count &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$tunes[$index]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$tunes.Remove($tunes[$index])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;"End = " + $tunes&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 12:27:35 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/A-better-random-play/m-p/5575239#M9079</guid>
      <dc:creator>surfboy36</dc:creator>
      <dc:date>2023-05-04T12:27:35Z</dc:date>
    </item>
  </channel>
</rss>

