Jump to content

Automated Tagging


Steve86

Recommended Posts

bakes82
3 minutes ago, roaku said:

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:

 

Does your plugin search/filter on the user's library like this?

My plugin takes a trakt list, if you have the movie on the list it addes it to the channel, if you dont have it, its still on the trakt list, and if you added in 4 days the next run it adds it.  Why should it matter if I have the item in emby or not?  Trakt is my master.

I dont fully understand the tagging of 4k per say other than they want to use it in the smart plugin I think, though they said you could block via tags?  But dont most people have 4k in their own 4k path?  Im more oriented to plex so 4k movies are in movies/4k/<moviename> and 1080p are in /mvoies/1080p/<movie>

Link to comment
Share on other sites

bakes82

This is why Im saying automatic tagging should just be some toggle options:

4k

hdr

dolby vision

century

decade

year

network (fox, wb, etc)

 

Then if you want "custom" prob easier to feed a list of IMDB and have those tagged with your custom tag

 

 

Link to comment
Share on other sites

1 minute ago, bakes82 said:

My plugin takes a trakt list, if you have the movie on the list it addes it to the channel, if you dont have it, its still on the trakt list, and if you added in 4 days the next run it adds it.  Why should it matter if I have the item in emby or not?  Trakt is my master.

Right, that's what it looked like to me, which is fine for your plugin...

...but this is about the thread starter's feature request...which doesn't involve trakt and does involve their library and specific properties about the media in it.

 

Quote

I dont fully understand the tagging of 4k per say other than they want to use it in the smart plugin I think, though they said you could block via tags?  But dont most people have 4k in their own 4k path?  Im more oriented to plex so 4k movies are in movies/4k/<moviename> and 1080p are in /mvoies/1080p/<movie>

The thread starter would like Emby to be able to automatically add user definable tags to items in their library that match certain criteria, one of which is the resolution of the video. Would you like to help him be able to do that?

Link to comment
Share on other sites

bakes82

Why do you need the resolution as a tag?  Whats the actual use case you know.  Just because you can add tags doesnt mean you should, for all we know adding 20 tags to an item will cause performance issues, when the user just wants to be able to make a collection of "Bond" movies or something.  So really why do you need the resolution when its already in the media info, why it need to be a tag, whats trying to be done.

 

Link to comment
Share on other sites

5 minutes ago, bakes82 said:

This is why Im saying automatic tagging should just be some toggle options:

4k

hdr

dolby vision

century

decade

year

network (fox, wb, etc)

 

Then if you want "custom" prob easier to feed a list of IMDB and have those tagged with your custom tag

 

 

Yeah, I agreed that the front end shouldn't be displaying results and that the actual logic of retrieving those movies and adding the tags should happen asynchronously on the back end.

...but the plugin still has to have the logic to match the library items to the criteria, which is what chef was asking for advice on.

 

I then responded to your declaration that your trakt plugin was 'the exact same thing' as what was being requested by asking if it did what was being requested. You said no, it's a completely different thing and the new pluign should just do that instead.

I'm still trying to help with the original feature request.

Link to comment
Share on other sites

1 minute ago, bakes82 said:

Why do you need the resolution as a tag?  Whats the actual use case you know.  Just because you can add tags doesnt mean you should, for all we know adding 20 tags to an item will cause performance issues, when the user just wants to be able to make a collection of "Bond" movies or something.  So really why do you need the resolution when its already in the media info, why it need to be a tag, whats trying to be done.

 

The request is for 'rule based tagging' and it's not mine.

I feel like you should start a new thread if your goal is to stop the feature from being developed. This one's about developing it.

Link to comment
Share on other sites

bakes82
1 minute ago, roaku said:

The request is for 'rule based tagging' and it's not mine.

I feel like you should start a new thread if your goal is to stop the feature from being developed. This one's about developing it.

Whos stopping it lol, im trying to figure out wtf you guys need and for what.  If you arent the person then maybe dont reply when thats what we looking for.  Adding a rules engine isnt "simple".  Its why Im offering alternatives for a faster turn around.

 

Link to comment
Share on other sites

2 minutes ago, bakes82 said:

Whos stopping it lol, im trying to figure out wtf you guys need and for what.  If you arent the person then maybe dont reply when thats what we looking for.  Adding a rules engine isnt "simple".  Its why Im offering alternatives for a faster turn around.

 

It's all in the first post. I'd suggest starting there.

Link to comment
Share on other sites

It's so tags can be used to limit accessibility.  For instance, we build the table with all items which are 4k, then put a tag on them (in bulk). This allows us to stop users from accessing 4k content, by stopping access to anything with that tag on it.

 

Under: Users > Parental Controls:tageditor8.png.cd28ef203cddad0f98c20ae137fcb65a.png

 

