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) |
Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-07 Metadata Editor Script Kodi script to edit basic metadata information of library items with support to automatically update the .nfo file. Supported Kodi versions
Where to get it
Supported .nfo types The updating of .nfo items is only possible for video library items, because the JSON result doesn't return any path for music entries. Supported .nfo namings:
By default the script is creating a .nfo if missing. This can be disabled in the settings. Scrapers The script is using TMDb (free) and OMDb. I already have included a TMDb API key (hardcoded). For OMDb please visit https://omdbapi.com/ and create your own API key and add it to the addon settings. Please note that the free available OMDb API key is limited to 1.000 calls a day. I highly recommend to become a patreon of the creator of OMDb. For $1 a month your daily limit gets increased to 100.000 calls / day. Support it and benefit. TMDb scraper (not used for episodes, because of different global airing dates and episode orders):
OMDb scraper:
Note: There is a experimental setting available to use title + year for the OMDb call, if the IMDb ID is not available. It's disabled by default, because there is a high chance for false positive returnings and wrong fetched metadata. I do not recommend to enable it. Running service
Additional features of the rating updater
It's also possible to skip "not rated" or to enable/disable the fallback to US ratings Run the script / context menu The script can be called with the context menu or RunScript() commands (useful for skinners). A library updating task can be started by starting the addon itself. Context menu entries:
RunScript calls:
RunScript calls for updating ratings:
Help to translate the script into your language! Translate on TransiFex Donations Free beer or money for the tip jar of my daughter is welcome and helps me to stay motivated Please click here to donate Screenshot Moderator Edit The original author @sualfred has not been active for a couple of years. A forked version for v20 by @HeresJohnny can be found here... https://forum.kodi.tv/showthread.php?tid=349035&pid=3109732#pid3109732 RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-07 @nessus @bsoriano For future discussions please use this thread. RE: Metadata Editor - Update library + .nfo informations - Karellen - 2019-11-07 @sualfred Fantastic!! A feature of Kodi that has been long missing. I tested and works as expected. I have a few comments... Movies 1. Do you intend to include editing of Actors? 2. Two types of Rating and Votes tags are written to the nfo file. This one is not used by Kodi... 3. Two types of UniqueID's are written to the nfo file. This one is not used by Kodi...
TV Shows 1. Status- Will not accept an entry, but it does update the DB with the entry. Why does it say missing Kodi feature? 2. A bit of wishful thinking... would be nice if you could edit the <episodeguide> URL. Offer either TMDB or TVDB template and the user just adds the ID value Episodes You allow changing of Season and Episode numbers, but this is incorrect. While it will temporarily accept the new Season and episode numbering, the next rescrape, rescan or rebuild of the library and it will be lost as that information comes from the file name not the nfo file tags. Do you think this thread would be better suited in Metadata Scrapers forum? RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-07 Movies: 1. Actors are little pita but doable. Because of the thumbnail url. On my list for later. 2+3. I know, but Emby uses it. It's just to cover the compatiblity. TV Shows: 1. JSON RPC is not able to return the field, but to be set. Created a REQ thread a few days ago. 2. Will be added Episodes: What do you suggest? Also rename the file or just drop it completely? Edit: Regarding the cast. To get the best integration I would require something like VideoLibrary.GetActors that would return all locally known actors with the thumbnail(s) location. It's really a pain that Kodi is handling the actor per item in the item folder and not globally. It always feels like storage wasting. I mean.... do you know the black guy in the movie *place random movie here*? It's Samual Jackson. No need to have 10000 copies of the same actor thumbnail RE: Metadata Editor - Update library + .nfo informations - Karellen - 2019-11-07 (2019-11-07, 11:27)sualfred Wrote: Movies:Ok, understood. (2019-11-07, 11:27)sualfred Wrote: 1. JSON RPC is not able to return the field, but to be set. Created a REQ thread a few days ago.Ok, must have missed that. (2019-11-07, 11:27)sualfred Wrote: 2. Will be addedGreat. TVDB uses v2 API which can be found here... https://forum.kodi.tv/showthread.php?tid=323588 under "What if I'm using NFO files?" TMDB I'll have to dig it up if you need it. (2019-11-07, 11:27)sualfred Wrote: What do you suggest? Also rename the file or just drop it completely?If you rename the file, then Kodi loses the path to the file and it becomes unplayable, unless you are also updating the path? If you cannot update the path, then I would recommend dropping the Season and Episode edit as it will lead users astray and cause a bit of confusion. I can already imagine all the posts about losing their episode sorting after rebuilding their library. RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-07 @Karellen Quote:TMDB I'll have to dig it up if you need it. Yes, please. I do not find the correct URL anywhere. Quote:If you rename the file, then Kodi loses the path to the file and it becomes unplayable, unless you are also updating the path? If you cannot update the path, then I would recommend dropping the Season and Episode edit as it will lead users astray and cause a bit of confusion. I can already imagine all the posts about losing their episode sorting after rebuilding their library.Ok, thanks. I guess I'll drop it. Renaming would not be an issue, but if there are other episodes with the same episode index... and the different naming schemes ... na, I don't want a rainy storm of s**t over my head. RE: Metadata Editor - Update library + .nfo informations - Karellen - 2019-11-07 (2019-11-07, 11:57)sualfred Wrote: Yes, please. I do not find the correct URL anywhere.In the below example, the number "1402" in two locations is the ID for the show that is replaced
(2019-11-07, 11:57)sualfred Wrote: Ok, thanks. I guess I'll drop it. Renaming would not be an issue, but if there are other episodes with the same episode index... and the different naming schemes ... na, I don't want a rainy storm of s**t over my head.Yea, probably best. Too many variables to go wrong. RE: Metadata Editor - Update library + .nfo informations - Karellen - 2019-11-07 (2019-11-07, 11:27)sualfred Wrote: Regarding the cast. To get the best integration I would require something like VideoLibrary.GetActors that would return all locally known actors with the thumbnail(s) location. It's really a pain that Kodi is handling the actor per item in the item folder and not globally. It always feels like storage wasting. I mean.... do you know the black guy in the movie *place random movie here*? It's Samual Jackson. No need to have 10000 copies of the same actor thumbnailIt would be nice to have centralised Actors folder, like Movie Set Artwork folder. But developers are scarce at the moment, and no-one has shown interest in coding the change and lots of other more important jobs to do. RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-07 @Karellen Thanks. Is the url different if the user has configured a different language? Examples Code:
edit: And if yes, are pt_PT in lowercase or is the region in uppercase? RE: Metadata Editor - Update library + .nfo informations - Karellen - 2019-11-07 Ah, yes I did not think of the language. Might be a bit more difficult than I first thought. Not sure how to advise there. Might be too difficult to cover the language variable. Also, Last Played and PlayCount. Are you able to include these as editable items? RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-07 Getting the language is not big deal. And even if not, I can add an addon setting for it. I just need to know if it differs from setting to setting Yes. But if I remember it correctly, the new Playcount value was ignored even if JSON returned "OK". Will take a look at it again. Edit: Works, just takes up to 30s until the container information gets updated for this value. RE: Metadata Editor - Update library + .nfo informations - nessus - 2019-11-07 Hi sualfred All working fine. I've tested and had no issues. Excellent approach on updating rating and votes. Is it possible to add a separate script call for a bunch update of all movies or tv shows? Also very nice addition the Fav. tag feature although IMO you should rename it to Watchlist so to not be confused with Kodi favorites. Great work man... as always!!! Cheers Nessus RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-07 @Karellen Created a dummy db and it is honored. Will add a solution for it. Code: <episodeguide><url cache="tmdb-1402-pt-br.json">http://api.themoviedb.org/3/tv/1402?api_key=6a5be4999abf74eba1f9a8311294c267&language=pt-br</url></episodeguide> Regarding the cast again: The videodb has all actors + thumb location already stored in the videodb file in a own table. If you guys add an JSON call for receive it it would be awesome. Do you know if it's against the rules to directly access the sqllite file to get those values? Without writing of course, just reading the table. But hmmm.... it also contains directors, writers, etc. That means a return of thousand of items for a bigger database. @nessus Yeah, watchlist makes sense. Will rename it. RE: Metadata Editor - Update library + .nfo informations - nessus - 2019-11-07 Quote:@nessus (2019-11-07, 13:55)nessus Wrote: Is it possible to add a separate script call for a bunch update of all movies or tv shows? RE: Metadata Editor - Update library + .nfo informations - sualfred - 2019-11-07 Example scenario? |