xanthos84 1 Posted January 5, 2018 Share Posted January 5, 2018 Hi, I searched but did not find anything related, as I am using Emby as a music collection player and I want to customize the search result list fields by adding some more meta tags from mp3 files: like genre, album name etc. Can someone hint me how to achieve this? I have some basic programming knowledge so editing should be no problem for me, just need a little starting helping hand. Thanks! Link to comment Share on other sites More sharing options...
Luke 37253 Posted January 5, 2018 Share Posted January 5, 2018 With the search api you can't customize the fields right now but in the coming months we're going to overhaul search. Thanks. Link to comment Share on other sites More sharing options...
xanthos84 1 Posted January 9, 2018 Author Share Posted January 9, 2018 I dont want to have a fancy menu where I can customize. I want to develop and code this stuff into, like for example on the player - showing the Album + Genre names: But its unreliable.. sometimes it shows the tags, sometimes not... I am not a real coder, so its hard for me to scan all the thousand files to know whats going on, so I thought to find some help here. Hope someone can enlighten me. Thanks! Link to comment Share on other sites More sharing options...
Luke 37253 Posted January 9, 2018 Share Posted January 9, 2018 Well now you're talking about two different things because this topic is about search but the image you're showing is from now playing info on the session object. You're going to have to provide a little more detail. thanks. Link to comment Share on other sites More sharing options...
xanthos84 1 Posted January 9, 2018 Author Share Posted January 9, 2018 Yes two things, but both are to be coded! So 1. Player - add Genre & Album tags from ID3/mp3 to the first row of playing information 2. Search Results / LISTs - also add Genre & Album tags to the result list view My guess is, if I achieve number 1, its easier to achieve number 2 because I maybe already know how I get the information in JS. And as said, 1 is 50% finished - it justs not working every time.. very often it tells me "undefined" instead of the ID3 tag. Link to comment Share on other sites More sharing options...
xanthos84 1 Posted January 9, 2018 Author Share Posted January 9, 2018 (edited) another hint I found was this in mediasession.js .. I guess I have to add the genre there.. but as already told I am not a real coder, so its really hard for me to get here results, and thats why I am searching help here on the forums... and at the moment my player looks like this: Edited January 9, 2018 by xanthos84 Link to comment Share on other sites More sharing options...
xanthos84 1 Posted January 12, 2018 Author Share Posted January 12, 2018 is this really so hard to implement? my final question is how I can get the genre of the currently playing song and show/insert it beside the title/interpret... Link to comment Share on other sites More sharing options...
xanthos84 1 Posted January 12, 2018 Author Share Posted January 12, 2018 ok I got so far that I can print the genre in console.log, but when I try to show them in a text on the website it shows only the promise object [object Promise] see this screenshot: maybe someone can give me a hint how i can print a promise object variable... Link to comment Share on other sites More sharing options...
xanthos84 1 Posted January 12, 2018 Author Share Posted January 12, 2018 finally got a result how to get it working. so in the rare case someone else wants album + genre from current song in his playbar like this: then change /opt/emby-server/system/dashboard-ui/bower_components/emby-webcomponents/playback/nowplayinghelper.js to this: define(["connectionManager"], function(connectionManager) { "use strict"; function getNowPlayingNames(nowPlayingItem, includeNonNameInfo) { var apiClient = connectionManager.getApiClient(nowPlayingItem.ServerId); var iteminfos = apiClient.getItem(apiClient.getCurrentUserId(), nowPlayingItem.Id); iteminfos.then(function(result) { document.getElementById('currentsonggenre').innerHTML = result.Genres; }); var topItem = nowPlayingItem, bottomItem = null, topText = nowPlayingItem.Name + " | " + nowPlayingItem.Album + " | <div id=\"currentsonggenre\" style=\"display:inline;\"></div>"; nowPlayingItem.AlbumId && "Audio" === nowPlayingItem.MediaType && (topItem = { Id: nowPlayingItem.AlbumId, Name: nowPlayingItem.Album, Type: "MusicAlbum", IsFolder: !0 }), "Video" === nowPlayingItem.MediaType && (null != nowPlayingItem.IndexNumber && (topText = nowPlayingItem.IndexNumber + " - " + topText), null != nowPlayingItem.ParentIndexNumber && (topText = nowPlayingItem.ParentIndexNumber + "." + topText)); var bottomText = ""; nowPlayingItem.ArtistItems && nowPlayingItem.ArtistItems.length ? (bottomItem = { Id: nowPlayingItem.ArtistItems[0].Id, Name: nowPlayingItem.ArtistItems[0].Name, Type: "MusicArtist", IsFolder: !0 }, bottomText = nowPlayingItem.ArtistItems.map(function(a) { return a.Name }).join(", ")) : nowPlayingItem.Artists && nowPlayingItem.Artists.length ? bottomText = nowPlayingItem.Artists.join(", ") : nowPlayingItem.SeriesName || nowPlayingItem.Album ? (bottomText = topText, topText = nowPlayingItem.SeriesName || nowPlayingItem.Album, bottomItem = topItem, topItem = nowPlayingItem.SeriesId ? { Id: nowPlayingItem.SeriesId, Name: nowPlayingItem.SeriesName, Type: "Series", IsFolder: !0 } : null) : nowPlayingItem.ProductionYear && includeNonNameInfo !== !1 && (bottomText = nowPlayingItem.ProductionYear); var list = []; return list.push({ text: topText, item: topItem }), bottomText && list.push({ text: bottomText, item: bottomItem }), list } return { getNowPlayingNames: getNowPlayingNames } }); Link to comment Share on other sites More sharing options...
Luke 37253 Posted January 12, 2018 Share Posted January 12, 2018 Great stuff, thanks ! 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