It's a good idea. We'll just bulk edit item tags. 

 

Edited by chef
Link to comment
Share on other sites

Ya, the catch with just a bulk tag editor is that the user has to remember to come back and repeat the process each time they add media.

If it includes a rule system with a task that can be auto triggered on a schedule and on new media, they can set it and forget it.

Both bulk tag editing *and* auto tagging seem like desirable Emby features. :)

  • Like 1
Link to comment
Share on other sites

14 minutes ago, roaku said:

Ya, the catch with just a bulk tag editor is that the user has to remember to come back and repeat the process each time they add media.

If it includes a rule system with a task that can be auto triggered on a schedule and on new media, they can set it and forget it.

Both bulk tag editing *and* auto tagging seem like desirable Emby features. :)

Okay, that might actually be easier to write. The editor will create rules.

 

Okay, I can do that.

  • Like 1
Link to comment
Share on other sites

PenkethBoy
2 hours ago, chef said:

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.

 

 

@chef

yes - when you add mediastreams into an emby request it does slow things down as the data (stream info) is returned twice for each record (or at least via the http api) - i did the same by splitting it up into chunks - or just wait - depending on need use case.

20 might be on the low side - i was getting a second or so for 100 records but it depends if the server is a donkey or not - so 20 might cover those servers - and remote servers could be a problem also. - Possible to make user configurable for beefier servers?

as for hdr - its not one of emby's filters - i.e check the filter button on a movie library home page for a list - remember its dynamic so some won't show if you don't have the data in emby - e,g, i remove all the studios - so they don't appear in the filters etc etc

Just in the middle of a server upgrade so dont have access to my code to check easily

 

An idea - if you give users a small set (initially) of parameters they can select - use that as a query - then they can add tags etc to that sub set

essentially you are now finding out why Luke has not added this before - its a huge rabbit hole - especially from the ui perspective. :)

  • Like 1
Link to comment
Share on other sites

After some careful consideration. I think simpler is better.

@PenkethBoy is correct, there is a rabbit hole here, we want to avoid falling into.

To start, it would seem that in order to properly automate the tagging of baseItems, @roaku is correct it needs to be a scheduled task.

The plugin configuration must be kept very simple.

Here we look at the TagService in the API, and add all the options available to selection boxes.

From there we create rules to tag items that exist in the libraries (also as they are added to the libraries) based on these conditions.

tageditor9.thumb.png.7a34486f1e25ddcb61a144f50db10c96.png

 

Next, the scheduled task will move through the library items, and if the items adheres to the tagging rule, they will be tagged appropriately, and automatically.

TODO:

  • In the dialog, create a text box to list tags in.
  • Create a way to remove saved Tags and conditions.

 

 

This seems easiest. 

 

Does anyone know where a list of possible MediaInfo display types are stored in the API? For instance, "4K", "1080p".

I can find "HVEC","H264", etc. but I would love to know where display value types are stored, so I don't have to create a custom list..

Edited by chef
  • Like 2
Link to comment
Share on other sites

bakes82
3 hours ago, chef said:

Does anyone know where a list of possible MediaInfo display types are stored in the API? For instance, "4K", "1080p".

I can find "HVEC","H264", etc. but I would love to know where display value types are stored, so I don't have to create a custom list..

There is no flag, its based by resolution, and HVEC etc I only found in the "title" if I recall.

This is what I use.

var is4K = mediaSourceItem.VideoStream.Height <= 2160 &&
mediaSourceItem.VideoStream.Width <= 4096 &&
mediaSourceItem.VideoStream.Height > 1080 &&
mediaSourceItem.VideoStream.Width > 1920;
 
if (!is4K) is4K = mediaSourceItem.VideoStream.DisplayTitle.ToLower().Contains("4k");
  • Like 1
Link to comment
Share on other sites

1 minute ago, bakes82 said:

There is no flag, its based by resolution, and HVEC etc I only found in the "title" if I recall.

This is what I use.

var is4K = mediaSourceItem.VideoStream.Height <= 2160 &&
mediaSourceItem.VideoStream.Width <= 4096 &&
mediaSourceItem.VideoStream.Height > 1080 &&
mediaSourceItem.VideoStream.Width > 1920;
 
if (!is4K) is4K = mediaSourceItem.VideoStream.DisplayTitle.ToLower().Contains("4k");

You are a master coder sir! 

Link to comment
Share on other sites

bakes82
1 minute ago, chef said:

You are a master coder sir! 

Well I still don't fully understand the use of the plugin per say but whatever.  It could of been fully accomplished already by storing the 4k files in a /4k folder and a separate 4k library, then just use the auto merge plugin, dont allow access to the 4k library ;)  no extra code required

Link to comment
Share on other sites

