# ObjectContainer only have 1 TrackObject?

**URL:** <https://forums.plex.tv/t/objectcontainer-only-have-1-trackobject/28278>\
**Category:** Dev/API Corner\
**Tags:** plugin-dev\
**Created:** [February 1, 2013, 8:49pm UTC](https://forums.plex.tv/t/objectcontainer-only-have-1-trackobject/28278 "2013-02-01T20:49:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bob3695](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@bob3695](https://forums.plex.tv/u/bob3695)\
**Post date:** [February 1, 2013, 8:49pm UTC](https://forums.plex.tv/t/objectcontainer-only-have-1-trackobject/28278/1 "2013-02-01T20:49:02Z")

</div>

Hello,  
  
  
  
I am working on my first Plex channel which is going well so far. I am successfully pulling the info from the 3rd party but noticed something when trying to populate a list of songs to play.  
  
  
  
I am just populating a ObjectContainer with a for loop something like:

```auto

<br />
oc = ObjectContainer()<br />
<br />
for song in songs:<br />
   oc.Add(TrackObject(ALL THE INFO HERE))<br />
<br />
return oc<br />

```

  
  
now... I know the TrackObject works as when I select it, it streams the music without missing a beat... the problem is it only shows one result! So I tried something else...  
  

```auto

<br />
oc = ObjectContainer()<br />
<br />
for song in songs:<br />
   oc.Add(DirectoryObject(ONLY SONG TITLE AND A KEY))<br />
<br />
return oc<br />

```

  
  
The directory doesn't let me play music directly (as it shouldn't) but now all of a sudden all the songs I am expecting show up!   
  
So my question is... Is there only allowed one track object per ObjectContainer? If so, what can I do to get around it?  
  
Disclaimer: This is not actual code but simple versions of my code (removing the part that pulls artist name and such which I know is working).

---

<div class="post-metadata">

**Author:** ![bob3695](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@bob3695](https://forums.plex.tv/u/bob3695)\
**Post date:** [February 1, 2013, 8:55pm UTC](https://forums.plex.tv/t/objectcontainer-only-have-1-trackobject/28278/2 "2013-02-01T20:55:44Z")

</div>

Disregard. I found the issue…  
  
  
  
I am working around a URL Service because I couldn’t get it to work right so I manually build my TrackObject with MediaObjects and so on… Well since the URL property of TrackObject is REQUIRED I just put a dummy URL in… it seems that kept it only showing 1 item. I put a counter and attached the number to the URL and it starts showing them all.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [December 20, 2019, 10:50pm UTC](https://forums.plex.tv/t/objectcontainer-only-have-1-trackobject/28278/3 "2019-12-20T22:50:22Z")

</div>

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
