tag:help.beatunes.com,2009-07-24:/discussions/plugin/2020-how-to-get-all-the-playlists-that-contain-a-given-trackbeaTunes: Discussion 2021-10-25T08:04:18Ztag:help.beatunes.com,2009-07-24:Comment/494497742021-10-24T03:51:01Z2021-10-24T03:51:01ZHow to get *all* the playlists that contain a given track?<div><p>In case it matters, my version numbers are:<br>
macOS 11.6<br>
Music.app 1.1.6.37<br>
beaTunes 5.2.24</p></div>hmijailtag:help.beatunes.com,2009-07-24:Comment/494497742021-10-25T08:04:15Z2021-10-25T08:04:15ZHow to get *all* the playlists that contain a given track?<div><p>Hey there,</p>
<p>please check out the attached screenshot. You can find out which playlists a track belongs to by using the track's context menu.</p>
<p>If that does not fit your use case, here's how you get the playlists (in Java):</p>
<pre>
<code>import com.tagtraum.audiokern.AudioSong;
import com.tagtraum.audiokern.PlayList;
import com.tagtraum.beatunes.BeaTunes;
import com.tagtraum.beatunes.library.Song;
import java.util.Collection;
[...]
public Collection<PlayList> create(final BeaTunes beaTunes, final AudioSong audioSong) {
final Song song = audioSong.getImplementation(Song.class);
// may or may not be necessary
beaTunes.getMediaLibrary().fetchCollections(song);
return song.getPlayLists();
}</code>
</pre>
<p>The issue here is that <code>getPlayLists()</code> is not exposed in <code>AudioSong</code>. Perhaps it should.</p>
<p>Anyhow, hope this helps you,</p>
<p>-hendrik</p></div>hendrik