Kodi Community Forum
Beta Metadata Editor - Update library + .nfo informations - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Add-on Support (https://forum.kodi.tv/forumdisplay.php?fid=27)
+---- Forum: Program Add-ons (https://forum.kodi.tv/forumdisplay.php?fid=151)
+---- Thread: Beta Metadata Editor - Update library + .nfo informations (/showthread.php?tid=349035)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14


RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-13

@Karellen

Thanks.
Quote:A general comment. For my use case I don't want my NFO files updated. I run a somewhat regular Export every fortnight, so I will ensure the setting to write to nfo files is always disabled. Does this affect any function of the add-on?

Nope. It's safe to skip nfo updating. Except for the <episodeguide> part. That is written bei the nfo, because JSON returns no information what is set as default, while the .nfo has the information.
Quote:Music...
1. Editing the Description seems problematic for me. When there is a long description, I don't know where the cursor is when i start typing. Nothing of what I type is seen onscreen and there is no way to navigate that single description line. Can you turn that single line box into a larger box that can be navigated so users can scroll to points in the description to add or remove text?

I know, but it's a limitation of the skinning engine. The edit control cannot be a multiline.
Quote:2. I think what you have available for editing in Music is much safer now and I defer to daveblake's comments. The only other items I think is safe and should be included is "Disambiguation" in Artists which allows users to add an identifying comment for artists with the same name and "Gender" . Albums and Songs I see no user problems.

I have no "Disambiguation" field in JSON, but "description". I guess it's the same? ( @DaveBlake )
Quote:Movies...
1. Ratings- If I only have IMDB and TheMovieDB ratings available, should the addon add the metacritic and rottentomatoes ratings as they are not added. I vaguely recall that you needed to write to nfo files for this or was that the episodeguide issue? Actually I cannot update any ratings. Log here... ticaqexago.kodi (paste)

Sorry, cannot follow you. If no other ratings were found the ratings won't be added. The episodeguide needs .nfo writing. The log is showing no issues. I guess the OMDb key has reached the limit and stopped returning values (1000 calls a day)?
Quote:2. Same issue as music when editing long text strings such as the movie plot. Also for TV Shows and Episodes

See above.
 
Quote:TV Shows
1. Ratings not updated

As mentioned above I assume the key limit is reached.
Quote:Episodes
1. UniqueID values are n/a but values exist in the DB.

? I have to check that.


RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-13

@Karellen 

I've added <episodeguide> writing for the rating updater.

-> if episodeguide is set to tvdb or tmdb and there is no ID for it stored in the uniqueid table it will remove it
-> if it was removed or it was not set at all it will set it to tmdb or tvdb if one of these is available in uniqueids

Regarding the uniqueid writing:
Works here. Please note that you only see the JSON for it if a new uniqueid was found. If these were already in the library stored this step is skipped

Regarding the missing new ratings:
Works here. But I've added a OMDb error logging that should tell us the reason why you haven't got any valid return. I guess the API just reached the limit for yesterday.


RE: Metadata Editor - Update library + .nfo informations - DaveBlake - 2019-11-13

(2019-11-13, 07:49)sualfred Wrote: I have no "Disambiguation" field in JSON, but "description". I guess it's the same? ( @DaveBlake )
@sualfred no "disambiguation" is not the same as "description" (which returns the artist biography). "disambiguation" is a field in both Audio.Fields.Artist and Audio.Details.Artist so can be both set and get. It is a few words to help identify artist when name isn't unique e.g. John Williams "classical guitarist" from John Williams "film music composer, conductor"


RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-13

@DaveBlake 
Sure it can be set?

Because this is telling me the wiki for SetArtistDetails

Code:

Library.Id artistid
[ Optional.String artist ]
[ mixed instrument ]
[ mixed style ]
[ mixed mood ]
[ Optional.String born ]
[ Optional.String formed ]
[ Optional.String description ]
[ mixed genre ]
[ Optional.String died ]
[ Optional.String disbanded ]
[ mixed yearsactive ]

And Audio.Fields.Artist

Code:

{ "extends": [ "Item.Fields.Base" ],
"id": "Audio.Fields.Artist",
"items": { "description": "Requesting the (song)genreid/genre, or roleid/role fields will result in increased response times",
"enums": [ "instrument", "style", "mood", "born", "formed", "description", "genre", "died", "disbanded", "yearsactive", "musicbrainzartistid", "fanart", "thumbnail", "compilationartist", "dateadded", "roles", "songgenres", "isalbumartist" ],
"type": "string" } }



RE: Metadata Editor - Update library + .nfo informations - DaveBlake - 2019-11-13

Yeap absolutely sure @sualfred , I even just tested it.

Don't believe the JSON wilki, it is not upto date. Moreover manually editing it from the schema is such a time consuming and error prone task that I don't think the wiki will be updated. Use the schema files https://github.com/xbmc/xbmc/blob/master/xbmc/interfaces/json-rpc/schema/types.json and methods.json, or the Introspect method to get JSON to tell you itself (it is self documenting)

PHP Code:
"jsonrpc""2.0""id"1"method""JSONRPC.Introspect",
"params": { "filter": { "id""AudioLibrary.SetArtistDetails""type""method" } } } 



RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-13

Oh, I like the wiki (and it's loading speed...). It's more readable and easier to handle as Introspect. But ok.


RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-13

@Karellen

Sorry, got you wrong. You were talking about episode uniqueid's. Fixed that. 

I've also added disambiguation for artists.


RE: Metadata Editor - Update library + .nfo informations - Karellen - 2019-11-13

(2019-11-13, 10:55)sualfred Wrote: Sorry, got you wrong. You were talking about episode uniqueid's. Fixed that. 

I've also added disambiguation for artists.
Great. Thanks @sualfred

Also understand answers in previous post. I will re-try ratings tomorrow and hopefully the limit has been reset for the API key.


RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-13

I was also thinking about updating episode ratings, but this is a pita. Especially because TMDb doesn't support calling episode details by episode ID. That means that a different regional airing or DVD order will be a mess. I better don't touch it.


RE: Metadata Editor - Update library + .nfo informations - Karellen - 2019-11-13

Probably a good idea to not touch it.

axlt2002 did that for v4.0 of the Light IMDB add-on and if the order is not the same as the IMDB listing, then ratings are applied to the wrong episodes or not applied at all. The v3.5.1 of the add-on still works perfectly by checking each episode id.
https://forum.kodi.tv/showthread.php?tid=316342&pid=2896034#pid2896034


RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-13

It would be possible, but will take long tasks. Except for IMDb ratings if ID is available in the uniqueids.

easy:
> if imdb -> call omdb -> rating is ok

pita and spaghetti code:
-> if imdb or tvdb available-> get tmdb of show + episode by id -> query tmdb by tvshow id, season and episode -> compare found data if it matches local imdb/tvdb id
-> if tmdb available -> get tmdb of show -> if not available try to get the tmdb by tmdb by imdb/tvdb -> query tmdb by tvshow id, season and episode -> compare found data if it matches local tmdb id -> if imdb was not available but found -> omdb -> imdb rating


RE: Metadata Editor - Update library + .nfo informations - DaveBlake - 2019-11-13

(2019-11-13, 10:52)sualfred Wrote: Oh, I like the wiki (and it's loading speed...). It's more readable and easier to handle as Introspect. But ok.
Understood and I sympathise, I use the methods.json and types.json files. It would be great if we had an automated way to create/populate the wiki from the JSON schema, because IMO in this case inaccurate wiki is worse than none.


RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-13

Totally agree

@Karellen 
FYI I've added updating of episode ratings. But only if IMDb is stored. That's the most secure way in my eyes.


RE: Metadata Editor - Update library + .nfo informations - Karellen - 2019-11-13

Thanks @sualfred I will test that sometime today.

Another question...

Every now and then I get asked how can I have two versions of the same TV Show in the library. See here for example over the last 2 days...
https://forum.kodi.tv/showthread.php?tid=349163
https://forum.kodi.tv/showthread.php?tid=349194

You can see the process can be complicated for some users and it took me a little while to make the connection to your new addon Smile Two changes are required...
1. Change the Title of the show. Easily done via your add-on or via the context menu>Manage
2. Change the default ID for the tv show.

We can already see and change the UniqueId for TV Shows. Is it possible to set another ID as the new Default ID. The entry in C12 of the tvshow table is what makes the ID as default.

I imagine this exact implementation is not possible, but something similar?

Image


RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-14

I have no way to get the default uniqueid thru JSON. It's just an array:

{'imdb': 'tt1234123', 'tmdb': '580', ....}

Only the .nfo has a "default=true" attribute, which is handled by the core in some way. 

To be honest... the complete uniqueid structure is confusing to me because of this. It's also linked to ListItem.IMDBNumber somehow and to the ratings table. But I don't really understand when and how.

@DaveBlake 
{ "name": "uniqueid", "type": [ "null", { "$ref": "Media.UniqueID.Set", "required": true } ], "default": null }

I guess it's too late and I'm feeling dumb, but how would the JSON cmd look like if I want to provide a default like in this line from methods.json?

Because this is returning me a error:

Code:

2019-11-13 23:55:19.505 T:26880  NOTICE: [ script.metadata.editor ] --> JSON CALL: {
                                                "id": 1,
                                                "jsonrpc": "2.0",
                                                "method": "VideoLibrary.SetmovieDetails",
                                                "params": {
                                                    "default": "tmdb",
                                                    "movieid": 1,
                                                    "uniqueid": {
                                                        "tmdb": "584"
                                                    }
                                                }
                                            }
2019-11-13 23:55:19.505 T:26880  NOTICE: [ script.metadata.editor ] --> JSON RESULT: {
                                                "error": {
                                                    "code": -32602,
                                                    "data": {
                                                        "message": "Too many parameters",
                                                        "method": "VideoLibrary.SetMovieDetails",
                                                        "stack": {
                                                            "name": "uniqueid",
                                                            "type": [
                                                                "null",
                                                                "object"
                                                            ]
                                                        }
                                                    },
                                                    "message": "Invalid params."
                                                },
                                                "id": 1,
                                                "jsonrpc": "2.0"
                                            }



This forum uses Lukasz Tkacz MyBB addons.