PenkethBoy 2063 Posted January 16, 2021 Share Posted January 16, 2021 (edited) @chef- i had a few thoughts a while back re a metadata editor plugin - at the time my thoughts on the interface were that it would need something very similar to the smartplaylist plugin - i.e. something users can pick criteria from and then apply might also be worth a look at the virtualtv plugin as that has some similarities etc for just Tags on thir own might be overkill but its a rabbithole - for whats on the face of it simple to "do" Edited January 16, 2021 by PenkethBoy 1 Link to comment Share on other sites More sharing options...
chef 3745 Posted January 16, 2021 Share Posted January 16, 2021 (edited) 2 minutes ago, PenkethBoy said: @chef- i had a few thoughts a while back re a metadata editor plugin - at the time my thoughts on the interface were that it would need something very similar to the smartplaylist plugin - i.e. something users can pick criteria from and then apply might also be worth a look at the virtualtv plugin as that has some similarities etc for just Tags on thir own might be overkill but its a rabbithole - for whats on the face of it simple to "do" Will do. Checking that now. Who wrote the smartplaylist? I can't remember. Someone who has been around a long time. Edited January 16, 2021 by chef Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted January 16, 2021 Share Posted January 16, 2021 there is a github https://github.com/ppankiewicz/Emby.SmartPlaylist.Plugin/tree/v1.3.0.0 Link to comment Share on other sites More sharing options...
seanbuff 840 Posted January 17, 2021 Share Posted January 17, 2021 9 hours ago, rbjtech said: Hi @chef - Just trying to understand the logic here so forgive me if I'm misunderstanding. If I needed to set tag's on more than one item - it's likely those items are all related in some way - maybe genre, maybe resolution, maybe rating etc. I don't *think* it would be done by Movie Name ? Correct, love the work that you are doing here @chef and am standing by with excitement. I also agree with @rbjtech in that for my use case examples, drop down box of 'Movie Name' would probably not be the best method to apply bulk tags. An example I can think of is to tag all my 80's movies. I would be looking for a way to filter out all movies with a production/release year between 1980 - 1989 and then be able to tag them with the same tag "1980s" or similar. Again, as others have mentioned - maybe the method used by Smart Playlists with various conditions should form the basis for this tool. Great work so far, I have been waiting far too long for this functionality to make it into Emby core. 1 Link to comment Share on other sites More sharing options...
chef 3745 Posted January 17, 2021 Share Posted January 17, 2021 (edited) Okay. New layout. There is a select box with collection types. If you choose movies, for example, then a table is created with movies, and most of the data pertaining to the baseItem, and media info. Note: feel free to create a list of data points which should populate the table rows. Each table item has a check box, which can be selected for bulk tag editing. And a button which writes the tags to the items. There is a lot of code there already, so if we can get to this point and have it working, we can start adding extra abilities to the plugin (whatever they maybe). Edited January 17, 2021 by chef 3 Link to comment Share on other sites More sharing options...
rbjtech 4255 Posted January 17, 2021 Share Posted January 17, 2021 Fantastic ! Let us know when you need testers or to bounce ideas about, I have a test emby instance waiting here to try early alpha's on if that helps. Link to comment Share on other sites More sharing options...
chef 3745 Posted January 17, 2021 Share Posted January 17, 2021 She's not as pretty close up, as she seems from far away.. but it's getting there Each of those table column names will be available as tags, and there will also be a button to create a custom tag. TODO: 1. Add the checkbox for item selection. 2. Table sorting select box. You'll be able to sort the table data by each of the column headers. That way you will be able to group all your media for easy selection. 3. Loading the table by Sort Name takes a really long time for large collections. I need some suggestions. If we use an alpha-picker, it gets a bit tricky to keep track of selected items... not impossible If we split up the collection with table pagination, it is also tricky to keep track of previously selected items... but again not impossible. I personally vote for pagination. Link to comment Share on other sites More sharing options...
chef 3745 Posted January 18, 2021 Share Posted January 18, 2021 Working pagination! TODO: Field, and filter request ordering and sorting (Rating, Year, Container, Video Codec, Video Display, Video Range (HDR/SDR), Audio Codec) Select All option at the top of the table Tag editor dialog 1 Link to comment Share on other sites More sharing options...
seanbuff 840 Posted January 18, 2021 Share Posted January 18, 2021 Looking good, could you please add things like Genre and Parental Rating if possible ? TIA 1 Link to comment Share on other sites More sharing options...
chef 3745 Posted January 18, 2021 Share Posted January 18, 2021 31 minutes ago, seanbuff said: Looking good, could you please add things like Genre and Parental Rating if possible ? TIA Yes! I think I can add genre to the request. To start we'll have to keep it simple and perhaps only request items using only one genre type... At least until I can organize and display the data properly. I will put it on the todo list. Parental rating is in the fourth column 1 Link to comment Share on other sites More sharing options...
seanbuff 840 Posted January 18, 2021 Share Posted January 18, 2021 3 minutes ago, chef said: Parental rating is in the fourth column Ah yes, i missed that. Cheers! Link to comment Share on other sites More sharing options...
chef 3745 Posted January 18, 2021 Share Posted January 18, 2021 (edited) @PenkethBoy hi! Say I wanted to return data from the API which was only specific to video range, in the Media streams object. I have successfully organized data based on official ratings (that seems flushed out in the swagger), but I'm unable to grasp filtering media info data... LOL I should know this, but don't LOL. It seems like, maybe, media info requests needs to have a custom IService endpoint created on the back end? @Luke maybe could chime in too? Edited January 18, 2021 by chef Link to comment Share on other sites More sharing options...
PenkethBoy 2063 Posted January 18, 2021 Share Posted January 18, 2021 not 100% sure i understand but if you are returning the full media info for an item - within the json you can access all the data items relevant to the video or audio streams it contains when i do this i can filter the objects fine by criteria - but you have to know that the streams are in a sub object a level or two below the normal data items - i.e. the info is nested Link to comment Share on other sites More sharing options...
bakes82 90 Posted January 18, 2021 Share Posted January 18, 2021 21 minutes ago, chef said: @PenkethBoy hi! Say I wanted to return data from the API which was only specific to video range, in the Media streams object. I have successfully organized data based on official ratings (that seems flushed out in the swagger), but I'm unable to grasp filtering media info data... LOL I should know this, but don't LOL. It seems like, maybe, media info requests needs to have a custom IService endpoint created on the back end? @Luke maybe could chime in too? Wheres the code? Id assume you would want to pull all the data 1x, then work with it all local rather than calling out to the api multiple times. Also you might want to to look at DevExpress for filtering/grid stuff, they also have a "filter builder" widget. https://js.devexpress.com/Overview/DataGrid/ @PenkethBoy Dont you pull from the restapi? Chef is using the SDK from the plugin dev and the data objects returned dont always match, its kind of a PITA, methods in the SDK dont exists in the REST or vice versa. Link to comment Share on other sites More sharing options...
chef 3745 Posted January 18, 2021 Share Posted January 18, 2021 Just now, PenkethBoy said: not 100% sure i understand but if you are returning the full media info for an item - within the json you can access all the data items relevant to the video or audio streams it contains when i do this i can filter the objects fine by criteria - but you have to know that the streams are in a sub object a level or two below the normal data items - i.e. the info is nested Yes the nested info. I think that's what I'm not quite understanding My problem is, because of large libraries, making a request for all the data at once (with many 'Fields') causes a really long load time for results. In order to combat this, I added pagination for result data. Keeping track of 20 items at a time; I use the "StartIndex" and "Limit" parameters to grab 20 items, incrementing the start index with each request. Because all the data is being requested in chunks, the API request has to be specific. Example this will grab 20 movies, in alphabetical order, from a 'startIndex' with a specific rating: function getItemsByRating(startIndex, type, rating) { return new Promise((resolve, reject) => { ApiClient.getJSON(ApiClient.getUrl('Items?Fields=MediaStreams%2CProductionYear%2COfficialRating&ExcludeLocationTypes=Virtual&Recursive=true&IncludeItemTypes=' + type + '&SortBy=SortName&OfficialRatings=' + rating + '&StartIndex=' + startIndex + '&Limit=20')).then(result => { resolve(result); }); }); } What would the URL look like to only grab "HDR" movies? Requesting and filtering by the nested MediaStreams data. Link to comment Share on other sites More sharing options...
chef 3745 Posted January 18, 2021 Share Posted January 18, 2021 Just now, bakes82 said: Wheres the code? Id assume you would want to pull all the data 1x, then work with it all local rather than calling out to the api multiple times. Also you might want to to look at DevExpress for filtering/grid stuff, they also have a "filter builder" widget. https://js.devexpress.com/Overview/DataGrid/ @PenkethBoy Dont you pull from the restapi? Chef is using the SDK from the plugin dev and the data objects returned dont always match, its kind of a PITA, methods in the SDK dont exists in the REST or vice versa. This time it is actually using the REST. I can post the project so far on git. One second. Link to comment Share on other sites More sharing options...
bakes82 90 Posted January 18, 2021 Share Posted January 18, 2021 1 minute ago, chef said: This time it is actually using the REST. I can post the project so far on git. One second. Why not make your own endpoint to get all the data using the plugin api then just call that one. 1 Link to comment Share on other sites More sharing options...
chef 3745 Posted January 18, 2021 Share Posted January 18, 2021 2 minutes ago, bakes82 said: Why not make your own endpoint to get all the data using the plugin api then just call that one. I'm thinking that is what needs to happen for most of the media info request stuff. Link to comment Share on other sites More sharing options...
roaku 795 Posted January 18, 2021 Share Posted January 18, 2021 I don't know how to *search* for the detailed media info, but I know you can get it by item id it through the API from this endpoint: /Items/{itemid}/PlaybackInfo And if you're in a plugin handling items directly, you can call: item.GetMediaSources(true, false, _libraryManager.GetLibraryOptions(item)); ...to get the same info. These give you the media info for each version in a multi-version item, also. 1 Link to comment Share on other sites More sharing options...
bakes82 90 Posted January 18, 2021 Share Posted January 18, 2021 If this is suppose to be "automatic" should this all be done via a plugin anways with limited UI options. IE: a new file is read in, based on some criteria you would create some tags, its now sounds like you are combining tags with collection building... Link to comment Share on other sites More sharing options...
bakes82 90 Posted January 18, 2021 Share Posted January 18, 2021 1 minute ago, roaku said: I don't know how to *search* for the detailed media info, but I know you can get it by item id it through the API from this endpoint: /Items/{itemid}/PlaybackInfo And if you're in a plugin handling items directly, you can call: item.GetMediaSources(true, false, _libraryManager.GetLibraryOptions(item)); ...to get the same info. These give you the media info for each version in a multi-version item, also. Now imagine running that on 20k movies and like 200k episodes Link to comment Share on other sites More sharing options...
roaku 795 Posted January 18, 2021 Share Posted January 18, 2021 Yeah, it feels like the user should be creating rules associated with tags and moving on with their life. Those rules should then get applied some time in the future, with a task that can be run and/or on new item entry. Link to comment Share on other sites More sharing options...
roaku 795 Posted January 18, 2021 Share Posted January 18, 2021 (edited) 7 minutes ago, bakes82 said: Now imagine running that on 20k movies and like 200k episodes Like I said, I don't know how to *search* against these criteria do deliver th. Do you? And like I said, I think it makes more sense to just build rules through the UI and let tasks and other backend techniques handle the actual item retrieval and tagging and GetMediaSources will be helpful in that case. Edited January 18, 2021 by roaku Link to comment Share on other sites More sharing options...
bakes82 90 Posted January 18, 2021 Share Posted January 18, 2021 (edited) To me it sounds like this plugin is the exact same thing as my Trakt List to "channel" code. You make a list in trakt with your movies, feed it in to the plugin and it makes a collection for you, would be a very minor change. Plus there are UIs that do the trakt list for you, let me find that. Going this route is way easier because then you just need to pull the IMDB from the trakt lists find it in Emby, tag it with the associated tag. This is one of them, I know there is another. https://listrr.pro https://trakt.tv/users/evilhidden/lists/60s?sort=rank,asc List created and maintained by https://listrr.pro Normal Filters: Content Type: Filters Countries: gb, us Languages: en Min rating: 0 Max rating: 100 Min votes: 0 Min runtime: 30 Max runtime: 300 Min year: 1960 Max year: 1969 Edited January 18, 2021 by bakes82 1 Link to comment Share on other sites More sharing options...
roaku 795 Posted January 18, 2021 Share Posted January 18, 2021 That plugin looks like it's geared toward filtering based on general metadata about a movie, not specific properties of a user's file(s) containing that movie? This was an example from the initial request: Quote As an example i'd like to add a 4K tag to every movie which has this resolution. Does your plugin search/filter on the user's library like this? 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