Jump to content

New releases on homescreen


computerprep

Recommended Posts

Oh! I just found it in the code. Holly mackerel!

It is the "GetChannelItemMediaInfo" method, and I believe this is the method that is about to fix all the issues in both channel plugins with regards to media versioning.

 

Link to comment
Share on other sites

10 minutes ago, ebr said:

@chef a mediasource is a version of an item.  Each mediasource will have multiple mediastreams (video, audio, subtitle, etc.)

excellent thank you.

The channel item wants MediaSources.

should I just pass along:

 

  MediaSources = myBaseItem.GetMediaSources(enableAlternateMediaSources: true, enablePathSubstitution: true, LibraryManager.GetLibraryOptions(myBaseItem)

 

🙃

Link to comment
Share on other sites

Oh finally! 

I understand! I got Media Sources working! Well... almost...

wow_mediaSources.png.458d18f608023d5185b9f391ef87d83c.png

 

I think I can fix that duplication issue.

 

I can't believe it. What a freaking relief. 🥴

  • Like 1
Link to comment
Share on other sites

This unfinished version finally fixes the "undefined" version issue.

It will also, make sure that all the different media sources (versions) of the media item in the library are listed.

The only issue right now, is that one of the versions  is listed twice. 

wow_mediaSources.png.458d18f608023d5185b9f391ef87d83c.png

 

I will fix this next.

 

Edited by chef
  • Thanks 1
Link to comment
Share on other sites

Oh bother!

ATV doesn't show the media source selection at all.

So the web app show too many and ATV shows none. 🤷 😆

man oh man.

 

Link to comment
Share on other sites

Happy2Play
2 minutes ago, chef said:

Oh bother!

ATV doesn't show the media source selection at all.

So the web app show too many and ATV shows none. 🤷 😆

man oh man.

 

Not seeing any in my test in web client.  But will test more as channel linked to test file instead of media and has no selector.

  • Like 1
Link to comment
Share on other sites

Happy2Play

Same note here as Emby.Kids

If users do not write nfo files with media this can be problematic if any metadata is changed in library or channel as they are technically two individual database entries.  If users write nfo files both items would use the same nfo file and updating one should update the other on item refresh.

  • Agree 1
Link to comment
Share on other sites

Happy2Play

Not seeing any media info Video/Audio on channel vs library in newest version.

Channel

image.png.083c226005e8b1e7e8753db0584ada78.png

Library

image.thumb.png.2b4f8f3673ecf03af3f1fdb7c8911583.png

See the difference in genres also, but this is a test library database only metadata.

  • Like 2
Link to comment
Share on other sites

37 minutes ago, Happy2Play said:

Not seeing any media info Video/Audio on channel vs library in newest version.

Channel

image.png.083c226005e8b1e7e8753db0584ada78.png

Library

image.thumb.png.2b4f8f3673ecf03af3f1fdb7c8911583.png

See the difference in genres also, but this is a test library database only metadata.

Have you run a library scan after internet channel refresh by chance?

Link to comment
Share on other sites

Happy2Play
1 minute ago, chef said:

Have you run a library scan after internet channel refresh by chance?

Both and removed plugin both scans and reinstalled.

Link to comment
Share on other sites

Junglejim
9 hours ago, Happy2Play said:

Not seeing any media info Video/Audio on channel vs library in newest version.

Yep same here

Channel (Notice blu-ray cover is missing and video/audio/subs info)

Screenshot_2022-09-21_18-38-46.thumb.png.41944da95231aaa072bbad235de7e552.png

Library

Screenshot_2022-09-21_18-39-27.thumb.png.23625ec3be651e47c0e2e2bb2f2b1541.png

EDIT: Also there are a few differences in the "New Releases" meta, like rating/genre/plot/background but I scraped this movie a while ago so if I refreshed the lib movie they would prob match up. ;)

EDIT: I was wrong about the refresh of the lib movie matching the "New Releases" meta. On further investigation it looks like "New Releases" is getting it's meta from TVDB (genre/plot at least) where as the lib movie is using TMDB. So that's why some meta is different, that's all good. :)

EDIT: When I try to play a movie from "New Releases" I get..

"Playback Error No compatible streams are currently available."

I have a intro that plays fine before the "New Releases" movie so I thought it was all good, maybe something to do with the video/audio meta missing? It plays fine from the movie lib. I'm sure it was working before the latest update, I got past the intro and into the movie. 😕

Edited by Junglejim
  • Thanks 1
Link to comment
Share on other sites

5 hours ago, Junglejim said:

Yep same here

Channel (Notice blu-ray cover is missing and video/audio/subs info)

Screenshot_2022-09-21_18-38-46.thumb.png.41944da95231aaa072bbad235de7e552.png

Library

Screenshot_2022-09-21_18-39-27.thumb.png.23625ec3be651e47c0e2e2bb2f2b1541.png

