Jump to content

MediaInfo.Type vs Item.GetContentType()


nxenos83

Recommended Posts

nxenos83

What's the difference between the two?

 

Is there a reason that the MediaInfo is available in the PlaybackProgressEventArgs, but not the ItemChangeEvenetArgs?

 

 

 

 

Link to comment
Share on other sites

hi @@nxenos83. In ItemChangeArgs you have the full library item.

 

PlaybackProgressEventArgs also contains the full library item using the Item property. However, if an app wanted to report that it was playing something not contained in the emby library, then of course Item would be null and instead you'd have MediaInfo, which would just be things like title, etc.

Link to comment
Share on other sites

nxenos83

thanks @@Luke,

 

Is there a way to get a MediaInfo object from a library item during the ItemAdded event? I poked around the code but only found BaseItemInfo type referenced in session manger.

 

If I'm trying to take action when an episode is added, should I just use Item.GetContentTyp() to determine what type of item is being added?

Link to comment
Share on other sites

what you can do is try to cast it to an Audio or Video object. Those classes will have some light media info characteristics designed for display. If that is not enough then you can call Audio/Video .GetMediaStreams(), but that is a separate db query so use only if needed. thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...