CarlosLima 148 Posted March 30, 2021 Share Posted March 30, 2021 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 Link to comment Share on other sites More sharing options...
Happy2Play 8296 Posted March 30, 2021 Share Posted March 30, 2021 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. 1 Link to comment Share on other sites More sharing options...
CarlosLima 148 Posted March 30, 2021 Author Share Posted March 30, 2021 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 More sharing options...
Happy2Play 8296 Posted March 31, 2021 Share Posted March 31, 2021 Looks like you would have to edit/rework the cardbuilder.js. Search "cardMediaInfoItem". Link to comment Share on other sites More sharing options...
CarlosLima 148 Posted March 31, 2021 Author Share Posted March 31, 2021 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 More sharing options...
Happy2Play 8296 Posted March 31, 2021 Share Posted March 31, 2021 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 More sharing options...
CarlosLima 148 Posted March 31, 2021 Author Share Posted March 31, 2021 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 More sharing options...
Happy2Play 8296 Posted March 31, 2021 Share Posted March 31, 2021 (edited) 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 + " – " + 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, { Edited April 1, 2021 by Happy2Play Link to comment Share on other sites More sharing options...
CarlosLima 148 Posted March 31, 2021 Author Share Posted March 31, 2021 (edited) 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? Edit: Oops, is this a script and not a CSS code? If so, where should I include these lines? Edited March 31, 2021 by CarlosLima Link to comment Share on other sites More sharing options...
Happy2Play 8296 Posted March 31, 2021 Share Posted March 31, 2021 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? Did you clear your browser cache? Link to comment Share on other sites More sharing options...
CarlosLima 148 Posted March 31, 2021 Author Share Posted March 31, 2021 Yes ! Link to comment Share on other sites More sharing options...
Happy2Play 8296 Posted March 31, 2021 Share Posted March 31, 2021 (edited) 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 March 31, 2021 by Happy2Play Link to comment Share on other sites More sharing options...
CarlosLima 148 Posted March 31, 2021 Author Share Posted March 31, 2021 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. Link to comment Share on other sites More sharing options...
Happy2Play 8296 Posted March 31, 2021 Share Posted March 31, 2021 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. 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 More sharing options...
Luke 37098 Posted March 31, 2021 Share Posted March 31, 2021 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 More sharing options...
CarlosLima 148 Posted March 31, 2021 Author Share Posted March 31, 2021 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. Link to comment Share on other sites More sharing options...
Happy2Play 8296 Posted March 31, 2021 Share Posted March 31, 2021 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. Link to comment Share on other sites More sharing options...
CarlosLima 148 Posted March 31, 2021 Author Share Posted March 31, 2021 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 More sharing options...
Happy2Play 8296 Posted March 31, 2021 Share Posted March 31, 2021 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 More sharing options...
CarlosLima 148 Posted March 31, 2021 Author Share Posted March 31, 2021 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 More sharing options...
Solution Happy2Play 8296 Posted March 31, 2021 Solution Share Posted March 31, 2021 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. 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 More sharing options...
CarlosLima 148 Posted March 31, 2021 Author Share Posted March 31, 2021 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. Link to comment Share on other sites More sharing options...
cochize1 41 Posted April 1, 2021 Share Posted April 1, 2021 @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 More sharing options...
CarlosLima 148 Posted April 1, 2021 Author Share Posted April 1, 2021 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. 1 Link to comment Share on other sites More sharing options...
Happy2Play 8296 Posted April 1, 2021 Share Posted April 1, 2021 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. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now