EDIT: Also there are a few differences in the "New Releases" meta, like rating/genre/plot/background but I scraped this movie a while ago so if I refreshed the lib movie they would prob match up. ;)

EDIT: I was wrong about the refresh of the lib movie matching the "New Releases" meta. On further investigation it looks like "New Releases" is getting it's meta from TVDB (genre/plot at least) where as the lib movie is using TMDB. So that's why some meta is different, that's all good. :)

EDIT: When I try to play a movie from "New Releases" I get..

"Playback Error No compatible streams are currently available."

I have a intro that plays fine before the "New Releases" movie so I thought it was all good, maybe something to do with the video/audio meta missing? It plays fine from the movie lib. I'm sure it was working before the latest update, I got past the intro and into the movie. 😕

Interesting,

it is using tvdb? 

I see the compatible streams error too.

One minutes, I think I have a fix here.

 

Link to comment
Share on other sites

  • I've added some logging when the channel is sending back media sources to a client UI.

 

When the item gets created in the channel,  we map all the values from the library item over. 

This also includes mapping the entire media source from original item.

It's a mystery why the item would be using tvdb data.

                    new ChannelItemInfo()
                    {                        
                        DateCreated     = item.DateCreated,
                        Name            = item.Name,
                        Id              = $"new_release_{item.InternalId}".GetMD5().ToString("N"), //Give it a new Id.                         
                        RunTimeTicks    = item.RunTimeTicks,                       
                        ProductionYear  = item.ProductionYear,
                        ImageUrl        = item.PrimaryImagePath, 
                        Type            = ChannelItemType.Media,
                        ContentType     = ChannelMediaContentType.Movie,
                        MediaType       = ChannelMediaType.Video,
                        IsLiveStream    = false,
                        OfficialRating  = item.OfficialRating,
                        Overview        = item.Overview,
                        PremiereDate    = item.PremiereDate,
                        Genres          = item.Genres.ToList(),
                        CommunityRating = item.CommunityRating,
                        OriginalTitle   = item.OriginalTitle,
                        ProviderIds     = item.ProviderIds,
                        Studios         = item.Studios.ToList(),
                        People          = LibraryManager.GetItemPeople(item),
                        MediaSources    = item.GetMediaSources(false, false, LibraryManager.GetLibraryOptions(item))                        
                    });

 

  • Stranger still, the channel Item will show all the media sources (versions) in the webapp, but ATV will only show one.
  • The other thing that would be nice to solve is why in the normal library the Versions are named by parsing the brackets, but the channel doesn't do that.

example:

 Library:

thor_example_1.png.0071158a78b5f077f99be72d83bf463e.png

 

Channel:

thor_example_2.png.f614da5025f315b41af08d6b98c6269b.png

 

Maybe the log it will  tell us why. 

 

  • Fixes no compatible streams problem. :) 

 

I took an "all-nighter" trying different things to learn how channels really work, but I ended up with more question I think LOL!

 

Emby.NewReleases.zip

 

 

 

Edited by chef
  • Like 2
Link to comment
Share on other sites

13 hours ago, chef said:

ATV doesn't show the media source selection at all.

Check settings.  You probably have them turned off.

  • Thanks 1
Link to comment
Share on other sites

16 minutes ago, ebr said:

Check settings.  You probably have them turned off.

Are these server side settings I might need to change?

 

Link to comment
Share on other sites

34 minutes ago, Happy2Play said:

As you already mentioned about duplication.

Channel

image.png.859eb4c24f8ac26d0ca9d4c952006865.png

Library

image.png.0895be45300d22923c7410c8456f1ef1.png

Maybe there is some kind of default, which is the first media source available. Then by adding the media source to the channel item we are somehow duplicating it?

 

Perhaps instead of returning a value, when one media source is present, just exiting the method is what is supposed happen.

 

Do you see the media source options being available in ATV (if you have ATV)?

 

I've tried Eric's suggestions, and looked though the different options/settings but I don't see multi versions available.

There is something else there that we're missing. 

It's only a matter of time before this works, just have to learn a bit more about it.

👍

 

Link to comment
Share on other sites

Happy2Play
8 minutes ago, chef said:

Do you see the media source options being available in ATV (if you have ATV)?

Sorry I don't use any Android devices.

  • Thanks 1
Link to comment
Share on other sites

Junglejim
13 hours ago, chef said:
  • I've added some logging when the channel is sending back media sources to a client UI.

 

When the item gets created in the channel,  we map all the values from the library item over. 

This also includes mapping the entire media source from original item.

