Jump to content

Channel plugin with Series examples


anv

Recommended Posts

I’m writing a plug-in for streaming content from some local news station. They have latest news and also a very large archive of free content.

I’m using their public api and can fetch data and start creating elements for Emby.

I cannot figure how to make the series show in the normal series way - like with files. I have tried foldertype as series and so on. Some series has seasons and others don’t. I’m missing some samples on how others would make it show up in emby with nice background,  metadata and so on.  My main issue is the only way I can get the videos to show up is making folders that are not series and I read old topics which states it is not fully supported (old posts).

Link to comment
Share on other sites

Hi @anv,

channel plugins are always welcome. While your assessment is right in that a series-hierarchy with metadata retrieval is currently not supported, you are still lucky as you are hitting the right point in time 🙂

Just recently I implemented the missing bits for a not-yet-published plugin. I will try to get these updates into the next beta, then I can provide instructions how to set up the channel folders.

softworkz

Link to comment
Share on other sites

@anv Good news, it's done. The upcoming beta will include support for this.

You will have to create the hierarchical structure for Series-Seasons-Episodes manually, but it seems you've already got to that point.

You need to set up the channel items as follows:

Item Ids

A note about channel item ids:

Those ids are strings that are not constrained by length. When working with the Emby channels API, you'll see that it can be difficult at times to determine an item's parent items.
My suggestion is to use a path-like structure for item ids that works in a way that an item's id always contains the items ids of all its parent items, e.g.:

/toplevelfolderid/SeriesItemId/SeasonItemId/EpisodeItemId

 

Series

Create a series item like this:

var item = new ChannelItemInfo
{
    FolderType = ChannelFolderType.Series,
    MediaType = ChannelMediaType.Video,
    Name = SeriesName, // "Baking Bread"
    Id = SeriesPathId, // "/bb123"
    Type = ChannelItemType.Folder,
};

 

Seasons

var item = new ChannelItemInfo
{
    FolderType = ChannelFolderType.Season,
    MediaType = ChannelMediaType.Video,
    Name = SeasonName, // "Season 1"
    IndexNumber = 1, // 1
    Id = SeasonPathId, // "/bb123/bbs456"
    Type = ChannelItemType.Folder,
};

 

Episodes

return new ChannelItemInfo
{
    ContentType = ChannelMediaContentType.Episode,
    Id = EpisodeId, // "/bb123/bbs456/bbe789"
    ImageUrl = origin.ImageUrl,
    MediaType = ChannelMediaType.Video,
    SeriesName = SeriesName, // "Baking Bread"
    Name = EpisodeName, // "Pilot",
    Type = ChannelItemType.Media,
    Overview = Overview, // "All it takes is flour, water and yeast.
    IndexNumber = EpisodeNumber, // 1
    ParentIndexNumber = SeasonNumber, // 1
};

 

Please let me know when you got any questions!

softworkz

  • Agree 1
Link to comment
Share on other sites

@anv No, Emby doesn't care about the IDs, you just need to make sure that these are unique. My suggestion for the ids was rather for making it easier for you to handle it inside your plugin.

The hierarchy is only determined by the way how Emby queries your plugin for channel items:

  • At the top level, Emby queries your plugin for a number of items
  • Next, it queries for the children of each those items which are of type folder
  • And so on, down to a maximum hierarchy depth of 6

The index number determines the order of items inside the parent folder and it is also used by the metadata providers as season number (for season items) and episode number (for episode items).

Edited by softworkz
  • Thanks 1
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...