Jump to content

Plugins for 4.x


DrCornelius

Recommended Posts

DrCornelius
I updated my plugins for personal use, I have a custom made TVHeadend integration that is working fine, but the other one I'm having problems and now I can't debug the code to see what's happening...
 
The plugins' codes are almost the same, before I used to change Emby's source code to have access to the providers and info for the show/movies to be more efficient/fast by using the internal cache, now I get that from a metadata server that I created.
 
Movies are duplicated if I add "query.UserId" to the id and I need it when I call "GetChannelItemMediaInfo(string id, CancellationToken cancellationToken)", is there a way to know the user then? When I go to an episode details it fires up the media info call before pressing play, even though I have "IRequiresMediaInfoCallback".
 
Channel:
public InternalChannelFeatures GetChannelFeatures()
{
	return new InternalChannelFeatures
	{
		ContentTypes = new List<ChannelMediaContentType>
		{
			ChannelMediaContentType.Episode,
			ChannelMediaContentType.Movie
		},

		MediaTypes = new List<ChannelMediaType>
		{
			ChannelMediaType.Video
		},

		SupportsContentDownloading = true
	};
}

Movies list:

var id = $"movies|{imdbId}|{query.UserId}";

Logger.Debug($"Adding {id} - {info.Name}");

items.Add(new ChannelItemInfo
{
	Id = id,
	Name = info.Name,
	Overview = info.Overview,
	Type = ChannelItemType.Media,
	ContentType = ChannelMediaContentType.Movie,
	MediaType = ChannelMediaType.Video,
	ImageUrl = info.ImageUrl,
	Genres = info.Genres,
	People = info.People,
	HomePageUrl = info.HomePageUrl,
	OfficialRating = info.OfficialRating,
	CommunityRating = info.CommunityRating,
	ProductionYear = info.ProductionYear,
	Studios = info.Studios,
	ProviderIds = info.ProviderIds,
	DateCreated = info.PremiereDate,
	RunTimeTicks = info.RunTimeTicks
});

Series list:

var id = $"series|{imdbId}|{seasonNumber}|{episode.Episode}|{query.UserId}";

Logger.Debug($"Adding {id} - {info.Name}");

items.Add(new ChannelItemInfo
{
	Id = id,
	Type = ChannelItemType.Media,
	ContentType = ChannelMediaContentType.Episode,
	MediaType = ChannelMediaType.Video,
	SeriesName = info.SeriesName,
	ParentIndexNumber = seasonNumber,
	IndexNumber = episode.Episode,
	Name = info.Name,
	Overview = info.Overview,
	People = info.People,
	ImageUrl = info.ImageUrl,
	OfficialRating = info.OfficialRating,
	CommunityRating = info.CommunityRating,
	ProviderIds = info.ProviderIds,
	PremiereDate = info.PremiereDate,
	DateCreated = info.PremiereDate,
	RunTimeTicks = info.RunTimeTicks,
});

post-28982-0-94608800-1554281644_thumb.png

post-28982-0-69655400-1554281727_thumb.png

Edited by DrCornelius
Link to comment
Share on other sites

Hi, no, channel requests are no longer user-specific. The per-user filtering comes after the media has been imported.

Link to comment
Share on other sites

DrCornelius
OK, I can change that, but I need the user's id when an item is played, right now I only get the id of the item... Is there a way to know the current user?

 

When will you guys update the WIKI for plugins? I wish I could figure things out by myself, like I used to do before, now I have gatekeepers...

Edited by DrCornelius
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...