Jump to content

About OMDB plugin classification - EmbyServer 4.6x


CarlosLima
Go to solution Solved by Happy2Play,

Recommended Posts

CarlosLima

Hi,
The yellow arrows show the classification displayed by the OMDB plugin.
Is it possible to use CSS or HTML code to display this information next to the year and not on an exclusive line?
Thank you very much

download.png

Link to comment
Share on other sites

Happy2Play

If that is OMDB metadata then where is RT?  Unless you are hiding RT.

I will do some digging but spacing could be a issue depending on options enabled.

card.jpg.3c3cd53bd611ae5ffd2cf790840c426b.jpg

  • Thanks 1
Link to comment
Share on other sites

CarlosLima

I do not use RT, just the OMDB classification, which for me is enough and more important to be displayed, so I will never use other data besides the star classification.
Thanks.

Link to comment
Share on other sites

Happy2Play

Looks like you would have to edit/rework the cardbuilder.js.  Search "cardMediaInfoItem".

 

Link to comment
Share on other sites

CarlosLima

Hi, I found it in seven places but I have no idea about editing in order to only have the classification next to the year, because I don't have the knowledge to create the code.

Link to comment
Share on other sites

Happy2Play
Just now, CarlosLima said:

Hi, I found it in seven places but I have no idea about editing in order to only have the classification next to the year, because I don't have the knowledge to create the code.

Those section are built via that script.  I can play around with it but don't really know anything about scripting.  But that is the section you would need to edit as that is where Community rating and Year are created.

Link to comment
Share on other sites

CarlosLima

Understood. Thanks for all your help.
This is not really important and in this case the option isn't to use OMDB.

Link to comment
Share on other sites

Happy2Play
On 3/30/2021 at 5:16 PM, CarlosLima said:

Understood. Thanks for all your help.
This is not really important and in this case the option isn't to use OMDB.

With some trial and error, looks like you would need to do something like this.  Criticrating is disabled with this so the settings option does not do anything.

Commented out first section and added Community rating to next section.  Script layout will look different as I used a notepad++ plugin to make the script look pretty.

