get all tags
#1
Hi. I'm trying to create a context menu addon that allows me to add or remove a tag to a media. The problem is that I don't know where I can get all the existing tags. I can retrieve all the movies and create the list but it's very slow. Is there a better method?
Reply
#2
Files.GetDirectory() + the VFS path of tags node should do the trick.
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#3
Thanks it works well!
Maybe I will create a pull request for J to have a "GetTags" method like you have a "GetGenres" method
Thanks again!
Reply
#4
(2015-06-30, 16:32)phate89 Wrote: Maybe I will create a pull request for J to have a "GetTags" method like you have a "GetGenres" method

There's really no need, you just use GetMovies with a filter on tag:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"sort": {"order": "ascending", "method": "title"}, "filter": {"operator": "contains", "field": "tag", "value": "%"}, "properties": ["title", "art", "tag"]}, "id": "libTags"}

The "%" value for the filter "value" field is a bit of a hack to return all movies with a tag.
Texture Cache Maintenance Utility: Preload your texture cache for optimal UI performance. Remotely manage media libraries. Purge unused artwork to free up space. Find missing media. Configurable QA check to highlight metadata issues. Aid in diagnosis of library and cache related problems.
Reply
#5
(2015-07-01, 05:06)Milhouse Wrote:
(2015-06-30, 16:32)phate89 Wrote: Maybe I will create a pull request for J to have a "GetTags" method like you have a "GetGenres" method

There's really no need, you just use GetMovies with a filter on tag:
Code:
{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovies", "params": {"sort": {"order": "ascending", "method": "title"}, "filter": {"operator": "contains", "field": "tag", "value": "%"}, "properties": ["title", "art", "tag"]}, "id": "libTags"}

The "%" value for the filter "value" field is a bit of a hack to return all movies with a tag.

You still have to go through all result entries and perform de-duplication etc. A VideoLibrary.GetTags will provide the minimum result set to get all tags.
Always read the online manual (wiki), FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the forum rules (wiki).
Please read the pages on troubleshooting (wiki) and bug reporting (wiki) before reporting issues.
Reply
#6
(2015-06-30, 16:32)phate89 Wrote: Maybe I will create a pull request for J to have a "GetTags" method like you have a "GetGenres" method

hi guys. sorry for the necromancy, bumping up such an old thread.

i guess this happened, because i just made a context addon that uses it.

would love some feedback before submitting it

http://forum.kodi.tv/showthread.php?tid=310752
rPi 2&3 | android phones | fireHD8 | linux | win10 + NFS NAS w/ mySQL + props to...
libreElecyatse, titan, AELflexGet, context.manageTags (a zosky original)
Reply

Logout Mark Read Team Forum Stats Members Help
get all tags0