bakes82
1 minute ago, bakes82 said:

Well I still don't fully understand the use of the plugin per say but whatever.  It could of been fully accomplished already by storing the 4k files in a /4k folder and a separate 4k library, then just use the auto merge plugin, dont allow access to the 4k library ;)  no extra code required

This might help:

https://github.com/bakes82/TraktLists/blob/86729d8f86e3478fe47ca46dab79e4c975d4cd49/TraktLists/Extensions.cs

Link to comment
Share on other sites

seanbuff
5 minutes ago, bakes82 said:

Well I still don't fully understand the use of the plugin per say but whatever.

Then use the example that I provided earlier, there are many other use cases for bulk tagging in general - not just 4K tags

  • Like 2
Link to comment
Share on other sites

bakes82
2 minutes ago, seanbuff said:

Then use the example that I provided earlier, there are many other use cases for bulk tagging in general - not just 4K tags

Im not making the plugin @chef is.  He can deal with suppornt and making a rule engine.  Im just providing assistance since he was asked for a second pair of eyes and I did the same for another plugin hes working on.  Just because someone asks for something doesnt mean its a good idea.  Where else are tags "natively" used in emby?  I  use plex mainly.  Im not sure why I would want to go adding "tags" when I could just make a collection from a list of IMDBs or whatever if thats a use case, this way infuse, plex, or any other system can use the same source, keeping things in Emby is kinda "meh" especially when you want to use other systems.

Link to comment
Share on other sites

rbjtech

Tag's are globally searchable - making them important for identifying specific items.  An example would be 'Dolby Vision' titles.  There is currently no way to sort by this, so short of having a 'Dolby Vision' library/ manual collection, there is no way to do this.  As has been explained earlier - Tag's are also extremely useful for preventing watching as 'exceptions'.  ie you tag it as 'Too Violent' (or whatever you want, despite also being able to restrict by rating..) and these will be filtered out of that users playlist.   

They can be extremely powerful (if allowed to bulk edit..) - but they shouldn't replace core functionality such as better filters or more detailed media attributes such as DV, Atmos etc which in my example they do as emby has not (yet) provided these fields so Tags can be used as a workaround ...

 

Edited by rbjtech
  • Like 1
Link to comment
Share on other sites

tmb4016

Hi, Whilst this has not been mentioned in the original request or subsequent discussion ... it would be useful if this could be extended to Music. I have several tags which are applied in Picard that do not map to an existing Emby field. It would be good if I could use this auto-tagging plugin to convert these to Emby Tags. This would give me the ability to group by these tags. A scheduled task would be great to keep things up to date with my picard data.

 

Edited by tmb4016
Correction
Link to comment
Share on other sites

7 minutes ago, tmb4016 said:

Hi, Whilst this has not been mentioned in the original request or subsequent discussion ... it would be useful if this could be extended to Music. I have several tags which are applied in Picard that do not map to an existing Emby field. It would be good if I could use this auto-tagging plugin to convert these to Emby Tags. This would give me the ability to group by these tags. A scheduled task would be great to keep things up to date with my picard data.

 

Yep, it should be able to handle music. 

 

Link to comment
Share on other sites

rbjtech
7 minutes ago, tmb4016 said:

Hi, Whilst this has not been mentioned in the original request or subsequent discussion ... it would be useful if this could be extended to Music. I have several tags which are applied in Picard that do not map to an existing Emby field. It would be good if I could use this auto-tagging plugin to convert these to Emby Tags. This would give me the ability to group by these tags. A scheduled task would be great to keep things up to date with my picard data.

 

While Tag's could be used as a workaround - we need to be cautious of using them to replace what essentially is either a bug or a feature request.  imo, if 'standard' fields are missing in the ID3v2 (or whatever the metadata is) then it is a bug - if it's just 'Picard' adding these tags - then we need a 'Picard Plug-In' ... ;)

Link to comment
Share on other sites

tmb4016

Hi,

Yes you are correct - this would be nice as a feature request to display additional fields in the EMBY UI - (and actually is I believe - it is certainly being discussed in the General section currently.) however this will take time and there is the balance between the real-estate to display this information especially when these tags may only be used as a way of grouping/ filtering data. 

IMHO there will always be use for a tool to transfer a media tag to an emby tag for odd tags whose use case is particular to a user for organising. Currently Picard is much easier to bulk tag data then Emby so a plugin tool to transfer those tags to Emby tags would be very helpful.

 

  • Like 1
Link to comment
Share on other sites

@tmb4016 here we go :)

From what I can tell, the codec lists seem to update internally  as media is added. The  more codecs in the library the bigger the list. That's a nifty thing Emby does.

tageditor10.thumb.png.9244973cf08d0e73ce82a492667c4f10.png

Edited by chef
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...