Quote

            /*var showCommunityRating = fieldMap.CommunityRating,
            showCriticRating = fieldMap.CriticRating;
            (showCommunityRating || showCriticRating) && (lineParts = [], showCommunityRating && item.CommunityRating && lineParts.push(mediaInfo.getCommunityRating(item, {
                        outerClass: "cardMediaInfoItem"
                    })), showCriticRating && item.CriticRating && lineParts.push(mediaInfo.getCriticRating(item, {
                        outerClass: "cardMediaInfoItem"
                    })), lines.push(lineParts.join("")));*/
            var endYear,
            lineParts,
            deviceHtml,
            showYear = fieldMap.ProductionYear,
            showCommunityRating = fieldMap.CommunityRating,
            showParentalRating = fieldMap.OfficialRating;
            (showYear || showCommunityRating || showParentalRating) && (lineParts = [], showYear && ("Series" === itemType ? "Continuing" === item.Status ? lineParts.push('<div class="cardMediaInfoItem">' + globalize.translate("SeriesYearToPresent", item.ProductionYear || "") + "</div>") : (endYear = item.EndDate ? datetime.parseISO8601Date(item.EndDate).getFullYear() : null) && item.ProductionYear && endYear !== item.ProductionYear ? lineParts.push('<div class="cardMediaInfoItem">' + item.ProductionYear + " &ndash; " + endYear + "</div>") : item.ProductionYear && lineParts.push('<div class="cardMediaInfoItem">' + item.ProductionYear + "</div>") : item.ProductionYear && lineParts.push('<div class="cardMediaInfoItem">' + item.ProductionYear + "</div>")), showCommunityRating && item.CommunityRating && lineParts.push(mediaInfo.getCommunityRating(item, {outerClass: "cardMediaInfoItem"})), showParentalRating && item.OfficialRating && lineParts.push('<div class="cardMediaInfoItem">' + item.OfficialRating + "</div>"), lines.push(lineParts.join(""))),
            options.showRuntime && (item.RunTimeTicks ? lines.push(datetime.getDisplayRunningTime(item.RunTimeTicks)) : lines.push("")),
            options.showAirTime && lines.push(getAirTimeText(item, options.showAirDateTime, options.showAirEndTime) || ""),
            options.showChannelName && (item.ChannelId ? lines.push(getTextActionButton(options, {

edit.jpg.b09aa7f59d00f231e8f69e27fe612a57.jpg

Edited by Happy2Play
Link to comment
Share on other sites

CarlosLima

You are the best. Thank you very much.
It didn't work for me but I imagine it was my mistake.
Should I leave the boxes that way?

download.png

Edit: 

Oops, is this a script and not a CSS code?
If so, where should I include these lines?

Edited by CarlosLima
Link to comment
Share on other sites

Happy2Play
Just now, CarlosLima said:

You are the best. Thank you very much.
It didn't work for me but I imagine it was my mistake.
Should I leave the boxes that way?

download.png

Did you clear your browser cache?

Link to comment
Share on other sites

Happy2Play
5 minutes ago, CarlosLima said:

Edit: 

Oops, is this a script and not a CSS code?
If so, where should I include these lines?

C:\Users\username\AppData\Roaming\Emby-Server\system\dashboard-ui\modules\cardbuilder\cardbuilder.js or the equivalent path on you platform.

Editing the sections I noted in red.

Edited by Happy2Play
Link to comment
Share on other sites

CarlosLima

Sorry for the lack of knowledge, but should I add the script there?
Doing this, the emby seems to break completely, as it does not display anything in the libraries.

Captura de tela 2021-03-30 224525.jpg

Link to comment
Share on other sites

Happy2Play
6 minutes ago, CarlosLima said:

Sorry for the lack of knowledge, but should I add the script there?
Doing this, the emby seems to break completely, as it does not display anything in the libraries.

Captura de tela 2021-03-30 224525.jpg

I only posted the "var showCommunityRating" and " var endYear" sections, you would edit/replace the lines I proved.  But a little harder to do as your script has not been beautified.

Will make it easy make a backup of original. attached modified cardbuilder.js.

But you should install the jstool plugin in notepad++, then click Plugins-JSTool-JSFormat to make it look pretty and readable.  Saving this new structure has no affect on Emby.

 

 

cardbuilder.zip

Link to comment
Share on other sites

I wouldn't try to do this. It will not look fit on mobile devices, and hacking it this way will cause scrolling quirks, because the virtual scroller depends on knowing what the exact height of each item is going to be.

Link to comment
Share on other sites

CarlosLima

Hmn, now that I finally managed to show how I would like to receive this sad information.
On my test server, on pc, the result was excellent and I didn't imagine that my idea would cause any kind of problem in other applications.
I was frustrated and I regret all the time and effort of the friend who made it wrote the script.

 

 

download.png

Link to comment
Share on other sites

Happy2Play

Guess it depends on how much information you want to show as to much gets truncated.

Note that file has criticrating added per selected options.

edit2.jpg.35e0808e62441ccd1ab7c74b49042353.jpg

Link to comment
Share on other sites

CarlosLima

OK I understand. I would only use star rating and nothing else.
Now I didn't know what to do. Help?

Link to comment
Share on other sites

Happy2Play
Just now, CarlosLima said:

OK I understand. I would only use star rating and nothing else.
Now I didn't know what to do. Help?

What do you need help with?

Link to comment
Share on other sites

CarlosLima

In fact I was in doubt if this idea of change as we did will cause a problem commented by @Luke.
In my case, can I use the script, as I will only use the star rating?

Link to comment
Share on other sites

  • Solution
Happy2Play
22 minutes ago, Luke said:

I wouldn't try to do this. It will not look fit on mobile devices, and hacking it this way will cause scrolling quirks, because the virtual scroller depends on knowing what the exact height of each item is going to be.

I would assume I break that by wrapping titles already, but see no ill side effects.

wrap.thumb.jpg.207f70b5e856f49d5ff47761b2035116.jpg

5 minutes ago, CarlosLima said:

In fact I was in doubt if this idea of change as we did will cause a problem commented by @Luke.
In my case, can I use the script, as I will only use the star rating?

Yes, just test it and see if  you have any side effect.  But I haven't see any so far.

Link to comment
Share on other sites

CarlosLima

Yes, tested on pc - no side effect - perfect
Yes, I tested it on a cell phone - no side effect - perfect
I backed up the original file just in case.
I am very grateful for all your time and effort. Thank you very much.

WhatsApp Image 2021-03-30 at 23.44.59.jpeg

Link to comment
Share on other sites

cochize1

@Happy2Play @CarlosLima I am on stable 4.5.4.0, is this only available in 4.6x server as I cannot find a way to add ratings inline with the title and year even though I have OMDB plugin installed? If not, where are those settings?

Link to comment
Share on other sites

CarlosLima
1 hour ago, cochize1 said:

@Happy2Play @CarlosLima I am on stable 4.5.4.0, is this only available in 4.6x server as I cannot find a way to add ratings inline with the title and year even though I have OMDB plugin installed? If not, where are those settings?

Hi, I understand what you said.
I have tested and am using OMDB only on the test server with EmbyServer 4.6x. The official server with 4.5.4.0 I didn't install OMDB and I couldn't test it.
I believe it is that, because a friend installed it on 4.5.4.0 and for him the configuration options are not displayed either.

  • Like 1
Link to comment
Share on other sites

Happy2Play
2 hours ago, cochize1 said:

@Happy2Play @CarlosLima I am on stable 4.5.4.0, is this only available in 4.6x server as I cannot find a way to add ratings inline with the title and year even though I have OMDB plugin installed? If not, where are those settings?

Yes all these changes were done/added in 4.6.  4.5 is different, I would assume it can be done but someone that knows scripting would have to take a looks.

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