It's a mystery why the item would be using tvdb data.

                    new ChannelItemInfo()
                    {                        
                        DateCreated     = item.DateCreated,
                        Name            = item.Name,
                        Id              = $"new_release_{item.InternalId}".GetMD5().ToString("N"), //Give it a new Id.                         
                        RunTimeTicks    = item.RunTimeTicks,                       
                        ProductionYear  = item.ProductionYear,
                        ImageUrl        = item.PrimaryImagePath, 
                        Type            = ChannelItemType.Media,
                        ContentType     = ChannelMediaContentType.Movie,
                        MediaType       = ChannelMediaType.Video,
                        IsLiveStream    = false,
                        OfficialRating  = item.OfficialRating,
                        Overview        = item.Overview,
                        PremiereDate    = item.PremiereDate,
                        Genres          = item.Genres.ToList(),
                        CommunityRating = item.CommunityRating,
                        OriginalTitle   = item.OriginalTitle,
                        ProviderIds     = item.ProviderIds,
                        Studios         = item.Studios.ToList(),
                        People          = LibraryManager.GetItemPeople(item),
                        MediaSources    = item.GetMediaSources(false, false, LibraryManager.GetLibraryOptions(item))                        
                    });

 

  • Stranger still, the channel Item will show all the media sources (versions) in the webapp, but ATV will only show one.
  • The other thing that would be nice to solve is why in the normal library the Versions are named by parsing the brackets, but the channel doesn't do that.

example:

 Library:

thor_example_1.png.0071158a78b5f077f99be72d83bf463e.png

 

Channel:

thor_example_2.png.f614da5025f315b41af08d6b98c6269b.png

 

Maybe the log it will  tell us why. 

 

  • Fixes no compatible streams problem. :) 

 

I took an "all-nighter" trying different things to learn how channels really work, but I ended up with more question I think LOL!

 

Emby.NewReleases.zip 9.46 kB · 4 downloads

 

 

 

Cheers mate, it's working great now. I have the versions menu still as mentioned above even though I don't have any double versions of anything in my library.

As for tvdb I don't have them enabled for my movie lib so not sure what's going on there. It's the only site that has that plot and genre info though for the movie in question (Prey). 😕

I have ATV but as I said above I don't have different versions of anything so I don't see the versions drop down menu usually. I can see the double version on my Samsung tablet that I'm using now but that's the mobile app. I'll double check my ATV later and get back to you. 

EDIT: Just checked my ATV and I don't see any double version menu in "New Releases". As mentioned I've never seen the version menu in ATV but I also can't see any setting for it either. 🤔

Edited by Junglejim
  • Thanks 1
Link to comment
Share on other sites

Junglejim

Just noticed this in "New Releases", I scrolled down to the media info in the web app..

Screenshot_2022-09-22_14-29-42.thumb.png.c0e6e580d228397eefc2d640ed9a7331.png

Two sets of identical media info, obviously the library version only has one.

The only other channel that I have that I can compare this with is "Trailers" which is totally different not being local media like this, it doesn't have any media info like you have added it just scrapes the artwork and general movie info. I suppose "Trailers" could be local but who would do that.. :) I'm not sure if you based this off any other plugin but maybe there could be a double dip of code doing the same thing? I wouldn't stress about it too much, it could be a bug out of your control. It works and that's what counts. I'm sure you'll figure it out. :)

Edited by Junglejim
  • Thanks 1
Link to comment
Share on other sites

Here is something interesting.

I think that each MediaSource has an ID which is the path to the file encoded using  MD5.

This seems to be a popular way (behind the scenes) of creating unique IDs in emby.

If we are passing the same source into the channel,  as one that is already in the library, and they both have the same ID, then is it possible that embys library query is returning both of those sources by IDs?

 

Maybe, we need to alter the media source ID to something unique so emby doesn't see both db entries.

 

Link to comment
Share on other sites

Oh! I have finally done it! 

channel_finally_1.thumb.png.78d0839e7ee49e46218230cbea1c8488.png

 

The method in the IChannel interface named "GetChannelItemMediaInfo"

should be called "GetAdditionalChannelItemMediaInfo😆 

 

If anyone comes across this in the future of IChannel development, this seems to work:

First check to see how many versions are available.

If there is more then one version available, skip the first source (the first source seems to be some kind of default that emby already knows about... somehow...), 

Then send MediaSources index 1 (which is the second item in the zero based index of media sources) to item.MediaSources.Count -1

I dunno... I'm the worst at explaining programming... I just works now... except on ATV. I only see the first media source listed.  But that is fine.

 

Emby.NewReleases.zip

 

 

 

Edited by chef
  • Like 4
Link to comment
Share on other sites

Finally, I think the next thing to do, would be to do the same kind of parsing on the media source name that emby does internally for normal library items.

From what I gather, emby must use a regex parser that first looks for square brackets and a string inside them.

For each media source if the string inside the square brackets are the same between sources it would take the quality/resolution and use that.

For example:

1080p [ theatrical ]

2160p [ theatrical ]

Would resolve to:

1080p

2160p

 

Whereas 

1080p [ Theatrical ]

1080p [ IMAX ]

Would resolve to:

Theatrical

IMAX

 

Maybe it is not worth going that far, but I could be done.

 

 

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...