Jump to content

Increase number of genre's and fix hanging comma


Recommended Posts

visproduction
Posted (edited)

This code solves hanging commas and increases the number of genres, possible, on a media or collection page..

Of course this update gets wiped out with a large update and would have to be redone.
Perhaps this is of interest for the dev team to fix the hanging comma error.

modules\mediainfo\mediainfo.js
Changes in the code snippit are:

  • - (options.length=23)
  • - {return'<nobr><a class="button-link
  • - .join(",</nobr> ")
{var type,context=options.context,options=(item.GenreItems||[]).slice(0),itemType=item.Type;switch("Playlist"!==itemType&&"BoxSet"!==itemType&&"MusicArtist"!==itemType||5<options.length&&(options.length=23),context){case"games":type="GameGenre";break;case"music":type="MusicGenre";break;default:type="Genre"}return itemType=(itemType=options.map(function(p){return'<nobr><a class="button-link button-link-color-inherit" is="emby-linkbutton" style="font-weight:inherit;" href="'+_approuter.default.getRouteUrl({Name:p.Name,Type:type,ServerId:item.ServerId,Id:p.Id},{context:context})+'">'+_textencoding.default.htmlEncode(p.Name)+"</a>"}).join(",</nobr> "))


The example image has many other CSS style changes.  This tweak increases the number of possible genres listed and fixes the hanging comma problem, where the last comma in a line wraps, on it's own, to the line below.

I happen to have a possible 23 genres, but generally there are a few less, depending on your media content.

Comma tweak and number of genres update.jpg

Edited by visproduction

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